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 /org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core
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
Diffstat (limited to 'org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core')
-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
169 files changed, 25125 insertions, 25125 deletions
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;
}

Back to the top