diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/alias/BasicAliasTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/alias/BasicAliasTest.java index 12583ff0201..f3d50f9db9a 100644 --- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/alias/BasicAliasTest.java +++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/alias/BasicAliasTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2022 IBM Corporation and others. + * Copyright (c) 2000, 2026 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -175,7 +175,7 @@ public void setUp(@TempDir Path tempDirectory) throws Exception { //project with no overlap pNoOverlap = root.getProject("NoOverlap"); createInWorkspace(pNoOverlap); - createInWorkspace(buildResources(pNoOverlap, new String[] {"/1/", "/1/1", "/1/2", "/2/", "/2/1"})); + createInWorkspace(buildResources(pNoOverlap, "/1/", "/1/1", "/1/2", "/2/", "/2/1")); //project with overlap pOverlap = root.getProject("Overlap"); @@ -186,9 +186,9 @@ public void setUp(@TempDir Path tempDirectory) throws Exception { lChildOverlap = fOverlap.getFile("lChildOverlap"); createInWorkspace(new IResource[] {fOverlap, f2, lOverlap, lChildOverlap}); //create some other random child elements - createInWorkspace(buildResources(pOverlap, new String[] {"/1/", "/1/1", "/1/2"})); - createInWorkspace(buildResources(f2, new String[] {"/1/", "/1/1", "/1/2"})); - createInWorkspace(buildResources(fOverlap, new String[] {"/1/", "/1/1", "/1/2"})); + createInWorkspace(buildResources(pOverlap, "/1/", "/1/1", "/1/2")); + createInWorkspace(buildResources(f2, "/1/", "/1/1", "/1/2")); + createInWorkspace(buildResources(fOverlap, "/1/", "/1/1", "/1/2")); //create links pLinked = root.getProject("LinkProject"); @@ -201,8 +201,8 @@ public void setUp(@TempDir Path tempDirectory) throws Exception { fLinked.createLink(fOverlap.getLocation(), IResource.NONE, null); lLinked.createLink(lOverlap.getLocation(), IResource.NONE, null); createInWorkspace(lChildLinked); - createInWorkspace(buildResources(pLinked, new String[] {"/a/", "/a/a", "/a/b"})); - createInWorkspace(buildResources(fLinked, new String[] {"/a/", "/a/a", "/a/b"})); + createInWorkspace(buildResources(pLinked, "/a/", "/a/a", "/a/b")); + createInWorkspace(buildResources(fLinked, "/a/", "/a/a", "/a/b")); linkOverlapLocation = wrapInCanonicalIPath(tempDirectory); linkOverlapLocation.toFile().mkdirs(); @@ -803,10 +803,9 @@ public void testDeleteProjectContents() throws CoreException { //delete the overlapping project - it should delete the children of the linked folder //but leave the actual links intact in the resource tree pOverlap.delete(IResource.ALWAYS_DELETE_PROJECT_CONTENT, createTestMonitor()); - assertDoesNotExistInWorkspace(new IResource[] { pOverlap, fOverlap, lOverlap, lChildOverlap, lChildLinked }); - assertDoesNotExistInFileSystem( - new IResource[] { pOverlap, fOverlap, lOverlap, lChildOverlap, lChildLinked, lLinked, fLinked }); - assertExistsInWorkspace(new IResource[] { pLinked, fLinked, lLinked }); + assertDoesNotExistInWorkspace(pOverlap, fOverlap, lOverlap, lChildOverlap, lChildLinked); + assertDoesNotExistInFileSystem(pOverlap, fOverlap, lOverlap, lChildOverlap, lChildLinked, lLinked, fLinked); + assertExistsInWorkspace(pLinked, fLinked, lLinked); } @Test diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/builders/RelaxedSchedRuleBuilderTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/builders/RelaxedSchedRuleBuilderTest.java index 3536a10ff4a..c458e812042 100644 --- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/builders/RelaxedSchedRuleBuilderTest.java +++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/builders/RelaxedSchedRuleBuilderTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2015 Broadcom Corporation and others. + * Copyright (c) 2010, 2026 Broadcom Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -565,7 +565,7 @@ protected IStatus run(IProgressMonitor monitor) { private void invokeTestBug343256(IProject project, ISchedulingRule[] getRules, ISchedulingRule[] buildRules, TestBarrier2 tb1, TestBarrier2 tb2, Job j) { // Test 1 - build project sched rule getRules[0] = getRules[1] = project; - buildRules[0] = buildRules[1] = new MultiRule(new ISchedulingRule[] {getRules[0]}); + buildRules[0] = buildRules[1] = new MultiRule(getRules[0]); tb1.setStatus(TestBarrier2.STATUS_START); tb2.setStatus(TestBarrier2.STATUS_START); j.schedule(); diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/BucketTreeTests.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/BucketTreeTests.java index 339c57861e9..fa0169c6c02 100644 --- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/BucketTreeTests.java +++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/BucketTreeTests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2015 IBM Corporation and others. + * Copyright (c) 2004, 2026 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -174,36 +174,25 @@ public void testVisitor() throws CoreException { Set.of(IPath.ROOT, proj1.getFullPath(), proj2.getFullPath())); verify(tree, IPath.ROOT, BucketTree.DEPTH_INFINITE, Set.of(IPath.ROOT, proj1.getFullPath(), file1.getFullPath(), folder1.getFullPath(), file2.getFullPath(), proj2.getFullPath())); - verify(tree, proj1.getFullPath(), BucketTree.DEPTH_ZERO, - Arrays.asList(new IPath[] { proj1.getFullPath() })); + verify(tree, proj1.getFullPath(), BucketTree.DEPTH_ZERO, Arrays.asList(proj1.getFullPath())); verify(tree, proj1.getFullPath(), BucketTree.DEPTH_ONE, - Arrays.asList(new IPath[] { proj1.getFullPath(), file1.getFullPath(), folder1.getFullPath() })); - verify(tree, proj1.getFullPath(), BucketTree.DEPTH_INFINITE, Arrays.asList( - new IPath[] { proj1.getFullPath(), file1.getFullPath(), folder1.getFullPath(), file2.getFullPath() })); - verify(tree, file1.getFullPath(), BucketTree.DEPTH_ZERO, - Arrays.asList(new IPath[] { file1.getFullPath() })); - verify(tree, file1.getFullPath(), BucketTree.DEPTH_ONE, - Arrays.asList(new IPath[] { file1.getFullPath() })); - verify(tree, file1.getFullPath(), BucketTree.DEPTH_INFINITE, - Arrays.asList(new IPath[] { file1.getFullPath() })); - verify(tree, folder1.getFullPath(), BucketTree.DEPTH_ZERO, - Arrays.asList(new IPath[] { folder1.getFullPath() })); + Arrays.asList(proj1.getFullPath(), file1.getFullPath(), folder1.getFullPath())); + verify(tree, proj1.getFullPath(), BucketTree.DEPTH_INFINITE, + Arrays.asList(proj1.getFullPath(), file1.getFullPath(), folder1.getFullPath(), file2.getFullPath())); + verify(tree, file1.getFullPath(), BucketTree.DEPTH_ZERO, Arrays.asList(file1.getFullPath())); + verify(tree, file1.getFullPath(), BucketTree.DEPTH_ONE, Arrays.asList(file1.getFullPath())); + verify(tree, file1.getFullPath(), BucketTree.DEPTH_INFINITE, Arrays.asList(file1.getFullPath())); + verify(tree, folder1.getFullPath(), BucketTree.DEPTH_ZERO, Arrays.asList(folder1.getFullPath())); verify(tree, folder1.getFullPath(), BucketTree.DEPTH_ONE, - Arrays.asList(new IPath[] { folder1.getFullPath(), file2.getFullPath() })); + Arrays.asList(folder1.getFullPath(), file2.getFullPath())); verify(tree, folder1.getFullPath(), BucketTree.DEPTH_INFINITE, - Arrays.asList(new IPath[] { folder1.getFullPath(), file2.getFullPath() })); - verify(tree, file2.getFullPath(), BucketTree.DEPTH_ZERO, - Arrays.asList(new IPath[] { file2.getFullPath() })); - verify(tree, file2.getFullPath(), BucketTree.DEPTH_ONE, - Arrays.asList(new IPath[] { file2.getFullPath() })); - verify(tree, file2.getFullPath(), BucketTree.DEPTH_INFINITE, - Arrays.asList(new IPath[] { file2.getFullPath() })); - verify(tree, proj2.getFullPath(), BucketTree.DEPTH_ZERO, - Arrays.asList(new IPath[] { proj2.getFullPath() })); - verify(tree, proj2.getFullPath(), BucketTree.DEPTH_ONE, - Arrays.asList(new IPath[] { proj2.getFullPath() })); - verify(tree, proj2.getFullPath(), BucketTree.DEPTH_INFINITE, - Arrays.asList(new IPath[] { proj2.getFullPath() })); + Arrays.asList(folder1.getFullPath(), file2.getFullPath())); + verify(tree, file2.getFullPath(), BucketTree.DEPTH_ZERO, Arrays.asList(file2.getFullPath())); + verify(tree, file2.getFullPath(), BucketTree.DEPTH_ONE, Arrays.asList(file2.getFullPath())); + verify(tree, file2.getFullPath(), BucketTree.DEPTH_INFINITE, Arrays.asList(file2.getFullPath())); + verify(tree, proj2.getFullPath(), BucketTree.DEPTH_ZERO, Arrays.asList(proj2.getFullPath())); + verify(tree, proj2.getFullPath(), BucketTree.DEPTH_ONE, Arrays.asList(proj2.getFullPath())); + verify(tree, proj2.getFullPath(), BucketTree.DEPTH_INFINITE, Arrays.asList(proj2.getFullPath())); } public void verify(BucketTree tree, IPath root, int depth, final Collection expected) diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/FileSystemResourceManagerTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/FileSystemResourceManagerTest.java index 76f71a47eaa..8c8d955c491 100644 --- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/FileSystemResourceManagerTest.java +++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/FileSystemResourceManagerTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2022 IBM Corporation and others. + * Copyright (c) 2000, 2026 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -190,8 +190,8 @@ public void testFileFor() { @Deprecated // Explicitly tests deprecated API public void testIsLocal() throws CoreException { // create resources - IResource[] resources = buildResources(project, new String[] { "/Folder1/", "/Folder1/File1", - "/Folder1/Folder2/", "/Folder1/Folder2/File2", "/Folder1/Folder2/Folder3/" }); + IResource[] resources = buildResources(project, "/Folder1/", "/Folder1/File1", "/Folder1/Folder2/", + "/Folder1/Folder2/File2", "/Folder1/Folder2/Folder3/"); createInWorkspace(resources); for (IResource resource : resources) { removeFromFileSystem(resource); diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/LocalSyncTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/LocalSyncTest.java index 691618f6241..8aca927fd13 100644 --- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/LocalSyncTest.java +++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/LocalSyncTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2026 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -65,8 +65,7 @@ public void testProjectDeletion() throws CoreException { TestingSupport.waitForSnapshot(); // create resources - IResource[] resources = buildResources(project, - new String[] { "/File1", "/Folder1/", "/Folder1/File1", "/Folder1/Folder2/" }); + IResource[] resources = buildResources(project, "/File1", "/Folder1/", "/Folder1/File1", "/Folder1/Folder2/"); createInWorkspace(resources); // delete project's default directory diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/MoveTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/MoveTest.java index 935e6aa3593..0b506f6b91f 100644 --- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/MoveTest.java +++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/MoveTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2017 IBM Corporation and others. + * Copyright (c) 2000, 2026 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -284,9 +284,9 @@ public void testMoveHierarchy() throws Exception { createInWorkspace(folderSource); // create hierarchy - String[] hierarchy = new String[] { "/", "/file1", "/file2", "/folder1/", "/folder1/file3", - "/folder1/file4", "/folder2/", "/folder2/file5", "/folder2/file6", "/folder1/folder3/", - "/folder1/folder3/file7", "/folder1/folder3/file8" }; + String[] hierarchy = { "/", "/file1", "/file2", "/folder1/", "/folder1/file3", "/folder1/file4", "/folder2/", + "/folder2/file5", "/folder2/file6", "/folder1/folder3/", "/folder1/folder3/file7", + "/folder1/folder3/file8" }; IResource[] resources = buildResources(folderSource, hierarchy); createInWorkspace(resources); @@ -359,8 +359,8 @@ public void testMoveHierarchyBetweenProjects() throws Exception { createInWorkspace(folderSource); // build hierarchy - String[] hierarchy = new String[] { "/", "/file1", "/file2", "/folder1/", "/folder1/file3", "/folder1/file4", - "/folder2/", "/folder2/file5", "/folder2/file6", "/folder1/folder3/", "/folder1/folder3/file7", + String[] hierarchy = { "/", "/file1", "/file2", "/folder1/", "/folder1/file3", "/folder1/file4", "/folder2/", + "/folder2/file5", "/folder2/file6", "/folder1/folder3/", "/folder1/folder3/file7", "/folder1/folder3/file8" }; IResource[] resources = buildResources(folderSource, hierarchy); createInWorkspace(resources); diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/mapping/ChangeValidationTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/mapping/ChangeValidationTest.java index 7bab1423b32..b47a5b54424 100644 --- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/mapping/ChangeValidationTest.java +++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/mapping/ChangeValidationTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2015 IBM Corporation and others. + * Copyright (c) 2006, 2026 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -108,7 +108,7 @@ private String getModelMessage(IStatus status) { public void setUp() throws Exception { TestModelProvider.enabled = true; project = getWorkspace().getRoot().getProject("Project"); - IResource[] before = buildResources(project, new String[] {"c/", "c/b/", "c/a/", "c/x", "c/b/y", "c/b/z"}); + IResource[] before = buildResources(project, "c/", "c/b/", "c/a/", "c/x", "c/b/y", "c/b/z"); createInWorkspace(before); assertExistsInWorkspace(before); factory = createEmptyChangeDescription(); diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/mapping/TestProjectDeletion.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/mapping/TestProjectDeletion.java index 72051cc1ea2..f2c957e1d36 100644 --- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/mapping/TestProjectDeletion.java +++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/mapping/TestProjectDeletion.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2021 IBM Corporation and others. + * Copyright (c) 2021, 2026 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -44,7 +44,7 @@ public class TestProjectDeletion { @BeforeEach public void setUp() throws Exception { project = getWorkspace().getRoot().getProject("Project"); - IResource[] resources = buildResources(project, new String[] { "a/", "a/b/", "a/c/", "a/d", "a/b/e", "a/b/f" }); + IResource[] resources = buildResources(project, "a/", "a/b/", "a/c/", "a/d", "a/b/e", "a/b/f"); createInWorkspace(resources); assertExistsInWorkspace(resources); factory = ResourceChangeValidator.getValidator().createDeltaFactory(); diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/HiddenResourceTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/HiddenResourceTest.java index 653e34e0a1f..03b5743e3ff 100644 --- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/HiddenResourceTest.java +++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/HiddenResourceTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2022 IBM Corporation and others. + * Copyright (c) 2000, 2026 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -304,8 +304,8 @@ public void testCopy() throws CoreException { createInWorkspace(destProject); setHidden(folder, true, IResource.DEPTH_ZERO); folder.copy(destFolder.getFullPath(), flags, createTestMonitor()); - assertExistsInWorkspace(new IResource[] { folder, subFile }); - assertExistsInWorkspace(new IResource[] { destFolder, destSubFile }); + assertExistsInWorkspace(folder, subFile); + assertExistsInWorkspace(destFolder, destSubFile); // set all the resources to be hidden // copy the project @@ -322,8 +322,8 @@ public void testCopy() throws CoreException { createInWorkspace(destProject); setHidden(project, true, IResource.DEPTH_INFINITE); folder.copy(destFolder.getFullPath(), flags, createTestMonitor()); - assertExistsInWorkspace(new IResource[] { folder, subFile }); - assertExistsInWorkspace(new IResource[] { destFolder, destSubFile }); + assertExistsInWorkspace(folder, subFile); + assertExistsInWorkspace(destFolder, destSubFile); } @Test @@ -358,8 +358,8 @@ public void testMove() throws CoreException { createInWorkspace(destProject); setHidden(folder, true, IResource.DEPTH_ZERO); folder.move(destFolder.getFullPath(), flags, createTestMonitor()); - assertDoesNotExistInWorkspace(new IResource[] { folder, subFile }); - assertExistsInWorkspace(new IResource[] { destFolder, destSubFile }); + assertDoesNotExistInWorkspace(folder, subFile); + assertExistsInWorkspace(destFolder, destSubFile); // set all the resources to be hidden // move the project @@ -376,8 +376,8 @@ public void testMove() throws CoreException { createInWorkspace(destProject); setHidden(project, true, IResource.DEPTH_INFINITE); folder.move(destFolder.getFullPath(), flags, createTestMonitor()); - assertDoesNotExistInWorkspace(new IResource[] { folder, subFile }); - assertExistsInWorkspace(new IResource[] { destFolder, destSubFile }); + assertDoesNotExistInWorkspace(folder, subFile); + assertExistsInWorkspace(destFolder, destSubFile); } @Test @@ -399,12 +399,12 @@ public void testDelete() throws CoreException { createInWorkspace(resources); file.delete(flags, createTestMonitor()); assertDoesNotExistInWorkspace(file); - assertExistsInWorkspace(new IResource[] { project, folder, subFile }); + assertExistsInWorkspace(project, folder, subFile); // delete a folder createInWorkspace(resources); folder.delete(flags, createTestMonitor()); - assertDoesNotExistInWorkspace(new IResource[] { folder, subFile }); - assertExistsInWorkspace(new IResource[] { project, file }); + assertDoesNotExistInWorkspace(folder, subFile); + assertExistsInWorkspace(project, file); // set one child to be hidden createInWorkspace(resources); @@ -416,8 +416,8 @@ public void testDelete() throws CoreException { createInWorkspace(resources); setHidden(folder, true, IResource.DEPTH_ZERO); folder.delete(flags, createTestMonitor()); - assertDoesNotExistInWorkspace(new IResource[] { folder, subFile }); - assertExistsInWorkspace(new IResource[] { project, file }); + assertDoesNotExistInWorkspace(folder, subFile); + assertExistsInWorkspace(project, file); // set all resources to be hidden createInWorkspace(resources); @@ -430,13 +430,13 @@ public void testDelete() throws CoreException { setHidden(project, true, IResource.DEPTH_INFINITE); file.delete(flags, createTestMonitor()); assertDoesNotExistInWorkspace(file); - assertExistsInWorkspace(new IResource[] { project, folder, subFile }); + assertExistsInWorkspace(project, folder, subFile); // delete a folder createInWorkspace(resources); setHidden(project, true, IResource.DEPTH_INFINITE); folder.delete(flags, createTestMonitor()); - assertDoesNotExistInWorkspace(new IResource[] { folder, subFile }); - assertExistsInWorkspace(new IResource[] { project, file }); + assertDoesNotExistInWorkspace(folder, subFile); + assertExistsInWorkspace(project, file); } @Test diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/IFolderTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/IFolderTest.java index 71bcad5c734..460410371ef 100644 --- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/IFolderTest.java +++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/IFolderTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2026 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -220,7 +220,7 @@ public void testFolderCreation() throws Exception { @Test public void testFolderDeletion() throws Throwable { IProject project = getWorkspace().getRoot().getProject("Project"); - IResource[] before = buildResources(project, new String[] {"c/", "c/b/", "c/x", "c/b/y", "c/b/z"}); + IResource[] before = buildResources(project, "c/", "c/b/", "c/x", "c/b/y", "c/b/z"); createInWorkspace(before); // assertExistsInWorkspace(before); @@ -231,8 +231,8 @@ public void testFolderDeletion() throws Throwable { @Test public void testFolderMove() throws Throwable { IProject project = getWorkspace().getRoot().getProject("Project"); - IResource[] before = buildResources(project, new String[] {"b/", "b/b/", "b/x", "b/b/y", "b/b/z"}); - IResource[] after = buildResources(project, new String[] {"a/", "a/b/", "a/x", "a/b/y", "a/b/z"}); + IResource[] before = buildResources(project, "b/", "b/b/", "b/x", "b/b/y", "b/b/z"); + IResource[] after = buildResources(project, "a/", "a/b/", "a/x", "a/b/y", "a/b/z"); // create the resources and set some content in a file that will be moved. createInWorkspace(before); diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/IResourceTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/IResourceTest.java index 43770a61bc5..030d4ed876c 100644 --- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/IResourceTest.java +++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/IResourceTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2023 IBM Corporation and others. + * Copyright (c) 2000, 2026 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -238,7 +238,7 @@ protected IResource[] buildInterestingResources() throws CoreException { IProject fullProject = getWorkspace().getRoot().getProject("FullProject"); //resource pattern is: empty file, empty folder, full folder, repeat // with full folder - IResource[] resources = buildResources(fullProject, new String[] {"1", "2/", "3/", "3/1", "3/2/"}); + IResource[] resources = buildResources(fullProject, "1", "2/", "3/", "3/1", "3/2/"); IResource[] result = new IResource[resources.length + 3]; result[0] = getWorkspace().getRoot(); @@ -252,21 +252,21 @@ protected IResource[] buildInterestingResources() throws CoreException { private IResource[] buildSampleResources(IContainer root) throws Exception { // do not change the example resources unless you change references to // specific indices in setUp() - IResource[] result = buildResources(root, new String[] {"1/", "1/1/", "1/1/1/", "1/1/1/1", "1/1/2/", "1/1/2/1/", "1/1/2/2/", "1/1/2/3/", "1/2/", "1/2/1", "1/2/2", "1/2/3/", "1/2/3/1", "1/2/3/2", "1/2/3/3", "1/2/3/4", "2", "2"}); + IResource[] result = buildResources(root, "1/", "1/1/", "1/1/1/", "1/1/1/1", "1/1/2/", "1/1/2/1/", "1/1/2/2/", "1/1/2/3/", "1/2/", "1/2/1", "1/2/2", "1/2/3/", "1/2/3/1", "1/2/3/2", "1/2/3/3", "1/2/3/4", "2", "2"); createInWorkspace(result); result[result.length - 1] = root.getFolder(IPath.fromOSString("2/")); nonExistingResources.add(result[result.length - 1]); - IResource[] deleted = buildResources(root, new String[] {"1/1/2/1/", "1/2/3/1"}); + IResource[] deleted = buildResources(root, "1/1/2/1/", "1/2/3/1"); removeFromWorkspace(deleted); nonExistingResources.addAll(Arrays.asList(deleted)); //out of sync - IResource[] unsynchronized = buildResources(root, new String[] {"1/2/3/3"}); + IResource[] unsynchronized = buildResources(root, "1/2/3/3"); ensureOutOfSync((IFile) unsynchronized[0]); unsynchronizedResources.add(unsynchronized[0]); //file system only - unsynchronized = buildResources(root, new String[] {"1/1/2/2/1"}); + unsynchronized = buildResources(root, "1/1/2/2/1"); removeFromWorkspace(unsynchronized); for (IResource resource : unsynchronized) { createInFileSystem(resource); @@ -764,7 +764,7 @@ public void testAcceptProxyVisitorWithDepth() throws CoreException { createInWorkspace(new IResource[] {project, a, a1, a2, b, b1, b2, c, c1, c2}); - toVisit.addAll(Arrays.asList(new IResource[] {a})); + toVisit.addAll(Arrays.asList(a)); toVisitCount[0] = 1; a.accept(visitor, IResource.DEPTH_ZERO, IResource.NONE); assertTrue(toVisit.isEmpty()); @@ -1607,7 +1607,7 @@ public void testGetModificationStamp() throws CoreException { getWorkspace().getRoot().delete(IResource.FORCE | IResource.ALWAYS_DELETE_PROJECT_CONTENT, createTestMonitor()); // setup - IResource[] resources = buildResources(getWorkspace().getRoot(), new String[] {"/1/", "/1/1", "/1/2", "/1/3", "/2/", "/2/1"}); + IResource[] resources = buildResources(getWorkspace().getRoot(), "/1/", "/1/1", "/1/2", "/1/3", "/2/", "/2/1"); final Map table = new HashMap<>(resources.length); for (IResource resource : resources) { @@ -2120,7 +2120,7 @@ public boolean wasSuccess(Object[] args, Object result, Object[] oldState) { @Test public void testMultiCreation() throws CoreException { final IProject project = getWorkspace().getRoot().getProject("bar"); - final IResource[] resources = buildResources(project, new String[] {"a/", "a/b"}); + final IResource[] resources = buildResources(project, "a/", "a/b"); // create the project. Have to do this outside the resource operation // to ensure that things are setup properly (e.g., add the delta // listener) diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/ISynchronizerTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/ISynchronizerTest.java index 8196106cd67..19b9471d151 100644 --- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/ISynchronizerTest.java +++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/ISynchronizerTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2017 IBM Corporation and others. + * Copyright (c) 2000, 2026 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -101,8 +101,8 @@ protected void flushAllSyncInfo(final IResource root) throws CoreException { @BeforeEach public void setUp() throws Exception { - resources = buildResources(getWorkspace().getRoot(), - new String[] { "/", "1/", "1/1", "1/2/", "1/2/1", "1/2/2/", "2/", "2/1", "2/2/", "2/2/1", "2/2/2/" }); + resources = buildResources(getWorkspace().getRoot(), "/", "1/", "1/1", "1/2/", "1/2/1", "1/2/2/", "2/", "2/1", + "2/2/", "2/2/1", "2/2/2/"); createInWorkspace(resources); } @@ -276,7 +276,7 @@ public void testMoveResource() throws CoreException { getWorkspace().getRoot().delete(true, createTestMonitor()); // setup - IResource[] testResources = buildResources(getWorkspace().getRoot(), new String[] { "/Foo", "/Foo/file.txt" }); + IResource[] testResources = buildResources(getWorkspace().getRoot(), "/Foo", "/Foo/file.txt"); IProject project = (IProject) testResources[0]; IFile source = (IFile) testResources[1]; // create in workspace @@ -307,7 +307,7 @@ public void testMoveResource2() throws CoreException { getWorkspace().getRoot().delete(true, createTestMonitor()); // setup - IResource[] toTest = buildResources(getWorkspace().getRoot(), new String[] {"/Foo", "/Foo/file.txt"}); + IResource[] toTest = buildResources(getWorkspace().getRoot(), "/Foo", "/Foo/file.txt"); IProject sourceProject = (IProject) toTest[0]; IFile sourceFile = (IFile) toTest[1]; // create in workspace diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/IWorkspaceTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/IWorkspaceTest.java index f4df24f6e42..19ad9e3054c 100644 --- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/IWorkspaceTest.java +++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/IWorkspaceTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2022 IBM Corporation and others. + * Copyright (c) 2000, 2026 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -84,8 +84,7 @@ public class IWorkspaceTest { private IResource[] buildResourceHierarchy() throws CoreException { - return buildResources(getWorkspace().getRoot(), - new String[] { "/", "/Project/", "/Project/Folder/", "/Project/Folder/File", }); + return buildResources(getWorkspace().getRoot(), "/", "/Project/", "/Project/Folder/", "/Project/Folder/File"); } private void ensureResourceHierarchyExist() throws CoreException { @@ -638,7 +637,7 @@ public void testMultiCopy() throws Exception { @Test public void testMultiCreation() throws Throwable { final IProject project = getWorkspace().getRoot().getProject("bar"); - final IResource[] resources = buildResources(project, new String[] {"a/", "a/b"}); + final IResource[] resources = buildResources(project, "a/", "a/b"); IWorkspaceRunnable body = monitor -> { project.create(null); project.open(null); @@ -665,7 +664,7 @@ public void testMultiCreation() throws Throwable { @Test public void testMultiDeletion() throws Throwable { IProject project = getWorkspace().getRoot().getProject("testProject"); - IResource[] before = buildResources(project, new String[] {"c/", "c/b/", "c/x", "c/b/y", "c/b/z"}); + IResource[] before = buildResources(project, "c/", "c/b/", "c/x", "c/b/y", "c/b/z"); createInWorkspace(before); // assertExistsInWorkspace(before); diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/MarkerTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/MarkerTest.java index 58d02762923..2b04fe3f416 100644 --- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/MarkerTest.java +++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/MarkerTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2017 IBM Corporation and others. + * Copyright (c) 2000, 2026 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -191,8 +191,8 @@ public void createProblem(IResource host, int severity) throws CoreException { @BeforeEach public void setUp() throws Exception { - resources = buildResources(getWorkspace().getRoot(), - new String[] { "/", "1/", "1/1", "1/2/", "1/2/1", "1/2/2/", "2/", "2/1", "2/2/", "2/2/1", "2/2/2/" }); + resources = buildResources(getWorkspace().getRoot(), "/", "1/", "1/1", "1/2/", "1/2/1", "1/2/2/", "2/", "2/1", + "2/2/", "2/2/1", "2/2/2/"); createInWorkspace(resources); // disable autorefresh an wait till that is finished diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/ResourceTestUtil.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/ResourceTestUtil.java index 4c1ea4ab42b..3f2481fc490 100644 --- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/ResourceTestUtil.java +++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/ResourceTestUtil.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2023, 2025 Vector Informatik GmbH and others. + * Copyright (c) 2023, 2026 Vector Informatik GmbH and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -261,22 +261,14 @@ public static void removeFromWorkspace(final IResource[] resources) throws CoreE getWorkspace().run(body, null); } - /** - * Assert whether or not the given resource exists in the workspace resource - * info tree. - */ - public static void assertExistsInWorkspace(IResource resource) { - assertTrue(existsInWorkspace(resource), - resource.getFullPath() + " unexpectedly does not exist in the workspace"); - } - /** * Assert that each element of the resource array exists in the workspace * resource info tree. */ - public static void assertExistsInWorkspace(IResource[] resources) { + public static void assertExistsInWorkspace(IResource... resources) { for (IResource resource : resources) { - assertExistsInWorkspace(resource); + assertTrue(existsInWorkspace(resource), + resource.getFullPath() + " unexpectedly does not exist in the workspace"); } } @@ -320,40 +312,25 @@ boolean resourceExists() { return checkIfResourceExistsJob.resourceExists(); } - /** - * Assert that the given resource does not exist in the workspace resource info - * tree. - */ - public static void assertDoesNotExistInWorkspace(IResource resource) { - assertFalse(existsInWorkspace(resource), resource.getFullPath() + " unexpectedly exists in the workspace"); - } - /** * Assert that each element of the resource array does not exist in the * workspace resource info tree. */ - public static void assertDoesNotExistInWorkspace(IResource[] resources) { + public static void assertDoesNotExistInWorkspace(IResource... resources) { for (IResource resource : resources) { - assertDoesNotExistInWorkspace(resource); + assertFalse(existsInWorkspace(resource), resource.getFullPath() + " unexpectedly exists in the workspace"); } } /** - * Assert whether or not the given resource exists in the local store. Use the - * resource manager to ensure that we have a correct Path -> File mapping. + * Assert that each element in the resource array exists in the local store. Use + * the resource manager to ensure that we have a correct Path -> File + * mapping. */ - public static void assertExistsInFileSystem(IResource resource) { - assertTrue(existsInFileSystem(resource), - resource.getFullPath() + " unexpectedly does not exist in the file system"); - } - - - /** - * Assert that each element in the resource array exists in the local store. - */ - public static void assertExistsInFileSystem(IResource[] resources) { + public static void assertExistsInFileSystem(IResource... resources) { for (IResource resource : resources) { - assertExistsInFileSystem(resource); + assertTrue(existsInFileSystem(resource), + resource.getFullPath() + " unexpectedly does not exist in the file system"); } } @@ -378,20 +355,14 @@ private static IPath computeDefaultLocation(IResource target) { } } - /** - * Assert that the given resource does not exist in the local store. - */ - public static void assertDoesNotExistInFileSystem(IResource resource) { - assertFalse(existsInFileSystem(resource), resource.getFullPath() + " unexpectedly exists in the file system"); - } - /** * Assert that each element of the resource array does not exist in the * local store. */ - public static void assertDoesNotExistInFileSystem(IResource[] resources) { + public static void assertDoesNotExistInFileSystem(IResource... resources) { for (IResource resource : resources) { - assertDoesNotExistInFileSystem(resource); + assertFalse(existsInFileSystem(resource), + resource.getFullPath() + " unexpectedly exists in the file system"); } } @@ -464,7 +435,7 @@ public static void setReadOnly(IResource target, boolean value) throws CoreExcep * Return a collection of resources for the given hierarchy at * the given root. */ - public static IResource[] buildResources(IContainer root, String[] hierarchy) throws CoreException { + public static IResource[] buildResources(IContainer root, String... hierarchy) throws CoreException { IResource[] result = new IResource[hierarchy.length]; for (int i = 0; i < hierarchy.length; i++) { IPath path = IPath.fromOSString(hierarchy[i]); diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/TeamPrivateMemberTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/TeamPrivateMemberTest.java index 2286b1649a5..635244916ba 100644 --- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/TeamPrivateMemberTest.java +++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/TeamPrivateMemberTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2022 IBM Corporation and others. + * Copyright (c) 2000, 2026 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -295,8 +295,8 @@ public void testCopy() throws CoreException { createInWorkspace(destProject); setTeamPrivateMember(folder, true, IResource.DEPTH_ZERO); folder.copy(destFolder.getFullPath(), flags, createTestMonitor()); - assertExistsInWorkspace(new IResource[] { folder, subFile }); - assertExistsInWorkspace(new IResource[] { destFolder, destSubFile }); + assertExistsInWorkspace(folder, subFile); + assertExistsInWorkspace(destFolder, destSubFile); // set all the resources to be team private // copy the project @@ -313,8 +313,8 @@ public void testCopy() throws CoreException { createInWorkspace(destProject); setTeamPrivateMember(project, true, IResource.DEPTH_INFINITE); folder.copy(destFolder.getFullPath(), flags, createTestMonitor()); - assertExistsInWorkspace(new IResource[] { folder, subFile }); - assertExistsInWorkspace(new IResource[] { destFolder, destSubFile }); + assertExistsInWorkspace(folder, subFile); + assertExistsInWorkspace(destFolder, destSubFile); } @Test @@ -349,8 +349,8 @@ public void testMove() throws CoreException { createInWorkspace(destProject); setTeamPrivateMember(folder, true, IResource.DEPTH_ZERO); folder.move(destFolder.getFullPath(), flags, createTestMonitor()); - assertDoesNotExistInWorkspace(new IResource[] { folder, subFile }); - assertExistsInWorkspace(new IResource[] { destFolder, destSubFile }); + assertDoesNotExistInWorkspace(folder, subFile); + assertExistsInWorkspace(destFolder, destSubFile); // set all the resources to be team private // move the project @@ -367,8 +367,8 @@ public void testMove() throws CoreException { createInWorkspace(destProject); setTeamPrivateMember(project, true, IResource.DEPTH_INFINITE); folder.move(destFolder.getFullPath(), flags, createTestMonitor()); - assertDoesNotExistInWorkspace(new IResource[] { folder, subFile }); - assertExistsInWorkspace(new IResource[] { destFolder, destSubFile }); + assertDoesNotExistInWorkspace(folder, subFile); + assertExistsInWorkspace(destFolder, destSubFile); } @Test @@ -390,12 +390,12 @@ public void testDelete() throws CoreException { createInWorkspace(resources); file.delete(flags, createTestMonitor()); assertDoesNotExistInWorkspace(file); - assertExistsInWorkspace(new IResource[] { project, folder, subFile }); + assertExistsInWorkspace(project, folder, subFile); // delete a folder createInWorkspace(resources); folder.delete(flags, createTestMonitor()); - assertDoesNotExistInWorkspace(new IResource[] { folder, subFile }); - assertExistsInWorkspace(new IResource[] { project, file }); + assertDoesNotExistInWorkspace(folder, subFile); + assertExistsInWorkspace(project, file); // set one child to be team private createInWorkspace(resources); @@ -407,8 +407,8 @@ public void testDelete() throws CoreException { createInWorkspace(resources); setTeamPrivateMember(folder, true, IResource.DEPTH_ZERO); folder.delete(flags, createTestMonitor()); - assertDoesNotExistInWorkspace(new IResource[] { folder, subFile }); - assertExistsInWorkspace(new IResource[] { project, file }); + assertDoesNotExistInWorkspace(folder, subFile); + assertExistsInWorkspace(project, file); // set all resources to be team private createInWorkspace(resources); @@ -421,13 +421,13 @@ public void testDelete() throws CoreException { setTeamPrivateMember(project, true, IResource.DEPTH_INFINITE); file.delete(flags, createTestMonitor()); assertDoesNotExistInWorkspace(file); - assertExistsInWorkspace(new IResource[] { project, folder, subFile }); + assertExistsInWorkspace(project, folder, subFile); // delete a folder createInWorkspace(resources); setTeamPrivateMember(project, true, IResource.DEPTH_INFINITE); folder.delete(flags, createTestMonitor()); - assertDoesNotExistInWorkspace(new IResource[] { folder, subFile }); - assertExistsInWorkspace(new IResource[] { project, file }); + assertDoesNotExistInWorkspace(folder, subFile); + assertExistsInWorkspace(project, file); } @Test diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/VirtualFolderTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/VirtualFolderTest.java index 68113e1a8be..f23b17a76d5 100644 --- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/VirtualFolderTest.java +++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/VirtualFolderTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2015 IBM Corporation and others. + * Copyright (c) 2008, 2026 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -217,7 +217,7 @@ public void testMoveProjectWithVirtualFolder() throws Exception { IFile childFile = folder.getFile(createUniqueString()); IResource[] oldResources = new IResource[] {existingProject, file, folder, childFile}; - assertDoesNotExistInWorkspace(new IResource[] { folder, file, childFile }); + assertDoesNotExistInWorkspace(folder, file, childFile); createInFileSystem(fileLocation); folderLocation.toFile().mkdir(); diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/WorkspaceTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/WorkspaceTest.java index 38ef015bf32..f7c08e2e868 100644 --- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/WorkspaceTest.java +++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/WorkspaceTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2017 IBM Corporation and others. + * Copyright (c) 2000, 2026 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -150,7 +150,7 @@ public void testFileOverFolder() throws Throwable { @Test public void testFolderDeletion() throws Throwable { IProject project = getTestProject(); - IResource[] before = buildResources(project, new String[] {"c/", "c/b/", "c/x", "c/b/y", "c/b/z"}); + IResource[] before = buildResources(project, "c/", "c/b/", "c/x", "c/b/y", "c/b/z"); createInWorkspace(before); // assertExistsInWorkspace(before); @@ -163,8 +163,8 @@ public void testFolderDeletion() throws Throwable { @Test public void testFolderMove() throws Throwable { IProject project = getTestProject(); - IResource[] before = buildResources(project, new String[] {"b/", "b/b/", "b/x", "b/b/y", "b/b/z"}); - IResource[] after = buildResources(project, new String[] {"a/", "a/b/", "a/x", "a/b/y", "a/b/z"}); + IResource[] before = buildResources(project, "b/", "b/b/", "b/x", "b/b/y", "b/b/z"); + IResource[] after = buildResources(project, "a/", "a/b/", "a/x", "a/b/y", "a/b/z"); // create the resources and set some content in a file that will be moved. createInWorkspace(before); @@ -218,7 +218,7 @@ public void testLeafFolderMove() throws Throwable { @Test public void testMultiCreation() throws Throwable { final IProject project = getWorkspace().getRoot().getProject("bar"); - final IResource[] resources = buildResources(project, new String[] {"a/", "a/b"}); + final IResource[] resources = buildResources(project, "a/", "a/b"); IWorkspaceRunnable body = monitor -> { if (!project.exists()) { project.create(null); @@ -251,7 +251,7 @@ public void testMultiCreation() throws Throwable { @Test public void testMultiDeletion() throws Throwable { IProject project = getTestProject(); - IResource[] before = buildResources(project, new String[] {"c/", "c/b/", "c/x", "c/b/y", "c/b/z"}); + IResource[] before = buildResources(project, "c/", "c/b/", "c/x", "c/b/y", "c/b/z"); createInWorkspace(before); // assertExistsInWorkspace(before); diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/regression/Bug_192631.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/regression/Bug_192631.java index 6a641f4d449..2a47fa6c66f 100644 --- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/regression/Bug_192631.java +++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/regression/Bug_192631.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012, 2017 IBM Corporation and others. + * Copyright (c) 2012, 2026 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -96,13 +96,13 @@ public void testCompareHost() throws CoreException, URISyntaxException { IFolder linkB = projectB.getFolder("link_to_commonB"); linkB.createLink(commonB, IResource.NONE, createTestMonitor()); - toVisit.addAll(Arrays.asList(new URI[] {projectA.getLocationURI(), commonA, folderA, projectA.getFile(".project").getLocationURI()})); + toVisit.addAll(Arrays.asList(projectA.getLocationURI(), commonA, folderA, projectA.getFile(".project").getLocationURI())); toVisitCount[0] = 6; projectA.accept(visitor); assertThat(toVisit).isEmpty(); assertEquals(0, toVisitCount[0]); - toVisit.addAll(Arrays.asList(new URI[] {projectB.getLocationURI(), commonB, folderB, projectB.getFile(".project").getLocationURI()})); + toVisit.addAll(Arrays.asList(projectB.getLocationURI(), commonB, folderB, projectB.getFile(".project").getLocationURI())); toVisitCount[0] = 6; projectB.accept(visitor); assertThat(toVisit).isEmpty(); @@ -142,13 +142,13 @@ public void testCompareUserInfo() throws CoreException, URISyntaxException { IFolder linkB = projectB.getFolder("link_to_commonB"); linkB.createLink(commonB, IResource.NONE, createTestMonitor()); - toVisit.addAll(Arrays.asList(new URI[] {projectA.getLocationURI(), commonA, folderA, projectA.getFile(".project").getLocationURI()})); + toVisit.addAll(Arrays.asList(projectA.getLocationURI(), commonA, folderA, projectA.getFile(".project").getLocationURI())); toVisitCount[0] = 6; projectA.accept(visitor); assertThat(toVisit).isEmpty(); assertEquals(0, toVisitCount[0]); - toVisit.addAll(Arrays.asList(new URI[] {projectB.getLocationURI(), commonB, folderB, projectB.getFile(".project").getLocationURI()})); + toVisit.addAll(Arrays.asList(projectB.getLocationURI(), commonB, folderB, projectB.getFile(".project").getLocationURI())); toVisitCount[0] = 6; projectB.accept(visitor); assertThat(toVisit).isEmpty(); @@ -188,13 +188,13 @@ public void testComparePort() throws CoreException, URISyntaxException { IFolder linkB = projectB.getFolder("link_to_commonB"); linkB.createLink(commonB, IResource.NONE, createTestMonitor()); - toVisit.addAll(Arrays.asList(new URI[] {projectA.getLocationURI(), commonA, folderA, projectA.getFile(".project").getLocationURI()})); + toVisit.addAll(Arrays.asList(projectA.getLocationURI(), commonA, folderA, projectA.getFile(".project").getLocationURI())); toVisitCount[0] = 6; projectA.accept(visitor); assertThat(toVisit).isEmpty(); assertEquals(0, toVisitCount[0]); - toVisit.addAll(Arrays.asList(new URI[] {projectB.getLocationURI(), commonB, folderB, projectB.getFile(".project").getLocationURI()})); + toVisit.addAll(Arrays.asList(projectB.getLocationURI(), commonB, folderB, projectB.getFile(".project").getLocationURI())); toVisitCount[0] = 6; projectB.accept(visitor); assertThat(toVisit).isEmpty(); diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/session/TestMultiSnap.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/session/TestMultiSnap.java index 9e9a2575178..7cc3eb89a05 100644 --- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/session/TestMultiSnap.java +++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/session/TestMultiSnap.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2026 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -87,7 +87,7 @@ public void test2() throws CoreException { assertTrue(project.exists()); assertTrue(project.isOpen()); - assertExistsInWorkspace(new IResource[] { project, folder, file }); + assertExistsInWorkspace(project, folder, file); } } diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/session/TestSaveSnap.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/session/TestSaveSnap.java index b49fe77ca16..34124e1586e 100644 --- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/session/TestSaveSnap.java +++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/session/TestSaveSnap.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2026 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -93,7 +93,7 @@ public void test2() throws CoreException { assertTrue(project.exists()); assertTrue(project.isOpen()); - assertExistsInWorkspace(new IResource[] { project, folder, file }); + assertExistsInWorkspace(project, folder, file); } } diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/session/TestSnapSaveSnap.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/session/TestSnapSaveSnap.java index 9d58a41906f..06a5c7578e5 100644 --- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/session/TestSnapSaveSnap.java +++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/session/TestSnapSaveSnap.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2026 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -89,7 +89,7 @@ public void test2() throws CoreException { assertTrue(project.exists()); assertTrue(project.isOpen()); - assertExistsInWorkspace(new IResource[] { project, folder, file }); + assertExistsInWorkspace(project, folder, file); } } diff --git a/team/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/RepositoryProviderTests.java b/team/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/RepositoryProviderTests.java index 3a306801926..8a18146a4aa 100644 --- a/team/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/RepositoryProviderTests.java +++ b/team/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/RepositoryProviderTests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2026 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -230,7 +230,8 @@ public boolean moveProject(IResourceTree tree, IProject source, IProjectDescript }; bicProvider.setMoveDeleteHook(hook); - IResource[] resources = buildResources(project, new String[] {"deleteFile.txt", "moveFile.txt", "deletedFolder/", "moveFolder/"}); + IResource[] resources = buildResources(project, "deleteFile.txt", "moveFile.txt", "deletedFolder/", + "moveFolder/"); createInWorkspace(resources); resources[0].delete(false, null); resources[1].move(resources[1].getFullPath().removeLastSegments(1).append("movedFile_NEW"), false, null); @@ -328,7 +329,7 @@ public boolean moveProject(IResourceTree tree, IProject source, IProjectDescript }); // test that moving files/folders between two projects with providers calls the destination - IResource[] resources = buildResources(projectA, new String[] {"moveFile.txt", "moveFolder/"}); + IResource[] resources = buildResources(projectA, "moveFile.txt", "moveFolder/"); createInWorkspace(resources); resources[0].move(projectB.getFullPath().append("moveFile_new.txt"), false, null); resources[1].move(projectB.getFullPath().append("movedFolder"), false, null); @@ -340,7 +341,7 @@ public boolean moveProject(IResourceTree tree, IProject source, IProjectDescript // hooks for the source calledProjectA[0] = false; calledProjectA[1] = false; calledProjectB[0] = false; calledProjectB[1] = false; - resources = buildResources(projectA, new String[] {"anotherMovedFiled.txt", "anotherMovedFolder/"}); + resources = buildResources(projectA, "anotherMovedFiled.txt", "anotherMovedFolder/"); createInWorkspace(resources); resources[0].move(projectC.getFullPath().append("moveFileOther_new.txt"), false, null); resources[1].move(projectC.getFullPath().append("movedFolderOther"), false, null); @@ -352,8 +353,7 @@ public boolean moveProject(IResourceTree tree, IProject source, IProjectDescript @Test public void testMapSuccess() throws CoreException, TeamException { IProject project = createTestProject("testLinkSuccess"); - IResource[] contents = buildResources(project, - new String[] { "changed.txt", "deleted.txt", "folder1/", "folder1/a.txt" }); + IResource[] contents = buildResources(project, "changed.txt", "deleted.txt", "folder1/", "folder1/a.txt"); createInWorkspace(contents); // Test shallow link when URI not allowed @@ -385,8 +385,7 @@ public void testMapSuccess() throws CoreException, TeamException { @Test public void testLinkSuccess() throws CoreException, TeamException { IProject project = createTestProject("testLinkSuccess"); - IResource[] contents = buildResources(project, - new String[] { "changed.txt", "deleted.txt", "folder1/", "folder1/a.txt" }); + IResource[] contents = buildResources(project, "changed.txt", "deleted.txt", "folder1/", "folder1/a.txt"); createInWorkspace(contents); RepositoryProviderWithLinking.setCanHandleLinking(true); @@ -409,8 +408,7 @@ public void testLinkSuccess() throws CoreException, TeamException { @Test public void testMapFailure() throws CoreException, TeamException { IProject project = createTestProject("testMapFailure"); - IResource[] contents = buildResources(project, - new String[] { "changed.txt", "deleted.txt", "folder1/", "folder1/a.txt" }); + IResource[] contents = buildResources(project, "changed.txt", "deleted.txt", "folder1/", "folder1/a.txt"); createInWorkspace(contents); IFolder folder = project.getFolder("link"); @@ -447,8 +445,7 @@ public void testMapFailure() throws CoreException, TeamException { @Test public void testLinkFailure() throws CoreException, TeamException { IProject project = createTestProject("testLinkFailure"); - IResource[] contents = buildResources(project, - new String[] { "changed.txt", "deleted.txt", "folder1/", "folder1/a.txt" }); + IResource[] contents = buildResources(project, "changed.txt", "deleted.txt", "folder1/", "folder1/a.txt"); createInWorkspace(contents); RepositoryProviderWithLinking.setCanHandleLinking(false); diff --git a/team/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/mapping/ScopeBuildingTests.java b/team/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/mapping/ScopeBuildingTests.java index 0783648fa25..9e5e5415918 100644 --- a/team/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/mapping/ScopeBuildingTests.java +++ b/team/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/mapping/ScopeBuildingTests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2009 IBM Corporation and others. + * Copyright (c) 2005, 2026 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -114,8 +114,8 @@ public boolean contains(ResourceMapping mapping) { public void testAdditionalResources() throws CoreException { IProject project = getWorkspace().getRoot().getProject("Project"); createInWorkspace(project); - IResource[] contents = buildResources(project, - new String[] { "file.txt", "folder1/file2.txt", "folder1/folder2/file3.txt", "folder3/" }); + IResource[] contents = buildResources(project, "file.txt", "folder1/file2.txt", "folder1/folder2/file3.txt", + "folder3/"); createInWorkspace(contents); ResourceMapping[] mappings = new ResourceMapping[] { diff --git a/team/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/synchronize/ResourceContentTests.java b/team/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/synchronize/ResourceContentTests.java index e4385332159..66214bd1809 100644 --- a/team/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/synchronize/ResourceContentTests.java +++ b/team/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/synchronize/ResourceContentTests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2006 IBM Corporation and others. + * Copyright (c) 2005, 2026 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -176,7 +176,7 @@ private IResource[] asResources(IProject project, String[] resourcePaths) { public void testFileContent() throws CoreException { IProject project = getWorkspace().getRoot().getProject("Project"); createInWorkspace(project); - String[] files = new String[] {"file.txt", "file2.txt", "folder1/file3.txt", "folder1/folder2/file4.txt"}; + String[] files = { "file.txt", "file2.txt", "folder1/file3.txt", "folder1/folder2/file4.txt" }; buildResources(project, files); assertContentMatches(project, files); }