diff --git a/ant/org.eclipse.ant.core/src/org/eclipse/ant/core/AntCorePreferences.java b/ant/org.eclipse.ant.core/src/org/eclipse/ant/core/AntCorePreferences.java
index 695ad3e7b61..2d8c7747fc8 100644
--- a/ant/org.eclipse.ant.core/src/org/eclipse/ant/core/AntCorePreferences.java
+++ b/ant/org.eclipse.ant.core/src/org/eclipse/ant/core/AntCorePreferences.java
@@ -43,7 +43,6 @@
import org.eclipse.core.runtime.IContributor;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Preferences;
import org.eclipse.core.runtime.Preferences.IPropertyChangeListener;
@@ -347,7 +346,7 @@ public String getDefaultAntHome() {
IAntClasspathEntry[] entries = getDefaultAntHomeEntries();
if (entries.length > 0) {
URL antjar = entries[entries.length - 1].getEntryURL();
- IPath antHomePath = new Path(antjar.getFile());
+ IPath antHomePath = IPath.fromOSString(antjar.getFile());
// parent directory of the lib directory
antHomePath = antHomePath.removeLastSegments(2);
return antHomePath.toFile().getAbsolutePath();
@@ -865,7 +864,7 @@ public IAntClasspathEntry getToolsJarEntry(IPath javaHomePath) {
*/
@Deprecated
public URL getToolsJarURL() {
- IPath path = new Path(System.getProperty("java.home")); //$NON-NLS-1$
+ IPath path = IPath.fromOSString(System.getProperty("java.home")); //$NON-NLS-1$
IAntClasspathEntry entry = getToolsJarEntry(path);
if (entry == null) {
IDynamicVariable variable = VariablesPlugin.getDefault().getStringVariableManager().getDynamicVariable("env_var"); //$NON-NLS-1$
@@ -875,7 +874,7 @@ public URL getToolsJarURL() {
javaHome = variable.getValue("JAVA_HOME"); //$NON-NLS-1$
}
if (javaHome != null) {
- path = new Path(javaHome);
+ path = IPath.fromOSString(javaHome);
entry = getToolsJarEntry(path);
}
}
@@ -897,7 +896,7 @@ public URL getToolsJarURL() {
* @return IAntClasspathEntry tools.jar IAntClasspathEntry or null
*/
public IAntClasspathEntry getToolsJarEntry() {
- IPath path = new Path(System.getProperty("java.home")); //$NON-NLS-1$
+ IPath path = IPath.fromOSString(System.getProperty("java.home")); //$NON-NLS-1$
IAntClasspathEntry entry = getToolsJarEntry(path);
if (entry == null) {
IDynamicVariable variable = VariablesPlugin.getDefault().getStringVariableManager().getDynamicVariable("env_var"); //$NON-NLS-1$
@@ -907,7 +906,7 @@ public IAntClasspathEntry getToolsJarEntry() {
javaHome = variable.getValue("JAVA_HOME"); //$NON-NLS-1$
}
if (javaHome != null) {
- path = new Path(javaHome);
+ path = IPath.fromOSString(javaHome);
entry = getToolsJarEntry(path);
}
}
diff --git a/ant/org.eclipse.ant.core/src/org/eclipse/ant/internal/core/AntCoreUtil.java b/ant/org.eclipse.ant.core/src/org/eclipse/ant/internal/core/AntCoreUtil.java
index e3625956329..53ee217e153 100644
--- a/ant/org.eclipse.ant.core/src/org/eclipse/ant/internal/core/AntCoreUtil.java
+++ b/ant/org.eclipse.ant.core/src/org/eclipse/ant/internal/core/AntCoreUtil.java
@@ -26,7 +26,6 @@
import org.eclipse.ant.core.AntCorePlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.variables.IStringVariableManager;
import org.eclipse.core.variables.VariablesPlugin;
import org.osgi.framework.BundleContext;
@@ -114,15 +113,15 @@ public static void processMinusDProperties(List commands, Map 0) {
@@ -421,7 +420,7 @@ public static void linkBuildFailedMessage(String message, IProcess process) {
catch (NumberFormatException e) {
// do nothing
}
- URI location = new Path(fileName).makeAbsolute().toFile().toURI();
+ URI location = IPath.fromOSString(fileName).makeAbsolute().toFile().toURI();
IFile[] files = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocationURI(location);
IFile file = null;
if (files.length > 0) {
diff --git a/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/debug/AntSourceContainer.java b/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/debug/AntSourceContainer.java
index 616c00478ab..287ee7b0c39 100644
--- a/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/debug/AntSourceContainer.java
+++ b/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/debug/AntSourceContainer.java
@@ -24,7 +24,6 @@
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.eclipse.debug.core.sourcelookup.ISourceContainerType;
import org.eclipse.debug.core.sourcelookup.containers.AbstractSourceContainer;
import org.eclipse.debug.core.sourcelookup.containers.LocalFileStorage;
@@ -43,7 +42,7 @@ public Object[] findSourceElements(String path) throws CoreException {
File osFile = new File(path);
if (osFile.exists()) {
try {
- IPath canonicalPath = new Path(osFile.getCanonicalPath());
+ IPath canonicalPath = IPath.fromOSString(osFile.getCanonicalPath());
IFile[] files = fRoot.findFilesForLocationURI(canonicalPath.makeAbsolute().toFile().toURI());
if (files.length > 0) {
for (IFile file : files) {
diff --git a/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/debug/model/AntStackFrame.java b/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/debug/model/AntStackFrame.java
index 6da7b1e0063..0d2d4f84fa9 100644
--- a/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/debug/model/AntStackFrame.java
+++ b/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/debug/model/AntStackFrame.java
@@ -15,7 +15,7 @@
import org.eclipse.ant.internal.launching.AntLaunchingUtil;
import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.model.IRegisterGroup;
import org.eclipse.debug.core.model.IStackFrame;
@@ -84,7 +84,7 @@ public void setFilePath(String fullPath) {
if (file != null) {
fFilePath = file.getProjectRelativePath().toString();
} else {
- fFilePath = new Path(fullPath).lastSegment();
+ fFilePath = IPath.fromOSString(fullPath).lastSegment();
}
}
diff --git a/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/launchConfigurations/AntHomeClasspathEntry.java b/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/launchConfigurations/AntHomeClasspathEntry.java
index 109acb6d880..8ec61b53791 100644
--- a/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/launchConfigurations/AntHomeClasspathEntry.java
+++ b/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/launchConfigurations/AntHomeClasspathEntry.java
@@ -24,7 +24,6 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.jdt.internal.launching.AbstractRuntimeClasspathEntry;
@@ -71,7 +70,7 @@ protected void buildMemento(Document document, Element memento) throws CoreExcep
if (antHomeLocation == null) {
memento.setAttribute("default", "true"); //$NON-NLS-1$//$NON-NLS-2$
} else {
- memento.setAttribute("antHome", new Path(antHomeLocation).toString()); //$NON-NLS-1$
+ memento.setAttribute("antHome", IPath.fromOSString(antHomeLocation).toString()); //$NON-NLS-1$
}
}
@@ -79,7 +78,7 @@ protected void buildMemento(Document document, Element memento) throws CoreExcep
public void initializeFrom(Element memento) throws CoreException {
String antHome = memento.getAttribute("antHome"); //$NON-NLS-1$
if (antHome != null && (antHome.length() > 0)) {
- IPath path = new Path(antHome);
+ IPath path = IPath.fromOSString(antHome);
antHomeLocation = path.toOSString();
} else {
antHomeLocation = null;
@@ -100,9 +99,9 @@ public IRuntimeClasspathEntry[] getRuntimeClasspathEntries(ILaunchConfiguration
libs.add(JavaRuntime.newStringVariableClasspathEntry(entry.getLabel()));
}
} else {
- IPath libDir = new Path(antHomeLocation).append("lib"); //$NON-NLS-1$
+ IPath libDir = IPath.fromOSString(antHomeLocation).append("lib"); //$NON-NLS-1$
for (String name : resolveAntHome().list()) {
- IPath path = new Path(name);
+ IPath path = IPath.fromOSString(name);
String fileExtension = path.getFileExtension();
if ("jar".equalsIgnoreCase(fileExtension)) { //$NON-NLS-1$
libs.add(JavaRuntime.newArchiveRuntimeClasspathEntry(libDir.append(path)));
@@ -116,7 +115,7 @@ public File resolveAntHome() throws CoreException {
if (antHomeLocation == null) { // using the default ant home
return null;
}
- IPath libDir = new Path(antHomeLocation).append("lib"); //$NON-NLS-1$
+ IPath libDir = IPath.fromOSString(antHomeLocation).append("lib"); //$NON-NLS-1$
File lib = libDir.toFile();
File parentDir = lib.getParentFile();
if (parentDir == null || !parentDir.exists()) {
diff --git a/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/launchConfigurations/AntLaunchDelegate.java b/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/launchConfigurations/AntLaunchDelegate.java
index ce1320f0f05..03429d9ec13 100644
--- a/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/launchConfigurations/AntLaunchDelegate.java
+++ b/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/launchConfigurations/AntLaunchDelegate.java
@@ -51,7 +51,6 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubMonitor;
@@ -122,7 +121,7 @@ public void launch(ILaunchConfiguration configuration, String mode, ILaunch laun
String path = configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH, new String("")); //$NON-NLS-1$
String vmver = null;
if (!path.isEmpty()) {
- IPath jrePath = Path.fromPortableString(path);
+ IPath jrePath = IPath.fromPortableString(path);
IVMInstall vm = JavaRuntime.getVMInstall(jrePath);
if (vm instanceof AbstractVMInstall) {
AbstractVMInstall install = (AbstractVMInstall) vm;
@@ -745,7 +744,7 @@ private String getSWTLibraryLocation() {
try {
URL url = FileLocator.toFileURL(fragBundle.getEntry("/")); //$NON-NLS-1$
try {
- IPath path = new Path(URIUtil.toURL(URIUtil.toURI(url)).getPath());
+ IPath path = IPath.fromOSString(URIUtil.toURL(URIUtil.toURI(url)).getPath());
path = path.removeTrailingSeparator();
fgSWTLibraryLocation = path.toOSString();
}
diff --git a/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/launchConfigurations/ContributedClasspathEntriesEntry.java b/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/launchConfigurations/ContributedClasspathEntriesEntry.java
index 5164b496be6..b13e2ff048d 100644
--- a/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/launchConfigurations/ContributedClasspathEntriesEntry.java
+++ b/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/launchConfigurations/ContributedClasspathEntriesEntry.java
@@ -34,7 +34,6 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.URIUtil;
import org.eclipse.debug.core.ILaunchConfiguration;
@@ -102,7 +101,7 @@ public IRuntimeClasspathEntry[] getRuntimeClasspathEntries(ILaunchConfiguration
for (IAntClasspathEntry userEntry : userEntries) {
entry = userEntry;
path = entry.getLabel();
- IPath toolsPath = new Path(path);
+ IPath toolsPath = IPath.fromOSString(path);
if (toolsPath.lastSegment().equals("tools.jar")) { //$NON-NLS-1$
haveToolsEntry = true;
// replace with dynamically resolved tools.jar based on
@@ -128,18 +127,18 @@ private void addToolsJar(ILaunchConfiguration configuration, List rtes) {
AntLaunching.log(e);
continue;
}
- IPath fragmentPath = new Path(urlFileName);
+ IPath fragmentPath = IPath.fromOSString(urlFileName);
if (fragmentPath.getFileExtension() != null) { // JAR file
fgSWTEntries.add(JavaRuntime.newArchiveRuntimeClasspathEntry(fragmentPath));
} else { // folder
@@ -228,9 +227,9 @@ private IRuntimeClasspathEntry getToolsJar(ILaunchConfiguration configuration) {
try {
IVMInstall install = JavaRuntime.computeVMInstall(configuration);
if (install != null) {
- IAntClasspathEntry entry = AntCorePlugin.getPlugin().getPreferences().getToolsJarEntry(new Path(install.getInstallLocation().getAbsolutePath()));
+ IAntClasspathEntry entry = AntCorePlugin.getPlugin().getPreferences().getToolsJarEntry(IPath.fromOSString(install.getInstallLocation().getAbsolutePath()));
if (entry != null) {
- return JavaRuntime.newArchiveRuntimeClasspathEntry(new Path(entry.getEntryURL().getPath()));
+ return JavaRuntime.newArchiveRuntimeClasspathEntry(IPath.fromOSString(entry.getEntryURL().getPath()));
}
}
}
diff --git a/ant/org.eclipse.ant.tests.core/test plugin/org/eclipse/ant/tests/core/testplugin/ProjectHelper.java b/ant/org.eclipse.ant.tests.core/test plugin/org/eclipse/ant/tests/core/testplugin/ProjectHelper.java
index 5775a940a84..91cbbc5eaca 100644
--- a/ant/org.eclipse.ant.tests.core/test plugin/org/eclipse/ant/tests/core/testplugin/ProjectHelper.java
+++ b/ant/org.eclipse.ant.tests.core/test plugin/org/eclipse/ant/tests/core/testplugin/ProjectHelper.java
@@ -28,9 +28,9 @@
*/
public class ProjectHelper {
- public static final IPath TEST_BUILDFILES_DIR = new Path("testbuildfiles"); //$NON-NLS-1$
- public static final IPath TEST_RESOURCES_DIR = new Path("testresources"); //$NON-NLS-1$
- public static final IPath TEST_LIB_DIR = new Path("testlib"); //$NON-NLS-1$
+ public static final IPath TEST_BUILDFILES_DIR = IPath.fromOSString("testbuildfiles"); //$NON-NLS-1$
+ public static final IPath TEST_RESOURCES_DIR = IPath.fromOSString("testresources"); //$NON-NLS-1$
+ public static final IPath TEST_LIB_DIR = IPath.fromOSString("testlib"); //$NON-NLS-1$
/**
* Creates a IProject.
diff --git a/ant/org.eclipse.ant.tests.core/tests/org/eclipse/ant/tests/core/AbstractAntTest.java b/ant/org.eclipse.ant.tests.core/tests/org/eclipse/ant/tests/core/AbstractAntTest.java
index 95350a9c485..02ddfe9f8df 100644
--- a/ant/org.eclipse.ant.tests.core/tests/org/eclipse/ant/tests/core/AbstractAntTest.java
+++ b/ant/org.eclipse.ant.tests.core/tests/org/eclipse/ant/tests/core/AbstractAntTest.java
@@ -40,7 +40,6 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.ui.IWorkbench;
@@ -292,7 +291,7 @@ protected String getAntHome() {
AntCorePreferences prefs = AntCorePlugin.getPlugin().getPreferences();
IAntClasspathEntry[] entries = prefs.getAntHomeClasspathEntries();
IAntClasspathEntry antjar = entries[0];
- IPath antHomePath = new Path(antjar.getEntryURL().getFile());
+ IPath antHomePath = IPath.fromOSString(antjar.getEntryURL().getFile());
antHomePath = antHomePath.removeLastSegments(1);
return antHomePath.toFile().getAbsolutePath();
}
diff --git a/ant/org.eclipse.ant.tests.core/tests/org/eclipse/ant/tests/core/tests/FrameworkTests.java b/ant/org.eclipse.ant.tests.core/tests/org/eclipse/ant/tests/core/tests/FrameworkTests.java
index 29c68447d8f..b762e0791af 100644
--- a/ant/org.eclipse.ant.tests.core/tests/org/eclipse/ant/tests/core/tests/FrameworkTests.java
+++ b/ant/org.eclipse.ant.tests.core/tests/org/eclipse/ant/tests/core/tests/FrameworkTests.java
@@ -36,7 +36,7 @@
import org.eclipse.ant.tests.core.testplugin.ProjectHelper;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.IPath;
import org.junit.Test;
public class FrameworkTests extends AbstractAntTest {
@@ -296,7 +296,7 @@ public void testAntClasspathEntryFromUrl() throws MalformedURLException {
IAntClasspathEntry resultedEntries[] = prefs.getAntHomeClasspathEntries();
int index = resultedEntries[entries.length].getLabel().indexOf("hub"); //$NON-NLS-1$
assertNotSame("Missing machine details", index, -1); //$NON-NLS-1$
- assertFalse("Incorrect classpath entry. This would have been the value before the fix", resultedEntries[entries.length].getLabel().equals(new Path("/home/tom/.eclipse/3.8/configuration/org.eclipse.osgi/bundles/21/2/.cp/lib/remote.jar").toOSString())); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue("Incorrect classpath entry", resultedEntries[entries.length].getLabel().substring(index).equals(new Path("hub/home/tom/.eclipse/3.8/configuration/org.eclipse.osgi/bundles/21/2/.cp/lib/remote.jar").toOSString())); //$NON-NLS-1$ //$NON-NLS-2$
+ assertFalse("Incorrect classpath entry. This would have been the value before the fix", resultedEntries[entries.length].getLabel().equals(IPath.fromOSString("/home/tom/.eclipse/3.8/configuration/org.eclipse.osgi/bundles/21/2/.cp/lib/remote.jar").toOSString())); //$NON-NLS-1$ //$NON-NLS-2$
+ assertTrue("Incorrect classpath entry", resultedEntries[entries.length].getLabel().substring(index).equals(IPath.fromOSString("hub/home/tom/.eclipse/3.8/configuration/org.eclipse.osgi/bundles/21/2/.cp/lib/remote.jar").toOSString())); //$NON-NLS-1$ //$NON-NLS-2$
}
}
diff --git a/ant/org.eclipse.ant.tests.ui/Ant Debug Tests/org/eclipse/ant/tests/ui/debug/AbstractAntDebugTest.java b/ant/org.eclipse.ant.tests.ui/Ant Debug Tests/org/eclipse/ant/tests/ui/debug/AbstractAntDebugTest.java
index 729016c573e..de834bdaf5a 100644
--- a/ant/org.eclipse.ant.tests.ui/Ant Debug Tests/org/eclipse/ant/tests/ui/debug/AbstractAntDebugTest.java
+++ b/ant/org.eclipse.ant.tests.ui/Ant Debug Tests/org/eclipse/ant/tests/ui/debug/AbstractAntDebugTest.java
@@ -24,7 +24,7 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.debug.core.DebugEvent;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.DebugPlugin;
@@ -490,7 +490,7 @@ protected AntDebugTarget resumeAndExit(AntThread thread) throws Exception {
}
protected IResource getBreakpointResource(String typeName) throws Exception {
- IJavaElement element = getJavaProject().findElement(new Path(typeName + ".java")); //$NON-NLS-1$
+ IJavaElement element = getJavaProject().findElement(IPath.fromOSString(typeName + ".java")); //$NON-NLS-1$
IResource resource = element.getCorrespondingResource();
if (resource == null) {
resource = getJavaProject().getProject();
diff --git a/ant/org.eclipse.ant.tests.ui/Ant Editor Tests/org/eclipse/ant/tests/ui/editor/support/TestLocationProvider.java b/ant/org.eclipse.ant.tests.ui/Ant Editor Tests/org/eclipse/ant/tests/ui/editor/support/TestLocationProvider.java
index a3a257ede44..b70a23f335b 100644
--- a/ant/org.eclipse.ant.tests.ui/Ant Editor Tests/org/eclipse/ant/tests/ui/editor/support/TestLocationProvider.java
+++ b/ant/org.eclipse.ant.tests.ui/Ant Editor Tests/org/eclipse/ant/tests/ui/editor/support/TestLocationProvider.java
@@ -18,7 +18,6 @@
import org.eclipse.ant.internal.ui.model.LocationProvider;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
public class TestLocationProvider extends LocationProvider {
@@ -31,6 +30,6 @@ public TestLocationProvider(File buildFile) {
@Override
public IPath getLocation() {
- return new Path(buildFile.getAbsolutePath());
+ return IPath.fromOSString(buildFile.getAbsolutePath());
}
}
diff --git a/ant/org.eclipse.ant.tests.ui/test plugin/org/eclipse/ant/tests/ui/testplugin/ProjectHelper.java b/ant/org.eclipse.ant.tests.ui/test plugin/org/eclipse/ant/tests/ui/testplugin/ProjectHelper.java
index 417c686c73f..1bb5c05179c 100644
--- a/ant/org.eclipse.ant.tests.ui/test plugin/org/eclipse/ant/tests/ui/testplugin/ProjectHelper.java
+++ b/ant/org.eclipse.ant.tests.ui/test plugin/org/eclipse/ant/tests/ui/testplugin/ProjectHelper.java
@@ -32,7 +32,6 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationType;
@@ -53,9 +52,9 @@
@SuppressWarnings("restriction")
public class ProjectHelper {
- public static final IPath TEST_BUILDFILES_DIR = new Path("testbuildfiles"); //$NON-NLS-1$
- public static final IPath TEST_RESOURCES_DIR = new Path("testresources"); //$NON-NLS-1$
- public static final IPath TEST_LIB_DIR = new Path("testlib"); //$NON-NLS-1$
+ public static final IPath TEST_BUILDFILES_DIR = IPath.fromOSString("testbuildfiles"); //$NON-NLS-1$
+ public static final IPath TEST_RESOURCES_DIR = IPath.fromOSString("testresources"); //$NON-NLS-1$
+ public static final IPath TEST_LIB_DIR = IPath.fromOSString("testlib"); //$NON-NLS-1$
public static final String PROJECT_NAME = "Ant UI Tests"; //$NON-NLS-1$
diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/AntUIImages.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/AntUIImages.java
index 513a6684b26..36ad44e8436 100644
--- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/AntUIImages.java
+++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/AntUIImages.java
@@ -17,7 +17,7 @@
import java.net.URL;
import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.resource.CompositeImageDescriptor;
import org.eclipse.jface.resource.ImageDescriptor;
@@ -116,7 +116,7 @@ private final static void declareRegistryImage(String key, String path) {
Bundle bundle = Platform.getBundle(AntUIPlugin.getUniqueIdentifier());
URL url = null;
if (bundle != null) {
- url = FileLocator.find(bundle, new Path(path), null);
+ url = FileLocator.find(bundle, IPath.fromOSString(path), null);
desc = ImageDescriptor.createFromURL(url);
}
imageRegistry.put(key, desc);
diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/AntUtil.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/AntUtil.java
index d3b5e95f60e..96922b3c37b 100644
--- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/AntUtil.java
+++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/AntUtil.java
@@ -51,7 +51,6 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.content.IContentType;
@@ -301,7 +300,7 @@ public IFile getFile() {
@Override
public IPath getLocation() {
if (file == null) {
- return new Path(buildFile.getAbsolutePath());
+ return IPath.fromOSString(buildFile.getAbsolutePath());
}
return file.getLocation();
}
@@ -316,7 +315,7 @@ public IPath getLocation() {
private static IDocument getDocument(File buildFile) {
ITextFileBufferManager manager = FileBuffers.getTextFileBufferManager();
- IPath location = new Path(buildFile.getAbsolutePath());
+ IPath location = IPath.fromOSString(buildFile.getAbsolutePath());
boolean connected = false;
try {
ITextFileBuffer buffer = manager.getTextFileBuffer(location, LocationKind.NORMALIZE);
diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/console/AbstractJavacPatternMatcher.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/console/AbstractJavacPatternMatcher.java
index 10ec2f7ddcc..acde1698cfb 100644
--- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/console/AbstractJavacPatternMatcher.java
+++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/console/AbstractJavacPatternMatcher.java
@@ -25,7 +25,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.debug.core.model.IProcess;
import org.eclipse.debug.ui.console.FileLink;
import org.eclipse.jface.preference.IPreferenceStore;
@@ -69,7 +69,7 @@ protected IFile getIFile(String filePath) {
}
IFile file = fFileNameToIFile.get(filePath);
if (file == null) {
- IFile[] files = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocationURI(new Path(filePath).toFile().toURI());
+ IFile[] files = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocationURI(IPath.fromOSString(filePath).toFile().toURI());
if (files.length > 0) {
file = files[0];
fFileNameToIFile.put(filePath, file);
diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/AntNewJavaProjectPage.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/AntNewJavaProjectPage.java
index 1d57dde1d8b..96792be4fce 100644
--- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/AntNewJavaProjectPage.java
+++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/AntNewJavaProjectPage.java
@@ -41,7 +41,6 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jface.dialogs.ErrorDialog;
@@ -278,7 +277,7 @@ private void handleBrowseButtonPressed() {
if (result == null) {
return;
}
- IPath filterPath = new Path(dialog.getFilterPath());
+ IPath filterPath = IPath.fromOSString(dialog.getFilterPath());
String buildFileName = dialog.getFileName();
IPath path = filterPath.append(buildFileName).makeAbsolute();
@@ -300,7 +299,7 @@ private boolean validatePage() {
return false;
}
- IPath path = new Path(IAntCoreConstants.EMPTY_STRING);
+ IPath path = IPath.fromOSString(IAntCoreConstants.EMPTY_STRING);
if (!path.isValidPath(locationFieldContents)) {
setErrorMessage(DataTransferMessages.AntNewJavaProjectPage_16);
return false;
@@ -425,7 +424,7 @@ protected void importBuildFile(IProgressMonitor monitor, IJavaProject javaProjec
IFile iBuildFile = project.getFile(buildFile.getName());
if (!iBuildFile.exists()) {
try {
- iBuildFile.createLink(new Path(buildFile.getAbsolutePath()), IResource.ALLOW_MISSING_LOCAL, monitor);
+ iBuildFile.createLink(IPath.fromOSString(buildFile.getAbsolutePath()), IResource.ALLOW_MISSING_LOCAL, monitor);
}
catch (CoreException e) {
ErrorDialog.openError(getShell(), DataTransferMessages.AntNewJavaProjectPage_22, null, e.getStatus());
diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/BuildFileCreator.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/BuildFileCreator.java
index ce778b9ac0e..63dd2988b25 100644
--- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/BuildFileCreator.java
+++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/BuildFileCreator.java
@@ -48,7 +48,6 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.core.variables.VariablesPlugin;
import org.eclipse.debug.core.DebugPlugin;
@@ -392,7 +391,7 @@ public void createClasspaths(String pathId, IJavaProject currentProject, Eclipse
{
String currentProjectRoot = ExportUtil.getProjectRoot(currentProject);
entry = ExportUtil.getRelativePath(entry, currentProjectRoot);
- if (!new Path(entry).isAbsolute()) {
+ if (!IPath.fromOSString(entry).isAbsolute()) {
prefix = "${" + currentProject.getProject().getName() + ".location}/"; //$NON-NLS-1$ //$NON-NLS-2$
}
}
diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/EclipseClasspath.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/EclipseClasspath.java
index 81753bea0fd..150153e2e03 100644
--- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/EclipseClasspath.java
+++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/EclipseClasspath.java
@@ -30,7 +30,6 @@
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.jdt.core.IClasspathContainer;
import org.eclipse.jdt.core.IClasspathEntry;
@@ -477,7 +476,7 @@ private IClasspathEntry convertVariableClasspathEntry(IRuntimeClasspathEntry ent
if (i != -1) {
variableString = variableString.substring(0, i) + variableString.substring(i + 1);
}
- IPath path = new Path(variableString);
+ IPath path = IPath.fromOSString(variableString);
return JavaCore.newVariableEntry(path, null, null);
}
catch (Exception e) {
diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/ExportUtil.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/ExportUtil.java
index 77589302c1b..85a73a83e43 100644
--- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/ExportUtil.java
+++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/ExportUtil.java
@@ -65,7 +65,6 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.variables.VariablesPlugin;
import org.eclipse.jdt.core.IClasspathEntry;
@@ -171,7 +170,7 @@ public static String resolve(IPath file) {
* Get Java project for given root.
*/
public static IJavaProject getJavaProject(String root) {
- IPath path = new Path(root);
+ IPath path = IPath.fromOSString(root);
if (path.segmentCount() == 1) {
return getJavaProjectByName(root);
}
@@ -700,8 +699,8 @@ public static void addVariable(Map variable2valueMap, String s,
*/
public static String getRelativePath(String otherLocation, String basePath) {
- IPath location = new Path(otherLocation);
- IPath base = new Path(basePath);
+ IPath location = IPath.fromOSString(otherLocation);
+ IPath base = IPath.fromOSString(basePath);
if ((location.getDevice() != null && !location.getDevice().equalsIgnoreCase(base.getDevice())) || !location.isAbsolute()) {
return otherLocation;
}
@@ -711,7 +710,7 @@ public static String getRelativePath(String otherLocation, String basePath) {
for (int j = 0; j < baseCount - count; j++) {
temp += "../"; //$NON-NLS-1$
}
- String relative = new Path(temp).append(location.removeFirstSegments(count)).toString();
+ String relative = IPath.fromOSString(temp).append(location.removeFirstSegments(count)).toString();
if (relative.length() == 0) {
relative = "."; //$NON-NLS-1$
}
diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/ProjectCreator.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/ProjectCreator.java
index f88bb8bab51..518f1d34e00 100644
--- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/ProjectCreator.java
+++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/ProjectCreator.java
@@ -30,7 +30,6 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.IJavaProject;
@@ -51,7 +50,7 @@ public IJavaProject createJavaProjectFromJavacNode(String projectName, Javac jav
createSourceDirectories(destDir, destDirName, sourceDirs, javaProject, monitor);
// add rt.jar
- addVariableEntry(javaProject, new Path(JavaRuntime.JRELIB_VARIABLE), new Path(JavaRuntime.JRESRC_VARIABLE), new Path(JavaRuntime.JRESRCROOT_VARIABLE), monitor);
+ addVariableEntry(javaProject, IPath.fromOSString(JavaRuntime.JRELIB_VARIABLE), IPath.fromOSString(JavaRuntime.JRESRC_VARIABLE), IPath.fromOSString(JavaRuntime.JRESRCROOT_VARIABLE), monitor);
setClasspath(javacTask, javaProject, monitor);
@@ -73,9 +72,9 @@ private void setClasspath(Javac javacTask, IJavaProject javaProject, IProgressMo
for (String cp : classpath.list()) {
File classpathEntry = new File(cp);
if (classpathEntry.isFile()) {
- addLibrary(javaProject, new Path(classpathEntry.getAbsolutePath()), monitor);
+ addLibrary(javaProject, IPath.fromOSString(classpathEntry.getAbsolutePath()), monitor);
} else {
- addContainer(javaProject, new Path(classpathEntry.getAbsolutePath()), monitor);
+ addContainer(javaProject, IPath.fromOSString(classpathEntry.getAbsolutePath()), monitor);
}
}
}
@@ -143,7 +142,7 @@ private void addSourceContainer(IJavaProject jproject, String srcName, String sr
} else {
IFolder folder = project.getFolder(srcName);
if (!folder.exists()) {
- folder.createLink(new Path(srcPath), IResource.ALLOW_MISSING_LOCAL, monitor);
+ folder.createLink(IPath.fromOSString(srcPath), IResource.ALLOW_MISSING_LOCAL, monitor);
}
container = folder;
}
@@ -153,7 +152,7 @@ private void addSourceContainer(IJavaProject jproject, String srcName, String sr
if (outputName != null) {
IFolder outputFolder = project.getFolder(outputName);
if (!outputFolder.exists()) {
- outputFolder.createLink(new Path(outputPath), IResource.ALLOW_MISSING_LOCAL, monitor);
+ outputFolder.createLink(IPath.fromOSString(outputPath), IResource.ALLOW_MISSING_LOCAL, monitor);
}
output = outputFolder.getFullPath();
}
diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntElementNode.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntElementNode.java
index 397a1ebe504..e550e330771 100644
--- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntElementNode.java
+++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntElementNode.java
@@ -38,7 +38,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.URIUtil;
import org.eclipse.jface.resource.ImageDescriptor;
@@ -221,7 +221,7 @@ public void setFilePath(String path) {
URL fileURL = FileLocator.toFileURL(url);
// To be worked in 4.6 via Bug 476266
if (IAntCoreConstants.FILE.equals(fileURL.getProtocol())) {
- fFilePath = new Path((URIUtil.toFile(URIUtil.toURI(fileURL))).getAbsolutePath()).toString();
+ fFilePath = IPath.fromOSString((URIUtil.toFile(URIUtil.toURI(fileURL))).getAbsolutePath()).toString();
}
}
catch (URISyntaxException e) {
diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AddCustomDialog.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AddCustomDialog.java
index 021c9ea4aa6..9df89c74dbb 100644
--- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AddCustomDialog.java
+++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AddCustomDialog.java
@@ -31,7 +31,6 @@
import org.eclipse.ant.internal.ui.AntUIPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.URIUtil;
import org.eclipse.core.variables.VariablesPlugin;
import org.eclipse.jface.dialogs.IDialogConstants;
@@ -535,10 +534,10 @@ protected void okPressed() {
className = ((ZipEntry) file).getName();
} else {
className = ((File) file).getAbsolutePath();
- IPath classPath = new Path(className);
+ IPath classPath = IPath.fromOSString(className);
IPath libraryPath = null;
try {
- libraryPath = new Path(URIUtil.toURL(URIUtil.toURI(library.getEntryURL())).getPath());
+ libraryPath = IPath.fromOSString(URIUtil.toURL(URIUtil.toURI(library.getEntryURL())).getPath());
}
catch (MalformedURLException e) {
AntUIPlugin.log(e);
diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntClasspathBlock.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntClasspathBlock.java
index c56306160f7..536e531826b 100644
--- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntClasspathBlock.java
+++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntClasspathBlock.java
@@ -31,7 +31,6 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.variables.VariablesPlugin;
import org.eclipse.jdt.ui.wizards.BuildPathDialogAccess;
import org.eclipse.jface.dialogs.IDialogConstants;
@@ -247,7 +246,7 @@ private void addExternalJars() {
if (result == null) {
return;
}
- IPath filterPath = new Path(dialog.getFilterPath());
+ IPath filterPath = IPath.fromOSString(dialog.getFilterPath());
AntClasspathContentProvider contentProvider = (AntClasspathContentProvider) treeViewer.getContentProvider();
contentProvider.setRefreshEnabled(false);
for (String jarName : dialog.getFileNames()) {
@@ -286,7 +285,7 @@ private void addJars() {
if (url != null) {
String fileName = url.getFile();
if (fileName != null && fileName.length() > 0) {
- for (IFile file : ResourcesPlugin.getWorkspace().getRoot().findFilesForLocationURI(new Path(fileName).toFile().toURI())) {
+ for (IFile file : ResourcesPlugin.getWorkspace().getRoot().findFilesForLocationURI(IPath.fromOSString(fileName).toFile().toURI())) {
selectedPaths.add(file.getFullPath());
}
}
diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntPropertiesBlock.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntPropertiesBlock.java
index 6faa0082382..2759caab66e 100644
--- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntPropertiesBlock.java
+++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntPropertiesBlock.java
@@ -29,7 +29,6 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.variables.VariablesPlugin;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.dialogs.MessageDialog;
@@ -419,7 +418,7 @@ private void addExternalPropertyFile() {
if (result == null) {
return;
}
- IPath filterPath = new Path(dialog.getFilterPath());
+ IPath filterPath = IPath.fromOSString(dialog.getFilterPath());
for (String fileName : dialog.getFileNames()) {
IPath path = filterPath.append(fileName).makeAbsolute();
((AntContentProvider) fileTableViewer.getContentProvider()).add(path.toOSString());
diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/FileSelectionDialog.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/FileSelectionDialog.java
index 046d8aec42d..3defe773e56 100644
--- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/FileSelectionDialog.java
+++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/FileSelectionDialog.java
@@ -22,7 +22,6 @@
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.swt.SWT;
@@ -85,7 +84,7 @@ protected Control createDialogArea(Composite parent) {
String lastPath = settings.get(LAST_CONTAINER);
if (lastPath != null) {
- IPath path = Path.fromPortableString(lastPath);
+ IPath path = IPath.fromPortableString(lastPath);
IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(path);
setInitialSelection(resource);
}
diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/views/AntView.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/views/AntView.java
index ef62faf8439..967d3d329d0 100644
--- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/views/AntView.java
+++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/views/AntView.java
@@ -48,7 +48,6 @@
import org.eclipse.core.resources.IResourceDelta;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.action.MenuManager;
@@ -521,7 +520,7 @@ private void restoreViewerInput(IMemento memento) {
}
for (IMemento projectMemento : projects) {
String pathString = projectMemento.getString(KEY_PATH);
- if (!ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(pathString)).exists()) {
+ if (!ResourcesPlugin.getWorkspace().getRoot().getFile(IPath.fromOSString(pathString)).exists()) {
// If the file no longer exists, don't add it.
continue;
}
@@ -609,7 +608,7 @@ public void resourceChanged(IResourceChangeEvent event) {
IResourceDelta delta = event.getDelta();
if (delta != null) {
for (AntProjectNode project : getProjects()) {
- IPath buildFilePath = new Path(project.getBuildFileName());
+ IPath buildFilePath = IPath.fromOSString(project.getBuildFileName());
IResourceDelta change = delta.findMember(buildFilePath);
if (change != null) {
handleChangeDelta(change, project);
diff --git a/ant/org.eclipse.ant.ui/META-INF/MANIFEST.MF b/ant/org.eclipse.ant.ui/META-INF/MANIFEST.MF
index 2aa6ac00f5f..76ca28949e7 100644
--- a/ant/org.eclipse.ant.ui/META-INF/MANIFEST.MF
+++ b/ant/org.eclipse.ant.ui/META-INF/MANIFEST.MF
@@ -45,7 +45,7 @@ Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.2.0,4.0.0)";resolution:=op
org.eclipse.jdt.ui;bundle-version="[3.15.0,4.0.0)",
org.eclipse.jdt.debug.ui;bundle-version="[3.9.0,4.0.0)",
org.eclipse.jdt.launching;bundle-version="[3.11.0,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.11.0,4.0.0)",
+ org.eclipse.core.runtime;bundle-version="[3.27.0,4.0.0)",
org.eclipse.jdt.core;bundle-version="[3.2.0,4.0.0)",
org.eclipse.team.core;bundle-version="[3.2.0,4.0.0)",
org.eclipse.ltk.core.refactoring;bundle-version="[3.2.0,4.0.0)",
diff --git a/resources/bundles/org.eclipse.core.filesystem/META-INF/MANIFEST.MF b/resources/bundles/org.eclipse.core.filesystem/META-INF/MANIFEST.MF
index c9a9bf24c89..00b9fb20e78 100644
--- a/resources/bundles/org.eclipse.core.filesystem/META-INF/MANIFEST.MF
+++ b/resources/bundles/org.eclipse.core.filesystem/META-INF/MANIFEST.MF
@@ -4,7 +4,7 @@ Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.core.filesystem; singleton:=true
Bundle-Version: 1.10.100.qualifier
Bundle-Localization: plugin
-Require-Bundle: org.eclipse.equinox.common;bundle-version="[3.2.0,4.0.0)",
+Require-Bundle: org.eclipse.equinox.common;bundle-version="[3.18.0,4.0.0)",
org.eclipse.equinox.registry;bundle-version="[3.2.0,4.0.0)",
org.eclipse.osgi;bundle-version="[3.2.0,4.0.0)"
Export-Package: org.eclipse.core.filesystem,
diff --git a/resources/bundles/org.eclipse.core.filesystem/src/org/eclipse/core/filesystem/URIUtil.java b/resources/bundles/org.eclipse.core.filesystem/src/org/eclipse/core/filesystem/URIUtil.java
index bf0f55eb063..14088ce728c 100644
--- a/resources/bundles/org.eclipse.core.filesystem/src/org/eclipse/core/filesystem/URIUtil.java
+++ b/resources/bundles/org.eclipse.core.filesystem/src/org/eclipse/core/filesystem/URIUtil.java
@@ -16,7 +16,9 @@
import java.io.File;
import java.net.URI;
import java.net.URISyntaxException;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
/**
* This class provides utility methods for comparing, inspecting, and manipulating
@@ -63,10 +65,10 @@ public static IPath toPath(URI uri) {
Assert.isNotNull(uri);
// Special treatment for LocalFileSystem. For performance only.
if (EFS.SCHEME_FILE.equals(uri.getScheme()))
- return new Path(uri.getSchemeSpecificPart());
+ return IPath.fromOSString(uri.getSchemeSpecificPart());
// Relative path
if (uri.getScheme() == null)
- return new Path(uri.getPath());
+ return IPath.fromOSString(uri.getPath());
// General case
try {
IFileStore store = EFS.getStore(uri);
@@ -75,7 +77,7 @@ public static IPath toPath(URI uri) {
File file = store.toLocalFile(EFS.NONE, null);
if (file == null)
return null;
- return new Path(file.getAbsolutePath());
+ return IPath.fromOSString(file.getAbsolutePath());
} catch (CoreException e) {
// Fall through to return null.
}
@@ -94,7 +96,7 @@ public static URI toURI(IPath path) {
if (path.isAbsolute())
return toURI(path.toFile().getAbsolutePath(), true);
//Must use the relativize method to properly construct a relative URI
- URI base = toURI(Path.ROOT.setDevice(path.getDevice()));
+ URI base = toURI(IPath.ROOT.setDevice(path.getDevice()));
return base.relativize(toURI(path.makeAbsolute()));
}
@@ -108,7 +110,7 @@ public static URI toURI(IPath path) {
* @return The URI representing the provided path string
*/
public static URI toURI(String pathString) {
- IPath path = new Path(pathString);
+ IPath path = IPath.fromOSString(pathString);
return toURI(path);
}
diff --git a/resources/bundles/org.eclipse.core.filesystem/src/org/eclipse/core/internal/filesystem/FileSystemAccess.java b/resources/bundles/org.eclipse.core.filesystem/src/org/eclipse/core/internal/filesystem/FileSystemAccess.java
index ecd955e42cc..adceee09859 100644
--- a/resources/bundles/org.eclipse.core.filesystem/src/org/eclipse/core/internal/filesystem/FileSystemAccess.java
+++ b/resources/bundles/org.eclipse.core.filesystem/src/org/eclipse/core/internal/filesystem/FileSystemAccess.java
@@ -18,9 +18,13 @@
import java.net.URL;
import java.util.Collections;
import java.util.Enumeration;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.osgi.service.datalocation.Location;
-import org.osgi.framework.*;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.FrameworkUtil;
+import org.osgi.framework.InvalidSyntaxException;
import org.osgi.util.tracker.ServiceTracker;
/**
@@ -48,7 +52,7 @@ public static IPath getCacheLocation() {
try {
Location location = tracker.getService();
if (location != null) {
- IPath instancePath = new Path(new File(location.getURL().getFile()).toString());
+ IPath instancePath = IPath.fromOSString(new File(location.getURL().getFile()).toString());
return instancePath.append(".metadata/.plugins").append(Policy.PI_FILE_SYSTEM); //$NON-NLS-1$
}
} finally {
@@ -61,7 +65,7 @@ public static IPath getCacheLocation() {
//fall through below and use user home
}
//just put the cache in the user home directory
- return Path.fromOSString(System.getProperty("user.home")); //$NON-NLS-1$
+ return IPath.fromOSString(System.getProperty("user.home")); //$NON-NLS-1$
}
public static Enumeration findEntries(String path, String filePattern, boolean recurse) {
diff --git a/resources/bundles/org.eclipse.core.filesystem/src/org/eclipse/core/internal/filesystem/NullFileSystem.java b/resources/bundles/org.eclipse.core.filesystem/src/org/eclipse/core/internal/filesystem/NullFileSystem.java
index 38126c82f71..1d20161fb35 100644
--- a/resources/bundles/org.eclipse.core.filesystem/src/org/eclipse/core/internal/filesystem/NullFileSystem.java
+++ b/resources/bundles/org.eclipse.core.filesystem/src/org/eclipse/core/internal/filesystem/NullFileSystem.java
@@ -14,10 +14,11 @@
package org.eclipse.core.internal.filesystem;
import java.net.URI;
-import org.eclipse.core.filesystem.*;
+import org.eclipse.core.filesystem.EFS;
+import org.eclipse.core.filesystem.IFileStore;
+import org.eclipse.core.filesystem.IFileSystem;
import org.eclipse.core.filesystem.provider.FileSystem;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
/**
* The null file system.
@@ -54,6 +55,6 @@ public IFileStore getStore(IPath path) {
@Override
public IFileStore getStore(URI uri) {
- return new NullFileStore(new Path(uri.getPath()));
+ return new NullFileStore(IPath.fromOSString(uri.getPath()));
}
}
diff --git a/resources/bundles/org.eclipse.core.filesystem/src/org/eclipse/core/internal/filesystem/local/LocalFile.java b/resources/bundles/org.eclipse.core.filesystem/src/org/eclipse/core/internal/filesystem/local/LocalFile.java
index 57307c69d68..6523d5a4381 100644
--- a/resources/bundles/org.eclipse.core.filesystem/src/org/eclipse/core/internal/filesystem/local/LocalFile.java
+++ b/resources/bundles/org.eclipse.core.filesystem/src/org/eclipse/core/internal/filesystem/local/LocalFile.java
@@ -18,16 +18,38 @@
*******************************************************************************/
package org.eclipse.core.internal.filesystem.local;
-import java.io.*;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
import java.net.URI;
-import java.nio.file.*;
-import org.eclipse.core.filesystem.*;
+import java.nio.file.AccessDeniedException;
+import java.nio.file.DirectoryNotEmptyException;
+import java.nio.file.FileAlreadyExistsException;
+import java.nio.file.Files;
+import java.nio.file.NoSuchFileException;
+import org.eclipse.core.filesystem.EFS;
+import org.eclipse.core.filesystem.IFileInfo;
+import org.eclipse.core.filesystem.IFileStore;
+import org.eclipse.core.filesystem.IFileSystem;
import org.eclipse.core.filesystem.URIUtil;
import org.eclipse.core.filesystem.provider.FileInfo;
import org.eclipse.core.filesystem.provider.FileStore;
-import org.eclipse.core.internal.filesystem.*;
-import org.eclipse.core.runtime.*;
-import org.eclipse.core.runtime.Path;
+import org.eclipse.core.internal.filesystem.FileStoreUtil;
+import org.eclipse.core.internal.filesystem.Messages;
+import org.eclipse.core.internal.filesystem.Policy;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.osgi.util.NLS;
/**
@@ -176,7 +198,7 @@ public IFileStore getChild(IPath path) {
@Override
public IFileStore getFileStore(IPath path) {
- return new LocalFile(new Path(file.getPath()).append(path).toFile());
+ return new LocalFile(IPath.fromOSString(file.getPath()).append(path).toFile());
}
@Override
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/dtree/AbstractDataTree.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/dtree/AbstractDataTree.java
index 9232a897ef0..64e9414fdd0 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/dtree/AbstractDataTree.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/dtree/AbstractDataTree.java
@@ -16,7 +16,6 @@
import org.eclipse.core.internal.utils.Messages;
import org.eclipse.core.internal.utils.Policy;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.osgi.util.NLS;
@@ -242,7 +241,7 @@ public boolean isImmutable() {
* Returns the key of the root node.
*/
public static final IPath rootKey() {
- return Path.ROOT;
+ return IPath.ROOT;
}
public boolean isRoot(IPath key) {
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/dtree/DataTreeReader.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/dtree/DataTreeReader.java
index 12fb815dd03..a03ed94ad06 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/dtree/DataTreeReader.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/dtree/DataTreeReader.java
@@ -17,7 +17,8 @@
import java.io.DataInput;
import java.io.IOException;
import org.eclipse.core.internal.utils.Messages;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IPath;
/**
* Class used for reading a single data tree (no parents) from an input stream
@@ -73,13 +74,13 @@ protected AbstractDataTreeNode readNode(IPath parentPath, String newProjectName)
/* if not the root node */
if (parentPath != null) {
- if (parentPath.equals(Path.ROOT) && newProjectName.length() > 0 && name.length() > 0) {
+ if (parentPath.equals(IPath.ROOT) && newProjectName.length() > 0 && name.length() > 0) {
/* use the supplied name for the project node */
name = newProjectName;
}
path = parentPath.append(name);
} else {
- path = Path.ROOT;
+ path = IPath.ROOT;
}
Object data = null;
@@ -146,7 +147,7 @@ protected int readNumber() throws IOException {
*/
public DeltaDataTree readTree(DeltaDataTree parent, DataInput input, String newProjectName) throws IOException {
this.input = input;
- AbstractDataTreeNode root = readNode(Path.ROOT, newProjectName);
+ AbstractDataTreeNode root = readNode(IPath.ROOT, newProjectName);
return new DeltaDataTree(root, parent);
}
}
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/dtree/DataTreeWriter.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/dtree/DataTreeWriter.java
index 52aabefe2d0..6f7e011c429 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/dtree/DataTreeWriter.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/dtree/DataTreeWriter.java
@@ -15,7 +15,8 @@
import java.io.DataOutput;
import java.io.IOException;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IPath;
/**
* Class for writing a single data tree (no parents) to an output stream.
@@ -158,7 +159,7 @@ public void writeTree(DeltaDataTree tree, IPath path, int depth, DataOutput outp
this.output = output;
/* tunnel down relevant path */
AbstractDataTreeNode node = tree.getRootNode();
- IPath currentPath = Path.ROOT;
+ IPath currentPath = IPath.ROOT;
String[] segments = path.segments();
for (String nextSegment : segments) {
/* write this node to the output */
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/events/NotificationManager.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/events/NotificationManager.java
index 71e5206ed5d..87e1465a359 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/events/NotificationManager.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/events/NotificationManager.java
@@ -18,12 +18,26 @@
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import org.eclipse.core.internal.events.ResourceChangeListenerList.ListenerEntry;
-import org.eclipse.core.internal.resources.*;
+import org.eclipse.core.internal.resources.IManager;
+import org.eclipse.core.internal.resources.MarkerSet;
+import org.eclipse.core.internal.resources.Workspace;
import org.eclipse.core.internal.utils.Messages;
import org.eclipse.core.internal.utils.Policy;
import org.eclipse.core.internal.watson.ElementTree;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.ICoreRunnable;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.ISafeRunnable;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.SafeRunner;
+import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
public class NotificationManager implements IManager, ILifecycleListener {
@@ -239,7 +253,7 @@ protected ResourceDelta getDelta(ElementTree tree, int type) {
// We don't have a delta or something changed so recompute the whole deal.
ElementTree oldTree = postChange ? lastPostChangeTree : lastPostBuildTree;
long markerId = postChange ? lastPostChangeId : lastPostBuildId;
- lastDelta = ResourceDeltaFactory.computeDelta(workspace, oldTree, tree, Path.ROOT, markerId + 1);
+ lastDelta = ResourceDeltaFactory.computeDelta(workspace, oldTree, tree, IPath.ROOT, markerId + 1);
}
// remember the state of the world when this delta was consistent
lastDeltaState = tree;
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/events/ResourceDelta.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/events/ResourceDelta.java
index 3b9384c598c..3203d411bdf 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/events/ResourceDelta.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/events/ResourceDelta.java
@@ -17,10 +17,20 @@
import java.util.Map;
import java.util.Map.Entry;
-import org.eclipse.core.internal.resources.*;
+import org.eclipse.core.internal.resources.ICoreConstants;
+import org.eclipse.core.internal.resources.IMarkerSetElement;
+import org.eclipse.core.internal.resources.MarkerSet;
+import org.eclipse.core.internal.resources.ResourceInfo;
import org.eclipse.core.internal.watson.ElementTree;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IMarkerDelta;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.IResourceDeltaVisitor;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.PlatformObject;
/**
* Concrete implementation of the IResourceDelta interface. Each ResourceDelta
@@ -256,7 +266,7 @@ public IMarkerDelta[] getMarkerDeltas() {
if (markerDeltas == null)
return EMPTY_MARKER_DELTAS;
if (path == null)
- path = Path.ROOT;
+ path = IPath.ROOT;
MarkerSet changes = markerDeltas.get(path);
if (changes == null)
return EMPTY_MARKER_DELTAS;
@@ -290,7 +300,7 @@ public IPath getProjectRelativePath() {
if (count < 0)
return null;
if (count <= 1) // 0 or 1
- return Path.EMPTY;
+ return IPath.EMPTY;
return full.removeFirstSegments(1);
}
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/events/ResourceDeltaFactory.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/events/ResourceDeltaFactory.java
index 6b4ed0a8e9a..73d96433c1f 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/events/ResourceDeltaFactory.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/events/ResourceDeltaFactory.java
@@ -17,12 +17,15 @@
import java.util.Map;
import org.eclipse.core.internal.dtree.DeltaDataTree;
import org.eclipse.core.internal.dtree.NodeComparison;
-import org.eclipse.core.internal.resources.*;
+import org.eclipse.core.internal.resources.ICoreConstants;
+import org.eclipse.core.internal.resources.MarkerSet;
+import org.eclipse.core.internal.resources.Project;
+import org.eclipse.core.internal.resources.ResourceInfo;
+import org.eclipse.core.internal.resources.Workspace;
import org.eclipse.core.internal.watson.ElementTree;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResourceDelta;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
/**
* This class is used for calculating and building resource delta trees for notification
@@ -45,14 +48,14 @@ public static ResourceDelta computeDelta(Workspace workspace, ElementTree oldTre
ResourceComparator comparator = markerGeneration >= 0 ? ResourceComparator.getNotificationComparator() : ResourceComparator.getBuildComparator();
newTree.immutable();
DeltaDataTree delta = null;
- if (Path.ROOT.equals(root))
+ if (IPath.ROOT.equals(root))
delta = newTree.getDataTree().compareWith(oldTree.getDataTree(), comparator);
else
delta = newTree.getDataTree().compareWith(oldTree.getDataTree(), comparator, root);
delta = delta.asReverseComparisonTree(comparator);
- IPath pathInTree = root.isRoot() ? Path.ROOT : root;
- IPath pathInDelta = Path.ROOT;
+ IPath pathInTree = root.isRoot() ? IPath.ROOT : root;
+ IPath pathInDelta = IPath.ROOT;
// get the marker deltas for the delta info object....if needed
Map allMarkerDeltas = null;
@@ -137,7 +140,7 @@ protected static ResourceDelta createDelta(Workspace workspace, DeltaDataTree de
NodeComparison compare = (NodeComparison) delta.getData(pathInDelta);
int comparison = compare.getUserComparison();
result.setStatus(comparison);
- if (comparison == IResourceDelta.NO_CHANGE || Path.ROOT.equals(pathInTree)) {
+ if (comparison == IResourceDelta.NO_CHANGE || IPath.ROOT.equals(pathInTree)) {
ResourceInfo info = workspace.getResourceInfo(pathInTree, true, false);
result.setOldInfo(info);
result.setNewInfo(info);
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/localstore/Bucket.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/localstore/Bucket.java
index 3251e01ce81..030720f0ab6 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/localstore/Bucket.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/localstore/Bucket.java
@@ -16,14 +16,27 @@
*******************************************************************************/
package org.eclipse.core.internal.localstore;
-import java.io.*;
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
import java.lang.ref.SoftReference;
-import java.util.*;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.WeakHashMap;
import org.eclipse.core.internal.resources.ResourceException;
import org.eclipse.core.internal.resources.ResourceStatus;
import org.eclipse.core.internal.utils.Messages;
import org.eclipse.core.resources.IResourceStatus;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.osgi.util.NLS;
/**
@@ -199,7 +212,7 @@ public final int accept(Visitor visitor, IPath filter, int depth) throws CoreExc
try {
for (Iterator> i = entries.entrySet().iterator(); i.hasNext();) {
Map.Entry mapEntry = i.next();
- IPath path = new Path(mapEntry.getKey());
+ IPath path = IPath.fromOSString(mapEntry.getKey());
// check whether the filter applies
int matchingSegments = filter.matchingFirstSegments(path);
if (!filter.isPrefixOf(path) || path.segmentCount() - matchingSegments > depth)
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/localstore/BucketTree.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/localstore/BucketTree.java
index 9fb9c01ade0..f400ff111db 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/localstore/BucketTree.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/localstore/BucketTree.java
@@ -14,13 +14,18 @@
*******************************************************************************/
package org.eclipse.core.internal.localstore;
-import java.io.*;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
import org.eclipse.core.internal.localstore.Bucket.Visitor;
import org.eclipse.core.internal.resources.ResourceException;
import org.eclipse.core.internal.resources.Workspace;
import org.eclipse.core.internal.utils.Messages;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResourceStatus;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.osgi.util.NLS;
/**
@@ -64,8 +69,8 @@ public BucketTree(Workspace workspace, Bucket bucket) {
* bucket
*/
public void accept(Bucket.Visitor visitor, IPath base, int depth) throws CoreException {
- if (Path.ROOT.equals(base)) {
- current.load(null, locationFor(Path.ROOT));
+ if (IPath.ROOT.equals(base)) {
+ current.load(null, locationFor(IPath.ROOT));
if (current.accept(visitor, base, DEPTH_ZERO) != Visitor.CONTINUE)
return;
if (depth == DEPTH_ZERO)
@@ -91,7 +96,7 @@ public Bucket getCurrent() {
}
public File getVersionFile() {
- return new File(locationFor(Path.ROOT), current.getVersionFileName());
+ return new File(locationFor(IPath.ROOT), current.getVersionFileName());
}
/**
@@ -120,7 +125,7 @@ private boolean internalAccept(Bucket.Visitor visitor, IPath base, File bucketDi
}
public void loadBucketFor(IPath path) throws CoreException {
- current.load(Path.ROOT.equals(path) ? null : path.segment(0), locationFor(path));
+ current.load(IPath.ROOT.equals(path) ? null : path.segment(0), locationFor(path));
}
private File locationFor(IPath resourcePath) {
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/localstore/FileStoreRoot.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/localstore/FileStoreRoot.java
index 9993e699beb..26dfb83ed0b 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/localstore/FileStoreRoot.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/localstore/FileStoreRoot.java
@@ -21,8 +21,13 @@
import org.eclipse.core.filesystem.IFileStore;
import org.eclipse.core.internal.resources.ICoreConstants;
import org.eclipse.core.internal.utils.FileUtil;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.resources.IPathVariableManager;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
/**
* Represents the root of a file system that is connected to the workspace.
@@ -190,7 +195,7 @@ void setValid(boolean value) {
private IPath toLocalPath(URI uri) {
try {
final File localFile = EFS.getStore(uri).toLocalFile(EFS.NONE, null);
- return localFile == null ? null : new Path(localFile.getAbsolutePath());
+ return localFile == null ? null : IPath.fromOSString(localFile.getAbsolutePath());
} catch (CoreException e) {
return FileUtil.toPath(uri);
}
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/localstore/FileSystemResourceManager.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/localstore/FileSystemResourceManager.java
index 216aaffe313..73dfa6ba35d 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/localstore/FileSystemResourceManager.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/localstore/FileSystemResourceManager.java
@@ -20,18 +20,61 @@
*******************************************************************************/
package org.eclipse.core.internal.localstore;
-import java.io.*;
+import java.io.BufferedInputStream;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
import java.net.URI;
-import java.util.*;
-import org.eclipse.core.filesystem.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import org.eclipse.core.filesystem.EFS;
+import org.eclipse.core.filesystem.IFileInfo;
+import org.eclipse.core.filesystem.IFileStore;
+import org.eclipse.core.filesystem.IFileTree;
import org.eclipse.core.filesystem.URIUtil;
import org.eclipse.core.internal.refresh.RefreshManager;
-import org.eclipse.core.internal.resources.*;
import org.eclipse.core.internal.resources.File;
-import org.eclipse.core.internal.utils.*;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.internal.resources.Folder;
+import org.eclipse.core.internal.resources.ICoreConstants;
+import org.eclipse.core.internal.resources.IManager;
+import org.eclipse.core.internal.resources.LinkDescription;
+import org.eclipse.core.internal.resources.ModelObjectWriter;
+import org.eclipse.core.internal.resources.Project;
+import org.eclipse.core.internal.resources.ProjectDescription;
+import org.eclipse.core.internal.resources.ProjectDescriptionReader;
+import org.eclipse.core.internal.resources.Resource;
+import org.eclipse.core.internal.resources.ResourceException;
+import org.eclipse.core.internal.resources.ResourceInfo;
+import org.eclipse.core.internal.resources.Workspace;
+import org.eclipse.core.internal.resources.WorkspaceDescription;
+import org.eclipse.core.internal.utils.BitMask;
+import org.eclipse.core.internal.utils.FileUtil;
+import org.eclipse.core.internal.utils.Messages;
+import org.eclipse.core.internal.utils.Policy;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IPathVariableManager;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceStatus;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourceAttributes;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Preferences;
import org.eclipse.core.runtime.Preferences.PropertyChangeEvent;
+import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.osgi.util.NLS;
import org.xml.sax.InputSource;
@@ -81,7 +124,7 @@ private ArrayList allPathsForLocationNonCanonical(URI inputLocation) {
final ArrayList results = new ArrayList<>();
if (URIUtil.equals(location, locationURIFor(root, true))) {
//there can only be one resource at the workspace root's location
- results.add(Path.ROOT);
+ results.add(IPath.ROOT);
return results;
}
for (IProject project : root.getProjects(IContainer.INCLUDE_HIDDEN)) {
@@ -99,7 +142,7 @@ private ArrayList allPathsForLocationNonCanonical(URI inputLocation) {
continue;
URI relative = testLocation.relativize(location);
if (!relative.isAbsolute() && !relative.equals(testLocation)) {
- IPath suffix = new Path(relative.getPath());
+ IPath suffix = IPath.fromOSString(relative.getPath());
results.add(project.getFullPath().append(suffix));
}
if (usingAnotherScheme) {
@@ -122,7 +165,7 @@ private ArrayList allPathsForLocationNonCanonical(URI inputLocation) {
continue;
relative = testLocation.relativize(location);
if (!relative.isAbsolute() && !relative.equals(testLocation)) {
- IPath suffix = new Path(relative.getPath());
+ IPath suffix = IPath.fromOSString(relative.getPath());
results.add(project.getFullPath().append(link.getProjectRelativePath()).append(suffix));
}
}
@@ -165,9 +208,9 @@ private void findLinkedResourcesPaths(URI inputLocation, final ArrayList
}
}
if (suffix == null)
- suffix = Path.fromPortableString(fileStore.getName());
+ suffix = IPath.fromPortableString(fileStore.getName());
else
- suffix = Path.fromPortableString(fileStore.getName()).append(suffix);
+ suffix = IPath.fromPortableString(fileStore.getName()).append(suffix);
fileStore = fileStore.getParent();
}
}
@@ -296,7 +339,7 @@ public IContainer containerForLocation(IPath location) {
private IResource resourceForLocation(IPath location, boolean files) {
if (workspace.getRoot().getLocation().equals(location)) {
if (!files)
- return resourceFor(Path.ROOT, false);
+ return resourceFor(IPath.ROOT, false);
return null;
}
int resultProjectPathSegments = 0;
@@ -573,7 +616,7 @@ private FileStoreRoot getStoreRoot(IResource target) {
if (parent == null) {
//this is the root, so we know where this must be located
//initialize root location
- info = workspace.getResourceInfo(Path.ROOT, false, true);
+ info = workspace.getResourceInfo(IPath.ROOT, false, true);
final IWorkspaceRoot rootResource = workspace.getRoot();
setLocation(rootResource, info, URIUtil.toURI(rootResource.getLocation()));
return info.getFileStoreRoot();
@@ -1186,7 +1229,7 @@ public void write(IFile target, InputStream content, IFileInfo fileInfo, int upd
FileUtil.transferStreams(content, out, store.toString(), subMonitor.split(1));
} catch (IOException e) {
String msg = NLS.bind(Messages.localstore_couldNotWrite, store.toString());
- throw new ResourceException(IResourceStatus.FAILED_WRITE_LOCAL, new Path(store.toString()), msg, e);
+ throw new ResourceException(IResourceStatus.FAILED_WRITE_LOCAL, IPath.fromOSString(store.toString()), msg, e);
}
// get the new last modified time and stash in the info
lastModified = store.fetchInfo().getLastModified();
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/localstore/HistoryStore2.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/localstore/HistoryStore2.java
index cc372c8f99f..93967062cd7 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/localstore/HistoryStore2.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/localstore/HistoryStore2.java
@@ -15,14 +15,35 @@
package org.eclipse.core.internal.localstore;
import java.io.InputStream;
-import java.util.*;
-import org.eclipse.core.filesystem.*;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+import org.eclipse.core.filesystem.EFS;
+import org.eclipse.core.filesystem.IFileInfo;
+import org.eclipse.core.filesystem.IFileStore;
import org.eclipse.core.internal.localstore.Bucket.Entry;
import org.eclipse.core.internal.localstore.HistoryBucket.HistoryEntry;
-import org.eclipse.core.internal.resources.*;
-import org.eclipse.core.internal.utils.*;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.internal.resources.FileState;
+import org.eclipse.core.internal.resources.ResourceException;
+import org.eclipse.core.internal.resources.ResourceStatus;
+import org.eclipse.core.internal.resources.Workspace;
+import org.eclipse.core.internal.resources.WorkspaceDescription;
+import org.eclipse.core.internal.utils.Messages;
+import org.eclipse.core.internal.utils.Policy;
+import org.eclipse.core.internal.utils.UniversalUniqueIdentifier;
+import org.eclipse.core.resources.IFileState;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceStatus;
+import org.eclipse.core.resources.IWorkspaceDescription;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
public class HistoryStore2 implements IHistoryStore {
@@ -176,7 +197,7 @@ public int visit(Entry fileEntry) {
removeUnreferencedBlobs(100);
return monitor.isCanceled() ? STOP : CONTINUE;
}
- }, Path.ROOT, BucketTree.DEPTH_INFINITE);
+ }, IPath.ROOT, BucketTree.DEPTH_INFINITE);
}
if (Policy.DEBUG_HISTORY) {
Policy.debug("Time to apply history store policies: " + (System.currentTimeMillis() - start) + "ms."); //$NON-NLS-1$ //$NON-NLS-2$
@@ -364,7 +385,7 @@ public int visit(Entry fileEntry) {
tmpBlobsToRemove.remove(((HistoryEntry) fileEntry).getUUID(i));
return CONTINUE;
}
- }, Path.ROOT, BucketTree.DEPTH_INFINITE);
+ }, IPath.ROOT, BucketTree.DEPTH_INFINITE);
blobStore.deleteBlobs(blobsToRemove);
blobsToRemove = new HashSet<>();
} catch (Exception e) {
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/localstore/RefreshLocalVisitor.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/localstore/RefreshLocalVisitor.java
index 7b4183a1e7b..0fb70969856 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/localstore/RefreshLocalVisitor.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/localstore/RefreshLocalVisitor.java
@@ -14,11 +14,26 @@
*******************************************************************************/
package org.eclipse.core.internal.localstore;
-import org.eclipse.core.internal.resources.*;
+import org.eclipse.core.internal.resources.Container;
+import org.eclipse.core.internal.resources.File;
+import org.eclipse.core.internal.resources.Folder;
+import org.eclipse.core.internal.resources.ICoreConstants;
+import org.eclipse.core.internal.resources.Resource;
+import org.eclipse.core.internal.resources.ResourceInfo;
+import org.eclipse.core.internal.resources.ResourceStatus;
+import org.eclipse.core.internal.resources.Workspace;
import org.eclipse.core.internal.utils.Messages;
import org.eclipse.core.internal.utils.Policy;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceStatus;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.osgi.util.NLS;
/**
@@ -279,7 +294,7 @@ public boolean visit(UnifiedTreeNode node) throws CoreException {
return true;
}
} else {
- if (node.existsInFileSystem() && !Path.EMPTY.isValidSegment(node.getLocalName())) {
+ if (node.existsInFileSystem() && !IPath.EMPTY.isValidSegment(node.getLocalName())) {
String message = NLS.bind(Messages.resources_invalidResourceName, node.getLocalName());
errors.merge(new ResourceStatus(IResourceStatus.INVALID_RESOURCE_NAME, message));
return false;
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/properties/PropertyBucket.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/properties/PropertyBucket.java
index cb35c7fdf62..9958c654adf 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/properties/PropertyBucket.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/properties/PropertyBucket.java
@@ -14,13 +14,21 @@
*******************************************************************************/
package org.eclipse.core.internal.properties;
-import java.io.*;
-import java.util.*;
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Comparator;
+import java.util.List;
import org.eclipse.core.internal.localstore.Bucket;
import org.eclipse.core.internal.resources.ResourceException;
import org.eclipse.core.internal.utils.Messages;
import org.eclipse.core.resources.IResourceStatus;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.osgi.util.NLS;
public class PropertyBucket extends Bucket {
@@ -283,7 +291,7 @@ protected Object readEntryValue(DataInputStream source) throws IOException, Core
break;
default :
//if we get here the properties file is corrupt
- IPath resourcePath = projectName == null ? Path.ROOT : Path.ROOT.append(projectName);
+ IPath resourcePath = projectName == null ? IPath.ROOT : IPath.ROOT.append(projectName);
String msg = NLS.bind(Messages.properties_readProperties, resourcePath.toString());
throw new ResourceException(IResourceStatus.FAILED_READ_METADATA, null, msg, null);
}
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/AliasManager.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/AliasManager.java
index f7572a2e0d8..edb295952f0 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/AliasManager.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/AliasManager.java
@@ -19,8 +19,15 @@
package org.eclipse.core.internal.resources;
import java.net.URI;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
import java.util.Map.Entry;
+import java.util.Set;
+import java.util.SortedMap;
+import java.util.TreeMap;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Consumer;
import org.eclipse.core.filesystem.EFS;
@@ -30,8 +37,16 @@
import org.eclipse.core.internal.localstore.FileSystemResourceManager;
import org.eclipse.core.internal.utils.FileUtil;
import org.eclipse.core.internal.utils.Messages;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.osgi.util.NLS;
/**
@@ -519,7 +534,7 @@ private void internalComputeAliases(IResource resource, IFileStore location) {
if (searchLocation == null)
return;
- suffix = Path.EMPTY;
+ suffix = IPath.EMPTY;
FindAliasesDoit findAliases = new FindAliasesDoit(resource);
/*
* Walk up the location segments for this resource, looking for a
@@ -528,7 +543,7 @@ private void internalComputeAliases(IResource resource, IFileStore location) {
*/
do {
locationsMap.matchingResourcesDo(searchLocation, findAliases);
- suffix = new Path(searchLocation.getName()).append(suffix);
+ suffix = IPath.fromOSString(searchLocation.getName()).append(suffix);
searchLocation = searchLocation.getParent();
} while (searchLocation != null);
}
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/CharsetDeltaJob.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/CharsetDeltaJob.java
index a70017ea3fb..96aef6e873d 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/CharsetDeltaJob.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/CharsetDeltaJob.java
@@ -17,10 +17,22 @@
import java.util.LinkedList;
import java.util.Queue;
-import org.eclipse.core.internal.utils.*;
-import org.eclipse.core.internal.watson.*;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.internal.utils.Messages;
+import org.eclipse.core.internal.utils.Policy;
+import org.eclipse.core.internal.utils.WrappedRuntimeException;
+import org.eclipse.core.internal.watson.ElementTreeIterator;
+import org.eclipse.core.internal.watson.IElementContentVisitor;
+import org.eclipse.core.internal.watson.IPathRequestor;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.content.IContentTypeManager;
import org.eclipse.core.runtime.content.IContentTypeManager.ContentTypeChangeEvent;
import org.eclipse.core.runtime.jobs.Job;
@@ -128,7 +140,7 @@ public void contentTypeChanged(final ContentTypeChangeEvent event) {
@Override
public IPath getRoot() {
// visit all resources in the workspace
- return Path.ROOT;
+ return IPath.ROOT;
}
@Override
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/CharsetManager.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/CharsetManager.java
index f7abd4e5b19..7f16808b5ac 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/CharsetManager.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/CharsetManager.java
@@ -18,11 +18,29 @@
*******************************************************************************/
package org.eclipse.core.internal.resources;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
import org.eclipse.core.internal.utils.Messages;
import org.eclipse.core.internal.utils.Policy;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.IResourceStatus;
+import org.eclipse.core.resources.ProjectScope;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
@@ -138,7 +156,7 @@ private boolean moveSettingsIfDerivedChanged(IResourceDelta parent, IProject cur
// if derived changed, move encoding to correct preferences
IPath parentPath = parent.getResource().getProjectRelativePath();
for (String affectedResource : affectedResources) {
- IPath affectedPath = new Path(affectedResource);
+ IPath affectedPath = IPath.fromOSString(affectedResource);
// if parentPath is an ancestor of affectedPath
if (parentPath.isPrefixOf(affectedPath)) {
IResource member = currentProject.findMember(affectedPath);
@@ -192,7 +210,7 @@ private void processEntryChanges(IResourceDelta projectDelta, Map getPathsToFlush() {
*/
void flush(IProject project) {
if (Policy.DEBUG_CONTENT_TYPE_CACHE)
- Policy.debug("Scheduling flushing of content type cache for " + (project == null ? Path.ROOT : project.getFullPath())); //$NON-NLS-1$
+ Policy.debug("Scheduling flushing of content type cache for " //$NON-NLS-1$
+ + (project == null ? IPath.ROOT : project.getFullPath()));
synchronized (toFlush) {
if (!fullFlush)
if (project == null)
@@ -239,7 +264,7 @@ synchronized void doFlushCache(final IProgressMonitor monitor, Set toClea
SubMonitor subMonitor = SubMonitor.convert(monitor);
if (toClean.isEmpty()) {
// no project was added, must be a global flush
- clearContentFlags(Path.ROOT, subMonitor.split(1));
+ clearContentFlags(IPath.ROOT, subMonitor.split(1));
} else {
subMonitor.setWorkRemaining(toClean.size());
// flush a project at a time
@@ -442,7 +467,7 @@ public synchronized void invalidateCache(boolean flush, IProject project) {
Policy.log(e.getStatus());
}
if (Policy.DEBUG_CONTENT_TYPE_CACHE)
- Policy.debug("Invalidated cache for " + (project == null ? Path.ROOT : project.getFullPath())); //$NON-NLS-1$
+ Policy.debug("Invalidated cache for " + (project == null ? IPath.ROOT : project.getFullPath())); //$NON-NLS-1$
if (flush) {
try {
// discard the cache, so it can be used before the flush job starts
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/File.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/File.java
index 602953865b8..32b159fe05d 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/File.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/File.java
@@ -16,12 +16,33 @@
*******************************************************************************/
package org.eclipse.core.internal.resources;
-import java.io.*;
-import org.eclipse.core.filesystem.*;
+import java.io.BufferedInputStream;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Reader;
+import org.eclipse.core.filesystem.EFS;
+import org.eclipse.core.filesystem.IFileInfo;
+import org.eclipse.core.filesystem.IFileStore;
import org.eclipse.core.internal.preferences.EclipsePreferences;
-import org.eclipse.core.internal.utils.*;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.internal.utils.BitMask;
+import org.eclipse.core.internal.utils.FileUtil;
+import org.eclipse.core.internal.utils.Messages;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFileState;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceStatus;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.QualifiedName;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.core.runtime.content.IContentDescription;
import org.eclipse.core.runtime.content.IContentTypeManager;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
@@ -124,7 +145,7 @@ public void create(InputStream content, int updateFlags, IProgressMonitor monito
} else {
// The file system is not case sensitive and there is already a file
// under this location.
- message = NLS.bind(Messages.resources_existsLocalDifferentCase, new Path(store.toString()).removeLastSegments(1).append(name).toOSString());
+ message = NLS.bind(Messages.resources_existsLocalDifferentCase, IPath.fromOSString(store.toString()).removeLastSegments(1).append(name).toOSString());
throw new ResourceException(IResourceStatus.CASE_VARIANT_EXISTS, getFullPath(), message, null);
}
}
@@ -135,7 +156,7 @@ public void create(InputStream content, int updateFlags, IProgressMonitor monito
if (!Workspace.caseSensitive) {
String name = getLocalManager().getLocalName(store);
if (name != null && !localInfo.getName().equals(name)) {
- message = NLS.bind(Messages.resources_existsLocalDifferentCase, new Path(store.toString()).removeLastSegments(1).append(name).toOSString());
+ message = NLS.bind(Messages.resources_existsLocalDifferentCase, IPath.fromOSString(store.toString()).removeLastSegments(1).append(name).toOSString());
throw new ResourceException(IResourceStatus.CASE_VARIANT_EXISTS, getFullPath(), message, null);
}
}
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/Folder.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/Folder.java
index f2da5475640..27c2ed1b28e 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/Folder.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/Folder.java
@@ -19,8 +19,15 @@
import org.eclipse.core.filesystem.IFileStore;
import org.eclipse.core.internal.utils.Messages;
import org.eclipse.core.internal.utils.Policy;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceStatus;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.osgi.util.NLS;
@@ -42,7 +49,7 @@ protected void assertCreateRequirements(IFileStore store, IFileInfo localInfo, i
if (!Workspace.caseSensitive) {
String name = getLocalManager().getLocalName(store);
if (name != null && !store.getName().equals(name)) {
- String msg = NLS.bind(Messages.resources_existsLocalDifferentCase, new Path(store.toString()).removeLastSegments(1).append(name).toOSString());
+ String msg = NLS.bind(Messages.resources_existsLocalDifferentCase, IPath.fromOSString(store.toString()).removeLastSegments(1).append(name).toOSString());
throw new ResourceException(IResourceStatus.CASE_VARIANT_EXISTS, getFullPath(), msg, null);
}
}
@@ -101,7 +108,7 @@ public void create(int updateFlags, boolean local, IProgressMonitor monitor) thr
// The file system is not case sensitive and a case variant exists at this
// location
String msg = NLS.bind(Messages.resources_existsLocalDifferentCase,
- new Path(store.toString()).removeLastSegments(1).append(name).toOSString());
+ IPath.fromOSString(store.toString()).removeLastSegments(1).append(name).toOSString());
throw new ResourceException(IResourceStatus.CASE_VARIANT_EXISTS, getFullPath(), msg, null);
}
}
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/LinkDescription.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/LinkDescription.java
index 79cbb053686..428b280231b 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/LinkDescription.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/LinkDescription.java
@@ -18,7 +18,8 @@
import java.net.URI;
import java.net.URISyntaxException;
import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IPath;
/**
* Object for describing the characteristics of linked resources that are stored
@@ -48,7 +49,7 @@ private static URI getVirtualLocation() {
private int type;
public LinkDescription() {
- this.path = Path.EMPTY;
+ this.path = IPath.EMPTY;
this.type = -1;
}
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/LocalMetaArea.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/LocalMetaArea.java
index 05800640216..8e96974fc58 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/LocalMetaArea.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/LocalMetaArea.java
@@ -19,7 +19,9 @@
*******************************************************************************/
package org.eclipse.core.internal.resources;
-import java.io.*;
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.IOException;
import java.net.URI;
import java.util.HashMap;
import java.util.Map;
@@ -28,8 +30,16 @@
import org.eclipse.core.internal.localstore.SafeChunkyOutputStream;
import org.eclipse.core.internal.utils.Messages;
import org.eclipse.core.internal.utils.Policy;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.resources.IBuildConfiguration;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceStatus;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.osgi.util.NLS;
public class LocalMetaArea implements ICoreConstants {
@@ -272,7 +282,7 @@ public boolean hasSavedProjects() {
* resource with the given path is stored.
*/
public IPath locationFor(IPath resourcePath) {
- if (Path.ROOT.equals(resourcePath))
+ if (IPath.ROOT.equals(resourcePath))
return metaAreaLocation.append(F_ROOT);
return projectMetaLocation.append(resourcePath.segment(0));
}
@@ -356,7 +366,7 @@ public void readPrivateDescription(IProject target, ProjectDescription descripti
if (location.startsWith(URI_PREFIX))
description.setLocationURI(URI.create(location.substring(URI_PREFIX.length())));
else
- description.setLocationURI(URIUtil.toURI(Path.fromOSString(location)));
+ description.setLocationURI(URIUtil.toURI(IPath.fromOSString(location)));
}
} catch (Exception e) {
//don't allow failure to read the location to propagate
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/LocationValidator.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/LocationValidator.java
index 9b782f79cd3..e4f2e7fcaa4 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/LocationValidator.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/LocationValidator.java
@@ -19,8 +19,19 @@
import org.eclipse.core.filesystem.URIUtil;
import org.eclipse.core.internal.utils.FileUtil;
import org.eclipse.core.internal.utils.Messages;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceStatus;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
import org.eclipse.osgi.util.NLS;
/**
@@ -56,7 +67,7 @@ private IStatus validateAbsolute(URI location, boolean error) {
if (schemeSpecificPart == null || schemeSpecificPart.isEmpty()) {
message = Messages.links_noPath;
} else {
- IPath pathPart = new Path(schemeSpecificPart);
+ IPath pathPart = IPath.fromOSString(schemeSpecificPart);
if (pathPart.segmentCount() > 0)
message = NLS.bind(Messages.pathvar_undefined, location.toString(), pathPart.segment(0));
else
@@ -83,7 +94,7 @@ public IStatus validateLinkLocation(IResource resource, IPath unresolvedLocation
}
//if the location doesn't have a device, see if the OS will assign one
if (location.getDevice() == null)
- location = new Path(location.toFile().getAbsolutePath());
+ location = IPath.fromOSString(location.toFile().getAbsolutePath());
return validateLinkLocationURI(resource, URIUtil.toURI(location));
}
@@ -291,7 +302,7 @@ public IStatus validatePath(String path, int type) {
String message = Messages.resources_pathNull;
return new ResourceStatus(IResourceStatus.INVALID_VALUE, null, message);
}
- return validatePath(Path.fromOSString(path), type, false);
+ return validatePath(IPath.fromOSString(path), type, false);
}
public IStatus validateProjectLocation(IProject context, IPath unresolvedLocation) {
@@ -428,7 +439,7 @@ public IStatus validateProjectLocationURI(IProject context, URI unresolvedLocati
*/
private IStatus validateSegments(URI location) {
if (EFS.SCHEME_FILE.equals(location.getScheme())) {
- IPath pathPart = new Path(location.getSchemeSpecificPart());
+ IPath pathPart = IPath.fromOSString(location.getSchemeSpecificPart());
int segmentCount = pathPart.segmentCount();
for (int i = 0; i < segmentCount; i++) {
IStatus result = validateName(pathPart.segment(i), IResource.PROJECT);
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/MarkerReader_1.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/MarkerReader_1.java
index 559b8a3dd78..71d1b410146 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/MarkerReader_1.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/MarkerReader_1.java
@@ -16,12 +16,18 @@
*******************************************************************************/
package org.eclipse.core.internal.resources;
-import java.io.*;
-import java.util.*;
+import java.io.DataInputStream;
+import java.io.EOFException;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
import org.eclipse.core.internal.utils.Messages;
import org.eclipse.core.resources.IResourceDelta;
import org.eclipse.core.resources.IResourceStatus;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
/**
* This class is used to read markers from disk. This is for version 1.
@@ -69,7 +75,7 @@ public void read(DataInputStream input, boolean generateDeltas) throws IOExcepti
try {
List readTypes = new ArrayList<>(5);
while (true) {
- IPath path = new Path(input.readUTF());
+ IPath path = IPath.fromOSString(input.readUTF());
int markersSize = input.readInt();
MarkerSet markers = new MarkerSet(markersSize);
for (int i = 0; i < markersSize; i++)
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/MarkerReader_2.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/MarkerReader_2.java
index ce2009ce125..9df09e18fed 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/MarkerReader_2.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/MarkerReader_2.java
@@ -16,12 +16,18 @@
*******************************************************************************/
package org.eclipse.core.internal.resources;
-import java.io.*;
-import java.util.*;
+import java.io.DataInputStream;
+import java.io.EOFException;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
import org.eclipse.core.internal.utils.Messages;
import org.eclipse.core.resources.IResourceDelta;
import org.eclipse.core.resources.IResourceStatus;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
/**
* This class is used to read markers from disk. This is for version 2. Here
@@ -70,7 +76,7 @@ public void read(DataInputStream input, boolean generateDeltas) throws IOExcepti
try {
List readTypes = new ArrayList<>(5);
while (true) {
- IPath path = new Path(input.readUTF());
+ IPath path = IPath.fromOSString(input.readUTF());
int markersSize = input.readInt();
MarkerSet markers = new MarkerSet(markersSize);
for (int i = 0; i < markersSize; i++)
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/MarkerReader_3.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/MarkerReader_3.java
index e2372f31e5d..f31266cb983 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/MarkerReader_3.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/MarkerReader_3.java
@@ -16,12 +16,18 @@
*******************************************************************************/
package org.eclipse.core.internal.resources;
-import java.io.*;
-import java.util.*;
+import java.io.DataInputStream;
+import java.io.EOFException;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
import org.eclipse.core.internal.utils.Messages;
import org.eclipse.core.resources.IResourceDelta;
import org.eclipse.core.resources.IResourceStatus;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
/**
* This class is used to read markers from disk. This is for version 2. Here
@@ -71,7 +77,7 @@ public void read(DataInputStream input, boolean generateDeltas) throws IOExcepti
try {
List readTypes = new ArrayList<>(5);
while (true) {
- IPath path = new Path(input.readUTF());
+ IPath path = IPath.fromOSString(input.readUTF());
int markersSize = input.readInt();
MarkerSet markers = new MarkerSet(markersSize);
for (int i = 0; i < markersSize; i++)
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/MarkerSnapshotReader_1.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/MarkerSnapshotReader_1.java
index 416dff0dfa9..d47c3dc1167 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/MarkerSnapshotReader_1.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/MarkerSnapshotReader_1.java
@@ -18,10 +18,14 @@
import java.io.DataInputStream;
import java.io.IOException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
import org.eclipse.core.internal.utils.Messages;
import org.eclipse.core.resources.IResourceStatus;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
//
/**
@@ -67,7 +71,7 @@ public MarkerSnapshotReader_1(Workspace workspace) {
*/
@Override
public void read(DataInputStream input) throws IOException, CoreException {
- IPath path = new Path(input.readUTF());
+ IPath path = IPath.fromOSString(input.readUTF());
int markersSize = input.readInt();
MarkerSet markers = new MarkerSet(markersSize);
ArrayList readTypes = new ArrayList<>();
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/MarkerSnapshotReader_2.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/MarkerSnapshotReader_2.java
index 2e632770a43..dcf6f41fe1e 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/MarkerSnapshotReader_2.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/MarkerSnapshotReader_2.java
@@ -18,10 +18,14 @@
import java.io.DataInputStream;
import java.io.IOException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
import org.eclipse.core.internal.utils.Messages;
import org.eclipse.core.resources.IResourceStatus;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
//
/**
@@ -68,7 +72,7 @@ public MarkerSnapshotReader_2(Workspace workspace) {
*/
@Override
public void read(DataInputStream input) throws IOException, CoreException {
- IPath path = new Path(input.readUTF());
+ IPath path = IPath.fromOSString(input.readUTF());
int markersSize = input.readInt();
MarkerSet markers = new MarkerSet(markersSize);
ArrayList readTypes = new ArrayList<>();
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/PathVariableManager.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/PathVariableManager.java
index 2f2e0d6bb9f..0dae1d1270e 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/PathVariableManager.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/PathVariableManager.java
@@ -16,13 +16,33 @@
package org.eclipse.core.internal.resources;
import java.net.URI;
-import java.util.*;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
import org.eclipse.core.filesystem.URIUtil;
import org.eclipse.core.internal.events.PathVariableChangeEvent;
import org.eclipse.core.internal.utils.FileUtil;
import org.eclipse.core.internal.utils.Messages;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.resources.IPathVariableChangeEvent;
+import org.eclipse.core.resources.IPathVariableChangeListener;
+import org.eclipse.core.resources.IPathVariableManager;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceStatus;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.ISafeRunnable;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Preferences;
+import org.eclipse.core.runtime.SafeRunner;
+import org.eclipse.core.runtime.Status;
import org.eclipse.osgi.util.NLS;
/**
@@ -174,7 +194,7 @@ public String[] getPathVariableNames() {
public IPath getValue(String varName) {
String key = getKeyForName(varName);
String value = preferences.getString(key);
- return value.length() == 0 ? null : Path.fromPortableString(value);
+ return value.length() == 0 ? null : IPath.fromPortableString(value);
}
/**
@@ -222,7 +242,7 @@ public URI resolveURI(URI uri) {
if (schemeSpecificPart == null || schemeSpecificPart.isEmpty()) {
return uri;
}
- IPath raw = new Path(schemeSpecificPart);
+ IPath raw = IPath.fromOSString(schemeSpecificPart);
IPath resolved = resolvePath(raw);
return raw == resolved ? uri : URIUtil.toURI(resolved);
}
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/PathVariableUtil.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/PathVariableUtil.java
index 8054ee7ee68..2d0789b9734 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/PathVariableUtil.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/PathVariableUtil.java
@@ -20,10 +20,15 @@
import java.util.ArrayList;
import java.util.LinkedList;
import org.eclipse.core.filesystem.URIUtil;
-import org.eclipse.core.internal.resources.projectvariables.*;
+import org.eclipse.core.internal.resources.projectvariables.ParentVariableResolver;
+import org.eclipse.core.internal.resources.projectvariables.ProjectLocationVariableResolver;
+import org.eclipse.core.internal.resources.projectvariables.WorkspaceLocationVariableResolver;
+import org.eclipse.core.internal.resources.projectvariables.WorkspaceParentLocationVariableResolver;
import org.eclipse.core.resources.IPathVariableManager;
import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Platform;
public class PathVariableUtil {
@@ -176,7 +181,7 @@ private static IPath makeRelativeToVariable(IPathVariableManager pathVariableMan
int valueSegmentCount = value.segmentCount();
if (value.isPrefixOf(path)) {
// transform "c:/foo/bar" into "FOO/bar"
- IPath tmp = Path.fromOSString(variableHint);
+ IPath tmp = IPath.fromOSString(variableHint);
for (int j = valueSegmentCount; j < originalPath.segmentCount(); j++) {
tmp = tmp.append(originalPath.segment(j));
}
@@ -189,7 +194,7 @@ private static IPath makeRelativeToVariable(IPathVariableManager pathVariableMan
int matchingFirstSegments = path.matchingFirstSegments(value);
if (matchingFirstSegments >= 0) {
String originalName = buildParentPathVariable(variableHint, valueSegmentCount - matchingFirstSegments, true);
- IPath tmp = Path.fromOSString(originalName);
+ IPath tmp = IPath.fromOSString(originalName);
for (int j = matchingFirstSegments; j < originalPath.segmentCount(); j++) {
tmp = tmp.append(originalPath.segment(j));
}
@@ -206,7 +211,7 @@ private static boolean devicesAreCompatible(IPath path, IPath value) {
static private IPath convertToProperCase(IPath path) {
if (Platform.getOS().equals(Platform.OS_WIN32))
- return Path.fromPortableString(path.toPortableString().toLowerCase());
+ return IPath.fromPortableString(path.toPortableString().toLowerCase());
return path;
}
@@ -247,7 +252,7 @@ static public String buildParentPathVariable(String variable, int difference, bo
public static IPath buildVariableMacro(IPath relativeSrcValue) {
String variable = relativeSrcValue.segment(0);
variable = "${" + variable + "}"; //$NON-NLS-1$//$NON-NLS-2$
- return Path.fromOSString(variable).append(relativeSrcValue.removeFirstSegments(1));
+ return IPath.fromOSString(variable).append(relativeSrcValue.removeFirstSegments(1));
}
public static String convertFromUserEditableFormatInternal(IPathVariableManager manager, String userFormat, boolean locationFormat) {
@@ -299,7 +304,7 @@ public static String convertFromUserEditableFormatInternal(IPathVariableManager
// So instead, an intermediate variable "VARFOO" will be created of value
// "${VAR}foo", and the string "${PARENT-1-VARFOO}" will be inserted.
String intermediateVariable = PathVariableUtil.getValidVariableName(variable + suffix);
- IPath intermediateValue = Path.fromPortableString(components[j]);
+ IPath intermediateValue = IPath.fromPortableString(components[j]);
int intermediateVariableIndex = 1;
String originalIntermediateVariableName = intermediateVariable;
while (manager.isDefined(intermediateVariable)) {
@@ -374,7 +379,7 @@ private static String[] splitPathComponents(String userFormat) {
public static String convertToUserEditableFormatInternal(String value, boolean locationFormat) {
StringBuilder buffer = new StringBuilder();
if (locationFormat) {
- IPath path = Path.fromOSString(value);
+ IPath path = IPath.fromOSString(value);
if (path.isAbsolute())
return path.toOSString();
int index = value.indexOf(java.io.File.separator);
@@ -397,7 +402,8 @@ private static void convertVariableToUserFormat(StringBuilder buffer, String com
String argument = PathVariableUtil.getParentVariableArgument(variable);
int count = PathVariableUtil.getParentVariableCount(variable);
if (argument != null && count != -1) {
- buffer.append(generateMacro ? PathVariableUtil.buildVariableMacro(Path.fromOSString(argument)) : Path.fromOSString(argument));
+ buffer.append(generateMacro ? PathVariableUtil.buildVariableMacro(IPath.fromOSString(argument))
+ : IPath.fromOSString(argument));
for (int j = 0; j < count; j++) {
buffer.append(java.io.File.separator + ".."); //$NON-NLS-1$
}
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/PlatformURLResourceConnection.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/PlatformURLResourceConnection.java
index 5d2efa04754..f957ec4a220 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/PlatformURLResourceConnection.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/PlatformURLResourceConnection.java
@@ -14,13 +14,17 @@
package org.eclipse.core.internal.resources;
import java.io.IOException;
-import java.net.*;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URL;
+import java.net.URLDecoder;
import org.eclipse.core.internal.boot.PlatformURLConnection;
import org.eclipse.core.internal.boot.PlatformURLHandler;
import org.eclipse.core.internal.utils.Messages;
-import org.eclipse.core.resources.*;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.eclipse.osgi.util.NLS;
/**
@@ -47,7 +51,7 @@ protected boolean allowCaching() {
protected URL resolve() throws IOException {
String filePath = url.getFile().trim();
filePath = URLDecoder.decode(filePath, "UTF-8"); //$NON-NLS-1$
- IPath spec = new Path(filePath).makeRelative();
+ IPath spec = IPath.fromOSString(filePath).makeRelative();
if (!spec.segment(0).equals(RESOURCE))
throw new IOException(NLS.bind(Messages.url_badVariant, url));
int count = spec.segmentCount();
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/Project.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/Project.java
index bc3291d227c..447ee2c9aec 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/Project.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/Project.java
@@ -21,14 +21,47 @@
package org.eclipse.core.internal.resources;
import java.net.URI;
-import java.util.*;
-import org.eclipse.core.filesystem.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeSet;
+import org.eclipse.core.filesystem.EFS;
+import org.eclipse.core.filesystem.IFileInfo;
+import org.eclipse.core.filesystem.IFileStore;
import org.eclipse.core.internal.events.LifecycleEvent;
import org.eclipse.core.internal.preferences.EclipsePreferences;
-import org.eclipse.core.internal.utils.*;
-import org.eclipse.core.resources.*;
+import org.eclipse.core.internal.utils.FileUtil;
+import org.eclipse.core.internal.utils.Messages;
+import org.eclipse.core.internal.utils.Policy;
+import org.eclipse.core.resources.IBuildConfiguration;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IProjectNature;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceStatus;
+import org.eclipse.core.resources.ISaveContext;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ProjectScope;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.resources.team.IMoveDeleteHook;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.ICoreRunnable;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.core.runtime.content.IContentTypeMatcher;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.core.runtime.jobs.Job;
@@ -70,7 +103,7 @@ protected void assertCreateRequirements(IProjectDescription description) throws
if (localInfo.exists()) {
String name = getLocalManager().getLocalName(store);
if (name != null && !store.getName().equals(name)) {
- String msg = NLS.bind(Messages.resources_existsLocalDifferentCase, new Path(store.toString()).removeLastSegments(1).append(name).toOSString());
+ String msg = NLS.bind(Messages.resources_existsLocalDifferentCase, IPath.fromOSString(store.toString()).removeLastSegments(1).append(name).toOSString());
throw new ResourceException(IResourceStatus.CASE_VARIANT_EXISTS, getFullPath(), msg, null);
}
}
@@ -430,7 +463,7 @@ public IProject getProject() {
@Override
public IPath getProjectRelativePath() {
- return Path.EMPTY;
+ return IPath.EMPTY;
}
@Override
@@ -643,7 +676,7 @@ protected void internalCopy(IProjectDescription destDesc, int updateFlags, IProg
String message = NLS.bind(Messages.resources_copying, getFullPath());
monitor.beginTask(message, Policy.totalWork);
String destName = destDesc.getName();
- IPath destPath = new Path(destName).makeAbsolute();
+ IPath destPath = IPath.fromOSString(destName).makeAbsolute();
Project destination = (Project) workspace.getRoot().getProject(destName);
final ISchedulingRule rule = workspace.getRuleFactory().copyRule(this, destination);
try {
@@ -975,7 +1008,7 @@ public void move(IProjectDescription description, int updateFlags, IProgressMoni
// The following assert method throws CoreExceptions as stated in the IResource.move API
// and assert for programming errors. See checkMoveRequirements for more information.
if (!getName().equals(description.getName())) {
- IPath destPath = Path.ROOT.append(description.getName());
+ IPath destPath = IPath.ROOT.append(description.getName());
assertMoveRequirements(destPath, IResource.PROJECT, updateFlags);
}
checkDescription(destination, description, true);
@@ -1127,7 +1160,7 @@ public void open(int updateFlags, IProgressMonitor monitor) throws CoreException
* Try to set encoding if we open the project for the first time. See bug 479450
*/
private void writeEncodingAfterOpen(IProgressMonitor monitor) throws CoreException {
- IPath settings = new Path(EclipsePreferences.DEFAULT_PREFERENCES_DIRNAME).append(ResourcesPlugin.PI_RESOURCES)
+ IPath settings = IPath.fromOSString(EclipsePreferences.DEFAULT_PREFERENCES_DIRNAME).append(ResourcesPlugin.PI_RESOURCES)
.addFileExtension(EclipsePreferences.PREFS_FILE_EXTENSION);
IFile file = getFile(settings);
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/ProjectDescriptionReader.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/ProjectDescriptionReader.java
index b989b6c4f74..433bdc89aed 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/ProjectDescriptionReader.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/ProjectDescriptionReader.java
@@ -51,7 +51,6 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.osgi.util.NLS;
import org.xml.sax.Attributes;
@@ -635,7 +634,8 @@ private void endLinkLocation(String elementName) {
if (oldLocation != null) {
parseProblem(NLS.bind(Messages.projRead_badLocation, oldLocation, newLocation));
} else {
- ((LinkDescription) objectStack.peek()).setLocationURI(URIUtil.toURI(Path.fromPortableString(newLocation)));
+ ((LinkDescription) objectStack.peek())
+ .setLocationURI(URIUtil.toURI(IPath.fromPortableString(newLocation)));
}
state = S_LINK;
}
@@ -668,7 +668,7 @@ private void endLinkLocationURI(String elementName) {
private void endLinkPath(String elementName) {
if (elementName.equals(NAME)) {
- IPath newPath = new Path(charBuffer.toString());
+ IPath newPath = IPath.fromOSString(charBuffer.toString());
// objectStack has a LinkDescription on it. Set the name
// on this LinkDescription.
IPath oldPath = ((LinkDescription) objectStack.peek()).getProjectRelativePath();
@@ -731,7 +731,7 @@ private void endFilterId(String elementName) {
private void endFilterPath(String elementName) {
if (elementName.equals(NAME)) {
- IPath newPath = new Path(charBuffer.toString());
+ IPath newPath = IPath.fromOSString(charBuffer.toString());
// objectStack has a FilterDescription on it. Set the name
// on this FilterDescription.
IResource oldResource = ((FilterDescription) objectStack.peek()).getResource();
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/ProjectPathVariableManager.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/ProjectPathVariableManager.java
index 4dcbc17bfea..2ce9df15809 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/ProjectPathVariableManager.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/ProjectPathVariableManager.java
@@ -18,12 +18,26 @@
import java.net.URI;
import java.net.URISyntaxException;
-import java.util.*;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
import org.eclipse.core.filesystem.URIUtil;
import org.eclipse.core.internal.resources.ProjectVariableProviderManager.Descriptor;
import org.eclipse.core.internal.utils.Messages;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.resources.IPathVariableChangeEvent;
+import org.eclipse.core.resources.IPathVariableChangeListener;
+import org.eclipse.core.resources.IPathVariableManager;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceStatus;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.osgi.util.NLS;
@@ -128,7 +142,7 @@ public URI getURIValue(String varName) {
try {
return URI.create(value);
} catch (IllegalArgumentException e) {
- IPath path = Path.fromPortableString(value);
+ IPath path = IPath.fromPortableString(value);
return URIUtil.toURI(path);
}
}
@@ -220,7 +234,7 @@ public URI resolveVariable(String variable) {
try {
return URI.create(value);
} catch (IllegalArgumentException e) {
- return URIUtil.toURI(Path.fromPortableString(value));
+ return URIUtil.toURI(IPath.fromPortableString(value));
}
}
return null;
@@ -285,7 +299,7 @@ public URI resolveURI(URI uri) {
if (schemeSpecificPart == null || schemeSpecificPart.isEmpty()) {
return uri;
}
- IPath raw = new Path(schemeSpecificPart);
+ IPath raw = IPath.fromOSString(schemeSpecificPart);
if (raw == null || raw.segmentCount() == 0 || raw.isAbsolute() || raw.getDevice() != null)
return URIUtil.toURI(raw);
URI value = resolveVariable(raw.segment(0));
@@ -294,7 +308,7 @@ public URI resolveURI(URI uri) {
String path = value.getPath();
if (path != null) {
- IPath p = Path.fromPortableString(path);
+ IPath p = IPath.fromPortableString(path);
p = p.append(raw.removeFirstSegments(1));
try {
value = new URI(value.getScheme(), value.getHost(), p.toPortableString(), value.getFragment());
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/ProjectPreferences.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/ProjectPreferences.java
index ad4d50bc201..87959af93af 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/ProjectPreferences.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/ProjectPreferences.java
@@ -17,16 +17,43 @@
*******************************************************************************/
package org.eclipse.core.internal.resources;
-import java.io.*;
+import java.io.BufferedInputStream;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.text.MessageFormat;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
import java.util.Map.Entry;
-import org.eclipse.core.internal.preferences.*;
+import java.util.Properties;
+import java.util.Set;
+import org.eclipse.core.internal.preferences.EclipsePreferences;
+import org.eclipse.core.internal.preferences.ExportedPreferences;
+import org.eclipse.core.internal.preferences.PreferencesService;
+import org.eclipse.core.internal.preferences.SortedProperties;
import org.eclipse.core.internal.utils.Messages;
import org.eclipse.core.internal.utils.Policy;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceRuleFactory;
+import org.eclipse.core.resources.IResourceStatus;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ProjectScope;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.ICoreRunnable;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.core.runtime.jobs.MultiRule;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
@@ -158,14 +185,14 @@ static void deleted(IResource resource) throws CoreException {
*/
static IFile getFile(IFolder folder, String qualifier) {
Assert.isLegal(folder.getName().equals(DEFAULT_PREFERENCES_DIRNAME));
- return folder.getFile(new Path(qualifier).addFileExtension(PREFS_FILE_EXTENSION));
+ return folder.getFile(IPath.fromOSString(qualifier).addFileExtension(PREFS_FILE_EXTENSION));
}
/*
* Return the preferences file for the given project and qualifier.
*/
static IFile getFile(IProject project, String qualifier) {
- return project.getFile(new Path(DEFAULT_PREFERENCES_DIRNAME).append(qualifier).addFileExtension(PREFS_FILE_EXTENSION));
+ return project.getFile(IPath.fromOSString(DEFAULT_PREFERENCES_DIRNAME).append(qualifier).addFileExtension(PREFS_FILE_EXTENSION));
}
private static Properties loadProperties(IFile file) throws BackingStoreException {
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/Resource.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/Resource.java
index d35193a792f..e0dd30bc07a 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/Resource.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/Resource.java
@@ -25,18 +25,55 @@
import java.net.URI;
import java.net.URISyntaxException;
-import java.util.*;
-import org.eclipse.core.filesystem.*;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import org.eclipse.core.filesystem.EFS;
+import org.eclipse.core.filesystem.IFileInfo;
+import org.eclipse.core.filesystem.IFileStore;
import org.eclipse.core.filesystem.URIUtil;
import org.eclipse.core.filesystem.provider.FileInfo;
import org.eclipse.core.internal.events.LifecycleEvent;
import org.eclipse.core.internal.localstore.FileSystemResourceManager;
import org.eclipse.core.internal.properties.IPropertyManager;
-import org.eclipse.core.internal.utils.*;
-import org.eclipse.core.internal.watson.*;
-import org.eclipse.core.resources.*;
+import org.eclipse.core.internal.utils.FileUtil;
+import org.eclipse.core.internal.utils.Messages;
+import org.eclipse.core.internal.utils.WrappedRuntimeException;
+import org.eclipse.core.internal.watson.ElementTreeIterator;
+import org.eclipse.core.internal.watson.IElementContentVisitor;
+import org.eclipse.core.internal.watson.IPathRequestor;
+import org.eclipse.core.resources.FileInfoMatcherDescription;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IPathVariableManager;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceProxy;
+import org.eclipse.core.resources.IResourceProxyVisitor;
+import org.eclipse.core.resources.IResourceStatus;
+import org.eclipse.core.resources.IResourceVisitor;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourceAttributes;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.resources.team.IMoveDeleteHook;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.PlatformObject;
+import org.eclipse.core.runtime.QualifiedName;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.core.runtime.jobs.MultiRule;
import org.eclipse.osgi.util.NLS;
@@ -567,7 +604,7 @@ public void copy(IProjectDescription destDesc, int updateFlags, IProgressMonitor
workspace.prepareOperation(workspace.getRoot(), split);
// The following assert method throws CoreExceptions as stated in the IResource.copy API
// and assert for programming errors. See checkCopyRequirements for more information.
- IPath destPath = new Path(destDesc.getName()).makeAbsolute();
+ IPath destPath = IPath.fromOSString(destDesc.getName()).makeAbsolute();
assertCopyRequirements(destPath, getType(), updateFlags);
Project destProject = (Project) workspace.getRoot().getProject(destPath.lastSegment());
workspace.beginOperation(true);
@@ -971,7 +1008,7 @@ public IResource findExistingResourceVariant(IPath target) {
if (info != null && info.isSet(M_PHANTOM))
return null;
// Resort to slow lookup to find exact case variant.
- IPath result = Path.ROOT;
+ IPath result = IPath.ROOT;
int segmentCount = target.segmentCount();
for (int i = 0; i < segmentCount; i++) {
String[] childNames = workspace.tree.getNamesOfChildren(result);
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/SafeFileTable.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/SafeFileTable.java
index 878eb321eed..76365fb0448 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/SafeFileTable.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/SafeFileTable.java
@@ -15,12 +15,15 @@
*******************************************************************************/
package org.eclipse.core.internal.resources;
-import java.io.*;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
import java.util.Properties;
import java.util.Set;
import org.eclipse.core.internal.utils.Messages;
import org.eclipse.core.resources.IResourceStatus;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
/**
* Represents a table of keys and paths used by a plugin to maintain its
@@ -42,7 +45,7 @@ public IPath[] getFiles() {
String[] keys = set.toArray(new String[set.size()]);
IPath[] files = new IPath[keys.length];
for (int i = 0; i < keys.length; i++)
- files[i] = new Path(keys[i]);
+ files[i] = IPath.fromOSString(keys[i]);
return files;
}
@@ -52,7 +55,7 @@ protected Workspace getWorkspace() {
public IPath lookup(IPath file) {
String result = table.getProperty(file.toOSString());
- return result == null ? null : new Path(result);
+ return result == null ? null : IPath.fromOSString(result);
}
public void map(IPath file, IPath aLocation) {
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/SaveManager.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/SaveManager.java
index 4e693417fa7..5892b14a73c 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/SaveManager.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/SaveManager.java
@@ -21,25 +21,85 @@
*******************************************************************************/
package org.eclipse.core.internal.resources;
-import java.io.*;
+import java.io.ByteArrayOutputStream;
+import java.io.DataInput;
+import java.io.DataInputStream;
+import java.io.DataOutput;
+import java.io.DataOutputStream;
import java.io.File;
+import java.io.FileInputStream;
+import java.io.FilenameFilter;
+import java.io.IOException;
import java.net.URI;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Paths;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.ListIterator;
+import java.util.Map;
import java.util.Map.Entry;
-import java.util.concurrent.*;
+import java.util.Objects;
+import java.util.Properties;
+import java.util.Set;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ForkJoinPool;
+import java.util.concurrent.ForkJoinWorkerThread;
import java.util.stream.Collectors;
-import java.util.zip.*;
+import java.util.zip.Deflater;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
+import java.util.zip.ZipOutputStream;
import org.eclipse.core.filesystem.EFS;
import org.eclipse.core.filesystem.IFileStore;
-import org.eclipse.core.internal.events.*;
-import org.eclipse.core.internal.localstore.*;
-import org.eclipse.core.internal.utils.*;
-import org.eclipse.core.internal.watson.*;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.internal.events.BuilderPersistentInfo;
+import org.eclipse.core.internal.events.ResourceComparator;
+import org.eclipse.core.internal.events.ResourceStats;
+import org.eclipse.core.internal.localstore.SafeChunkyInputStream;
+import org.eclipse.core.internal.localstore.SafeChunkyOutputStream;
+import org.eclipse.core.internal.localstore.SafeFileInputStream;
+import org.eclipse.core.internal.localstore.SafeFileOutputStream;
+import org.eclipse.core.internal.utils.FileUtil;
+import org.eclipse.core.internal.utils.IStringPoolParticipant;
+import org.eclipse.core.internal.utils.Messages;
+import org.eclipse.core.internal.utils.Policy;
+import org.eclipse.core.internal.utils.StringPool;
+import org.eclipse.core.internal.utils.WrappedRuntimeException;
+import org.eclipse.core.internal.watson.ElementTree;
+import org.eclipse.core.internal.watson.ElementTreeIterator;
+import org.eclipse.core.internal.watson.ElementTreeWriter;
+import org.eclipse.core.internal.watson.IElementContentVisitor;
+import org.eclipse.core.internal.watson.IElementInfoFlattener;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceStatus;
+import org.eclipse.core.resources.ISaveContext;
+import org.eclipse.core.resources.ISaveParticipant;
+import org.eclipse.core.resources.ISavedState;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.ILog;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.ISafeRunnable;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.ProgressMonitorWrapper;
+import org.eclipse.core.runtime.QualifiedName;
+import org.eclipse.core.runtime.SafeRunner;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.osgi.util.NLS;
@@ -66,7 +126,7 @@ public synchronized Object put(Object key, Object value) {
}
}
- protected static final String ROOT_SEQUENCE_NUMBER_KEY = Path.ROOT + LocalMetaArea.F_TREE;
+ protected static final String ROOT_SEQUENCE_NUMBER_KEY = IPath.ROOT + LocalMetaArea.F_TREE;
protected static final String CLEAR_DELTA_PREFIX = "clearDelta_"; //$NON-NLS-1$
protected static final String DELTA_EXPIRATION_PREFIX = "deltaExpiration_"; //$NON-NLS-1$
protected static final int DONE_SAVING = 3;
@@ -233,7 +293,7 @@ protected void cleanMasterTable() {
continue;
String prefix = key.substring(0, key.length() - LocalMetaArea.F_TREE.length());
//always save the root tree entry
- if (prefix.equals(Path.ROOT.toString()))
+ if (prefix.equals(IPath.ROOT.toString()))
continue;
IProject project = workspace.getRoot().getProject(prefix);
if (!project.exists() || project.isOpen())
@@ -1112,7 +1172,7 @@ protected boolean restoreTreeFromRefreshSnapshot(Project project, java.io.File s
reader.readTree(project, input, Policy.subMonitorFor(monitor, Policy.totalWork));
}
} catch (IOException e) {
- snapshotPath = new Path(snapshotFile.getPath());
+ snapshotPath = IPath.fromOSString(snapshotFile.getPath());
message = NLS.bind(Messages.resources_readMeta, snapshotPath);
throw new ResourceException(IResourceStatus.FAILED_READ_METADATA, snapshotPath, message, e);
} finally {
@@ -1332,7 +1392,7 @@ protected IStatus saveMetaInfo(Project project, IProgressMonitor monitor) throws
*/
public void saveRefreshSnapshot(Project project, URI snapshotLocation, IProgressMonitor monitor) throws CoreException {
IFileStore store = EFS.getStore(snapshotLocation);
- IPath snapshotPath = new Path(snapshotLocation.getPath());
+ IPath snapshotPath = IPath.fromOSString(snapshotLocation.getPath());
try (ByteArrayOutputStream tmp = new ByteArrayOutputStream()) {
try (DataOutputStream output = new DataOutputStream(tmp)) {
output.writeInt(ICoreConstants.WORKSPACE_TREE_VERSION_2);
@@ -1368,7 +1428,7 @@ protected void saveTree(Map contexts, IProgressMonitor moni
}
} catch (Exception e) {
String msg = NLS.bind(Messages.resources_writeWorkspaceMeta, treeLocation);
- throw new ResourceException(IResourceStatus.FAILED_WRITE_METADATA, Path.ROOT, msg, e);
+ throw new ResourceException(IResourceStatus.FAILED_WRITE_METADATA, IPath.ROOT, msg, e);
}
if (Policy.DEBUG_SAVE_TREE)
Policy.debug("Save Workspace Tree: " + (System.currentTimeMillis() - start) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -1458,14 +1518,14 @@ protected void snapTree(ElementTree tree, IProgressMonitor monitor) throws CoreE
try (DataOutputStream out = new DataOutputStream(safeStream);) {
out.writeInt(ICoreConstants.WORKSPACE_TREE_VERSION_2);
writeWorkspaceFields(out, subMonitor);
- writer.writeDelta(tree, lastSnap, Path.ROOT, ElementTreeWriter.D_INFINITE, out,
+ writer.writeDelta(tree, lastSnap, IPath.ROOT, ElementTreeWriter.D_INFINITE, out,
ResourceComparator.getSaveComparator());
safeStream.succeed();
out.close();
}
} catch (IOException e) {
message = NLS.bind(Messages.resources_writeWorkspaceMeta, localFile.getAbsolutePath());
- throw new ResourceException(IResourceStatus.FAILED_WRITE_METADATA, Path.ROOT, message, e);
+ throw new ResourceException(IResourceStatus.FAILED_WRITE_METADATA, IPath.ROOT, message, e);
}
lastSnap = tree;
if (Policy.DEBUG_SAVE_TREE)
@@ -2023,7 +2083,7 @@ protected void writeTree(Map statesToSave, DataOutputStream
/* save the forest! */
ElementTreeWriter writer = new ElementTreeWriter(this);
ElementTree[] treesToSave = trees.toArray(new ElementTree[trees.size()]);
- writer.writeDeltaChain(treesToSave, Path.ROOT, ElementTreeWriter.D_INFINITE, output,
+ writer.writeDeltaChain(treesToSave, IPath.ROOT, ElementTreeWriter.D_INFINITE, output,
ResourceComparator.getSaveComparator());
subMonitor.worked(4);
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/SavedState.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/SavedState.java
index d913c1c15ee..5e9df612743 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/SavedState.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/SavedState.java
@@ -18,8 +18,11 @@
import org.eclipse.core.internal.events.ResourceDeltaFactory;
import org.eclipse.core.internal.utils.Policy;
import org.eclipse.core.internal.watson.ElementTree;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.ISavedState;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
/**
@@ -80,7 +83,7 @@ public void processResourceChangeEvents(IResourceChangeListener listener) {
if (oldTree == null || newTree == null)
return;
workspace.beginOperation(true);
- ResourceDelta delta = ResourceDeltaFactory.computeDelta(workspace, oldTree, newTree, Path.ROOT, -1);
+ ResourceDelta delta = ResourceDeltaFactory.computeDelta(workspace, oldTree, newTree, IPath.ROOT, -1);
forgetTrees(); // free trees to prevent memory leak
workspace.getNotificationManager().broadcastChanges(listener, IResourceChangeEvent.POST_BUILD, delta);
} finally {
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/SyncInfoReader_2.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/SyncInfoReader_2.java
index cf6206e8ab9..3222affe544 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/SyncInfoReader_2.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/SyncInfoReader_2.java
@@ -15,13 +15,17 @@
*******************************************************************************/
package org.eclipse.core.internal.resources;
-import java.io.*;
+import java.io.DataInputStream;
+import java.io.EOFException;
+import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.internal.utils.Messages;
import org.eclipse.core.internal.utils.ObjectMap;
import org.eclipse.core.resources.IResourceStatus;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.osgi.util.NLS;
/**
@@ -57,7 +61,7 @@ public void readSyncInfo(DataInputStream input) throws IOException, CoreExceptio
try {
List readPartners = new ArrayList<>(5);
while (true) {
- IPath path = new Path(input.readUTF());
+ IPath path = IPath.fromOSString(input.readUTF());
readSyncInfo(path, input, readPartners);
}
} catch (EOFException e) {
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/SyncInfoReader_3.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/SyncInfoReader_3.java
index a5ef11c8c1c..ba71b2b1a78 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/SyncInfoReader_3.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/SyncInfoReader_3.java
@@ -15,13 +15,17 @@
*******************************************************************************/
package org.eclipse.core.internal.resources;
-import java.io.*;
+import java.io.DataInputStream;
+import java.io.EOFException;
+import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.internal.utils.Messages;
import org.eclipse.core.internal.utils.ObjectMap;
import org.eclipse.core.resources.IResourceStatus;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.osgi.util.NLS;
/**
@@ -57,7 +61,7 @@ public void readSyncInfo(DataInputStream input) throws IOException, CoreExceptio
try {
List readPartners = new ArrayList<>(5);
while (true) {
- IPath path = new Path(input.readUTF());
+ IPath path = IPath.fromOSString(input.readUTF());
readSyncInfo(path, input, readPartners);
}
} catch (EOFException e) {
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/SyncInfoSnapReader_3.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/SyncInfoSnapReader_3.java
index c88d05aff91..e3a9c84b3d9 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/SyncInfoSnapReader_3.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/SyncInfoSnapReader_3.java
@@ -18,7 +18,8 @@
import java.io.DataInputStream;
import java.io.IOException;
import org.eclipse.core.internal.utils.ObjectMap;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.QualifiedName;
public class SyncInfoSnapReader_3 extends SyncInfoSnapReader {
@@ -58,7 +59,7 @@ private ObjectMap internalReadSyncInfo(DataInputStream in
*/
@Override
public void readSyncInfo(DataInputStream input) throws IOException {
- IPath path = new Path(input.readUTF());
+ IPath path = IPath.fromOSString(input.readUTF());
ObjectMap map = internalReadSyncInfo(input);
// set the table on the resource info
ResourceInfo info = workspace.getResourceInfo(path, true, false);
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/VirtualFileStore.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/VirtualFileStore.java
index f2966f972e7..9b3d8f43b05 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/VirtualFileStore.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/VirtualFileStore.java
@@ -16,10 +16,14 @@
import java.io.InputStream;
import java.net.URI;
-import org.eclipse.core.filesystem.*;
+import org.eclipse.core.filesystem.EFS;
+import org.eclipse.core.filesystem.IFileInfo;
+import org.eclipse.core.filesystem.IFileStore;
import org.eclipse.core.filesystem.provider.FileInfo;
import org.eclipse.core.filesystem.provider.FileStore;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
/**
* A file store representing a virtual resource.
@@ -53,7 +57,7 @@ public void delete(int options, IProgressMonitor monitor) {
@Override
public IFileStore getChild(String name) {
- return EFS.getNullFileSystem().getStore(new Path(name).makeAbsolute());
+ return EFS.getNullFileSystem().getStore(IPath.fromOSString(name).makeAbsolute());
}
@Override
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/Workspace.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/Workspace.java
index 3e6875af2b7..1fd18771bff 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/Workspace.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/Workspace.java
@@ -25,14 +25,34 @@
import java.net.URI;
import java.net.URISyntaxException;
import java.text.MessageFormat;
-import java.util.*;
+import java.util.ArrayDeque;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.Deque;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.SortedSet;
+import java.util.TreeSet;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.atomic.AtomicLong;
import java.util.function.Predicate;
import org.eclipse.core.filesystem.EFS;
import org.eclipse.core.filesystem.IFileStore;
import org.eclipse.core.filesystem.URIUtil;
-import org.eclipse.core.internal.events.*;
+import org.eclipse.core.internal.events.BuildManager;
+import org.eclipse.core.internal.events.ILifecycleListener;
+import org.eclipse.core.internal.events.LifecycleEvent;
+import org.eclipse.core.internal.events.NotificationManager;
+import org.eclipse.core.internal.events.ResourceChangeEvent;
+import org.eclipse.core.internal.events.ResourceComparator;
import org.eclipse.core.internal.localstore.FileSystemResourceManager;
import org.eclipse.core.internal.preferences.PreferencesService;
import org.eclipse.core.internal.properties.IPropertyManager;
@@ -40,12 +60,62 @@
import org.eclipse.core.internal.refresh.RefreshManager;
import org.eclipse.core.internal.resources.ComputeProjectOrder.Digraph;
import org.eclipse.core.internal.resources.ComputeProjectOrder.VertexOrder;
-import org.eclipse.core.internal.utils.*;
-import org.eclipse.core.internal.watson.*;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.resources.team.*;
-import org.eclipse.core.runtime.*;
-import org.eclipse.core.runtime.jobs.*;
+import org.eclipse.core.internal.utils.Messages;
+import org.eclipse.core.internal.utils.Policy;
+import org.eclipse.core.internal.utils.StringPoolJob;
+import org.eclipse.core.internal.watson.ElementTree;
+import org.eclipse.core.internal.watson.ElementTreeIterator;
+import org.eclipse.core.internal.watson.IElementContentVisitor;
+import org.eclipse.core.resources.IBuildConfiguration;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFileModificationValidator;
+import org.eclipse.core.resources.IFilterMatcherDescriptor;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IPathVariableManager;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IProjectNatureDescriptor;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.IResourceRuleFactory;
+import org.eclipse.core.resources.IResourceStatus;
+import org.eclipse.core.resources.ISaveContext;
+import org.eclipse.core.resources.ISaveParticipant;
+import org.eclipse.core.resources.ISavedState;
+import org.eclipse.core.resources.ISynchronizer;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.IWorkspaceDescription;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.IWorkspaceRunnable;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.resources.ProjectScope;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.resources.team.FileModificationValidationContext;
+import org.eclipse.core.resources.team.FileModificationValidator;
+import org.eclipse.core.resources.team.IMoveDeleteHook;
+import org.eclipse.core.resources.team.TeamHook;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.ICoreRunnable;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.ISafeRunnable;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.PlatformObject;
+import org.eclipse.core.runtime.Plugin;
+import org.eclipse.core.runtime.SafeRunner;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubMonitor;
+import org.eclipse.core.runtime.jobs.ISchedulingRule;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.core.runtime.jobs.JobGroup;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.osgi.util.NLS;
@@ -109,7 +179,7 @@ public class Workspace extends PlatformObject implements IWorkspace, ICoreConsta
protected ContentDescriptionManager contentDescriptionManager;
/** indicates if the workspace crashed in a previous session */
protected boolean crashed = false;
- protected final IWorkspaceRoot defaultRoot = new WorkspaceRoot(Path.ROOT, this);
+ protected final IWorkspaceRoot defaultRoot = new WorkspaceRoot(IPath.ROOT, this);
protected WorkspacePreferences description;
protected FileSystemResourceManager fileSystemManager;
protected final CopyOnWriteArrayList lifecycleListeners = new CopyOnWriteArrayList<>();
@@ -1181,7 +1251,7 @@ public URI transferVariableDefinition(IResource source, IResource dest, URI sour
if (!source.getProject().equals(dest.getProject())) {
String variable = srcRawLoc.segment(0);
variable = copyVariable(source, dest, variable);
- IPath newLocation = Path.fromPortableString(variable).append(srcRawLoc.removeFirstSegments(1));
+ IPath newLocation = IPath.fromPortableString(variable).append(srcRawLoc.removeFirstSegments(1));
sourceURI = toURI(newLocation);
} else {
sourceURI = toURI(srcRawLoc);
@@ -1264,7 +1334,7 @@ String copyVariable(IResource source, IResource dest, String variable) throws Co
} else
result.append(segment);
}
- srcValue = Path.fromPortableString(result.toString());
+ srcValue = IPath.fromPortableString(result.toString());
}
}
if (shouldConvertToRelative) {
@@ -1465,7 +1535,7 @@ public void deleteMarkers(IMarker[] markers) throws CoreException {
*/
void deleteResource(IResource resource) {
IPath path = resource.getFullPath();
- if (path.equals(Path.ROOT)) {
+ if (path.equals(IPath.ROOT)) {
IProject[] children = getRoot().getProjects(IContainer.INCLUDE_HIDDEN);
for (IProject element : children)
tree.deleteElement(element.getFullPath());
@@ -2260,7 +2330,8 @@ public IStatus open(IProgressMonitor monitor) throws CoreException {
refreshManager.refresh(getRoot());
} catch (RuntimeException e) {
//don't fail entire open if refresh failed, just report as warning
- return new ResourceStatus(IResourceStatus.INTERNAL_ERROR, Path.ROOT, Messages.resources_errorMultiRefresh, e);
+ return new ResourceStatus(IResourceStatus.INTERNAL_ERROR, IPath.ROOT,
+ Messages.resources_errorMultiRefresh, e);
}
}
//finally register a string pool participant
@@ -2579,7 +2650,7 @@ public String toDebugString() {
buffer.append("\n " + requestor.requestPath() + ": " + elementContents); //$NON-NLS-1$ //$NON-NLS-2$
return true;
};
- new ElementTreeIterator(tree, Path.ROOT).iterate(visitor);
+ new ElementTreeIterator(tree, IPath.ROOT).iterate(visitor);
return buffer.toString();
}
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/WorkspaceRoot.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/WorkspaceRoot.java
index 0318b485f4f..05bde76cacb 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/WorkspaceRoot.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/WorkspaceRoot.java
@@ -20,8 +20,20 @@
import org.eclipse.core.filesystem.URIUtil;
import org.eclipse.core.internal.utils.FileUtil;
import org.eclipse.core.internal.utils.Policy;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Preferences;
import org.eclipse.osgi.util.NLS;
public class WorkspaceRoot extends Container implements IWorkspaceRoot {
@@ -39,7 +51,7 @@ public class WorkspaceRoot extends Container implements IWorkspaceRoot {
protected WorkspaceRoot(IPath path, Workspace container) {
super(path, container);
- Assert.isTrue(path.equals(Path.ROOT));
+ Assert.isTrue(path.equals(IPath.ROOT));
workspaceLocation = FileUtil.canonicalPath(Platform.getLocation());
Assert.isNotNull(workspaceLocation);
}
@@ -158,7 +170,7 @@ public IProject getProject(String name) {
@Override
public IPath getProjectRelativePath() {
- return Path.EMPTY;
+ return IPath.EMPTY;
}
@Override
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/WorkspaceTreeReader_1.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/WorkspaceTreeReader_1.java
index d0c479719f3..b9050d21ff2 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/WorkspaceTreeReader_1.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/WorkspaceTreeReader_1.java
@@ -16,8 +16,12 @@
*******************************************************************************/
package org.eclipse.core.internal.resources;
-import java.io.*;
-import java.util.*;
+import java.io.DataInputStream;
+import java.io.EOFException;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
import org.eclipse.core.internal.events.BuilderPersistentInfo;
import org.eclipse.core.internal.utils.Messages;
import org.eclipse.core.internal.utils.Policy;
@@ -25,7 +29,9 @@
import org.eclipse.core.internal.watson.ElementTreeReader;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResourceStatus;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
/**
* Reads version 1 of the workspace tree file format.
@@ -169,7 +175,7 @@ public void readTree(DataInputStream input, IProgressMonitor monitor) throws Cor
List buildersToBeLinked = new ArrayList<>(20);
readBuildersPersistentInfo(null, input, buildersToBeLinked, Policy.subMonitorFor(monitor, Policy.opWork * 10 / 100));
- ElementTree[] trees = readTrees(Path.ROOT, input, Policy.subMonitorFor(monitor, Policy.opWork * 40 / 100));
+ ElementTree[] trees = readTrees(IPath.ROOT, input, Policy.subMonitorFor(monitor, Policy.opWork * 40 / 100));
linkPluginsSavedStateToTrees(pluginsToBeLinked, trees, Policy.subMonitorFor(monitor, Policy.opWork * 10 / 100));
linkBuildersToTrees(buildersToBeLinked, trees, pluginsToBeLinked.size(), Policy.subMonitorFor(monitor, Policy.opWork * 10 / 100));
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/WorkspaceTreeReader_2.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/WorkspaceTreeReader_2.java
index 08d5ea893fb..aaefa603e81 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/WorkspaceTreeReader_2.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/WorkspaceTreeReader_2.java
@@ -18,14 +18,19 @@
import java.io.DataInputStream;
import java.io.IOException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
import org.eclipse.core.internal.events.BuilderPersistentInfo;
import org.eclipse.core.internal.utils.Messages;
import org.eclipse.core.internal.utils.Policy;
import org.eclipse.core.internal.watson.ElementTree;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResourceStatus;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
/**
* Reads version 2 of the workspace tree file format.
@@ -108,7 +113,8 @@ public void readTree(DataInputStream input, IProgressMonitor monitor) throws Cor
List buildersToBeLinked = new ArrayList<>(20);
readBuildersPersistentInfo(null, input, buildersToBeLinked, Policy.subMonitorFor(monitor, Policy.opWork * 10 / 100));
- final ElementTree[] trees = readTrees(Path.ROOT, input, Policy.subMonitorFor(monitor, Policy.opWork * 40 / 100));
+ final ElementTree[] trees = readTrees(IPath.ROOT, input,
+ Policy.subMonitorFor(monitor, Policy.opWork * 40 / 100));
linkPluginsSavedStateToTrees(pluginsToBeLinked, trees, Policy.subMonitorFor(monitor, Policy.opWork * 10 / 100));
linkBuildersToTrees(buildersToBeLinked, trees, treeIndex, Policy.subMonitorFor(monitor, Policy.opWork * 10 / 100));
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/utils/FileUtil.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/utils/FileUtil.java
index 469785f41d8..540fc166f17 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/utils/FileUtil.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/utils/FileUtil.java
@@ -16,15 +16,25 @@
*******************************************************************************/
package org.eclipse.core.internal.utils;
-import java.io.*;
+import java.io.ByteArrayInputStream;
+import java.io.Closeable;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
import java.net.URI;
-import org.eclipse.core.filesystem.*;
+import org.eclipse.core.filesystem.EFS;
+import org.eclipse.core.filesystem.IFileInfo;
+import org.eclipse.core.filesystem.IFileStore;
+import org.eclipse.core.filesystem.IFileSystem;
import org.eclipse.core.filesystem.URIUtil;
import org.eclipse.core.internal.resources.ResourceException;
import org.eclipse.core.internal.resources.Workspace;
import org.eclipse.core.resources.IResourceStatus;
import org.eclipse.core.resources.ResourceAttributes;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.osgi.service.environment.Constants;
import org.eclipse.osgi.util.NLS;
@@ -67,7 +77,7 @@ public static IPath canonicalPath(IPath path) {
//only create a new path if necessary
if (canonicalPath.equals(pathString))
return path;
- return new Path(canonicalPath);
+ return IPath.fromOSString(canonicalPath);
} catch (IOException e) {
return path;
}
@@ -89,7 +99,7 @@ public static IPath realPath(IPath path) {
IFileSystem fileSystem = EFS.getLocalFileSystem();
if (fileSystem.isCaseSensitive())
return path;
- IPath realPath = path.isAbsolute() ? Path.ROOT : Path.EMPTY;
+ IPath realPath = path.isAbsolute() ? IPath.ROOT : IPath.EMPTY;
String device = path.getDevice();
if (device != null) {
realPath = realPath.setDevice(device.toUpperCase());
@@ -198,8 +208,8 @@ private static boolean computeOverlap(IPath location1, IPath location2, boolean
IPath two = location2;
// If we are on a case-insensitive file system then convert to all lower case.
if (!Workspace.caseSensitive) {
- one = new Path(location1.toOSString().toLowerCase());
- two = new Path(location2.toOSString().toLowerCase());
+ one = IPath.fromOSString(location1.toOSString().toLowerCase());
+ two = IPath.fromOSString(location2.toOSString().toLowerCase());
}
return one.isPrefixOf(two) || (bothDirections && two.isPrefixOf(one));
}
@@ -322,7 +332,7 @@ public static IPath toPath(URI uri) {
final String scheme = uri.getScheme();
// null scheme represents path variable
if (scheme == null || EFS.SCHEME_FILE.equals(scheme))
- return new Path(uri.getSchemeSpecificPart());
+ return IPath.fromOSString(uri.getSchemeSpecificPart());
return null;
}
@@ -343,7 +353,7 @@ public static final void transferStreams(InputStream source, OutputStream destin
bytesRead = source.read(buffer);
} catch (IOException e) {
String msg = NLS.bind(Messages.localstore_failedReadDuringWrite, path);
- throw new ResourceException(IResourceStatus.FAILED_READ_LOCAL, new Path(path), msg, e);
+ throw new ResourceException(IResourceStatus.FAILED_READ_LOCAL, IPath.fromOSString(path), msg, e);
}
if (bytesRead == -1) {
break;
@@ -356,7 +366,7 @@ public static final void transferStreams(InputStream source, OutputStream destin
destination.close();
} catch (IOException e) {
String msg = NLS.bind(Messages.localstore_couldNotWrite, path);
- throw new ResourceException(IResourceStatus.FAILED_WRITE_LOCAL, new Path(path), msg, e);
+ throw new ResourceException(IResourceStatus.FAILED_WRITE_LOCAL, IPath.fromOSString(path), msg, e);
}
} finally {
safeClose(source);
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/watson/ElementTree.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/watson/ElementTree.java
index 8aa7e7a87b8..e9c2d609424 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/watson/ElementTree.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/watson/ElementTree.java
@@ -15,12 +15,19 @@
*******************************************************************************/
package org.eclipse.core.internal.watson;
-import java.util.*;
+import java.util.HashSet;
+import java.util.LinkedHashSet;
+import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
-import org.eclipse.core.internal.dtree.*;
+import org.eclipse.core.internal.dtree.AbstractDataTreeNode;
+import org.eclipse.core.internal.dtree.DataTreeLookup;
+import org.eclipse.core.internal.dtree.DataTreeNode;
+import org.eclipse.core.internal.dtree.DeltaDataTree;
+import org.eclipse.core.internal.dtree.ObjectNotFoundException;
import org.eclipse.core.internal.utils.Messages;
import org.eclipse.core.internal.utils.StringPool;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.osgi.util.NLS;
/**
@@ -596,7 +603,7 @@ public ElementTree mergeDeltaChain(IPath path, ElementTree[] trees) {
while (toMerge != null) {
if (path.isRoot()) {
//copy all the children
- IPath[] children = toMerge.getChildren(Path.ROOT);
+ IPath[] children = toMerge.getChildren(IPath.ROOT);
for (IPath element : children) {
current.createSubtree(element, toMerge.getSubtree(element));
}
@@ -721,7 +728,7 @@ public String toDebugString() {
buffer.append(elementID.requestPath() + " " + elementContents + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
return true;
};
- new ElementTreeIterator(this, Path.ROOT).iterate(visitor);
+ new ElementTreeIterator(this, IPath.ROOT).iterate(visitor);
return buffer.toString();
}
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/watson/ElementTreeIterator.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/watson/ElementTreeIterator.java
index d537daff61b..86a5c4d51ec 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/watson/ElementTreeIterator.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/watson/ElementTreeIterator.java
@@ -159,8 +159,9 @@ public String requestName() {
@Override
public IPath requestPath() {
- if (nextFreeSegment == 0)
- return Path.ROOT;
+ if (nextFreeSegment == 0) {
+ return IPath.ROOT;
+ }
int length = nextFreeSegment;
for (int i = 0; i < nextFreeSegment; i++) {
length += segments[i].length();
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/watson/ElementTreeReader.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/watson/ElementTreeReader.java
index 7bf7bf5d89f..ec130e43335 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/watson/ElementTreeReader.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/watson/ElementTreeReader.java
@@ -14,11 +14,14 @@
*******************************************************************************/
package org.eclipse.core.internal.watson;
-import java.io.*;
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
import org.eclipse.core.internal.dtree.DataTreeReader;
import org.eclipse.core.internal.dtree.IDataFlattener;
import org.eclipse.core.internal.utils.Messages;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IPath;
/** ElementTreeReader
is the standard implementation
* of an element tree serialization reader.
@@ -64,7 +67,7 @@ public void writeData(IPath path, Object data, DataOutput output) {
public Object readData(IPath path, DataInput input) throws IOException {
//never read the root node of an ElementTree
//this node is reserved for the parent backpointer
- if (!Path.ROOT.equals(path))
+ if (!IPath.ROOT.equals(path))
return factory.readElement(path, input);
return null;
}
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/watson/ElementTreeWriter.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/watson/ElementTreeWriter.java
index ee9dd0f385d..3e38c6fffb7 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/watson/ElementTreeWriter.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/watson/ElementTreeWriter.java
@@ -16,11 +16,19 @@
*******************************************************************************/
package org.eclipse.core.internal.watson;
-import java.io.*;
-import java.util.*;
-import org.eclipse.core.internal.dtree.*;
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.util.ArrayDeque;
+import java.util.Deque;
+import java.util.HashMap;
+import java.util.Map;
+import org.eclipse.core.internal.dtree.DataTreeWriter;
+import org.eclipse.core.internal.dtree.DeltaDataTree;
+import org.eclipse.core.internal.dtree.IDataFlattener;
import org.eclipse.core.internal.resources.SaveManager;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IPath;
/** ElementTreeWriter
flattens an ElementTree
* onto a data output stream.
@@ -65,7 +73,7 @@ public ElementTreeWriter(final IElementInfoFlattener flattener) {
public void writeData(IPath path, Object data, DataOutput output) throws IOException {
// never write the root node of an ElementTree
//because it contains the parent backpointer.
- if (!Path.ROOT.equals(path)) {
+ if (!IPath.ROOT.equals(path)) {
flattener.writeElement(path, data, output);
}
}
@@ -204,7 +212,7 @@ public void writeTree(ElementTree tree, IPath path, int depth, final DataOutput
writeNumber(CURRENT_FORMAT, output);
/* This actually just copies the root node, which is what we want */
- DeltaDataTree subtree = new DeltaDataTree(tree.getDataTree().copyCompleteSubtree(Path.ROOT));
+ DeltaDataTree subtree = new DeltaDataTree(tree.getDataTree().copyCompleteSubtree(IPath.ROOT));
dataTreeWriter.writeTree(subtree, path, depth, output);
}
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/resources/IResource.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/resources/IResource.java
index 7e1b4302832..009ef50aecf 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/resources/IResource.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/resources/IResource.java
@@ -19,7 +19,13 @@
import java.net.URI;
import java.util.Map;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
/**
@@ -1315,7 +1321,7 @@ default IMarker createMarker(String type, Map attribut
*
* @return the absolute path of this resource
* @see #getProjectRelativePath()
- * @see Path#ROOT
+ * @see IPath#ROOT
*/
IPath getFullPath();
@@ -1600,7 +1606,7 @@ default IMarker createMarker(String type, Map attribut
* @return the relative path of this resource with respect to its project
* @see #getFullPath()
* @see #getProject()
- * @see Path#EMPTY
+ * @see IPath#EMPTY
*/
IPath getProjectRelativePath();
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/resources/IResourceDelta.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/resources/IResourceDelta.java
index 64ecf58a78f..6e16a93c372 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/resources/IResourceDelta.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/resources/IResourceDelta.java
@@ -15,7 +15,11 @@
import org.eclipse.core.internal.watson.IElementComparator;
import org.eclipse.core.resources.mapping.IResourceChangeDescriptionFactory;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Platform;
/**
* A resource delta represents changes in the state of a resource tree
@@ -582,7 +586,7 @@ public interface IResourceDelta extends IAdaptable {
* @return the project-relative path of this resource delta
* @see IResource#getProjectRelativePath()
* @see #getFullPath()
- * @see Path#EMPTY
+ * @see IPath#EMPTY
*/
IPath getProjectRelativePath();
diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/resources/ISaveParticipant.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/resources/ISaveParticipant.java
index 95fc653ad84..32e52f20822 100644
--- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/resources/ISaveParticipant.java
+++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/resources/ISaveParticipant.java
@@ -126,7 +126,7 @@ public interface ISaveParticipant extends EventListener {
* String saveFileName = "save-" + Integer.toString(saveNumber);
* File f = plugin.getStateLocation().append(saveFileName).toFile();
* plugin.writeImportantState(f);
- * context.map(new Path("save"), new Path(saveFileName));
+ * context.map(IPath.fromOSString("save"), IPath.fromOSString(saveFileName));
* context.needSaveNumber();
* context.needDelta(); // optional
*
@@ -149,7 +149,7 @@ public interface ISaveParticipant extends EventListener {
* // activate for very first time
* plugin.buildState();
* } else {
- * String saveFileName = ss.lookup(new Path("save"));
+ * String saveFileName = ss.lookup(IPath.fromOSString("save"));
* File f = plugin.getStateLocation().append(saveFileName).toFile();
* plugin.readImportantState(f);
* IResourceChangeListener listener = new IResourceChangeListener() {
diff --git a/resources/bundles/org.eclipse.core.resources/src_ant/org/eclipse/core/resources/ant/ConvertPath.java b/resources/bundles/org.eclipse.core.resources/src_ant/org/eclipse/core/resources/ant/ConvertPath.java
index 50b97b02e52..67fb67dd7bd 100644
--- a/resources/bundles/org.eclipse.core.resources/src_ant/org/eclipse/core/resources/ant/ConvertPath.java
+++ b/resources/bundles/org.eclipse.core.resources/src_ant/org/eclipse/core/resources/ant/ConvertPath.java
@@ -14,7 +14,9 @@
package org.eclipse.core.resources.ant;
import java.io.File;
-import org.apache.tools.ant.*;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.Task;
import org.apache.tools.ant.types.Path;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
@@ -139,7 +141,7 @@ protected void convertResourcePathToFileSystemPath(IPath path) {
public void setFileSystemPath(File value) {
if (resourcePath != null)
throw new BuildException(Policy.bind("exception.cantUseBoth")); //$NON-NLS-1$
- fileSystemPath = new org.eclipse.core.runtime.Path(value.toString());
+ fileSystemPath = IPath.fromOSString(value.toString());
}
/**
@@ -150,7 +152,7 @@ public void setFileSystemPath(File value) {
public void setResourcePath(String value) {
if (fileSystemPath != null)
throw new BuildException(Policy.bind("exception.cantUseBoth")); //$NON-NLS-1$
- resourcePath = new org.eclipse.core.runtime.Path(value);
+ resourcePath = IPath.fromOSString(value);
}
/**
diff --git a/resources/bundles/org.eclipse.core.resources/src_ant/org/eclipse/core/resources/ant/RefreshLocalTask.java b/resources/bundles/org.eclipse.core.resources/src_ant/org/eclipse/core/resources/ant/RefreshLocalTask.java
index 33bdbfa0d3b..165ee124748 100644
--- a/resources/bundles/org.eclipse.core.resources/src_ant/org/eclipse/core/resources/ant/RefreshLocalTask.java
+++ b/resources/bundles/org.eclipse.core.resources/src_ant/org/eclipse/core/resources/ant/RefreshLocalTask.java
@@ -14,11 +14,15 @@
package org.eclipse.core.resources.ant;
import java.util.Hashtable;
-import org.apache.tools.ant.*;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.Task;
import org.eclipse.ant.core.AntCorePlugin;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
/**
* An Ant task which refreshes the Eclipse Platform's view of the local filesystem.
@@ -106,7 +110,7 @@ else if (DEPTH_INFINITE.equalsIgnoreCase(value))
* @param value the root value
*/
public void setResource(String value) {
- IPath path = new Path(value);
+ IPath path = IPath.fromOSString(value);
resource = ResourcesPlugin.getWorkspace().getRoot().findMember(path);
if (resource == null) {
// if it does not exist we guess it is a folder or a project
diff --git a/resources/bundles/org.eclipse.core.tools.resources/src/org/eclipse/core/tools/resources/ElementTreeView.java b/resources/bundles/org.eclipse.core.tools.resources/src/org/eclipse/core/tools/resources/ElementTreeView.java
index 73398efaaf4..76cc4d627ff 100644
--- a/resources/bundles/org.eclipse.core.tools.resources/src/org/eclipse/core/tools/resources/ElementTreeView.java
+++ b/resources/bundles/org.eclipse.core.tools.resources/src/org/eclipse/core/tools/resources/ElementTreeView.java
@@ -14,18 +14,45 @@
package org.eclipse.core.tools.resources;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
import org.eclipse.core.internal.dtree.AbstractDataTreeNode;
import org.eclipse.core.internal.dtree.DataTreeNode;
-import org.eclipse.core.internal.resources.*;
-import org.eclipse.core.internal.watson.*;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.Path;
+import org.eclipse.core.internal.resources.ICoreConstants;
+import org.eclipse.core.internal.resources.IMarkerSetElement;
+import org.eclipse.core.internal.resources.MarkerAttributeMap;
+import org.eclipse.core.internal.resources.MarkerInfo;
+import org.eclipse.core.internal.resources.MarkerSet;
+import org.eclipse.core.internal.resources.ProjectInfo;
+import org.eclipse.core.internal.resources.ResourceInfo;
+import org.eclipse.core.internal.resources.RootInfo;
+import org.eclipse.core.internal.resources.SpySupport;
+import org.eclipse.core.internal.resources.Workspace;
+import org.eclipse.core.internal.watson.ElementTree;
+import org.eclipse.core.internal.watson.ElementTreeIterator;
+import org.eclipse.core.internal.watson.IElementContentVisitor;
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.core.tools.*;
-import org.eclipse.jface.action.*;
+import org.eclipse.core.tools.ClearTextAction;
+import org.eclipse.core.tools.CopyTextSelectionAction;
+import org.eclipse.core.tools.DeepSize;
+import org.eclipse.core.tools.GlobalAction;
+import org.eclipse.core.tools.SelectAllAction;
+import org.eclipse.core.tools.SpyView;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.text.*;
+import org.eclipse.jface.text.Document;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.TextViewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.KeyAdapter;
import org.eclipse.swt.events.KeyEvent;
@@ -222,7 +249,7 @@ void countResources() {
}
return true;
};
- new ElementTreeIterator(workspace.getElementTree(), Path.ROOT).iterate(visitor);
+ new ElementTreeIterator(workspace.getElementTree(), IPath.ROOT).iterate(visitor);
}
void reset() {
diff --git a/resources/bundles/org.eclipse.core.tools.resources/src/org/eclipse/core/tools/resources/LocalHistoryBrowserView.java b/resources/bundles/org.eclipse.core.tools.resources/src/org/eclipse/core/tools/resources/LocalHistoryBrowserView.java
index 1bd2dbc419f..76e3fe58d07 100644
--- a/resources/bundles/org.eclipse.core.tools.resources/src/org/eclipse/core/tools/resources/LocalHistoryBrowserView.java
+++ b/resources/bundles/org.eclipse.core.tools.resources/src/org/eclipse/core/tools/resources/LocalHistoryBrowserView.java
@@ -15,18 +15,41 @@
import java.util.ArrayList;
import java.util.Set;
-import org.eclipse.core.resources.*;
+import org.eclipse.core.resources.IFileState;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IStorage;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.action.*;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.*;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerComparator;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Menu;
-import org.eclipse.ui.*;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IEditorDescriptor;
+import org.eclipse.ui.IEditorRegistry;
+import org.eclipse.ui.IPersistableElement;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.IStorageEditorInput;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchActionConstants;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.editors.text.EditorsUI;
import org.eclipse.ui.part.DrillDownAdapter;
import org.eclipse.ui.part.ViewPart;
@@ -182,7 +205,7 @@ public boolean hasChildren(Object parent) {
@SuppressWarnings("restriction")
public void initialize() {
invisibleRoot = new Node(null, "/"); //$NON-NLS-1$
- Set allFiles = store.allFiles(Path.ROOT, IResource.DEPTH_INFINITE, null);
+ Set allFiles = store.allFiles(IPath.ROOT, IResource.DEPTH_INFINITE, null);
for (IPath path : allFiles) {
Node current = invisibleRoot;
String[] segments = path.segments();
diff --git a/resources/bundles/org.eclipse.core.tools.resources/src/org/eclipse/core/tools/resources/markers/MarkerView.java b/resources/bundles/org.eclipse.core.tools.resources/src/org/eclipse/core/tools/resources/markers/MarkerView.java
index 3386125b1b5..f559c5257dc 100644
--- a/resources/bundles/org.eclipse.core.tools.resources/src/org/eclipse/core/tools/resources/markers/MarkerView.java
+++ b/resources/bundles/org.eclipse.core.tools.resources/src/org/eclipse/core/tools/resources/markers/MarkerView.java
@@ -18,24 +18,66 @@
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.List;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
-import org.eclipse.jface.action.*;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.ILog;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.*;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.ui.*;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.IPageListener;
+import org.eclipse.ui.IPartListener;
+import org.eclipse.ui.ISelectionListener;
+import org.eclipse.ui.ISelectionService;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.IViewSite;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.SelectionProviderAction;
import org.eclipse.ui.actions.WorkspaceModifyOperation;
import org.eclipse.ui.ide.IDE.SharedImages;
import org.eclipse.ui.part.EditorPart;
import org.eclipse.ui.part.ViewPart;
import org.eclipse.ui.progress.IProgressService;
-import org.eclipse.ui.views.properties.*;
+import org.eclipse.ui.views.properties.IPropertySheetPage;
+import org.eclipse.ui.views.properties.PropertySheet;
+import org.eclipse.ui.views.properties.PropertySheetPage;
/**
* This is a view that allows one to inspect the state of a resource's markers.
@@ -620,7 +662,7 @@ private void restoreState(IMemento memento) {
try {
String resourcePath = child.getTextData();
if (resourcePath != null && !NONE_SELECTED.equals(resourcePath)) {
- Path path = new Path(resourcePath);
+ IPath path = IPath.fromOSString(resourcePath);
IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
if (file != null && file.exists()) {
currentResource = file;
diff --git a/resources/examples/org.eclipse.ui.examples.filesystem/src/org/eclipse/core/internal/filesystem/memory/MemoryFileSystem.java b/resources/examples/org.eclipse.ui.examples.filesystem/src/org/eclipse/core/internal/filesystem/memory/MemoryFileSystem.java
index 68db2df9647..444a808d34f 100644
--- a/resources/examples/org.eclipse.ui.examples.filesystem/src/org/eclipse/core/internal/filesystem/memory/MemoryFileSystem.java
+++ b/resources/examples/org.eclipse.ui.examples.filesystem/src/org/eclipse/core/internal/filesystem/memory/MemoryFileSystem.java
@@ -18,7 +18,6 @@
import org.eclipse.core.filesystem.IFileStore;
import org.eclipse.core.filesystem.provider.FileSystem;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
/**
* A test file system that keeps everything in memory.
@@ -46,7 +45,7 @@ public MemoryFileSystem() {
@Override
public IFileStore getStore(URI uri) {
- return new MemoryFileStore(Path.fromPortableString(uri.getSchemeSpecificPart()));
+ return new MemoryFileStore(IPath.fromPortableString(uri.getSchemeSpecificPart()));
}
@Override
diff --git a/resources/examples/org.eclipse.ui.examples.filesystem/src/org/eclipse/core/internal/filesystem/memory/MemoryFileSystemContributor.java b/resources/examples/org.eclipse.ui.examples.filesystem/src/org/eclipse/core/internal/filesystem/memory/MemoryFileSystemContributor.java
index 0e0dc8264c1..bbce36a4421 100644
--- a/resources/examples/org.eclipse.ui.examples.filesystem/src/org/eclipse/core/internal/filesystem/memory/MemoryFileSystemContributor.java
+++ b/resources/examples/org.eclipse.ui.examples.filesystem/src/org/eclipse/core/internal/filesystem/memory/MemoryFileSystemContributor.java
@@ -17,7 +17,7 @@
import java.net.URI;
import java.net.URISyntaxException;
import org.eclipse.core.filesystem.IFileStore;
-import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.jface.window.Window;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.ide.fileSystem.FileSystemContributor;
@@ -60,6 +60,6 @@ public URI getURI(String string) {
Policy.log(Policy.createStatus(e));
e.printStackTrace();
}
- return MemoryFileSystem.toURI(new Path(string));
+ return MemoryFileSystem.toURI(IPath.fromOSString(string));
}
}
diff --git a/resources/examples/org.eclipse.ui.examples.filesystem/src/org/eclipse/core/internal/filesystem/memory/MemoryTreeSelectionDialog.java b/resources/examples/org.eclipse.ui.examples.filesystem/src/org/eclipse/core/internal/filesystem/memory/MemoryTreeSelectionDialog.java
index 56571a7da43..b0e40de40d1 100644
--- a/resources/examples/org.eclipse.ui.examples.filesystem/src/org/eclipse/core/internal/filesystem/memory/MemoryTreeSelectionDialog.java
+++ b/resources/examples/org.eclipse.ui.examples.filesystem/src/org/eclipse/core/internal/filesystem/memory/MemoryTreeSelectionDialog.java
@@ -15,15 +15,21 @@
import org.eclipse.core.filesystem.EFS;
import org.eclipse.core.filesystem.IFileStore;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.viewers.*;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.dialogs.SelectionDialog;
import org.eclipse.ui.model.WorkbenchContentProvider;
import org.eclipse.ui.model.WorkbenchLabelProvider;
@@ -59,7 +65,7 @@ protected void buttonPressed(int buttonId) {
if (parent != null)
toCreate = parent.getChild(nameField.getText());
else
- toCreate = new MemoryFileStore(Path.ROOT.append(nameField.getText()));
+ toCreate = new MemoryFileStore(IPath.ROOT.append(nameField.getText()));
if (buttonId == CREATE_FILE_ID) {
toCreate.openOutputStream(EFS.NONE, null).close();
} else {
@@ -92,7 +98,7 @@ protected Control createDialogArea(Composite parent) {
tree.getControl().setLayoutData(data);
tree.setContentProvider(new WorkbenchContentProvider());
tree.setLabelProvider(new WorkbenchLabelProvider());
- tree.setInput(new MemoryFileStore(Path.ROOT));
+ tree.setInput(new MemoryFileStore(IPath.ROOT));
createNewElementArea(parent);
diff --git a/resources/examples/org.eclipse.ui.examples.filesystem/src/org/eclipse/core/internal/filesystem/zip/ZipFileSystem.java b/resources/examples/org.eclipse.ui.examples.filesystem/src/org/eclipse/core/internal/filesystem/zip/ZipFileSystem.java
index 6ac562ee7a4..1696932aea5 100644
--- a/resources/examples/org.eclipse.ui.examples.filesystem/src/org/eclipse/core/internal/filesystem/zip/ZipFileSystem.java
+++ b/resources/examples/org.eclipse.ui.examples.filesystem/src/org/eclipse/core/internal/filesystem/zip/ZipFileSystem.java
@@ -18,7 +18,8 @@
import org.eclipse.core.filesystem.EFS;
import org.eclipse.core.filesystem.IFileStore;
import org.eclipse.core.filesystem.provider.FileSystem;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
/**
*
@@ -32,7 +33,7 @@ public class ZipFileSystem extends FileSystem {
@Override
public IFileStore getStore(URI uri) {
if (SCHEME_ZIP.equals(uri.getScheme())) {
- IPath path = new Path(uri.getPath());
+ IPath path = IPath.fromOSString(uri.getPath());
try {
return new ZipFileStore(EFS.getStore(new URI(uri.getQuery())), path);
} catch (URISyntaxException e) {
diff --git a/resources/examples/org.eclipse.ui.examples.filesystem/src/org/eclipse/ui/examples/filesystem/CollapseZipHandler.java b/resources/examples/org.eclipse.ui.examples.filesystem/src/org/eclipse/ui/examples/filesystem/CollapseZipHandler.java
index 192ed02c0c3..9b75ba8bf0d 100644
--- a/resources/examples/org.eclipse.ui.examples.filesystem/src/org/eclipse/ui/examples/filesystem/CollapseZipHandler.java
+++ b/resources/examples/org.eclipse.ui.examples.filesystem/src/org/eclipse/ui/examples/filesystem/CollapseZipHandler.java
@@ -17,10 +17,16 @@
package org.eclipse.ui.examples.filesystem;
import java.net.URI;
-import org.eclipse.core.commands.*;
-import org.eclipse.core.filesystem.*;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.Path;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.filesystem.EFS;
+import org.eclipse.core.filesystem.IFileStore;
+import org.eclipse.core.filesystem.URIUtil;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
@@ -42,7 +48,7 @@ private void collapseZip(IFolder folder, Shell shell) {
folder.getParent().refreshLocal(IResource.DEPTH_INFINITE, null);
} else {
//otherwise the zip file must be a linked resource
- IFile file = folder.getParent().getFile(new Path(folder.getName()));
+ IFile file = folder.getParent().getFile(IPath.fromOSString(folder.getName()));
file.createLink(zipURI, IResource.REPLACE, null);
}
} catch (Exception e) {
diff --git a/resources/examples/org.eclipse.ui.examples.filesystem/src/org/eclipse/ui/examples/filesystem/ExpandZipHandler.java b/resources/examples/org.eclipse.ui.examples.filesystem/src/org/eclipse/ui/examples/filesystem/ExpandZipHandler.java
index 9757843f3ab..7fde7131080 100644
--- a/resources/examples/org.eclipse.ui.examples.filesystem/src/org/eclipse/ui/examples/filesystem/ExpandZipHandler.java
+++ b/resources/examples/org.eclipse.ui.examples.filesystem/src/org/eclipse/ui/examples/filesystem/ExpandZipHandler.java
@@ -17,10 +17,14 @@
package org.eclipse.ui.examples.filesystem;
import java.net.URI;
-import org.eclipse.core.commands.*;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.internal.filesystem.zip.ZipFileSystem;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.Path;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
@@ -32,7 +36,7 @@ public class ExpandZipHandler extends AbstractHandler {
private void expandZip(IFile file, Shell shell) {
try {
URI zipURI = new URI(ZipFileSystem.SCHEME_ZIP, null, "/", file.getLocationURI().toString(), null);
- IFolder link = file.getParent().getFolder(new Path(file.getName()));
+ IFolder link = file.getParent().getFolder(IPath.fromOSString(file.getName()));
link.createLink(zipURI, IResource.REPLACE, null);
} catch (Exception e) {
MessageDialog.openError(shell, "Error", "Error opening zip file");
diff --git a/resources/tests/org.eclipse.core.tests.resources.saveparticipant/src/org/eclipse/core/tests/resources/saveparticipant/SaveManager2Test.java b/resources/tests/org.eclipse.core.tests.resources.saveparticipant/src/org/eclipse/core/tests/resources/saveparticipant/SaveManager2Test.java
index 681b1f80727..1fa4da2d282 100644
--- a/resources/tests/org.eclipse.core.tests.resources.saveparticipant/src/org/eclipse/core/tests/resources/saveparticipant/SaveManager2Test.java
+++ b/resources/tests/org.eclipse.core.tests.resources.saveparticipant/src/org/eclipse/core/tests/resources/saveparticipant/SaveManager2Test.java
@@ -13,11 +13,14 @@
*******************************************************************************/
package org.eclipse.core.tests.resources.saveparticipant;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.core.tests.internal.builders.DeltaVerifierBuilder;
import org.eclipse.core.tests.resources.regression.SimpleBuilder;
import org.eclipse.core.tests.resources.saveparticipant1.SaveParticipant1Plugin;
@@ -25,6 +28,9 @@
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleException;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
/**
* @see SaveManager1Test
* @see SaveManager3Test
@@ -91,7 +97,7 @@ public void testSaveParticipant() {
// prepare plugin to the save operation
plugin1.resetDeltaVerifier();
- IResource added1 = getWorkspace().getRoot().getFile(new Path(PROJECT_1).append("addedFile"));
+ IResource added1 = getWorkspace().getRoot().getFile(IPath.fromOSString(PROJECT_1).append("addedFile"));
plugin1.addExpectedChange(added1, IResourceDelta.ADDED, 0);
IStatus status;
try {
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/filesystem/FileCacheTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/filesystem/FileCacheTest.java
index 211bc3d6271..c22aa6f5529 100755
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/filesystem/FileCacheTest.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/filesystem/FileCacheTest.java
@@ -13,12 +13,16 @@
*******************************************************************************/
package org.eclipse.core.tests.filesystem;
-import java.io.*;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.OutputStream;
import java.util.Arrays;
import org.eclipse.core.filesystem.EFS;
import org.eclipse.core.filesystem.IFileStore;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.tests.internal.filesystem.ram.MemoryFileStore;
import org.eclipse.core.tests.internal.filesystem.ram.MemoryTree;
@@ -90,7 +94,7 @@ protected void tearDown() throws Exception {
public void testCacheFile() {
try {
- IFileStore store = new MemoryFileStore(new Path("testCacheFile"));
+ IFileStore store = new MemoryFileStore(IPath.fromOSString("testCacheFile"));
OutputStream out = store.openOutputStream(EFS.NONE, getMonitor());
byte[] contents = "test".getBytes();
out.write(contents);
@@ -122,7 +126,7 @@ public void testCacheFile() {
public void testCacheFolder() {
try {
- IFileStore store = new MemoryFileStore(new Path("testCacheFolder"));
+ IFileStore store = new MemoryFileStore(IPath.fromOSString("testCacheFolder"));
store.mkdir(EFS.NONE, getMonitor());
File cachedFile = store.toLocalFile(EFS.CACHE, getMonitor());
assertTrue("1.0", cachedFile.exists());
@@ -137,7 +141,7 @@ public void testCacheFolder() {
*/
public void testNoCacheFlag() {
try {
- IFileStore store = new MemoryFileStore(new Path("testNoCacheFlag"));
+ IFileStore store = new MemoryFileStore(IPath.fromOSString("testNoCacheFlag"));
store.mkdir(EFS.NONE, getMonitor());
File cachedFile = store.toLocalFile(EFS.NONE, getMonitor());
assertNull("1.0", cachedFile);
@@ -151,7 +155,7 @@ public void testNoCacheFlag() {
*/
public void testNonExisting() {
try {
- IFileStore store = new MemoryFileStore(new Path("testNonExisting"));
+ IFileStore store = new MemoryFileStore(IPath.fromOSString("testNonExisting"));
File cachedFile = store.toLocalFile(EFS.CACHE, getMonitor());
assertTrue("1.0", !cachedFile.exists());
} catch (CoreException e) {
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/filesystem/FileStoreTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/filesystem/FileStoreTest.java
index 35eed1df7e2..d9caba942d9 100755
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/filesystem/FileStoreTest.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/filesystem/FileStoreTest.java
@@ -35,7 +35,6 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.tests.internal.localstore.LocalStoreTest;
import org.eclipse.osgi.util.NLS;
@@ -62,7 +61,7 @@ private IFileStore createDir(IFileStore store, boolean clear) throws CoreExcepti
}
private IFileStore createDir(String string, boolean clear) throws CoreException {
- return createDir(EFS.getFileSystem(EFS.SCHEME_FILE).getStore(new Path(string)), clear);
+ return createDir(EFS.getFileSystem(EFS.SCHEME_FILE).getStore(IPath.fromOSString(string)), clear);
}
/**
@@ -93,7 +92,7 @@ public void testBrokenFetchInfo() {
}
private IFileStore getDirFileStore(String path) throws CoreException {
- IFileStore store = EFS.getFileSystem(EFS.SCHEME_FILE).getStore(new Path(path));
+ IFileStore store = EFS.getFileSystem(EFS.SCHEME_FILE).getStore(IPath.fromOSString(path));
if (!store.toLocalFile(EFS.NONE, getMonitor()).exists()) {
store.mkdir(EFS.NONE, null);
deleteOnTearDown(store);
@@ -661,7 +660,7 @@ public void testGetFileStore() throws Exception {
assertTrue("2.0", file.exists());
// check the parent reference
- IPath relativePath = new Path("../test.txt");
+ IPath relativePath = IPath.fromOSString("../test.txt");
IFileStore relativeStore = tempStore.getFileStore(relativePath);
assertNotNull("3.0", relativeStore);
@@ -670,7 +669,7 @@ public void testGetFileStore() throws Exception {
assertTrue("5.0", info.exists());
// check the parent and self reference
- relativePath = new Path(".././test.txt");
+ relativePath = IPath.fromOSString(".././test.txt");
relativeStore = tempStore.getFileStore(relativePath);
assertNotNull("6.0", relativeStore);
@@ -679,7 +678,7 @@ public void testGetFileStore() throws Exception {
assertTrue("8.0", info.exists());
// check the a path with no parent and self references
- relativePath = new Path("temp2/test.txt");
+ relativePath = IPath.fromOSString("temp2/test.txt");
relativeStore = tempStore.getFileStore(relativePath);
assertNotNull("9.0", relativeStore);
@@ -695,14 +694,14 @@ public void testSortOrder() {
nullfs = new NullFileSystem();
((FileSystem) nullfs).initialize(EFS.SCHEME_NULL);
}
- IFileStore nabc = nullfs.getStore(new Path("/a/b/c"));
- IFileStore nabd = nullfs.getStore(new Path("/a/b/d"));
+ IFileStore nabc = nullfs.getStore(IPath.fromOSString("/a/b/c"));
+ IFileStore nabd = nullfs.getStore(IPath.fromOSString("/a/b/d"));
assertEquals("1.0", -1, nabc.compareTo(nabd));
assertEquals("1.1", 0, nabc.compareTo(nabc));
assertEquals("1.2", 1, nabd.compareTo(nabc));
IFileSystem lfs = LocalFileSystem.getInstance();
- IFileStore labc = lfs.getStore(new Path("/a/b/c"));
- IFileStore labd = lfs.getStore(new Path("/a/b/d"));
+ IFileStore labc = lfs.getStore(IPath.fromOSString("/a/b/c"));
+ IFileStore labd = lfs.getStore(IPath.fromOSString("/a/b/d"));
assertEquals("2.0", -1, labc.compareTo(labd));
assertEquals("2.1", 0, labc.compareTo(labc));
assertEquals("2.2", 1, labd.compareTo(labc));
@@ -736,8 +735,8 @@ public void testSortOrderPaths() {
).toList();
paths = new ArrayList<>(paths); // to get a mutable copy for shuffling
Collections.shuffle(paths);
- // Test with new Path(string).getStore()
- Stream pathStores = paths.stream().map(Path::new).map(lfs::getStore);
+ // Test with IPath.fromOSString(string).getStore()
+ Stream pathStores = paths.stream().map(IPath::fromOSString).map(lfs::getStore);
List sortedPathStores = pathStores.sorted(IFileStore::compareTo).map(IFileStore::toURI)
.map(URI::getPath).toList();
assertEquals("1.0 ", pathsTrimmed, sortedPathStores);
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/filesystem/URIUtilTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/filesystem/URIUtilTest.java
index 8e3bcda7bf2..456af3d2b40 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/filesystem/URIUtilTest.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/filesystem/URIUtilTest.java
@@ -16,7 +16,8 @@
import java.net.URI;
import org.eclipse.core.filesystem.EFS;
import org.eclipse.core.filesystem.URIUtil;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.core.tests.internal.filesystem.wrapper.WrapperFileSystem;
/**
@@ -59,9 +60,9 @@ public void testPathToURI() {
*/
public void testStringToURI() {
if (Platform.getOS().equals(Platform.OS_WIN32)) {
- assertEquals("1.0", "/c:/temp/with spaces", URIUtil.toURI(new Path("c:\\temp\\with spaces")).getSchemeSpecificPart());
+ assertEquals("1.0", "/c:/temp/with spaces", URIUtil.toURI(IPath.fromOSString("c:\\temp\\with spaces")).getSchemeSpecificPart());
} else {
- assertEquals("1.0", "/tmp/with spaces", URIUtil.toURI(new Path("/tmp/with spaces")).getSchemeSpecificPart());
+ assertEquals("1.0", "/tmp/with spaces", URIUtil.toURI(IPath.fromOSString("/tmp/with spaces")).getSchemeSpecificPart());
}
}
@@ -71,16 +72,16 @@ public void testStringToURI() {
public void testToPath() throws Exception {
// Relative path
String pathString = "test/path with/spaces to_file.txt";
- assertEquals("1.0", new Path(pathString), URIUtil.toPath(URIUtil.toURI(pathString, false)));
+ assertEquals("1.0", IPath.fromOSString(pathString), URIUtil.toPath(URIUtil.toURI(pathString, false)));
// Absolute path
if (Platform.getOS().equals(Platform.OS_WIN32)) {
pathString = "c:/test/path with/spaces to_file.txt";
} else {
pathString = "/test/path with/spaces to_file.txt";
}
- assertEquals("2.0", new Path(pathString), URIUtil.toPath(URIUtil.toURI(pathString)));
+ assertEquals("2.0", IPath.fromOSString(pathString), URIUtil.toPath(URIUtil.toURI(pathString)));
// User defined file system
- assertEquals("3.0", new Path(pathString), URIUtil.toPath(WrapperFileSystem.getWrappedURI(URIUtil.toURI(pathString))));
+ assertEquals("3.0", IPath.fromOSString(pathString), URIUtil.toPath(WrapperFileSystem.getWrappedURI(URIUtil.toURI(pathString))));
}
/**
@@ -94,7 +95,7 @@ public void testToURIAbsolute() {
} else {
pathString = "/test/path with/spaces to_file.txt";
}
- IPath path = new Path(pathString);
+ IPath path = IPath.fromOSString(pathString);
URI uri01 = URIUtil.toURI(path);
URI uri02 = URIUtil.toURI(pathString);
assertEquals("1.0", uri01, uri02);
@@ -106,7 +107,7 @@ public void testToURIAbsolute() {
*/
public void testToURIRelative() {
String pathString = "test/path with/spaces to_file.txt";
- IPath path = new Path(pathString);
+ IPath path = IPath.fromOSString(pathString);
URI uri01 = URIUtil.toURI(path);
URI uri02 = URIUtil.toURI(pathString, false);
assertEquals("1.0", uri01, uri02);
@@ -122,12 +123,12 @@ public void testFromPathToURI() {
//absolute path
IPath aPath = null;
if (Platform.getOS().equals(Platform.OS_WIN32)) {
- aPath = new Path("c:/test/path with spaces/to_file.txt");
+ aPath = IPath.fromOSString("c:/test/path with spaces/to_file.txt");
} else {
- aPath = new Path("/test/path with spaces/to_file.txt");
+ aPath = IPath.fromOSString("/test/path with spaces/to_file.txt");
}
//relative path
- IPath rPath = new Path("relative/with spaces/path/to_file.txt");
+ IPath rPath = IPath.fromOSString("relative/with spaces/path/to_file.txt");
URI aUri = URIUtil.toURI(aPath);
URI rUri = URIUtil.toURI(rPath);
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 cca175a1367..d059344bc14 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
@@ -41,7 +41,6 @@
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.tests.internal.filesystem.wrapper.WrapperFileSystem;
import org.eclipse.core.tests.resources.ResourceTest;
import org.junit.Assume;
@@ -94,7 +93,7 @@ private static URI from(String uri) {
}
public BatFSURI(URI uri) {
- super(new Path("/not/used"));
+ super(IPath.fromOSString("/not/used"));
this.uri = uri;
}
@@ -276,11 +275,11 @@ public void testBug198571() {
// the projects have the same segments but different id
IProjectDescription desc1 = getWorkspace().newProjectDescription(testProject1.getName());
- IPath location1 = new Path(devices[0] + location);
+ IPath location1 = IPath.fromOSString(devices[0] + location);
assertTrue("0.1", !location1.toFile().exists());
desc1.setLocation(location1);
IProjectDescription desc2 = getWorkspace().newProjectDescription(testProject2.getName());
- IPath location2 = new Path(devices[1] + location);
+ IPath location2 = IPath.fromOSString(devices[1] + location);
assertTrue("0.2", !location2.toFile().exists());
desc2.setLocation(location2);
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/alias/SyncAliasTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/alias/SyncAliasTest.java
index 5d9226ac077..4db6c65ec9c 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/alias/SyncAliasTest.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/alias/SyncAliasTest.java
@@ -14,9 +14,20 @@
*******************************************************************************/
package org.eclipse.core.tests.internal.alias;
-import java.io.*;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.IWorkspaceRunnable;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
import org.eclipse.core.tests.resources.ResourceTest;
/**
@@ -47,7 +58,7 @@ public void testNestedProjects() throws CoreException {
//create project physically nested in top level project
IProjectDescription description = getWorkspace().newProjectDescription("nestedProject");
- description.setLocation(new Path(childProject.getAbsolutePath()));
+ description.setLocation(IPath.fromOSString(childProject.getAbsolutePath()));
nestedProject.create(description, monitor);
nestedProject.open(monitor);
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/dtree/DeltaDataTreeTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/dtree/DeltaDataTreeTest.java
index 07df1db9d02..68c4fd420cc 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/dtree/DeltaDataTreeTest.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/dtree/DeltaDataTreeTest.java
@@ -20,10 +20,13 @@
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
-import org.eclipse.core.internal.dtree.*;
+import org.eclipse.core.internal.dtree.AbstractDataTree;
+import org.eclipse.core.internal.dtree.DeltaDataTree;
+import org.eclipse.core.internal.dtree.NodeComparison;
+import org.eclipse.core.internal.dtree.ObjectNotFoundException;
+import org.eclipse.core.internal.dtree.TestHelper;
import org.eclipse.core.internal.watson.DefaultElementComparator;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.junit.Before;
import org.junit.Test;
@@ -83,7 +86,7 @@ public void setUp() {
emptyTree = new DeltaDataTree();
tree = new DeltaDataTree();
- rootKey = Path.ROOT;
+ rootKey = IPath.ROOT;
/* Add two children to root */
try {
@@ -116,10 +119,10 @@ public void setUp() {
*/
@Test
public void testAddAndRemoveOnSameLayer() {
- IPath elementA = Path.ROOT.append("A");
+ IPath elementA = IPath.ROOT.append("A");
DeltaDataTree tree1 = new DeltaDataTree();
- tree1.createChild(Path.ROOT, "A", "Data for A");
+ tree1.createChild(IPath.ROOT, "A", "Data for A");
tree1.immutable();
DeltaDataTree tree2;
@@ -135,8 +138,8 @@ public void testAddAndRemoveOnSameLayer() {
tree2.compareWith(tree1, DefaultElementComparator.getComparator());
tree1.forwardDeltaWith(tree2, DefaultElementComparator.getComparator());
tree2.forwardDeltaWith(tree1, DefaultElementComparator.getComparator());
- tree1.copyCompleteSubtree(Path.ROOT);
- tree2.copyCompleteSubtree(Path.ROOT);
+ tree1.copyCompleteSubtree(IPath.ROOT);
+ tree2.copyCompleteSubtree(IPath.ROOT);
tree1.reroot();
tree2.reroot();
tree1.makeComplete();
@@ -147,18 +150,18 @@ public void testAddAndRemoveOnSameLayer() {
public void testCompareWithPath() {
// setup data:
String X = "x";
- IPath elementX = Path.ROOT.append(X);
+ IPath elementX = IPath.ROOT.append(X);
DeltaDataTree treeA;
DeltaDataTree treeB;
DeltaDataTree treeC;
DeltaDataTree treeD;
treeA = new DeltaDataTree();
String oldData = "A Data for x";
- treeA.createChild(Path.ROOT, X, oldData);
+ treeA.createChild(IPath.ROOT, X, oldData);
treeA.immutable();
treeB = treeA.newEmptyDeltaTree();
String newData = "B Data for x";
- treeB.createChild(Path.ROOT, X, newData);
+ treeB.createChild(IPath.ROOT, X, newData);
treeB.immutable();
treeC = treeB.newEmptyDeltaTree();
treeC.immutable();
@@ -183,20 +186,20 @@ public void testCompareWithPath() {
public void testCompareWithPath2() {
// setup data:
String X = "x";
- IPath elementX = Path.ROOT.append(X);
+ IPath elementX = IPath.ROOT.append(X);
DeltaDataTree treeD;
DeltaDataTree treeC;
DeltaDataTree treeB;
DeltaDataTree treeA;
treeD = new DeltaDataTree();
String oldData = "D Data for x";
- treeD.createChild(Path.ROOT, X, oldData);
+ treeD.createChild(IPath.ROOT, X, oldData);
treeD.immutable();
treeC = treeD.newEmptyDeltaTree();
treeC.immutable();
treeB = treeC.newEmptyDeltaTree();
String newData = "B Data for x";
- treeB.createChild(Path.ROOT, X, newData);
+ treeB.createChild(IPath.ROOT, X, newData);
treeB.immutable();
treeA = treeB.newEmptyDeltaTree();
treeA.immutable();
@@ -222,12 +225,12 @@ public void testCompareWithPath2() {
public void testCompareWithPathUnchanged() {
// setup data:
String X = "x";
- IPath elementX = Path.ROOT.append(X);
+ IPath elementX = IPath.ROOT.append(X);
DeltaDataTree treeA;
DeltaDataTree treeB;
treeA = new DeltaDataTree();
String oldData = "Old Data for x";
- treeA.createChild(Path.ROOT, X, oldData);
+ treeA.createChild(IPath.ROOT, X, oldData);
treeA.immutable();
treeB = treeA.newEmptyDeltaTree();
treeB.immutable();
@@ -262,20 +265,20 @@ private void assertUnchanged(DeltaDataTree delta) {
public void testAddTwiceAndDelete() {
DeltaDataTree tree1 = new DeltaDataTree();
- tree1.createChild(Path.ROOT, "A", "Data for A");
+ tree1.createChild(IPath.ROOT, "A", "Data for A");
tree1.immutable();
tree1 = tree1.newEmptyDeltaTree();
- tree1.createChild(Path.ROOT, "A", "New A Data");
+ tree1.createChild(IPath.ROOT, "A", "New A Data");
tree1.immutable();
tree1 = tree1.newEmptyDeltaTree();
- tree1.deleteChild(Path.ROOT, "A");
+ tree1.deleteChild(IPath.ROOT, "A");
tree1.immutable();
- assertEquals(0, tree1.getChildCount(Path.ROOT));
+ assertEquals(0, tree1.getChildCount(IPath.ROOT));
}
@@ -935,11 +938,11 @@ public void testNewEmptyDeltaTree() {
*/
@Test
public void testRegression1FVVP6L() {
- IPath elementA = Path.ROOT.append("A");
+ IPath elementA = IPath.ROOT.append("A");
DeltaDataTree tree1 = new DeltaDataTree();
- tree1.createChild(Path.ROOT, "A", "Data for A");
+ tree1.createChild(IPath.ROOT, "A", "Data for A");
tree1.createChild(elementA, "B", "Data for B");
tree1.immutable();
@@ -954,7 +957,7 @@ public void testRegression1FVVP6L() {
tree1.deleteChild(elementA, "B");
try {
- tree1.copyCompleteSubtree(Path.ROOT);
+ tree1.copyCompleteSubtree(IPath.ROOT);
} catch (RuntimeException e) {
fail("Unexpected error copying tree");
}
@@ -966,13 +969,13 @@ public void testRegression1FVVP6L() {
*/
@Test
public void testRegression1FVVP6LWithChildren() {
- IPath elementA = Path.ROOT.append("A");
+ IPath elementA = IPath.ROOT.append("A");
IPath elementB = elementA.append("B");
IPath elementC = elementB.append("C");
DeltaDataTree tree1 = new DeltaDataTree();
- tree1.createChild(Path.ROOT, "A", "Data for A");
+ tree1.createChild(IPath.ROOT, "A", "Data for A");
tree1.createChild(elementA, "B", "Data for B");
tree1.createChild(elementB, "C", "Data for C");
@@ -988,7 +991,7 @@ public void testRegression1FVVP6LWithChildren() {
assertFalse("Child exists after deletion", tree1.includes(elementC));
try {
- tree1.copyCompleteSubtree(Path.ROOT);
+ tree1.copyCompleteSubtree(IPath.ROOT);
} catch (RuntimeException e) {
fail("Unexpected error copying tree");
}
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/filesystem/bogus/BogusFileSystem.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/filesystem/bogus/BogusFileSystem.java
index 01dd04c3c27..6987f9f6ef8 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/filesystem/bogus/BogusFileSystem.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/filesystem/bogus/BogusFileSystem.java
@@ -17,7 +17,6 @@
import java.net.URISyntaxException;
import org.eclipse.core.filesystem.IFileStore;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.tests.internal.filesystem.ram.MemoryFileSystem;
/**
@@ -52,6 +51,6 @@ public BogusFileSystem() {
@Override
public IFileStore getStore(URI uri) {
- return new BogusFileStore(Path.fromPortableString(uri.getSchemeSpecificPart()));
+ return new BogusFileStore(IPath.fromPortableString(uri.getSchemeSpecificPart()));
}
}
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/filesystem/broken/BrokenFileStore.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/filesystem/broken/BrokenFileStore.java
index e5e0ec57e7a..46a6d2ab4b2 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/filesystem/broken/BrokenFileStore.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/filesystem/broken/BrokenFileStore.java
@@ -19,7 +19,11 @@
import org.eclipse.core.filesystem.IFileInfo;
import org.eclipse.core.filesystem.IFileStore;
import org.eclipse.core.filesystem.provider.FileStore;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
import org.junit.Assert;
/**
@@ -58,7 +62,7 @@ public IFileInfo fetchInfo(int options, IProgressMonitor monitor) throws CoreExc
}
private IPath getPath() {
- return new Path(uri.getSchemeSpecificPart());
+ return IPath.fromOSString(uri.getSchemeSpecificPart());
}
@Override
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/filesystem/bug369177/Bug369177FileSystem.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/filesystem/bug369177/Bug369177FileSystem.java
index 4a8cd6227b5..eeeaea2908a 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/filesystem/bug369177/Bug369177FileSystem.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/filesystem/bug369177/Bug369177FileSystem.java
@@ -19,7 +19,8 @@
import org.eclipse.core.internal.filesystem.NullFileSystem;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
/**
* Special file system implementation used by TestBug369177.
@@ -57,6 +58,6 @@ public IFileStore getStore(IPath path) {
@Override
public IFileStore getStore(URI uri) {
runTestScenario();
- return new Bug369177FileStore(new Path(uri.getPath()));
+ return new Bug369177FileStore(IPath.fromOSString(uri.getPath()));
}
}
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/filesystem/bug440110/Bug440110FileSystem.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/filesystem/bug440110/Bug440110FileSystem.java
index cc451404a4a..e4257ec47ba 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/filesystem/bug440110/Bug440110FileSystem.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/filesystem/bug440110/Bug440110FileSystem.java
@@ -14,8 +14,12 @@
package org.eclipse.core.tests.internal.filesystem.bug440110;
import java.net.URI;
-import org.eclipse.core.filesystem.*;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.filesystem.IFileStore;
+import org.eclipse.core.filesystem.IFileSystem;
+import org.eclipse.core.filesystem.IFileTree;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.tests.internal.filesystem.ram.MemoryFileSystem;
public class Bug440110FileSystem extends MemoryFileSystem {
@@ -48,6 +52,6 @@ public IFileTree fetchFileTree(IFileStore root, IProgressMonitor monitor) throws
@Override
public IFileStore getStore(URI uri) {
- return new Bug440110FileStore(Path.fromPortableString(uri.getSchemeSpecificPart()));
+ return new Bug440110FileStore(IPath.fromPortableString(uri.getSchemeSpecificPart()));
}
}
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/filesystem/ram/MemoryFileSystem.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/filesystem/ram/MemoryFileSystem.java
index 19e5ece5ec6..b125352b5bf 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/filesystem/ram/MemoryFileSystem.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/filesystem/ram/MemoryFileSystem.java
@@ -18,7 +18,9 @@
import org.eclipse.core.filesystem.IFileStore;
import org.eclipse.core.filesystem.IFileTree;
import org.eclipse.core.filesystem.provider.FileSystem;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
/**
* A test file system that keeps everything in memory.
@@ -55,7 +57,7 @@ public IFileTree fetchFileTree(IFileStore root, IProgressMonitor monitor) throws
@Override
public IFileStore getStore(URI uri) {
- return new MemoryFileStore(Path.fromPortableString(uri.getSchemeSpecificPart()));
+ return new MemoryFileStore(IPath.fromPortableString(uri.getSchemeSpecificPart()));
}
@Override
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/filesystem/remote/RemoteFileStore.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/filesystem/remote/RemoteFileStore.java
index f3482b0939b..f1b5e1cd10c 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/filesystem/remote/RemoteFileStore.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/filesystem/remote/RemoteFileStore.java
@@ -17,7 +17,6 @@
import java.net.URISyntaxException;
import org.eclipse.core.filesystem.IFileStore;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.tests.internal.filesystem.ram.MemoryFileStore;
/**
@@ -41,7 +40,7 @@ private static String createAuthoritySegment(String userInfo, String host, int p
private IPath remotePath;
public RemoteFileStore(String userInfo, String host, int port, IPath path) {
- super(Path.ROOT.append(createAuthoritySegment(userInfo, host, port)).append(path));
+ super(IPath.ROOT.append(createAuthoritySegment(userInfo, host, port)).append(path));
this.userInfo = userInfo;
this.host = host;
this.port = port;
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/filesystem/remote/RemoteFileSystem.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/filesystem/remote/RemoteFileSystem.java
index a16eca134f4..5efac240d78 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/filesystem/remote/RemoteFileSystem.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/filesystem/remote/RemoteFileSystem.java
@@ -15,7 +15,7 @@
import java.net.URI;
import org.eclipse.core.filesystem.IFileStore;
-import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.tests.internal.filesystem.ram.MemoryFileSystem;
/**
@@ -30,6 +30,6 @@ public RemoteFileSystem() {
@Override
public IFileStore getStore(URI uri) {
- return new RemoteFileStore(uri.getUserInfo(), uri.getHost(), uri.getPort(), new Path(uri.getPath()));
+ return new RemoteFileStore(uri.getUserInfo(), uri.getHost(), uri.getPort(), IPath.fromOSString(uri.getPath()));
}
}
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/filesystem/wrapper/WrapperFileSystem.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/filesystem/wrapper/WrapperFileSystem.java
index fe20413127e..518869515d9 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/filesystem/wrapper/WrapperFileSystem.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/filesystem/wrapper/WrapperFileSystem.java
@@ -19,7 +19,9 @@
import org.eclipse.core.filesystem.EFS;
import org.eclipse.core.filesystem.IFileStore;
import org.eclipse.core.filesystem.provider.FileSystem;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.tests.harness.CoreTest;
import org.eclipse.core.tests.resources.ResourceTest;
@@ -33,7 +35,7 @@
*
*/
public class WrapperFileSystem extends FileSystem {
- protected static final IFileStore NULL_ROOT = EFS.getNullFileSystem().getStore(Path.ROOT);
+ protected static final IFileStore NULL_ROOT = EFS.getNullFileSystem().getStore(IPath.ROOT);
private static final String SCHEME_WRAPPED = "wrapped";
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/BlobStoreTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/BlobStoreTest.java
index 10d417dcbb7..561e6f7e07b 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/BlobStoreTest.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/BlobStoreTest.java
@@ -14,11 +14,13 @@
package org.eclipse.core.tests.internal.localstore;
import java.io.InputStream;
-import org.eclipse.core.filesystem.*;
+import org.eclipse.core.filesystem.EFS;
+import org.eclipse.core.filesystem.IFileInfo;
+import org.eclipse.core.filesystem.IFileStore;
import org.eclipse.core.internal.localstore.BlobStore;
import org.eclipse.core.internal.utils.UniversalUniqueIdentifier;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.IPath;
//
public class BlobStoreTest extends LocalStoreTest {
@@ -39,7 +41,7 @@ public void testConstructor() {
/* nonexistent location */
ok = false;
try {
- new BlobStore(EFS.getLocalFileSystem().getStore(new Path("../this/path/should/not/be/a/folder")), 128);
+ new BlobStore(EFS.getLocalFileSystem().getStore(IPath.fromOSString("../this/path/should/not/be/a/folder")), 128);
} catch (RuntimeException e) {
ok = true;
}
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 f4e591ea157..a8ea96edb71 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
@@ -15,13 +15,24 @@
*******************************************************************************/
package org.eclipse.core.tests.internal.localstore;
-import java.io.*;
-import java.util.*;
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
import org.eclipse.core.internal.localstore.Bucket;
import org.eclipse.core.internal.localstore.BucketTree;
import org.eclipse.core.internal.resources.Workspace;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.tests.resources.ResourceTest;
public class BucketTreeTests extends ResourceTest {
@@ -134,7 +145,8 @@ public void testVisitor() {
IFolder folder1 = proj1.getFolder("folder1");
IFile file2 = folder1.getFile("file2.txt");
ensureExistsInWorkspace(new IResource[] {file1, file2, proj2}, true);
- IPath[] paths = {Path.ROOT, proj1.getFullPath(), file1.getFullPath(), folder1.getFullPath(), file2.getFullPath(), proj2.getFullPath()};
+ IPath[] paths = { IPath.ROOT, proj1.getFullPath(), file1.getFullPath(), folder1.getFullPath(),
+ file2.getFullPath(), proj2.getFullPath() };
for (int i = 0; i < paths.length; i++) {
try {
tree.loadBucketFor(paths[i]);
@@ -149,9 +161,12 @@ public void testVisitor() {
} catch (CoreException e) {
fail("0.2", e);
}
- verify(tree, "1.1", Path.ROOT, BucketTree.DEPTH_ZERO, Arrays.asList(new IPath[] {Path.ROOT}));
- verify(tree, "1.2", Path.ROOT, BucketTree.DEPTH_ONE, Arrays.asList(new IPath[] {Path.ROOT, proj1.getFullPath(), proj2.getFullPath()}));
- verify(tree, "1.3", Path.ROOT, BucketTree.DEPTH_INFINITE, Arrays.asList(new IPath[] {Path.ROOT, proj1.getFullPath(), file1.getFullPath(), folder1.getFullPath(), file2.getFullPath(), proj2.getFullPath()}));
+ verify(tree, "1.1", IPath.ROOT, BucketTree.DEPTH_ZERO, Set.of(IPath.ROOT));
+ verify(tree, "1.2", IPath.ROOT, BucketTree.DEPTH_ONE,
+ Set.of(IPath.ROOT, proj1.getFullPath(), proj2.getFullPath()));
+ verify(tree, "1.3", IPath.ROOT, BucketTree.DEPTH_INFINITE, Set.of(IPath.ROOT, proj1.getFullPath(),
+ file1.getFullPath(), folder1.getFullPath(),
+ file2.getFullPath(), proj2.getFullPath()));
verify(tree, "2.1", proj1.getFullPath(), BucketTree.DEPTH_ZERO, Arrays.asList(new IPath[] {proj1.getFullPath()}));
verify(tree, "2.2", proj1.getFullPath(), BucketTree.DEPTH_ONE, Arrays.asList(new IPath[] {proj1.getFullPath(), file1.getFullPath(), folder1.getFullPath()}));
verify(tree, "2.3", proj1.getFullPath(), BucketTree.DEPTH_INFINITE, Arrays.asList(new IPath[] {proj1.getFullPath(), file1.getFullPath(), folder1.getFullPath(), file2.getFullPath()}));
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/CaseSensitivityTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/CaseSensitivityTest.java
index 851df42b9f3..1ac9b482ffb 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/CaseSensitivityTest.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/CaseSensitivityTest.java
@@ -15,9 +15,12 @@
import java.io.IOException;
import org.eclipse.core.internal.resources.Workspace;
-import org.eclipse.core.resources.*;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.IPath;
public class CaseSensitivityTest extends LocalStoreTest {
private final boolean isCaseSensitive = Workspace.caseSensitive;
@@ -136,7 +139,7 @@ public void testRenameProject() {
// try to rename project 1 to the uppercase name of project 2, should fail
try {
- project1.move(Path.ROOT.append(project2.getName().toUpperCase()), true, null);
+ project1.move(IPath.ROOT.append(project2.getName().toUpperCase()), true, null);
assertTrue("3.0", isCaseSensitive);
} catch (CoreException e) {
if (isCaseSensitive) {
@@ -382,7 +385,7 @@ public void testCopyAndMoveFolderBecomeProject() {
// try to move the folder from source project to the root, which makes it a project.
// should always fails since we aren't allowed to move a folder to be a project.
try {
- folder.move(Path.ROOT.append(folder.getName()), true, null);
+ folder.move(IPath.ROOT.append(folder.getName()), true, null);
fail("1.1");
} catch (CoreException e) {
// expected
@@ -391,7 +394,7 @@ public void testCopyAndMoveFolderBecomeProject() {
// try to copy the folder from source project to the root, which makes it a project.
// should always fail since we aren't allowed to copy a folder to be a project
try {
- folder.copy(Path.ROOT.append(folder.getName()), true, null);
+ folder.copy(IPath.ROOT.append(folder.getName()), true, null);
fail("1.2");
} catch (CoreException e) {
// expected
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/CopyTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/CopyTest.java
index 3b66bc6b058..0745bfdc440 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/CopyTest.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/CopyTest.java
@@ -13,8 +13,14 @@
*******************************************************************************/
package org.eclipse.core.tests.internal.localstore;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.QualifiedName;
/**
* Test the copy operation.
@@ -62,7 +68,7 @@ public void testCopyResource() throws Throwable {
ensureDoesNotExistInFileSystem(destination);
/* copy to relative path */
- IPath path = new Path("copy of file.txt");
+ IPath path = IPath.fromOSString("copy of file.txt");
destination = folder.getFile(path);
ensureDoesNotExistInFileSystem(destination);
try {
@@ -106,11 +112,11 @@ public void testCopyResource() throws Throwable {
assertTrue("4.2", e.getStatus().getChildren().length == 2);
}
assertTrue("4.3", destination.exists());
- assertTrue("4.4", ((IContainer) destination).getFile(new Path(file.getName())).exists());
- assertTrue("4.5", !((IContainer) destination).getFolder(new Path(subfolder.getName())).exists());
- assertTrue("4.6", !((IContainer) destination).getFile(new Path(anotherFile.getName())).exists());
+ assertTrue("4.4", ((IContainer) destination).getFile(IPath.fromOSString(file.getName())).exists());
+ assertTrue("4.5", !((IContainer) destination).getFolder(IPath.fromOSString(subfolder.getName())).exists());
+ assertTrue("4.6", !((IContainer) destination).getFile(IPath.fromOSString(anotherFile.getName())).exists());
/* assert properties were properly copied */
- IResource target = ((IContainer) destination).getFile(new Path(file.getName()));
+ IResource target = ((IContainer) destination).getFile(IPath.fromOSString(file.getName()));
for (int i = 0; i < numberOfProperties; i++) {
String persistentValue = target.getPersistentProperty(propNames[i]);
Object sessionValue = target.getSessionProperty(propNames[i]);
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 68afaa3f462..9e254b48bdf 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
@@ -21,9 +21,24 @@
import org.eclipse.core.filesystem.IFileInfo;
import org.eclipse.core.filesystem.IFileStore;
import org.eclipse.core.internal.localstore.FileSystemResourceManager;
-import org.eclipse.core.internal.resources.*;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.internal.resources.File;
+import org.eclipse.core.internal.resources.ICoreConstants;
+import org.eclipse.core.internal.resources.Project;
+import org.eclipse.core.internal.resources.Resource;
+import org.eclipse.core.internal.resources.Workspace;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.IWorkspaceRunnable;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
import org.eclipse.core.tests.internal.filesystem.bug440110.Bug440110FileSystem;
import org.junit.Test;
@@ -71,28 +86,28 @@ public void testContainerFor() {
/* test normal conditions under default mapping */
// project/target
- Path path = new Path("target");
+ IPath path = IPath.fromOSString("target");
IFolder folder = projects[0].getFolder(path);
IPath location = projects[0].getLocation().append(path);
IFolder testFolder = (IFolder) getLocalManager().containerForLocation(location);
assertEquals("2.1", folder, testFolder);
// project/folder/target
- path = new Path("folder/target");
+ path = IPath.fromOSString("folder/target");
folder = projects[0].getFolder(path);
location = projects[0].getLocation().append(path);
testFolder = (IFolder) getLocalManager().containerForLocation(location);
assertEquals("2.2", folder, testFolder);
// project/folder/folder/target
- path = new Path("folder/folder/target");
+ path = IPath.fromOSString("folder/folder/target");
folder = projects[0].getFolder(path);
location = projects[0].getLocation().append(path);
testFolder = (IFolder) getLocalManager().containerForLocation(location);
assertEquals("2.3", folder, testFolder);
/* non-existent location */
- testFolder = (IFolder) getLocalManager().containerForLocation(new Path("../this/path/must/not/exist"));
+ testFolder = (IFolder) getLocalManager().containerForLocation(IPath.fromOSString("../this/path/must/not/exist"));
assertNull("3.1", testFolder);
}
@@ -124,28 +139,28 @@ public void testFileFor() {
/* test normal conditions under default mapping */
// project/file
- Path path = new Path("file");
+ IPath path = IPath.fromOSString("file");
IFile file = projects[0].getFile(path);
IPath location = projects[0].getLocation().append(path);
IFile testFile = getLocalManager().fileForLocation(location);
assertEquals("2.1", file, testFile);
// project/folder/file
- path = new Path("folder/file");
+ path = IPath.fromOSString("folder/file");
file = projects[0].getFile(path);
location = projects[0].getLocation().append(path);
testFile = getLocalManager().fileForLocation(location);
assertEquals("2.2", file, testFile);
// project/folder/folder/file
- path = new Path("folder/folder/file");
+ path = IPath.fromOSString("folder/folder/file");
file = projects[0].getFile(path);
location = projects[0].getLocation().append(path);
testFile = getLocalManager().fileForLocation(location);
assertEquals("2.3", file, testFile);
/* non-existent location */
- testFile = getLocalManager().fileForLocation(new Path("../this/path/must/not/exist"));
+ testFile = getLocalManager().fileForLocation(IPath.fromOSString("../this/path/must/not/exist"));
assertNull("7.1", testFile);
}
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/HistoryBucketTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/HistoryBucketTest.java
index 3dac47cb5bc..28844461a14 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/HistoryBucketTest.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/HistoryBucketTest.java
@@ -16,7 +16,8 @@
import org.eclipse.core.internal.localstore.Bucket.Entry;
import org.eclipse.core.internal.localstore.HistoryBucket;
import org.eclipse.core.internal.utils.UniversalUniqueIdentifier;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.tests.resources.ResourceTest;
public class HistoryBucketTest extends ResourceTest {
@@ -35,7 +36,7 @@ public void testDuplicates() {
} catch (CoreException e) {
fail("1.0", e);
}
- IPath path = new Path("/foo/bar");
+ IPath path = IPath.fromOSString("/foo/bar");
UniversalUniqueIdentifier uuid = new UniversalUniqueIdentifier();
long lastModified = (long) (Math.random() * Long.MAX_VALUE);
index1.addBlob(path, uuid, lastModified);
@@ -64,7 +65,7 @@ public void testPersistence() {
fail("1.0", e);
}
assertEquals("1.1", 0, index1.getEntryCount());
- IPath path = new Path("/foo/bar");
+ IPath path = IPath.fromOSString("/foo/bar");
UniversalUniqueIdentifier uuid1 = new UniversalUniqueIdentifier();
long lastModified1 = (long) (Math.random() * Long.MAX_VALUE);
index1.addBlob(path, uuid1, lastModified1);
@@ -137,7 +138,7 @@ public int visit(Entry fileEntry) {
*/
public void testSort() {
HistoryBucket index = new HistoryBucket();
- IPath path = new Path("/foo");
+ IPath path = IPath.fromOSString("/foo");
assertNull("1.0", index.getEntry(path));
UniversalUniqueIdentifier uuid1 = new UniversalUniqueIdentifier();
long timestamp1 = 10;
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/HistoryStoreTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/HistoryStoreTest.java
index c94015c3519..f0e6132cb69 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/HistoryStoreTest.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/HistoryStoreTest.java
@@ -14,15 +14,35 @@
*******************************************************************************/
package org.eclipse.core.tests.internal.localstore;
-import java.io.*;
-import java.util.*;
+import java.io.ByteArrayInputStream;
+import java.io.DataInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
import org.eclipse.core.filesystem.IFileStore;
import org.eclipse.core.filesystem.provider.FileInfo;
import org.eclipse.core.internal.localstore.IHistoryStore;
-import org.eclipse.core.internal.resources.*;
+import org.eclipse.core.internal.resources.FileState;
+import org.eclipse.core.internal.resources.Resource;
+import org.eclipse.core.internal.resources.Workspace;
import org.eclipse.core.internal.utils.UniversalUniqueIdentifier;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFileState;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceStatus;
+import org.eclipse.core.resources.IWorkspaceDescription;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.ILog;
+import org.eclipse.core.runtime.ILogListener;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.tests.resources.ResourceTest;
/**
@@ -106,7 +126,7 @@ public static void wipeHistoryStore(IProgressMonitor monitor) {
IHistoryStore store = ((Workspace) getWorkspace()).getFileSystemManager().getHistoryStore();
// Remove all the entries from the history store index. Note that
// this does not cause the history store states to be removed.
- store.remove(Path.ROOT, monitor);
+ store.remove(IPath.ROOT, monitor);
// Now make sure all the states are really removed.
store.removeGarbage();
}
@@ -1407,7 +1427,8 @@ public void testGetContents() throws Throwable {
for (int i = 0; i < ITERATIONS; i++) {
// Create bogus FileState using invalid uuid.
try {
- InputStream in = historyStore.getContents(new FileState(historyStore, Path.ROOT, myLong, new UniversalUniqueIdentifier()));
+ InputStream in = historyStore
+ .getContents(new FileState(historyStore, IPath.ROOT, myLong, new UniversalUniqueIdentifier()));
in.close();
fail("6." + i + " Edition should be invalid.");
} catch (CoreException e) {
@@ -1589,7 +1610,7 @@ public void testMoveProject() {
assertTrue("1.2", compareContent(getContents(contents[0]), states[1].getContents()));
// Now do the move
- project.move(new Path("SecondMoveProjectProject"), true, getMonitor());
+ project.move(IPath.fromOSString("SecondMoveProjectProject"), true, getMonitor());
// Check to make sure the file has been moved
IFile file2 = project2.getFile("folder1/file1.txt");
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 b6f58902147..e03f77edca5 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
@@ -13,10 +13,14 @@
*******************************************************************************/
package org.eclipse.core.tests.internal.localstore;
-import org.eclipse.core.internal.resources.*;
+import org.eclipse.core.internal.resources.ICoreConstants;
+import org.eclipse.core.internal.resources.Project;
+import org.eclipse.core.internal.resources.TestingSupport;
+import org.eclipse.core.internal.resources.Workspace;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
public class LocalSyncTest extends LocalStoreTest implements ICoreConstants {
@@ -87,10 +91,10 @@ public void testSimpleSync() {
Project project = (Project) projects[0];
// create resource handles
- IResource index = project.getFile(new Path("index.html"));
- IResource toc = project.getFile(new Path("toc.html"));
- IResource file = project.getFile(new Path("file"));
- IResource folder = project.getFolder(new Path("folder"));
+ IResource index = project.getFile(IPath.fromOSString("index.html"));
+ IResource toc = project.getFile(IPath.fromOSString("toc.html"));
+ IResource file = project.getFile(IPath.fromOSString("file"));
+ IResource folder = project.getFolder(IPath.fromOSString("folder"));
// add resources to the workspace
ensureExistsInWorkspace((IFile) index, "");
@@ -134,8 +138,8 @@ public void testSimpleSync() {
} catch (InterruptedException e) {
fail("3.0", e);
}
- file = project.getFolder(new Path("file"));
- folder = project.getFile(new Path("folder"));
+ file = project.getFolder(IPath.fromOSString("file"));
+ folder = project.getFile(IPath.fromOSString("folder"));
ensureExistsInFileSystem(file);
ensureExistsInFileSystem((IFile) folder);
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 64a5abfe316..a7c569226ad 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
@@ -13,9 +13,21 @@
*******************************************************************************/
package org.eclipse.core.tests.internal.localstore;
-import org.eclipse.core.internal.resources.*;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.internal.resources.File;
+import org.eclipse.core.internal.resources.Resource;
+import org.eclipse.core.internal.resources.ResourceInfo;
+import org.eclipse.core.internal.resources.Workspace;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRunnable;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.QualifiedName;
import org.junit.Assume;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -52,7 +64,7 @@ public void testMoveFileAcrossVolumes() {
source.open(getMonitor());
IProjectDescription description = getWorkspace().newProjectDescription(destination.getName());
- description.setLocation(new Path(devices[1] + location));
+ description.setLocation(IPath.fromOSString(devices[1] + location));
destination.create(description, getMonitor());
destination.open(getMonitor());
} catch (CoreException e) {
@@ -174,7 +186,7 @@ public void testMoveFolderAcrossVolumes() {
source.open(getMonitor());
IProjectDescription description = getWorkspace().newProjectDescription(destination.getName());
- description.setLocation(new Path(devices[1] + location));
+ description.setLocation(IPath.fromOSString(devices[1] + location));
destination.create(description, getMonitor());
destination.open(getMonitor());
} catch (CoreException e) {
@@ -437,7 +449,7 @@ public void testMoveResource() throws Exception {
assertTrue("1.4", !destination.exists());
/* move to relative destination */
- IPath path = new Path("destination");
+ IPath path = IPath.fromOSString("destination");
destination = folder.getFile(path);
file.move(path, true, null);
assertTrue("2.1", !file.exists());
@@ -481,7 +493,7 @@ public void testMoveResource() throws Exception {
assertTrue("4.3", folder.exists());
// FIXME: should #move be a best effort operation?
// its ok for the root to be moved but ensure the destination child wasn't moved
- IResource destChild = ((IContainer) destination).getFile(new Path(anotherFile.getName()));
+ IResource destChild = ((IContainer) destination).getFile(IPath.fromOSString(anotherFile.getName()));
assertTrue("4.4", !destination.exists());
assertTrue("4.5", !destChild.exists());
// cleanup and delete the destination
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/SafeFileInputOutputStreamTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/SafeFileInputOutputStreamTest.java
index 3ae38899a10..52bb19d68af 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/SafeFileInputOutputStreamTest.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/SafeFileInputOutputStreamTest.java
@@ -13,12 +13,13 @@
*******************************************************************************/
package org.eclipse.core.tests.internal.localstore;
-import java.io.*;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
import org.eclipse.core.internal.localstore.SafeFileInputStream;
import org.eclipse.core.internal.localstore.SafeFileOutputStream;
import org.eclipse.core.internal.resources.Workspace;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.tests.resources.ResourceTest;
public class SafeFileInputOutputStreamTest extends ResourceTest {
@@ -68,7 +69,7 @@ public void testSafeFileInputStream() {
assertTrue("1.0", !target.exists());
// define temp path
- Path parentLocation = new Path(target.getParentFile().getAbsolutePath());
+ IPath parentLocation = IPath.fromOSString(target.getParentFile().getAbsolutePath());
IPath tempLocation = parentLocation.append(target.getName() + ".backup");
// we did not have a file on the destination, so we should not have a temp file
@@ -124,7 +125,7 @@ public void testSpecifiedTempFile() {
assertTrue("1.0", !target.exists());
// define temp path
- Path parentLocation = new Path(target.getParentFile().getAbsolutePath());
+ IPath parentLocation = IPath.fromOSString(target.getParentFile().getAbsolutePath());
IPath tempLocation = parentLocation.append(target.getName() + ".backup");
// we did not have a file on the destination, so we should not have a temp file
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/SymlinkResourceTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/SymlinkResourceTest.java
index 31d8a012b82..2ad00cc90c5 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/SymlinkResourceTest.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/SymlinkResourceTest.java
@@ -17,9 +17,12 @@
import org.eclipse.core.filesystem.EFS;
import org.eclipse.core.filesystem.IFileStore;
-import org.eclipse.core.resources.*;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceVisitor;
+import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.IPath;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
@@ -44,10 +47,10 @@ protected void createBug232426Structure(IFileStore rootDir) throws CoreException
folderC.mkdir(EFS.NONE, getMonitor());
/* create symbolic links */
- mkLink(folderA, "link", new Path("../b").toOSString(), true);
- mkLink(folderB, "linkA", new Path("../a").toOSString(), true);
- mkLink(folderB, "linkC", new Path("../c").toOSString(), true);
- mkLink(folderC, "link", new Path("../b").toOSString(), true);
+ mkLink(folderA, "link", IPath.fromOSString("../b").toOSString(), true);
+ mkLink(folderB, "linkA", IPath.fromOSString("../a").toOSString(), true);
+ mkLink(folderB, "linkC", IPath.fromOSString("../c").toOSString(), true);
+ mkLink(folderC, "link", IPath.fromOSString("../b").toOSString(), true);
}
protected void createBug358830Structure(IFileStore rootDir) throws CoreException {
@@ -55,7 +58,7 @@ protected void createBug358830Structure(IFileStore rootDir) throws CoreException
folderA.mkdir(EFS.NONE, getMonitor());
/* create trivial recursive symbolic link */
- mkLink(folderA, "link", new Path("../").toOSString(), true);
+ mkLink(folderA, "link", IPath.fromOSString("../").toOSString(), true);
}
/**
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/UnifiedTreeTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/UnifiedTreeTest.java
index d6c10da65e3..a97476e7b91 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/UnifiedTreeTest.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/UnifiedTreeTest.java
@@ -14,7 +14,10 @@
*******************************************************************************/
package org.eclipse.core.tests.internal.localstore;
-import java.io.*;
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.OutputStream;
import java.net.URI;
import java.util.Hashtable;
import org.eclipse.core.filesystem.EFS;
@@ -23,9 +26,16 @@
import org.eclipse.core.internal.localstore.UnifiedTree;
import org.eclipse.core.internal.resources.Resource;
import org.eclipse.core.internal.resources.Workspace;
-import org.eclipse.core.resources.*;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRunnable;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.IPath;
public class UnifiedTreeTest extends LocalStoreTest {
protected static int limit = 10;
@@ -54,7 +64,7 @@ protected void createFiles(final IContainer target, final Hashtable {
for (int i = 0; i < limit; i++) {
- IFile child = target.getFile(new Path("wbFile" + i));
+ IFile child = target.getFile(IPath.fromOSString("wbFile" + i));
workspace.createResource(child, false);
String location = child.getLocation().toOSString();
set.put(location, "");
@@ -78,7 +88,7 @@ protected void createResourcesInFileSystem(IFileStore folder, Hashtable set) throws CoreException {
createFiles(target, set);
for (int i = 0; i < limit; i++) {
- IFolder child = target.getFolder(new Path("wbFolder" + i));
+ IFolder child = target.getFolder(IPath.fromOSString("wbFolder" + i));
child.create(true, true, null);
String location = child.getLocation().toOSString();
set.put(location, "");
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 be049ec9dc3..2262dc99366 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
@@ -16,7 +16,6 @@
import java.util.ArrayList;
import java.util.List;
-
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
@@ -24,8 +23,8 @@
import org.eclipse.core.resources.mapping.IResourceChangeDescriptionFactory;
import org.eclipse.core.resources.mapping.ModelStatus;
import org.eclipse.core.resources.mapping.ResourceChangeValidator;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.tests.resources.ResourceTest;
/**
@@ -126,8 +125,8 @@ public void testFileChanges() {
}
public void testFileCopy() {
- factory.copy(project.findMember("c/x"), new Path("c/x2"));
- factory.copy(project.findMember("c/b/y"), new Path("c/y"));
+ factory.copy(project.findMember("c/x"), IPath.fromOSString("c/x2"));
+ factory.copy(project.findMember("c/b/y"), IPath.fromOSString("c/y"));
IStatus status = validateChange(factory);
assertStatusEqual(status, new String[] {ChangeDescription.getMessageFor(ChangeDescription.COPIED, project.findMember("c/x")), ChangeDescription.getMessageFor(ChangeDescription.COPIED, project.findMember("c/b/y"))});
}
@@ -161,15 +160,15 @@ public void testFileDeletion() {
}
public void testFileMoves() {
- factory.move(project.findMember("c/x"), new Path("c/x2"));
- factory.move(project.findMember("c/b/y"), new Path("c/y"));
+ factory.move(project.findMember("c/x"), IPath.fromOSString("c/x2"));
+ factory.move(project.findMember("c/b/y"), IPath.fromOSString("c/y"));
IStatus status = validateChange(factory);
assertStatusEqual(status, new String[] {ChangeDescription.getMessageFor(ChangeDescription.MOVED, project.findMember("c/x")), ChangeDescription.getMessageFor(ChangeDescription.MOVED, project.findMember("c/b/y"))});
}
public void testFolderCopy() {
final IResource folder = project.findMember("c/b/");
- factory.copy(folder, new Path("c/d"));
+ factory.copy(folder, IPath.fromOSString("c/d"));
IStatus status = validateChange(factory);
assertStatusEqual(status, new String[] {ChangeDescription.getMessageFor(ChangeDescription.COPIED, folder),});
}
@@ -186,7 +185,7 @@ public void testFolderDeletion() {
public void testFolderMove() {
final IResource folder = project.findMember("c/b/");
- factory.move(folder, new Path("c/d"));
+ factory.move(folder, IPath.fromOSString("c/d"));
IStatus status = validateChange(factory);
assertStatusEqual(status, new String[] {ChangeDescription.getMessageFor(ChangeDescription.MOVED, folder),});
}
@@ -212,7 +211,7 @@ public void testProjectClose() {
public void testProjectCopy() {
// A project copy
- factory.copy(project, new Path("MovedProject"));
+ factory.copy(project, IPath.fromOSString("MovedProject"));
IStatus status = validateChange(factory);
assertStatusEqual(status, new String[] {ChangeDescription.getMessageFor(ChangeDescription.COPIED, project)});
}
@@ -244,7 +243,7 @@ public void testProjectDeletionWithoutContents() {
}
public void testProjectMove() {
- factory.move(project, new Path("MovedProject"));
+ factory.move(project, IPath.fromOSString("MovedProject"));
IStatus status = validateChange(factory);
assertStatusEqual(status, new String[] {ChangeDescription.getMessageFor(ChangeDescription.MOVED, project)});
}
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/properties/PropertyManagerTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/properties/PropertyManagerTest.java
index 1043d8b619c..88557e1ceff 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/properties/PropertyManagerTest.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/properties/PropertyManagerTest.java
@@ -17,12 +17,22 @@
import static org.junit.Assert.assertNotEquals;
import java.nio.charset.StandardCharsets;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.LinkedList;
+import java.util.List;
import org.eclipse.core.internal.properties.IPropertyManager;
import org.eclipse.core.internal.properties.PropertyManager2;
import org.eclipse.core.internal.resources.Workspace;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.core.tests.internal.localstore.LocalStoreTest;
public class PropertyManagerTest extends LocalStoreTest {
@@ -399,7 +409,7 @@ public void testFileRename() {
fail("0.5", e);
}
try {
- file1a.move(new Path("file2"), true, getMonitor());
+ file1a.move(IPath.fromOSString("file2"), true, getMonitor());
} catch (CoreException e) {
fail("0.6", e);
}
@@ -437,7 +447,7 @@ public void testFolderRename() {
fail("0.5", e);
}
try {
- folder1a.move(new Path("folder2"), true, getMonitor());
+ folder1a.move(IPath.fromOSString("folder2"), true, getMonitor());
} catch (CoreException e) {
fail("0.6", e);
}
@@ -509,7 +519,7 @@ public void testProjectRename() {
fail("0.5", e);
}
try {
- project1a.move(new Path("proj2"), true, getMonitor());
+ project1a.move(IPath.fromOSString("proj2"), true, getMonitor());
} catch (CoreException e) {
fail("0.6", e);
}
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/resources/ModelObjectReaderWriterTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/resources/ModelObjectReaderWriterTest.java
index 0fa79067685..58bf50986eb 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/resources/ModelObjectReaderWriterTest.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/resources/ModelObjectReaderWriterTest.java
@@ -15,7 +15,11 @@
*******************************************************************************/
package org.eclipse.core.tests.internal.resources;
-import java.io.*;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
import java.net.URI;
import java.net.URL;
import java.util.HashMap;
@@ -24,16 +28,28 @@
import org.eclipse.core.filesystem.EFS;
import org.eclipse.core.filesystem.IFileStore;
import org.eclipse.core.filesystem.URIUtil;
-import org.eclipse.core.internal.resources.*;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.internal.resources.LinkDescription;
+import org.eclipse.core.internal.resources.ModelObjectWriter;
+import org.eclipse.core.internal.resources.Project;
+import org.eclipse.core.internal.resources.ProjectDescription;
+import org.eclipse.core.internal.resources.ProjectDescriptionReader;
+import org.eclipse.core.internal.resources.Workspace;
+import org.eclipse.core.resources.ICommand;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.core.tests.resources.ResourceTest;
import org.xml.sax.InputSource;
public class ModelObjectReaderWriterTest extends ResourceTest {
- static final IPath LONG_LOCATION = new Path("/eclipse/dev/i0218/eclipse/pffds/fds//fds///fdsfsdfsd///fdsfdsf/fsdfsdfsd/lugi/dsds/fsd//f/ffdsfdsf/fsdfdsfsd/fds//fdsfdsfdsf/fdsfdsfds/fdsfdsfdsf/fdsfdsfdsds/ns/org.eclipse.help.ui_2.1.0/contexts.xml").setDevice(isWindows() ? "D:" : null);
+ static final IPath LONG_LOCATION = IPath.fromOSString("/eclipse/dev/i0218/eclipse/pffds/fds//fds///fdsfsdfsd///fdsfdsf/fsdfsdfsd/lugi/dsds/fsd//f/ffdsfdsf/fsdfdsfsd/fds//fdsfdsfdsf/fdsfdsfds/fdsfdsfdsf/fdsfdsfdsds/ns/org.eclipse.help.ui_2.1.0/contexts.xml").setDevice(isWindows() ? "D:" : null);
static final URI LONG_LOCATION_URI = LONG_LOCATION.toFile().toURI();
- private static final String PATH_STRING = new Path("/abc/def").setDevice(isWindows() ? "D:" : null).toString();
+ private static final String PATH_STRING = IPath.fromOSString("/abc/def").setDevice(isWindows() ? "D:" : null).toString();
private HashMap buildBaselineDescriptors() {
HashMap result = new HashMap<>();
@@ -247,7 +263,7 @@ private LinkDescription createLinkDescription(IPath path, int type, URI location
}
private LinkDescription createLinkDescription(String path, int type, String location) {
- return createLinkDescription(new Path(path), type, uriFromPortableString(location));
+ return createLinkDescription(IPath.fromOSString(path), type, uriFromPortableString(location));
}
private String getLongDescription() {
@@ -395,7 +411,7 @@ public void testInvalidProjectDescription4() throws Throwable {
assertEquals("3.5", new String[0], projDesc.getNatureIds());
assertEquals("3.6", new ICommand[0], projDesc.getBuildSpec());
LinkDescription link = projDesc.getLinks().values().iterator().next();
- assertEquals("3.7", new Path("newLink"), link.getProjectRelativePath());
+ assertEquals("3.7", IPath.fromOSString("newLink"), link.getProjectRelativePath());
assertEquals("3.8", PATH_STRING, URIUtil.toPath(link.getLocationURI()).toString());
}
@@ -626,7 +642,7 @@ public void testProjectDescription3() throws Throwable {
public void testProjectDescriptionWithSpaces() throws Throwable {
IFileStore store = getTempStore();
- final Path path = new Path("link");
+ IPath path = IPath.fromOSString("link");
URI location = store.toURI();
URI locationWithSpaces = store.getChild("With some spaces").toURI();
/* test write */
@@ -645,7 +661,7 @@ public void testProjectDescriptionWithSpaces() throws Throwable {
}
protected URI uriFromPortableString(String pathString) {
- return Path.fromPortableString(pathString).toFile().toURI();
+ return IPath.fromPortableString(pathString).toFile().toURI();
}
/**
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/resources/ProjectPreferencesTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/resources/ProjectPreferencesTest.java
index ef06fa64040..d606a198c40 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/resources/ProjectPreferencesTest.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/resources/ProjectPreferencesTest.java
@@ -34,7 +34,6 @@
import java.util.Arrays;
import java.util.List;
import java.util.Properties;
-
import org.eclipse.core.internal.preferences.EclipsePreferences;
import org.eclipse.core.internal.resources.ProjectPreferences;
import org.eclipse.core.resources.IFile;
@@ -47,7 +46,7 @@
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.ILogListener;
-import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
@@ -341,7 +340,7 @@ public void testProjectMove() {
}
// move project
try {
- project1.move(new Path(project2.getName()), false, null);
+ project1.move(IPath.fromOSString(project2.getName()), false, null);
} catch (CoreException e) {
fail("2.0", e);
}
@@ -1016,7 +1015,7 @@ public void test_384151() throws BackingStoreException, CoreException {
String oldProjectValue = projectNode.get(Platform.PREF_LINE_SEPARATOR, null);
String qualifier = "qualifier";
- IFile file = project.getFile(new Path(".settings/" + qualifier + ".prefs"));
+ IFile file = project.getFile(IPath.fromOSString(".settings/" + qualifier + ".prefs"));
Preferences node = rootNode.node(ProjectScope.SCOPE).node(project.getName()).node(qualifier);
String key = "key";
try {
@@ -1219,7 +1218,7 @@ private static IProject getProject(String name) {
}
private static IFile getFileInWorkspace(IProject project, String qualifier) {
- return project.getFile(new Path(DIR_NAME).append(qualifier).addFileExtension(FILE_EXTENSION));
+ return project.getFile(IPath.fromOSString(DIR_NAME).append(qualifier).addFileExtension(FILE_EXTENSION));
}
private static File getFileInFilesystem(IProject project, String qualifier) {
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/utils/FileUtilTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/utils/FileUtilTest.java
index ea241f627ff..ced64f1e023 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/utils/FileUtilTest.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/utils/FileUtilTest.java
@@ -18,7 +18,6 @@
import org.eclipse.core.filesystem.URIUtil;
import org.eclipse.core.internal.utils.FileUtil;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.tests.filesystem.FileSystemTest;
/**
@@ -47,7 +46,7 @@ public void testRealPath() throws Exception {
if (EFS.getLocalFileSystem().isCaseSensitive()) {
testPath = realPath;
} else {
- testPath = Path.fromOSString(realPath.toOSString().toLowerCase());
+ testPath = IPath.fromOSString(realPath.toOSString().toLowerCase());
}
assertEquals(realPath, FileUtil.realPath(testPath));
}
@@ -59,7 +58,7 @@ public void testRealPathOfNonexistingFile() throws Exception {
if (EFS.getLocalFileSystem().isCaseSensitive()) {
testPath = realPath;
} else {
- testPath = Path.fromOSString(realPath.toOSString().toLowerCase());
+ testPath = IPath.fromOSString(realPath.toOSString().toLowerCase());
}
String suffix = "NonexistingDir/NonexistingFile.txt";
assertEquals(realPath.append(suffix), FileUtil.realPath(testPath.append(suffix)));
@@ -72,7 +71,7 @@ public void testRealURI() throws Exception {
if (EFS.getLocalFileSystem().isCaseSensitive()) {
testPath = realPath;
} else {
- testPath = Path.fromOSString(realPath.toOSString().toLowerCase());
+ testPath = IPath.fromOSString(realPath.toOSString().toLowerCase());
}
URI realURI = URIUtil.toURI(realPath);
URI testURI = URIUtil.toURI(testPath);
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/watson/ElementTreeIteratorTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/watson/ElementTreeIteratorTest.java
index af8e715da45..3fdfa2a69a5 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/watson/ElementTreeIteratorTest.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/watson/ElementTreeIteratorTest.java
@@ -18,9 +18,11 @@
import java.util.ArrayList;
import java.util.Stack;
-import org.eclipse.core.internal.watson.*;
+import org.eclipse.core.internal.watson.ElementTree;
+import org.eclipse.core.internal.watson.ElementTreeIterator;
+import org.eclipse.core.internal.watson.IElementContentVisitor;
+import org.eclipse.core.internal.watson.IElementTreeData;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.junit.Test;
/**
@@ -39,7 +41,7 @@ public Object clone() {
return null;
}
};
- IPath sol = Path.ROOT.append("sol");
+ IPath sol = IPath.ROOT.append("sol");
tree.createElement(sol, data);
for (int p = 0; p < num; p++) {
IPath proj = sol.append("proj" + p);
@@ -71,13 +73,13 @@ public void testConcurrentModification() {
};
Thread reader = new Thread((Runnable) () -> {
for (int i = 0; i < 80000; i++) {
- new ElementTreeIterator(tree, Path.ROOT).iterate(visitor);
+ new ElementTreeIterator(tree, IPath.ROOT).iterate(visitor);
}
}, "Holmes (reader)");
Thread writer = new Thread((Runnable) () -> {
for (int i = 0; i < 1000; i++) {
modifyTree(tree);
- recursiveDelete(tree, Path.ROOT);
+ recursiveDelete(tree, IPath.ROOT);
setupElementTree(tree, 3);
}
}, "Doyle (writer)");
@@ -102,11 +104,11 @@ public void testContentIterator() {
elts.add(requestor.requestPath());
return true;
};
- new ElementTreeIterator(tree, Path.ROOT).iterate(elementVisitor);
+ new ElementTreeIterator(tree, IPath.ROOT).iterate(elementVisitor);
assertEquals("1", 2 + n + n * n + n * n * n, elts.size());
elts.clear();
- IPath innerElement = Path.ROOT.append("sol").append("proj1");
+ IPath innerElement = IPath.ROOT.append("sol").append("proj1");
new ElementTreeIterator(tree, innerElement).iterate(elementVisitor);
assertEquals("2", 1 + n + n * n, elts.size());
}
@@ -137,7 +139,7 @@ public void pushAll(IPath[] array) {
}
}
MyStack toModify = new MyStack();
- IPath[] children = tree.getChildren(Path.ROOT);
+ IPath[] children = tree.getChildren(IPath.ROOT);
toModify.pushAll(children);
while (!toModify.isEmpty()) {
IPath visit = toModify.pop();
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/watson/IPathConstants.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/watson/IPathConstants.java
index e4e6ec4d40f..de2bee0f885 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/watson/IPathConstants.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/watson/IPathConstants.java
@@ -14,7 +14,6 @@
package org.eclipse.core.tests.internal.watson;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
/**
* Testing interface containing various paths.
@@ -25,7 +24,7 @@ interface IPathConstants {
* The following paths are used in the tree created by
* ElementTreeTestUtilities.createTestElementTree()
*/
- IPath root = Path.ROOT;
+ IPath root = IPath.ROOT;
IPath solution = root.append("solution");
IPath project1 = solution.append("project1");
IPath project2 = solution.append("project2");
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/watson/TestUtil.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/watson/TestUtil.java
index 90b86c99430..427422b70bb 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/watson/TestUtil.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/watson/TestUtil.java
@@ -20,9 +20,10 @@
import java.util.ArrayList;
import java.util.Random;
-import org.eclipse.core.internal.watson.*;
+import org.eclipse.core.internal.watson.ElementTree;
+import org.eclipse.core.internal.watson.ElementTreeWriter;
+import org.eclipse.core.internal.watson.IElementComparator;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
/**
* Framework for running tests on element tree components.
@@ -39,7 +40,7 @@ class TestUtil implements IPathConstants {
* @param actual the actual value of a tree
*/
static protected void assertEqualTrees(String message, ElementTree expected, ElementTree actual) {
- assertEqualTrees(message, expected, actual, Path.ROOT, ElementTreeWriter.D_INFINITE);
+ assertEqualTrees(message, expected, actual, IPath.ROOT, ElementTreeWriter.D_INFINITE);
}
/**
@@ -108,7 +109,7 @@ static protected void assertNoPaths(ElementTree tree, IPath[] paths) {
static protected void assertTreeStructure(ElementTree tree) {
assertHasPaths(tree, getTreePaths());
- IPath[] children = tree.getChildren(Path.ROOT);
+ IPath[] children = tree.getChildren(IPath.ROOT);
assertEquals(1, children.length);
/* solution children */
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/watson/TreeFlatteningTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/watson/TreeFlatteningTest.java
index 220432614f9..4bf4aa16b33 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/watson/TreeFlatteningTest.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/watson/TreeFlatteningTest.java
@@ -18,12 +18,15 @@
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
-import java.io.*;
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.IOException;
import java.util.Arrays;
import org.eclipse.core.internal.resources.SaveManager;
-import org.eclipse.core.internal.watson.*;
+import org.eclipse.core.internal.watson.ElementTree;
+import org.eclipse.core.internal.watson.ElementTreeReader;
+import org.eclipse.core.internal.watson.ElementTreeWriter;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.junit.Before;
import org.junit.Test;
@@ -243,7 +246,7 @@ public void testNullData() {
public void testWriteRoot() {
/* Get an element tree from somewhere. */
fTree = TestUtil.createTestElementTree();
- fSubtreePath = Path.ROOT;
+ fSubtreePath = IPath.ROOT;
ElementTree newTree = (ElementTree) doPipeTest();
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/CharsetTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/CharsetTest.java
index 0f9e9894585..fa548fb155c 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/CharsetTest.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/CharsetTest.java
@@ -29,7 +29,6 @@
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
-
import org.eclipse.core.internal.events.NotificationManager;
import org.eclipse.core.internal.preferences.EclipsePreferences;
import org.eclipse.core.internal.resources.CharsetDeltaJob;
@@ -56,7 +55,6 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.content.IContentDescription;
import org.eclipse.core.runtime.content.IContentType;
@@ -1306,7 +1304,7 @@ public void testMovingProject() throws CoreException {
assertEquals("1.3", "FOO", project1.getDefaultCharset());
// move project and ensures charsets settings are preserved
- project1.move(new Path("Project2"), false, null);
+ project1.move(IPath.fromOSString("Project2"), false, null);
project2 = workspace.getRoot().getProject("Project2");
folder = project2.getFolder("folder1");
file1 = project2.getFile("file1.txt");
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/IFileTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/IFileTest.java
index ca3d23b77f8..4fc13d79646 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/IFileTest.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/IFileTest.java
@@ -31,7 +31,6 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.core.tests.harness.FussyProgressMonitor;
import org.junit.Test;
@@ -109,29 +108,29 @@ protected void generateInterestingFiles() throws CoreException {
*/
public void generateInterestingFiles(IContainer container) {
//non-existent file
- IFile file = container.getFile(new Path(DOES_NOT_EXIST));
+ IFile file = container.getFile(IPath.fromOSString(DOES_NOT_EXIST));
nonExistingFiles.add(file);
allFiles.add(file);
//exists in file system only
- file = container.getFile(new Path(LOCAL_ONLY));
+ file = container.getFile(IPath.fromOSString(LOCAL_ONLY));
localOnlyFiles.add(file);
allFiles.add(file);
if (existsAndOpen(container)) {
//existing file
- file = container.getFile(new Path(EXISTING));
+ file = container.getFile(IPath.fromOSString(EXISTING));
existingFiles.add(file);
allFiles.add(file);
//exists in workspace only
- file = container.getFile(new Path(WORKSPACE_ONLY));
+ file = container.getFile(IPath.fromOSString(WORKSPACE_ONLY));
workspaceOnlyFiles.add(file);
allFiles.add(file);
//exists in both but is out of sync
- file = container.getFile(new Path(OUT_OF_SYNC));
+ file = container.getFile(IPath.fromOSString(OUT_OF_SYNC));
outOfSyncFiles.add(file);
allFiles.add(file);
}
@@ -1029,7 +1028,7 @@ public void testInvalidFileNames() {
}
for (String name : names) {
monitor.prepare();
- IFile file = project.getFile(Path.fromPortableString(name));
+ IFile file = project.getFile(IPath.fromPortableString(name));
assertTrue("1.0 " + name, !file.exists());
try {
file.create(getRandomContents(), true, monitor);
@@ -1158,7 +1157,7 @@ public void testSetContents2() {
@Test
public void testSetGetFolderPersistentProperty() throws Throwable {
- IResource target = getWorkspace().getRoot().getFile(new Path("/Project/File.txt"));
+ IResource target = getWorkspace().getRoot().getFile(IPath.fromOSString("/Project/File.txt"));
String value = "this is a test property value";
QualifiedName name = new QualifiedName("itp-test", "testProperty");
// getting/setting persistent properties on non-existent resources should throw an exception
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 c1ec6a5b714..a3436ad6a0b 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
@@ -13,8 +13,15 @@
*******************************************************************************/
package org.eclipse.core.tests.resources;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.QualifiedName;
public class IFolderTest extends ResourceTest {
@Override
@@ -217,7 +224,7 @@ public void testFolderCreation() throws Exception {
// try to create a folder on a project (one segment) path
try {
- target = getWorkspace().getRoot().getFolder(new Path("/Folder3"));
+ target = getWorkspace().getRoot().getFolder(IPath.fromOSString("/Folder3"));
fail("6.0");
} catch (IllegalArgumentException e) {
// expected
@@ -272,7 +279,7 @@ public void testFolderMove() throws Throwable {
// create the resources and set some content in a file that will be moved.
ensureExistsInWorkspace(before, true);
String content = getRandomString();
- IFile file = project.getFile(new Path("b/b/z"));
+ IFile file = project.getFile(IPath.fromOSString("b/b/z"));
file.setContents(getContents(content), true, false, getMonitor());
// Be sure the resources exist and then move them.
@@ -282,12 +289,12 @@ public void testFolderMove() throws Throwable {
//
assertDoesNotExistInWorkspace("2.0", before);
assertExistsInWorkspace(after);
- file = project.getFile(new Path("a/b/z"));
+ file = project.getFile(IPath.fromOSString("a/b/z"));
assertTrue("2.1", compareContent(getContents(content), file.getContents(false)));
}
public void testFolderOverFile() throws Throwable {
- IPath path = new Path("/Project/File");
+ IPath path = IPath.fromOSString("/Project/File");
IFile existing = getWorkspace().getRoot().getFile(path);
ensureExistsInWorkspace(existing, true);
IFolder target = getWorkspace().getRoot().getFolder(path);
@@ -380,7 +387,7 @@ public void testReadOnlyFolderCopy() throws Exception {
}
public void testSetGetFolderPersistentProperty() throws Throwable {
- IResource target = getWorkspace().getRoot().getFolder(new Path("/Project/Folder"));
+ IResource target = getWorkspace().getRoot().getFolder(IPath.fromOSString("/Project/Folder"));
String value = "this is a test property value";
QualifiedName name = new QualifiedName("itp-test", "testProperty");
// getting/setting persistent properties on non-existent resources should throw an exception
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/IPathVariableTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/IPathVariableTest.java
index 05b14799bb7..8edb15da714 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/IPathVariableTest.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/IPathVariableTest.java
@@ -21,7 +21,6 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
-
import org.eclipse.core.filesystem.URIUtil;
import org.eclipse.core.internal.resources.ICoreConstants;
import org.eclipse.core.internal.resources.Project;
@@ -35,7 +34,6 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
/**
@@ -187,7 +185,7 @@ public void testGetPathVariableNames() {
// add another
try {
- manager.setValue("two", Path.ROOT);
+ manager.setValue("two", IPath.ROOT);
} catch (CoreException e) {
fail("2.0", e);
}
@@ -224,11 +222,11 @@ public void testGetPathVariableNames() {
*/
public void testGetSetValue() {
boolean WINDOWS = java.io.File.separatorChar == '\\';
- IPath pathOne = WINDOWS ? new Path("C:\\testGetSetValue") : new Path("/testGetSetValue");
- IPath pathTwo = new Path("/blort/backup");
+ IPath pathOne = WINDOWS ? IPath.fromOSString("C:\\testGetSetValue") : IPath.fromOSString("/testGetSetValue");
+ IPath pathTwo = IPath.fromOSString("/blort/backup");
//add device if necessary
- pathTwo = new Path(pathTwo.toFile().getAbsolutePath());
- IPath pathOneEdit = WINDOWS ? new Path("D:/foobar") : new Path("/foobar");
+ pathTwo = IPath.fromOSString(pathTwo.toFile().getAbsolutePath());
+ IPath pathOneEdit = WINDOWS ? IPath.fromOSString("D:/foobar") : IPath.fromOSString("/foobar");
// nothing to begin with
assertNull("0.0", manager.getValue("one"));
@@ -273,7 +271,7 @@ public void testGetSetValue() {
// set values with bogus names
try {
- manager.setValue("ECLIPSE$HOME", Path.ROOT);
+ manager.setValue("ECLIPSE$HOME", IPath.ROOT);
fail("5.0 Accepted invalid variable name in setValue()");
} catch (CoreException ce) {
// success
@@ -281,7 +279,7 @@ public void testGetSetValue() {
// set value with relative path
try {
- manager.setValue("one", new Path("foo/bar"));
+ manager.setValue("one", IPath.fromOSString("foo/bar"));
} catch (CoreException ce) {
fail("5.0 Did not Accepted invalid variable value in setValue()");
}
@@ -289,9 +287,9 @@ public void testGetSetValue() {
// set invalid value (with invalid segment)
if (WINDOWS) {
String invalidPathString = "C:/a/\\::/b";
- IPath invalidPath = Path.fromPortableString(invalidPathString);
+ IPath invalidPath = IPath.fromPortableString(invalidPathString);
assertTrue("6.0", invalidPath.isAbsolute());
- assertTrue("6.1", !Path.EMPTY.isValidPath(invalidPathString));
+ assertTrue("6.1", !IPath.EMPTY.isValidPath(invalidPathString));
assertTrue("6.2", manager.validateValue(invalidPath).isOK());
try {
manager.setValue("one", invalidPath);
@@ -308,7 +306,7 @@ public void testGetSetValue() {
public void testIsDefined() {
assertTrue("0.0", !manager.isDefined("one"));
try {
- manager.setValue("one", Path.ROOT);
+ manager.setValue("one", IPath.ROOT);
} catch (CoreException e) {
fail("1.0", e);
}
@@ -326,10 +324,10 @@ public void testIsDefined() {
*/
public void testResolvePathWithMacro() {
final boolean WINDOWS = java.io.File.separatorChar == '\\';
- IPath pathOne = WINDOWS ? new Path("c:/testGetSetValue/foo") : new Path("/testGetSetValue/foo");
- IPath pathTwo = WINDOWS ? new Path("c:/tmp/backup") : new Path("/tmp/backup");
+ IPath pathOne = WINDOWS ? IPath.fromOSString("c:/testGetSetValue/foo") : IPath.fromOSString("/testGetSetValue/foo");
+ IPath pathTwo = WINDOWS ? IPath.fromOSString("c:/tmp/backup") : IPath.fromOSString("/tmp/backup");
// add device if neccessary
- pathTwo = new Path(pathTwo.toFile().getAbsolutePath());
+ pathTwo = IPath.fromOSString(pathTwo.toFile().getAbsolutePath());
try {
manager.setValue("one", pathOne);
@@ -343,13 +341,13 @@ public void testResolvePathWithMacro() {
}
try {
- manager.setValue("three", Path.fromOSString("${two}/extra"));
+ manager.setValue("three", IPath.fromOSString("${two}/extra"));
} catch (CoreException e) {
fail("0.3", e);
}
- IPath path = new Path("three/bar");
- IPath expected = new Path("/tmp/backup/extra/bar").setDevice(WINDOWS ? "c:" : null);
+ IPath path = IPath.fromOSString("three/bar");
+ IPath expected = IPath.fromOSString("/tmp/backup/extra/bar").setDevice(WINDOWS ? "c:" : null);
IPath actual = manager.resolvePath(path);
assertEquals("1.0", expected, actual);
}
@@ -357,7 +355,7 @@ public void testResolvePathWithMacro() {
/**
*/
public void testProjectLoc() {
- IPath path = new Path("${PROJECT_LOC}/bar");
+ IPath path = IPath.fromOSString("${PROJECT_LOC}/bar");
IPath projectLocation = project.getLocation();
IPath expected = projectLocation.append("bar");
@@ -368,8 +366,8 @@ public void testProjectLoc() {
/**
*/
public void testEclipseHome() {
- IPath path = new Path("${ECLIPSE_HOME}/bar");
- IPath expected = new Path(Platform.getInstallLocation().getURL().getPath()).append("bar");
+ IPath path = IPath.fromOSString("${ECLIPSE_HOME}/bar");
+ IPath expected = IPath.fromOSString(Platform.getInstallLocation().getURL().getPath()).append("bar");
IPath actual = manager.resolvePath(path);
assertEquals("1.0", expected, actual);
}
@@ -377,7 +375,7 @@ public void testEclipseHome() {
/**
*/
public void testWorkspaceLocation() {
- IPath path = new Path("${WORKSPACE_LOC}/bar");
+ IPath path = IPath.fromOSString("${WORKSPACE_LOC}/bar");
IPath expected = project.getWorkspace().getRoot().getLocation().append("bar");
IPath actual = manager.resolvePath(path);
assertEquals("1.0", expected, actual);
@@ -393,20 +391,20 @@ public void testGetVariableRelativePathLocation() {
IPath expected;
/* Does not work on the test machine because ECLIPSE_HOME and WORKSPACE is the same location
actual = getVariableRelativePathLocation(project, path);
- expected = new Path("WORKSPACE_LOC/bar");
+ expected = IPath.fromOSString("WORKSPACE_LOC/bar");
assertEquals("1.0", expected, actual);
*/
- path = new Path(Platform.getInstallLocation().getURL().getPath()).append("bar");
- expected = new Path("ECLIPSE_HOME/bar");
+ path = IPath.fromOSString(Platform.getInstallLocation().getURL().getPath()).append("bar");
+ expected = IPath.fromOSString("ECLIPSE_HOME/bar");
actual = getVariableRelativePathLocation(project, path);
assertEquals("2.0", expected, actual);
path = project.getLocation().append("bar");
- expected = new Path("PROJECT_LOC/bar");
+ expected = IPath.fromOSString("PROJECT_LOC/bar");
actual = getVariableRelativePathLocation(project, path);
assertEquals("3.0", expected, actual);
- actual = getVariableRelativePathLocation(project, new Path("/nonExistentPath/foo"));
+ actual = getVariableRelativePathLocation(project, IPath.fromOSString("/nonExistentPath/foo"));
assertEquals("4.0", null, actual);
}
@@ -423,10 +421,10 @@ private IPath getVariableRelativePathLocation(IProject project, IPath location)
*/
public void testResolvePath() {
final boolean WINDOWS = java.io.File.separatorChar == '\\';
- IPath pathOne = WINDOWS ? new Path("C:/testGetSetValue/foo") : new Path("/testGetSetValue/foo");
- IPath pathTwo = new Path("/blort/backup");
+ IPath pathOne = WINDOWS ? IPath.fromOSString("C:/testGetSetValue/foo") : IPath.fromOSString("/testGetSetValue/foo");
+ IPath pathTwo = IPath.fromOSString("/blort/backup");
//add device if necessary
- pathTwo = new Path(pathTwo.toFile().getAbsolutePath());
+ pathTwo = IPath.fromOSString(pathTwo.toFile().getAbsolutePath());
try {
// for WINDOWS - the device id for windows will be changed to upper case
@@ -442,47 +440,47 @@ public void testResolvePath() {
}
// one substitution
- IPath path = new Path("one/bar");
- IPath expected = new Path("/testGetSetValue/foo/bar").setDevice(WINDOWS ? "C:" : null);
+ IPath path = IPath.fromOSString("one/bar");
+ IPath expected = IPath.fromOSString("/testGetSetValue/foo/bar").setDevice(WINDOWS ? "C:" : null);
IPath actual = manager.resolvePath(path);
assertEquals("1.0", expected, actual);
// another substitution
- path = new Path("two/myworld");
- expected = new Path("/blort/backup/myworld");
- expected = new Path(expected.toFile().getAbsolutePath());
+ path = IPath.fromOSString("two/myworld");
+ expected = IPath.fromOSString("/blort/backup/myworld");
+ expected = IPath.fromOSString(expected.toFile().getAbsolutePath());
actual = manager.resolvePath(path);
assertEquals("2.0", expected, actual);
// variable not defined
- path = new Path("three/nothere");
+ path = IPath.fromOSString("three/nothere");
expected = path;
actual = manager.resolvePath(path);
assertEquals("3.0", expected, actual);
// device
- path = new Path("/one").setDevice(WINDOWS ? "C:" : null);
+ path = IPath.fromOSString("/one").setDevice(WINDOWS ? "C:" : null);
expected = path;
actual = manager.resolvePath(path);
assertEquals("4.0", expected, actual);
// device2
if (WINDOWS) {
- path = new Path("C:two");
+ path = IPath.fromOSString("C:two");
expected = path;
actual = manager.resolvePath(path);
assertEquals("5.0", expected, actual);
}
// absolute
- path = new Path("/one");
+ path = IPath.fromOSString("/one");
expected = path;
actual = manager.resolvePath(path);
assertEquals("6.0", expected, actual);
// just resolving, check if the variable stored in the manager is canonicalized
if (WINDOWS) {
- path = new Path("one");
+ path = IPath.fromOSString("one");
expected = FileUtil.canonicalPath(pathOne);
actual = manager.resolvePath(path);
// the path stored in the manager is canonicalized, so the device id of actual will be upper case
@@ -504,10 +502,10 @@ private IPath convertToRelative(IPathVariableManager manager, IPath path, boolea
*/
public void testConvertToRelative() {
final boolean WINDOWS = java.io.File.separatorChar == '\\';
- IPath pathOne = WINDOWS ? new Path("c:/foo/bar") : new Path("/foo/bar");
- IPath pathTwo = WINDOWS ? new Path("c:/foo/other") : new Path("/foo/other");
- IPath pathThree = WINDOWS ? new Path("c:/random/other/subpath") : new Path("/random/other/subpath");
- IPath file = WINDOWS ? new Path("c:/foo/other/file.txt") : new Path("/foo/other/file.txt");
+ IPath pathOne = WINDOWS ? IPath.fromOSString("c:/foo/bar") : IPath.fromOSString("/foo/bar");
+ IPath pathTwo = WINDOWS ? IPath.fromOSString("c:/foo/other") : IPath.fromOSString("/foo/other");
+ IPath pathThree = WINDOWS ? IPath.fromOSString("c:/random/other/subpath") : IPath.fromOSString("/random/other/subpath");
+ IPath file = WINDOWS ? IPath.fromOSString("c:/foo/other/file.txt") : IPath.fromOSString("/foo/other/file.txt");
try {
manager.setValue("ONE", pathOne);
@@ -544,7 +542,7 @@ public void testConvertToRelative() {
} catch (CoreException e) {
fail("2.1", e);
}
- expected = new Path("TWO/file.txt");
+ expected = IPath.fromOSString("TWO/file.txt");
assertEquals("3.0", expected, actual);
// force the path to be relative to "ONE"
@@ -553,7 +551,7 @@ public void testConvertToRelative() {
} catch (CoreException e) {
fail("3.1", e);
}
- expected = new Path("PARENT-1-ONE/other/file.txt");
+ expected = IPath.fromOSString("PARENT-1-ONE/other/file.txt");
assertEquals("4.0", expected, actual);
// the second time should be re-using "FOO"
@@ -562,7 +560,7 @@ public void testConvertToRelative() {
} catch (CoreException e) {
fail("4.3", e);
}
- expected = new Path("PARENT-1-ONE/other/file.txt");
+ expected = IPath.fromOSString("PARENT-1-ONE/other/file.txt");
assertEquals("5.0", expected, actual);
try {
@@ -570,7 +568,7 @@ public void testConvertToRelative() {
} catch (CoreException e) {
fail("5.4", e);
}
- expected = new Path("TWO/file.txt");
+ expected = IPath.fromOSString("TWO/file.txt");
assertEquals("6.0", expected, actual);
try {
@@ -578,7 +576,7 @@ public void testConvertToRelative() {
} catch (CoreException e) {
fail("6.1", e);
}
- expected = new Path("TWO/file.txt");
+ expected = IPath.fromOSString("TWO/file.txt");
assertEquals("7.0", expected, actual);
try {
@@ -586,7 +584,7 @@ public void testConvertToRelative() {
} catch (CoreException e) {
fail("7.1", e);
}
- expected = new Path("TWO/file.txt");
+ expected = IPath.fromOSString("TWO/file.txt");
assertEquals("8.0", expected, actual);
try {
@@ -609,7 +607,7 @@ public void testConvertToRelative() {
} catch (CoreException e) {
fail("9.1", e);
}
- expected = new Path("PARENT-1-ONE/other/file.txt");
+ expected = IPath.fromOSString("PARENT-1-ONE/other/file.txt");
assertEquals("10.0", expected, actual);
}
@@ -637,7 +635,7 @@ public void testValidateName() {
* Regression test for Bug 304195
*/
public void testEmptyURIResolution() {
- IPath path = new Path(new String());
+ IPath path = IPath.fromOSString(new String());
URI uri = URIUtil.toURI(path);
try {
manager.resolveURI(uri);
@@ -657,9 +655,9 @@ public void testEmptyURIResolution() {
public void testListeners() {
PathVariableChangeVerifier listener = new PathVariableChangeVerifier();
manager.addChangeListener(listener);
- IPath pathOne = new Path("/blort/foobar");
+ IPath pathOne = IPath.fromOSString("/blort/foobar");
//add device if necessary
- pathOne = new Path(pathOne.toFile().getAbsolutePath());
+ pathOne = IPath.fromOSString(pathOne.toFile().getAbsolutePath());
IPath pathOneEdit = pathOne.append("myworld");
try {
@@ -789,7 +787,7 @@ public void testLinkExistInProjectDescriptionButNotInWorkspace() {
* existing IFile.
*/
public void testDiscoverLocationOfInvalidFile() {
- IPath filep = new Path("someFile");
+ IPath filep = IPath.fromOSString("someFile");
IPath invalidChild = filep.append("invalidChild");
// Create filep
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/IProjectTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/IProjectTest.java
index d0353417351..56dd0a4cb80 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/IProjectTest.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/IProjectTest.java
@@ -22,8 +22,25 @@
import org.eclipse.core.filesystem.IFileStore;
import org.eclipse.core.internal.resources.Resource;
import org.eclipse.core.internal.resources.Workspace;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IProjectNature;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.IResourceVisitor;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.IWorkspaceRunnable;
+import org.eclipse.core.resources.ProjectScope;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.core.tests.harness.FussyProgressMonitor;
import org.osgi.service.prefs.BackingStoreException;
@@ -271,7 +288,7 @@ public void testPathVariableLocation() throws CoreException {
final String projectName = "Project";
final String varName = "ProjectLocatio";
IPath varValue = Platform.getLocation().removeLastSegments(1);
- IPath rawLocation = new Path(varName).append("ProjectLocation");
+ IPath rawLocation = IPath.fromOSString(varName).append("ProjectLocation");
//define the variable
getWorkspace().getPathVariableManager().setValue(varName, varValue);
IProject project = getWorkspace().getRoot().getProject(projectName);
@@ -2483,7 +2500,7 @@ public void testWorkspaceNotificationMove() throws CoreException {
monitor.assertUsedUp();
assertTrue("1.4", project.exists());
monitor.prepare();
- project.move(new Path("MyNewProject"), IResource.FORCE, monitor);
+ project.move(IPath.fromOSString("MyNewProject"), IResource.FORCE, monitor);
monitor.assertUsedUp();
assertEquals("1.6", 1, count[0]);
assertFalse("1.7", project.exists());
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/IResourceDeltaTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/IResourceDeltaTest.java
index 3751de1fb27..d1cbca73f4b 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/IResourceDeltaTest.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/IResourceDeltaTest.java
@@ -13,9 +13,15 @@
*******************************************************************************/
package org.eclipse.core.tests.resources;
-import org.eclipse.core.resources.*;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.IPath;
/**
* Tests the public API of IResourceDelta
@@ -98,8 +104,8 @@ public void testFindMember() {
//delta with no children
delta = delta.findMember(file1.getProjectRelativePath());
- assertEquals("3.1", delta, delta.findMember(Path.ROOT));
- assertNull("3.2", delta.findMember(new Path("foo")));
+ assertEquals("3.1", delta, delta.findMember(IPath.ROOT));
+ assertNull("3.2", delta.findMember(IPath.fromOSString("foo")));
};
getWorkspace().addResourceChangeListener(listener);
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 bbecc5cc15e..7e21ffc5a2b 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
@@ -53,7 +53,6 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
@@ -216,7 +215,7 @@ private IResource[] buildSampleResources(IContainer root) {
// 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"});
ensureExistsInWorkspace(result, true);
- result[result.length - 1] = root.getFolder(new Path("2/"));
+ 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"});
@@ -241,7 +240,7 @@ private static IPath[] getInterestingPaths() {
"2/3", "2/4", "2/1/", "2/2/", "2/3/", "2/4/", ".." };
IPath[] paths = new IPath[interestingPathnames.length];
for (int i = 0; i < interestingPathnames.length; i++) {
- paths[i] = new Path(interestingPathnames[i]);
+ paths[i] = IPath.fromOSString(interestingPathnames[i]);
}
return paths;
}
@@ -971,8 +970,8 @@ public boolean visit(IResource toVisit) throws CoreException {
IContainer container = (IContainer) toVisit;
for (String element : list) {
File file = new File(target, element);
- IResource child = file.isFile() ? (IResource) container.getFile(new Path(element))
- : container.getFolder(new Path(element));
+ IResource child = file.isFile() ? (IResource) container.getFile(IPath.fromOSString(element))
+ : container.getFolder(IPath.fromOSString(element));
if (!child.exists()) {
visit(child);
}
@@ -994,7 +993,7 @@ public void testCopyProjectWithResFilterToExternLocation() throws CoreException
// prepare destination project description.
IProject destProj = getWorkspace().getRoot().getProject("testCopyProject" + 2);
- IProjectDescription desc = prepareDestProjDesc(sourceProj, destProj, new Path(FileSystemHelper
+ IProjectDescription desc = prepareDestProjDesc(sourceProj, destProj, IPath.fromOSString(FileSystemHelper
.getRandomLocation(FileSystemHelper.getTempDir()).append(destProj.getName()).toOSString()));
LogListener logListener = copyProject(sourceProj, desc);
@@ -1015,7 +1014,7 @@ public void testCopyProjectWithoutResFilterToExternLocation() throws CoreExcepti
// prepare destination project description.
IProject destProj = getWorkspace().getRoot().getProject("testCopyProject" + 2);
- IProjectDescription desc = prepareDestProjDesc(sourceProj, destProj, new Path(FileSystemHelper
+ IProjectDescription desc = prepareDestProjDesc(sourceProj, destProj, IPath.fromOSString(FileSystemHelper
.getRandomLocation(FileSystemHelper.getTempDir()).append(destProj.getName()).toOSString()));
LogListener logListener = copyProject(sourceProj, desc);
@@ -1062,7 +1061,7 @@ private LogListener copyProject(IProject sourceProj, IProjectDescription desc) t
return logListener;
}
- private IProjectDescription prepareDestProjDesc(IProject sourceProj, IProject destProj, Path destLocation)
+ private IProjectDescription prepareDestProjDesc(IProject sourceProj, IProject destProj, IPath destLocation)
throws CoreException {
ensureDoesNotExistInWorkspace(destProj);
IProjectDescription desc = sourceProj.getDescription();
@@ -1852,7 +1851,7 @@ public void testGetModificationStamp() {
* has changed.
*/
public void testGetModificationStampAfterReplace() throws Exception {
- final IFile file = getWorkspace().getRoot().getFile(new Path("/project/f"));
+ final IFile file = getWorkspace().getRoot().getFile(IPath.fromOSString("/project/f"));
create(file, true);
long modificationStamp = file.getModificationStamp();
@@ -1963,8 +1962,8 @@ public void testGetRawLocation() {
assertEquals("7.3", projectLocation.append(deepFile.getProjectRelativePath()), deepFile.getRawLocation());
project.open(getMonitor());
- IPath variableFolderLocation = new Path(variableName).append("/VarFolderName");
- IPath variableFileLocation = new Path(variableName).append("/VarFileName");
+ IPath variableFolderLocation = IPath.fromOSString(variableName).append("/VarFolderName");
+ IPath variableFileLocation = IPath.fromOSString(variableName).append("/VarFileName");
ensureDoesNotExistInWorkspace(topFolder);
ensureDoesNotExistInWorkspace(topFile);
createFileInFileSystem(EFS.getFileSystem(EFS.SCHEME_FILE).getStore(varMan.resolvePath(variableFileLocation)));
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/IWorkspaceRootTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/IWorkspaceRootTest.java
index 70b67823017..b86b76051ce 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/IWorkspaceRootTest.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/IWorkspaceRootTest.java
@@ -20,8 +20,17 @@
import org.eclipse.core.filesystem.EFS;
import org.eclipse.core.filesystem.IFileStore;
import org.eclipse.core.filesystem.URIUtil;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.IWorkspaceRunnable;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.core.tests.internal.filesystem.wrapper.WrapperFileSystem;
import org.junit.Assume;
import org.junit.Test;
@@ -229,7 +238,7 @@ private void testFindFilesForLocation(IProject project) {
//existing file with different case
if (!isCaseSensitive(existing)) {
- IPath differentCase = new Path(existingFileLocation.toOSString().toUpperCase());
+ IPath differentCase = IPath.fromOSString(existingFileLocation.toOSString().toUpperCase());
result = root.findFilesForLocation(differentCase);
assertResources("5.0", existing, result);
result = root.findFilesForLocationURI(existing.getLocationURI());
@@ -292,7 +301,7 @@ public void testGetContainerForLocation() {
@Test
public void testGetFile() {
IWorkspaceRoot root = getWorkspace().getRoot();
- IFile file = root.getFile(new Path("//P1/a.txt"));
+ IFile file = root.getFile(IPath.fromOSString("//P1/a.txt"));
assertTrue("1.0", !file.getFullPath().isUNC());
}
@@ -566,7 +575,7 @@ private void checkFindContainers(URI location, int memberFlags, int foundResourc
}
private IFile createFile(IContainer parent, int updateFlags, boolean linked) {
- IFile file = parent.getFile(new Path(getUniqueString()));
+ IFile file = parent.getFile(IPath.fromOSString(getUniqueString()));
try {
if (linked) {
try {
@@ -589,7 +598,7 @@ private IFile createFile(IContainer parent, int updateFlags, boolean linked) {
}
private IFolder createFolder(IContainer parent, int updateFlags, boolean linked) {
- IFolder folder = parent.getFolder(new Path(getUniqueString()));
+ IFolder folder = parent.getFolder(IPath.fromOSString(getUniqueString()));
try {
if (linked) {
IPath path = getTempDir().append(getUniqueString());
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 7c956e88355..2733319b647 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
@@ -21,9 +21,26 @@
import java.net.URISyntaxException;
import org.eclipse.core.internal.resources.TestingSupport;
import org.eclipse.core.internal.resources.Workspace;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
-import org.osgi.framework.*;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFilterMatcherDescriptor;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IProjectNatureDescriptor;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.IWorkspaceDescription;
+import org.eclipse.core.resources.IWorkspaceRunnable;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.FrameworkUtil;
+import org.osgi.framework.ServiceReference;
public class IWorkspaceTest extends ResourceTest {
@@ -943,39 +960,39 @@ public void testValidateProjectLocation() {
IProject project = workspace.getRoot().getProject("Project");
/* normal path */
- assertTrue("1.1", workspace.validateProjectLocation(project, new Path("/one/two/three/four/")).isOK());
+ assertTrue("1.1", workspace.validateProjectLocation(project, IPath.fromOSString("/one/two/three/four/")).isOK());
/* invalid characters (windows only) */
final boolean WINDOWS = isWindows();
if (WINDOWS) {
- assertFalse("2.1", workspace.validateProjectLocation(project, new Path("d:\\dsa:sf")).isOK());
- assertFalse("2.2", workspace.validateProjectLocation(project, new Path("/abc/*dsasf")).isOK());
- assertFalse("2.3", workspace.validateProjectLocation(project, new Path("/abc/?dsasf")).isOK());
- assertFalse("2.4", workspace.validateProjectLocation(project, new Path("/abc/\"dsasf")).isOK());
- assertFalse("2.5", workspace.validateProjectLocation(project, new Path("/abc/dsasf")).isOK());
- assertFalse("2.7", workspace.validateProjectLocation(project, new Path("/abc/|dsasf")).isOK());
- assertFalse("2.8", workspace.validateProjectLocation(project, new Path("/abc/\"dsasf")).isOK());
+ assertFalse("2.1", workspace.validateProjectLocation(project, IPath.fromOSString("d:\\dsa:sf")).isOK());
+ assertFalse("2.2", workspace.validateProjectLocation(project, IPath.fromOSString("/abc/*dsasf")).isOK());
+ assertFalse("2.3", workspace.validateProjectLocation(project, IPath.fromOSString("/abc/?dsasf")).isOK());
+ assertFalse("2.4", workspace.validateProjectLocation(project, IPath.fromOSString("/abc/\"dsasf")).isOK());
+ assertFalse("2.5", workspace.validateProjectLocation(project, IPath.fromOSString("/abc/dsasf")).isOK());
+ assertFalse("2.7", workspace.validateProjectLocation(project, IPath.fromOSString("/abc/|dsasf")).isOK());
+ assertFalse("2.8", workspace.validateProjectLocation(project, IPath.fromOSString("/abc/\"dsasf")).isOK());
//trailing dots invalid on Windows
- assertFalse("3.1", workspace.validateProjectLocation(project, new Path("/abc/.../defghi")).isOK());
- assertFalse("3.2", workspace.validateProjectLocation(project, new Path("/abc/..../defghi")).isOK());
- assertFalse("3.3", workspace.validateProjectLocation(project, new Path("/abc/def..../ghi")).isOK());
+ assertFalse("3.1", workspace.validateProjectLocation(project, IPath.fromOSString("/abc/.../defghi")).isOK());
+ assertFalse("3.2", workspace.validateProjectLocation(project, IPath.fromOSString("/abc/..../defghi")).isOK());
+ assertFalse("3.3", workspace.validateProjectLocation(project, IPath.fromOSString("/abc/def..../ghi")).isOK());
} else {
- assertTrue("3.1", workspace.validateProjectLocation(project, new Path("/abc/.../defghi")).isOK());
- assertTrue("3.2", workspace.validateProjectLocation(project, new Path("/abc/..../defghi")).isOK());
- assertTrue("3.3", workspace.validateProjectLocation(project, new Path("/abc/def..../ghi")).isOK());
+ assertTrue("3.1", workspace.validateProjectLocation(project, IPath.fromOSString("/abc/.../defghi")).isOK());
+ assertTrue("3.2", workspace.validateProjectLocation(project, IPath.fromOSString("/abc/..../defghi")).isOK());
+ assertTrue("3.3", workspace.validateProjectLocation(project, IPath.fromOSString("/abc/def..../ghi")).isOK());
}
/* dots */
- assertTrue("3.4", workspace.validateProjectLocation(project, new Path("/abc/....def/ghi")).isOK());
- assertTrue("3.5", workspace.validateProjectLocation(project, new Path("/abc/def....ghi/jkl")).isOK());
+ assertTrue("3.4", workspace.validateProjectLocation(project, IPath.fromOSString("/abc/....def/ghi")).isOK());
+ assertTrue("3.5", workspace.validateProjectLocation(project, IPath.fromOSString("/abc/def....ghi/jkl")).isOK());
/* test hiding incorrect characters using .. and device separator : */
- assertTrue("4.1", workspace.validateProjectLocation(project, new Path("/abc/.?./../def/as")).isOK());
- assertTrue("4.2", workspace.validateProjectLocation(project, new Path("/abc/;*?\"'/../def/safd")).isOK());
+ assertTrue("4.1", workspace.validateProjectLocation(project, IPath.fromOSString("/abc/.?./../def/as")).isOK());
+ assertTrue("4.2", workspace.validateProjectLocation(project, IPath.fromOSString("/abc/;*?\"'/../def/safd")).isOK());
assertFalse("4.3",
- (workspace.validateProjectLocation(project, new Path("c:/abc;*?\"':/def/asdf/sadf")).isOK()));
+ (workspace.validateProjectLocation(project, IPath.fromOSString("c:/abc;*?\"':/def/asdf/sadf")).isOK()));
// cannot overlap the platform directory
IPath platformLocation = Platform.getLocation();
@@ -999,17 +1016,17 @@ public void testValidateProjectLocation() {
//cannot be a relative path
assertFalse("7.1", workspace.validateProjectLocation(project, new Path("u:", "")).isOK());
- assertFalse("7.2", workspace.validateProjectLocation(project, new Path("c:")).isOK());
- assertFalse("7.3", workspace.validateProjectLocation(project, new Path("c:foo")).isOK());
- assertFalse("7.4", workspace.validateProjectLocation(project, new Path("foo/bar")).isOK());
- assertFalse("7.5", workspace.validateProjectLocation(project, new Path("c:foo/bar")).isOK());
+ assertFalse("7.2", workspace.validateProjectLocation(project, IPath.fromOSString("c:")).isOK());
+ assertFalse("7.3", workspace.validateProjectLocation(project, IPath.fromOSString("c:foo")).isOK());
+ assertFalse("7.4", workspace.validateProjectLocation(project, IPath.fromOSString("foo/bar")).isOK());
+ assertFalse("7.5", workspace.validateProjectLocation(project, IPath.fromOSString("c:foo/bar")).isOK());
//may be relative to an existing path variable
final String PATH_VAR_NAME = "FOOVAR";
final IPath PATH_VAR_VALUE = getRandomLocation();
try {
try {
- IPath varPath = new Path(PATH_VAR_NAME);
+ IPath varPath = IPath.fromOSString(PATH_VAR_NAME);
workspace.getPathVariableManager().setValue(PATH_VAR_NAME, PATH_VAR_VALUE);
assertTrue("8.1", workspace.validateProjectLocation(project, varPath).isOK());
assertTrue("8.2", workspace.validateProjectLocation(project, varPath.append("test")).isOK());
@@ -1089,10 +1106,10 @@ public void testValidateProjectLocation() {
assertFalse("12.2", (workspace.validateProjectLocation(metadataProject, null)).isOK());
// FIXME: Should this be valid?
- assertTrue("23.1", workspace.validateProjectLocation(project, new Path("/asf")).isOK());
- assertTrue("23.2", workspace.validateProjectLocation(project, new Path("/project/.metadata")).isOK());
+ assertTrue("23.1", workspace.validateProjectLocation(project, IPath.fromOSString("/asf")).isOK());
+ assertTrue("23.2", workspace.validateProjectLocation(project, IPath.fromOSString("/project/.metadata")).isOK());
// FIXME: Should this be valid?
- assertTrue("23.3", workspace.validateProjectLocation(project, new Path("/.metadata/project")).isOK());
+ assertTrue("23.3", workspace.validateProjectLocation(project, IPath.fromOSString("/.metadata/project")).isOK());
}
/**
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/LinkedResourceTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/LinkedResourceTest.java
index 4f7f04c4925..1df82f40926 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/LinkedResourceTest.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/LinkedResourceTest.java
@@ -21,7 +21,6 @@
import java.io.IOException;
import java.net.URI;
import java.util.HashMap;
-
import org.eclipse.core.filesystem.EFS;
import org.eclipse.core.filesystem.IFileStore;
import org.eclipse.core.filesystem.URIUtil;
@@ -43,7 +42,6 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.tests.harness.CancelingProgressMonitor;
import org.eclipse.core.tests.harness.FussyProgressMonitor;
@@ -147,10 +145,10 @@ protected void setUp() throws Exception {
File dir = existingProject.getLocation().toFile();
dir = dir.getParentFile();
dir = new File(dir + File.separator + "sub");
- deleteOnTearDown(Path.fromOSString(dir.getAbsolutePath()));
+ deleteOnTearDown(IPath.fromOSString(dir.getAbsolutePath()));
dir = new File(dir + File.separator + "dir" + File.separator + "more" + File.separator + "proj");
dir.mkdirs();
- desc.setLocation(Path.fromOSString(dir.getAbsolutePath()));
+ desc.setLocation(IPath.fromOSString(dir.getAbsolutePath()));
existingProjectInSubDirectory.create(desc, getMonitor());
}
if (!existingProjectInSubDirectory.isOpen()) {
@@ -206,9 +204,9 @@ public void testAllowMissingLocal() {
//try to create with local path that can never exist
if (isWindows()) {
- location = new Path("b:\\does\\not\\exist");
+ location = IPath.fromOSString("b:\\does\\not\\exist");
} else {
- location = new Path("/dev/null/does/not/exist");
+ location = IPath.fromOSString("/dev/null/does/not/exist");
}
location = FileUtil.canonicalPath(location);
try {
@@ -736,7 +734,7 @@ public void testCreateFolderInBackground() throws CoreException {
*/
public void testCreateLinkCaseVariant() {
IFolder link = nonExistingFolderInExistingProject;
- IFolder variant = link.getParent().getFolder(new Path(link.getName().toUpperCase()));
+ IFolder variant = link.getParent().getFolder(IPath.fromOSString(link.getName().toUpperCase()));
ensureExistsInWorkspace(variant, true);
try {
@@ -1440,7 +1438,7 @@ public boolean wasSuccess(Object[] args, Object result, Object[] oldState) throw
*/
public void testValidateEmptyLinkLocation() {
IFolder folder = nonExistingFolderInExistingProject;
- IPath newLocation = new Path("");
+ IPath newLocation = IPath.fromOSString("");
URI newLocationURI = URIUtil.toURI(newLocation);
try {
IStatus linkedResourceStatus = getWorkspace().validateLinkLocation(folder, newLocation);
@@ -1464,7 +1462,7 @@ public void testLocationWithColon() {
try {
//Note that on *nix, "c:/temp" is a relative path with two segments
//so this is treated as relative to an undefined path variable called "c:".
- IPath location = new Path("c:/temp");
+ IPath location = IPath.fromOSString("c:/temp");
folder.createLink(location, IResource.ALLOW_MISSING_LOCAL, getMonitor());
assertEquals("1.0", location, folder.getRawLocation());
} catch (CoreException e) {
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/LinkedResourceWithPathVariableTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/LinkedResourceWithPathVariableTest.java
index 6b5abe25bef..779282508e0 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/LinkedResourceWithPathVariableTest.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/LinkedResourceWithPathVariableTest.java
@@ -16,14 +16,29 @@
package org.eclipse.core.tests.resources;
-import java.io.*;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
import java.net.URI;
import java.util.ArrayList;
-import org.eclipse.core.filesystem.*;
+import org.eclipse.core.filesystem.EFS;
+import org.eclipse.core.filesystem.IFileInfo;
+import org.eclipse.core.filesystem.IFileStore;
import org.eclipse.core.filesystem.URIUtil;
import org.eclipse.core.internal.resources.Workspace;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IPathVariableManager;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceStatus;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.tests.harness.FileSystemHelper;
/**
@@ -50,7 +65,8 @@ protected void setUp() throws Exception {
toDelete.add(base);
super.setUp();
existingProject.getPathVariableManager().setValue(PROJECT_VARIABLE_NAME, base);
- existingProject.getPathVariableManager().setValue(PROJECT_RELATIVE_VARIABLE_NAME, Path.fromPortableString(PROJECT_RELATIVE_VARIABLE_VALUE));
+ existingProject.getPathVariableManager().setValue(PROJECT_RELATIVE_VARIABLE_NAME,
+ IPath.fromPortableString(PROJECT_RELATIVE_VARIABLE_VALUE));
}
@Override
@@ -122,7 +138,7 @@ protected void convertLineEndings(IFileStore inStore, IFileStore outStore, IProg
public IPath getRandomLocation() {
IPathVariableManager pathVars = getWorkspace().getPathVariableManager();
//low order bits are current time, high order bits are static counter
- IPath parent = new Path(VARIABLE_NAME);
+ IPath parent = IPath.fromOSString(VARIABLE_NAME);
IPath path = FileSystemHelper.computeRandomLocation(parent);
while (pathVars.resolvePath(path).toFile().exists()) {
try {
@@ -142,7 +158,7 @@ public IPath getRandomLocation() {
public IPath getRandomProjectLocation() {
IPathVariableManager pathVars = getWorkspace().getPathVariableManager();
// low order bits are current time, high order bits are static counter
- IPath parent = new Path(PROJECT_VARIABLE_NAME);
+ IPath parent = IPath.fromOSString(PROJECT_VARIABLE_NAME);
IPath path = FileSystemHelper.computeRandomLocation(parent);
while (pathVars.resolvePath(path).toFile().exists()) {
try {
@@ -162,7 +178,7 @@ public IPath getRandomProjectLocation() {
public IPath getRandomRelativeProjectLocation() {
IPathVariableManager pathVars = getWorkspace().getPathVariableManager();
// low order bits are current time, high order bits are static counter
- IPath parent = new Path(PROJECT_RELATIVE_VARIABLE_NAME);
+ IPath parent = IPath.fromOSString(PROJECT_RELATIVE_VARIABLE_NAME);
IPath path = FileSystemHelper.computeRandomLocation(parent);
while (pathVars.resolvePath(path).toFile().exists()) {
try {
@@ -461,8 +477,9 @@ public void testPROJECT_LOC_MoveFileToDifferentProject() {
toDelete.add(targetPath);
try {
- existingProjectInSubDirectory.getPathVariableManager().setValue("P_RELATIVE", Path.fromPortableString("${PARENT-3-PROJECT_LOC}"));
- variableBasedLocation = Path.fromPortableString("P_RELATIVE/outside.txt");
+ existingProjectInSubDirectory.getPathVariableManager().setValue("P_RELATIVE",
+ IPath.fromPortableString("${PARENT-3-PROJECT_LOC}"));
+ variableBasedLocation = IPath.fromPortableString("P_RELATIVE/outside.txt");
} catch (CoreException e1) {
fail("0.99", e1);
}
@@ -970,8 +987,8 @@ public void testFolderProjectVariableRemoved() {
* Tests scenario where links are relative to undefined variables
*/
public void testUndefinedVariable() {
- IPath folderLocation = new Path("NOVAR/folder");
- IPath fileLocation = new Path("NOVAR/abc.txt");
+ IPath folderLocation = IPath.fromOSString("NOVAR/folder");
+ IPath fileLocation = IPath.fromOSString("NOVAR/abc.txt");
IFile testFile = existingProject.getFile("UndefinedVar.txt");
IFolder testFolder = existingProject.getFolder("UndefinedVarTest");
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 aaca204ebcb..ef73b2fde6a 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
@@ -14,13 +14,41 @@
*******************************************************************************/
package org.eclipse.core.tests.resources;
-import java.io.*;
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
import java.io.File;
-import java.util.*;
-import org.eclipse.core.internal.resources.*;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Map;
+import java.util.Vector;
+import org.eclipse.core.internal.resources.MarkerManager;
+import org.eclipse.core.internal.resources.MarkerReader;
+import org.eclipse.core.internal.resources.Resource;
+import org.eclipse.core.internal.resources.ResourceInfo;
+import org.eclipse.core.internal.resources.Workspace;
import org.eclipse.core.internal.watson.IPathRequestor;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceVisitor;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.IWorkspaceRunnable;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.InstanceScope;
@@ -366,7 +394,7 @@ protected void assertExists(String message, IMarker marker) {
public IResource[] createLargeHierarchy() {
ArrayList result = new ArrayList<>();
result.add("/");
- new MarkerTest().addChildren(result, Path.ROOT, 3, 4);
+ new MarkerTest().addChildren(result, IPath.ROOT, 3, 4);
String[] names = result.toArray(new String[result.size()]);
IResource[] created = buildResources(getWorkspace().getRoot(), names);
ensureExistsInWorkspace(created, true);
@@ -498,7 +526,7 @@ public void testCreateMarker() {
}
// try creating a marker on a resource which does't exist
- IResource testResource = getWorkspace().getRoot().getFile(new Path("non/existant/resource"));
+ IResource testResource = getWorkspace().getRoot().getFile(IPath.fromOSString("non/existant/resource"));
assertTrue("3.0", !testResource.exists());
try {
testResource.createMarker(IMarker.PROBLEM);
@@ -555,7 +583,7 @@ public void testCreateNullMarkerWithAttributesShouldFail() {
public void testCreateMarkerWithAttributesOnAResourceWhichDoesNotExistShouldFail() {
// try creating a marker on a resource which does't exist
- IResource testResource = getWorkspace().getRoot().getFile(new Path("non/existant/resource"));
+ IResource testResource = getWorkspace().getRoot().getFile(IPath.fromOSString("non/existant/resource"));
assertTrue("Resource should not exist", !testResource.exists());
try {
testResource.createMarker(IMarker.PROBLEM, Map.of(IMarker.MESSAGE, "My text"));
@@ -1203,7 +1231,7 @@ public void testMarkerDeltasCopyResource() {
for (IProject project : projects) {
IResource[] children = project.members();
for (IResource element : children) {
- IPath destination = new Path(element.getName() + "copy");
+ IPath destination = IPath.fromOSString(element.getName() + "copy");
element.copy(destination, true, getMonitor());
}
}
@@ -1220,7 +1248,7 @@ public void testMarkerDeltasCopyResource() {
// if (!resource.getName().endsWith("copy"))
// return false;
// String name = resource.getFullPath().segment(0);
- // IPath path = new Path(name.substring(0, name.length() - 4)).makeAbsolute();
+ // IPath path = IPath.fromOSString(name.substring(0, name.length() - 4)).makeAbsolute();
// path = path.append(resource.getFullPath().removeFirstSegments(1));
// IResource oldResource = ((Workspace) getWorkspace()).newResource(path, resource.getType());
// IMarker marker = (IMarker) table.get(oldResource);
@@ -1545,7 +1573,7 @@ public void testMarkerDeltasMoveProject() {
// move all resources
IProject[] projects = getWorkspace().getRoot().getProjects();
for (IProject project : projects) {
- IPath destination = new Path(project.getName() + "move");
+ IPath destination = IPath.fromOSString(project.getName() + "move");
try {
project.move(destination, true, getMonitor());
} catch (CoreException e) {
@@ -1559,7 +1587,7 @@ public void testMarkerDeltasMoveProject() {
return true;
}
String name = resource.getFullPath().segment(0);
- IPath path = new Path(name.substring(0, name.length() - 4)).makeAbsolute();
+ IPath path = IPath.fromOSString(name.substring(0, name.length() - 4)).makeAbsolute();
path = path.append(resource.getFullPath().removeFirstSegments(1));
IResource oldResource = ((Workspace) getWorkspace()).newResource(path, resource.getType());
IMarker marker = table.get(oldResource);
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/MarkersChangeListener.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/MarkersChangeListener.java
index 29ba38f3fc0..dd3640b089a 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/MarkersChangeListener.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/MarkersChangeListener.java
@@ -14,10 +14,16 @@
*******************************************************************************/
package org.eclipse.core.tests.resources;
-import java.util.*;
-import org.eclipse.core.resources.*;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Vector;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IMarkerDelta;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.IResourceDelta;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
/**
* A support class for the marker tests.
@@ -34,7 +40,7 @@ public MarkersChangeListener() {
* are exactly the added, removed and changed markers given. The arrays may be null.
*/
public boolean checkChanges(IResource resource, IMarker[] added, IMarker[] removed, IMarker[] changed) {
- IPath path = resource == null ? Path.ROOT : resource.getFullPath();
+ IPath path = resource == null ? IPath.ROOT : resource.getFullPath();
List v = changes.get(path);
if (v == null) {
v = new Vector<>();
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/NonLocalLinkedResourceTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/NonLocalLinkedResourceTest.java
index e56db4544ea..da583a576a7 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/NonLocalLinkedResourceTest.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/NonLocalLinkedResourceTest.java
@@ -13,10 +13,15 @@
*******************************************************************************/
package org.eclipse.core.tests.resources;
-import org.eclipse.core.filesystem.*;
-import org.eclipse.core.resources.*;
+import org.eclipse.core.filesystem.EFS;
+import org.eclipse.core.filesystem.IFileStore;
+import org.eclipse.core.filesystem.IFileSystem;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.tests.internal.filesystem.bogus.BogusFileSystem;
import org.eclipse.core.tests.internal.filesystem.ram.MemoryFileSystem;
import org.eclipse.core.tests.internal.filesystem.ram.MemoryTree;
@@ -33,7 +38,7 @@ public class NonLocalLinkedResourceTest extends ResourceTest {
*/
protected IFileStore createFolderStore(String name) {
IFileSystem system = getFileSystem();
- IFileStore store = system.getStore(Path.ROOT.append(name));
+ IFileStore store = system.getStore(IPath.ROOT.append(name));
try {
store.mkdir(EFS.NONE, getMonitor());
} catch (CoreException e) {
@@ -57,7 +62,7 @@ protected IFileStore getTempStore() {
IFileSystem system = getFileSystem();
IFileStore store;
do {
- store = system.getStore(Path.ROOT.append(Integer.toString(nextFolder++)));
+ store = system.getStore(IPath.ROOT.append(Integer.toString(nextFolder++)));
} while (store.fetchInfo().exists());
return store;
}
@@ -244,7 +249,7 @@ public void test342060() {
//move to linked destination should succeed
try {
- project.move(Path.fromPortableString("movedProject"), IResource.NONE, getMonitor());
+ project.move(IPath.fromPortableString("movedProject"), IResource.NONE, getMonitor());
} catch (CoreException e) {
fail("1.0", e);
}
@@ -252,10 +257,10 @@ public void test342060() {
protected IFileStore createBogusFolderStore(String name) {
IFileSystem system = getBogusFileSystem();
- IFileStore store = system.getStore(Path.ROOT.append(name));
+ IFileStore store = system.getStore(IPath.ROOT.append(name));
try {
deleteOnTearDown(
- Path.fromOSString(system.getStore(Path.ROOT).toLocalFile(EFS.NONE, getMonitor()).getPath()));
+ IPath.fromOSString(system.getStore(IPath.ROOT).toLocalFile(EFS.NONE, getMonitor()).getPath()));
store.mkdir(EFS.NONE, getMonitor());
} catch (CoreException e) {
fail("createFolderStore", e);
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/ProjectSnapshotTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/ProjectSnapshotTest.java
index 5b45d5ef7c5..efec75a2fa8 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/ProjectSnapshotTest.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/ProjectSnapshotTest.java
@@ -23,8 +23,15 @@
import org.eclipse.core.filesystem.IFileStore;
import org.eclipse.core.internal.resources.Project;
import org.eclipse.core.internal.resources.ProjectDescription;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
/**
* Tests API for save/load refresh snapshots introduced in 3.6M6 (bug 301563):
@@ -215,7 +222,7 @@ public void testLoadWithRename2() throws Throwable {
// perform refresh to ensure new resources in tree
project.refreshLocal(IResource.DEPTH_INFINITE, null);
// rename the project
- project.move(Path.ROOT.append("p0"), true, null);
+ project.move(IPath.ROOT.append("p0"), true, null);
project = getWorkspace().getRoot().getProject("p0");
// add two more files to probably provoke a tree delta chain
// In SaveManager.writeTree() line 1885, treesToSave.length must be 1
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/ResourceDeltaVerifier.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/ResourceDeltaVerifier.java
index cb52bcea178..7fa02cce1f8 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/ResourceDeltaVerifier.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/ResourceDeltaVerifier.java
@@ -17,7 +17,6 @@
import java.util.HashSet;
import java.util.Hashtable;
import java.util.Map;
-
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceChangeEvent;
@@ -25,7 +24,6 @@
import org.eclipse.core.resources.IResourceDelta;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.junit.Assert;
/**
@@ -564,16 +562,16 @@ public static void main(String[] args) {
int formerChildStatus = expectedStatus;
int latterChildStatus = actualStatus;
- IPath path = new Path("/a/b/c");
- IPath path2 = new Path("/a/b/d");
+ IPath path = IPath.fromOSString("/a/b/c");
+ IPath path2 = IPath.fromOSString("/a/b/d");
IPath expectedFullPath = path;
IPath actualFullPath = path2;
IPath expectedMovedFromPath = path;
IPath actualMovedFromPath = path2;
IPath expectedMovedToPath = path;
IPath actualMovedToPath = path2;
- IPath expectedProjectRelativePath = new Path("b/c");
- IPath actualProjectRelativePath = new Path("b/d");
+ IPath expectedProjectRelativePath = IPath.fromOSString("b/c");
+ IPath actualProjectRelativePath = IPath.fromOSString("b/d");
comparer.fMessage.append("Checking delta for ");
comparer.fMessage.append(path);
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/ResourceTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/ResourceTest.java
index c5c9421f3a2..4d5b0abdee5 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/ResourceTest.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/ResourceTest.java
@@ -62,7 +62,6 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
@@ -440,7 +439,7 @@ public IResource[] buildResources() {
public IResource[] buildResources(IContainer root, String[] hierarchy) {
IResource[] result = new IResource[hierarchy.length];
for (int i = 0; i < hierarchy.length; i++) {
- IPath path = new Path(hierarchy[i]);
+ IPath path = IPath.fromOSString(hierarchy[i]);
IPath fullPath = root.getFullPath().append(path);
switch (fullPath.segmentCount()) {
case 0 :
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/ResourceURLTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/ResourceURLTest.java
index 5ff3f2c4689..49bb4b1dbe1 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/ResourceURLTest.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/ResourceURLTest.java
@@ -19,8 +19,13 @@
import java.net.MalformedURLException;
import java.net.URL;
import org.eclipse.core.internal.resources.PlatformURLResourceConnection;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Platform;
/**
* Test suites for {@link org.eclipse.core.internal.resources.PlatformURLResourceConnection}
@@ -45,7 +50,7 @@ public ResourceURLTest(String name) {
private void checkURL(IResource resource) throws Throwable {
URL url = getURL(resource);
- IPath file = new Path(FileLocator.resolve(url).getFile());
+ IPath file = IPath.fromOSString(FileLocator.resolve(url).getFile());
IPath metric = resource.getLocation();
assertEquals(metric, file);
}
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 ed1c555d8a6..564e466f43e 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
@@ -20,8 +20,16 @@
import java.io.File;
import java.io.InputStream;
import org.eclipse.core.internal.resources.Workspace;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRunnable;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.core.tests.harness.FussyProgressMonitor;
/**
@@ -61,7 +69,7 @@ public void setGetPersistentProperty(IResource target) throws Throwable {
}
public void testFileDeletion() throws Throwable {
- IPath path = new Path("/testProject/testFileForDelete");
+ IPath path = IPath.fromOSString("/testProject/testFileForDelete");
IFile target = getWorkspace().getRoot().getFile(path);
FussyProgressMonitor monitor = new FussyProgressMonitor();
target.create(null, true, monitor);
@@ -74,7 +82,7 @@ public void testFileDeletion() throws Throwable {
}
public void testFileEmptyDeletion() throws Throwable {
- IPath path = new Path("/testProject/testFileForDelete2");
+ IPath path = IPath.fromOSString("/testProject/testFileForDelete2");
IFile target = getWorkspace().getRoot().getFile(path);
FussyProgressMonitor monitor = new FussyProgressMonitor();
target.create(getContents(""), true, monitor);
@@ -87,7 +95,7 @@ public void testFileEmptyDeletion() throws Throwable {
}
public void testFileInFolderCreation() throws Throwable {
- IPath path = new Path("/testProject/testFolder/testFile2");
+ IPath path = IPath.fromOSString("/testProject/testFolder/testFile2");
IFile target = getWorkspace().getRoot().getFile(path);
FussyProgressMonitor monitor = new FussyProgressMonitor();
target.create(getRandomContents(), true, monitor);
@@ -96,12 +104,12 @@ public void testFileInFolderCreation() throws Throwable {
}
public void testFileMove() throws Throwable {
- IPath path = new Path("/testProject/targetFile");
+ IPath path = IPath.fromOSString("/testProject/targetFile");
IFile target = getWorkspace().getRoot().getFile(path);
FussyProgressMonitor monitor = new FussyProgressMonitor();
target.create(getRandomContents(), true, monitor);
monitor.assertUsedUp();
- IFile destination = getWorkspace().getRoot().getFile(new Path("/testProject/movedFile"));
+ IFile destination = getWorkspace().getRoot().getFile(IPath.fromOSString("/testProject/movedFile"));
monitor.prepare();
target.move(destination.getFullPath(), true, monitor);
monitor.assertUsedUp();
@@ -110,7 +118,7 @@ public void testFileMove() throws Throwable {
}
public void testFileOverFolder() throws Throwable {
- IPath path = new Path("/testProject/testFolder");
+ IPath path = IPath.fromOSString("/testProject/testFolder");
IFolder existing = getWorkspace().getRoot().getFolder(path);
assertTrue(existing.exists());
IFile target = getWorkspace().getRoot().getFile(path);
@@ -145,7 +153,7 @@ public void testFolderMove() throws Throwable {
// create the resources and set some content in a file that will be moved.
ensureExistsInWorkspace(before, true);
String content = getRandomString();
- IFile file = project.getFile(new Path("b/b/z"));
+ IFile file = project.getFile(IPath.fromOSString("b/b/z"));
FussyProgressMonitor monitor = new FussyProgressMonitor();
file.setContents(getContents(content), true, false, monitor);
monitor.assertUsedUp();
@@ -159,12 +167,12 @@ public void testFolderMove() throws Throwable {
//
assertDoesNotExistInWorkspace(before);
assertExistsInWorkspace(after);
- file = project.getFile(new Path("a/b/z"));
+ file = project.getFile(IPath.fromOSString("a/b/z"));
assertTrue("get not equal set", compareContent(getContents(content), file.getContents(false)));
}
public void testFolderOverFile() throws Throwable {
- IPath path = new Path("/testProject/testFile");
+ IPath path = IPath.fromOSString("/testProject/testFile");
IFile existing = getWorkspace().getRoot().getFile(path);
assertTrue(existing.exists());
IFolder target = getWorkspace().getRoot().getFolder(path);
@@ -283,13 +291,13 @@ public void setUp() throws Exception {
target.open(monitor);
monitor.assertUsedUp();
assertTrue(target.isOpen());
- IPath path = new Path("/testProject/testFolder");
+ IPath path = IPath.fromOSString("/testProject/testFolder");
IFolder folderTarget = getWorkspace().getRoot().getFolder(path);
monitor = new FussyProgressMonitor();
folderTarget.create(true, true, monitor);
monitor.assertUsedUp();
assertTrue(folderTarget.exists());
- IPath filePath = new Path("/testProject/testFile");
+ IPath filePath = IPath.fromOSString("/testProject/testFile");
IFile fileTarget = getWorkspace().getRoot().getFile(filePath);
monitor = new FussyProgressMonitor();
fileTarget.create(null, true, monitor);
@@ -375,7 +383,7 @@ public void testDanglingReferences() throws Throwable {
}
public void testSetContents() throws Throwable {
- IPath path = new Path("/testProject/testFile");
+ IPath path = IPath.fromOSString("/testProject/testFile");
IFile target = getWorkspace().getRoot().getFile(path);
String testString = getRandomString();
FussyProgressMonitor monitor = new FussyProgressMonitor();
@@ -387,12 +395,12 @@ public void testSetContents() throws Throwable {
}
public void testSetGetFilePersistentProperty() throws Throwable {
- IResource target = getWorkspace().getRoot().getFile(new Path("/testProject/testFile"));
+ IResource target = getWorkspace().getRoot().getFile(IPath.fromOSString("/testProject/testFile"));
setGetPersistentProperty(target);
}
public void testSetGetFolderPersistentProperty() throws Throwable {
- IResource target = getWorkspace().getRoot().getFolder(new Path("/testProject/testFolder"));
+ IResource target = getWorkspace().getRoot().getFolder(IPath.fromOSString("/testProject/testFolder"));
setGetPersistentProperty(target);
}
@@ -402,7 +410,7 @@ public void testSetGetProjectPersistentProperty() throws Throwable {
}
public void testSetProperty() throws Throwable {
- IPath path = new Path("/testProject/testFile");
+ IPath path = IPath.fromOSString("/testProject/testFile");
IFile target = getWorkspace().getRoot().getFile(path);
String value = "this is a test property value";
QualifiedName name = new QualifiedName("itp-test", "testProperty");
@@ -411,12 +419,12 @@ public void testSetProperty() throws Throwable {
}
public void testSimpleMove() throws Throwable {
- IPath path = new Path("/testProject/simpleFile");
+ IPath path = IPath.fromOSString("/testProject/simpleFile");
IFile target = getWorkspace().getRoot().getFile(path);
FussyProgressMonitor monitor = new FussyProgressMonitor();
target.create(getRandomContents(), true, monitor);
monitor.assertUsedUp();
- IFile destination = getWorkspace().getRoot().getFile(new Path("/testProject/newSimpleFile"));
+ IFile destination = getWorkspace().getRoot().getFile(IPath.fromOSString("/testProject/newSimpleFile"));
monitor.prepare();
target.move(destination.getFullPath(), true, monitor);
monitor.assertUsedUp();
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/perf/BenchElementTree.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/perf/BenchElementTree.java
index 8aa90a2f324..793fbaf0f3b 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/perf/BenchElementTree.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/perf/BenchElementTree.java
@@ -17,7 +17,6 @@
import java.util.ArrayList;
import org.eclipse.core.internal.watson.ElementTree;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.tests.harness.PerformanceTestRunner;
import org.eclipse.core.tests.resources.OldCorePerformanceTest;
@@ -36,7 +35,7 @@ public class BenchElementTree extends OldCorePerformanceTest {
"StringIndexOutOfBoundsException.java", "System.java", "Thread.java", "ThreadDeath.java", "ThreadGroup.java", "Throwable.java", "UnknownError.java", "UnsatisfiedLinkError.java", //
"VerifyError.java", "VirtualMachineError.java", "Void.java"};
- static final IPath solution = Path.ROOT.append("solution");
+ static final IPath solution = IPath.ROOT.append("solution");
static final IPath project = solution.append("project");
static final IPath folder = project.append("folder");
static final IPath[] files = getFilePaths();
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/perf/LocalHistoryPerformanceTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/perf/LocalHistoryPerformanceTest.java
index dcfe37a4dae..ce3adb5f7c5 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/perf/LocalHistoryPerformanceTest.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/perf/LocalHistoryPerformanceTest.java
@@ -15,9 +15,15 @@
import org.eclipse.core.internal.localstore.IHistoryStore;
import org.eclipse.core.internal.resources.Workspace;
-import org.eclipse.core.resources.*;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.IWorkspaceDescription;
+import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.tests.harness.PerformanceTestRunner;
import org.eclipse.core.tests.internal.localstore.HistoryStoreTest;
import org.eclipse.core.tests.resources.ResourceTest;
@@ -144,7 +150,7 @@ protected void tearDown() {
IHistoryStore store = ((Workspace) getWorkspace()).getFileSystemManager().getHistoryStore();
// Remove all the entries from the history store index. Note that
// this does not cause the history store states to be removed.
- store.remove(Path.ROOT, getMonitor());
+ store.remove(IPath.ROOT, getMonitor());
// Now make sure all the states are really removed.
store.removeGarbage();
} catch (Exception e) {
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/perf/MarkerPerformanceTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/perf/MarkerPerformanceTest.java
index 5c676bb4f5a..8b76059a3b4 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/perf/MarkerPerformanceTest.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/perf/MarkerPerformanceTest.java
@@ -13,9 +13,12 @@
*******************************************************************************/
package org.eclipse.core.tests.resources.perf;
-import org.eclipse.core.resources.*;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.tests.harness.PerformanceTestRunner;
import org.eclipse.core.tests.resources.ResourceTest;
@@ -85,7 +88,7 @@ protected void setUp() throws Exception {
project = getWorkspace().getRoot().getProject("TestProject");
project.create(null);
project.open(null);
- file = project.getFile(Path.ROOT.append("file.txt"));
+ file = project.getFile(IPath.ROOT.append("file.txt"));
file.create(getRandomContents(), true, null);
//create markers
for (int i = 0; i < NUM_MARKERS; i++) {
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/regression/Bug_026294.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/regression/Bug_026294.java
index 72e9ad0a37f..5ecec388801 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/regression/Bug_026294.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/regression/Bug_026294.java
@@ -13,10 +13,16 @@
*******************************************************************************/
package org.eclipse.core.tests.resources.regression;
-import java.io.*;
-import org.eclipse.core.resources.*;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.tests.resources.ResourceTest;
/**
@@ -45,7 +51,7 @@ public void testDeleteOpenProjectWindows() {
IFile file1 = folder.getFile("file1.txt");
IFile file2 = project.getFile("file2.txt");
IFile file3 = folder.getFile("file3.txt");
- IFile projectFile = project.getFile(new Path(".project"));
+ IFile projectFile = project.getFile(IPath.fromOSString(".project"));
ensureExistsInWorkspace(new IResource[] {file1, file2, file3}, true);
projectRoot = project.getLocation().toFile();
@@ -215,7 +221,7 @@ public void testDeleteClosedProjectWindows() {
file1 = folder.getFile("file1.txt");
IFile file2 = project.getFile("file2.txt");
IFile file3 = folder.getFile("file3.txt");
- IFile projectFile = project.getFile(new Path(".project"));
+ IFile projectFile = project.getFile(IPath.fromOSString(".project"));
ensureExistsInWorkspace(new IResource[] {file1, file2, file3}, true);
@@ -293,7 +299,7 @@ public void testDeleteClosedProjectLinux() {
folder = project.getFolder("a_folder");
IFile file1 = folder.getFile("file1.txt");
IFile file2 = project.getFile("file2.txt");
- IFile projectFile = project.getFile(new Path(".project"));
+ IFile projectFile = project.getFile(IPath.fromOSString(".project"));
ensureExistsInWorkspace(new IResource[] {file1, file2}, true);
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/regression/Bug_027271.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/regression/Bug_027271.java
index 784a04b7da3..dc6c20a1762 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/regression/Bug_027271.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/regression/Bug_027271.java
@@ -15,7 +15,8 @@
import org.eclipse.core.resources.IPathVariableManager;
import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Preferences;
import org.eclipse.core.tests.resources.ResourceTest;
/**
@@ -61,20 +62,20 @@ public void testBug() {
Preferences prefs = ResourcesPlugin.getPlugin().getPluginPreferences();
assertEquals("1.0", 0, pvm.getPathVariableNames().length);
- prefs.setValue(VARIABLE_PREFIX + "VALID_VAR", new Path("c:/temp").toPortableString());
+ prefs.setValue(VARIABLE_PREFIX + "VALID_VAR", IPath.fromOSString("c:/temp").toPortableString());
assertEquals("1.1", 1, pvm.getPathVariableNames().length);
assertEquals("1.2", "VALID_VAR", pvm.getPathVariableNames()[0]);
//sets invalid value (relative path)
- IPath relativePath = new Path("temp");
+ IPath relativePath = IPath.fromOSString("temp");
prefs.setValue(VARIABLE_PREFIX + "INVALID_VAR", relativePath.toPortableString());
assertEquals("2.0", 1, pvm.getPathVariableNames().length);
assertEquals("2.1", "VALID_VAR", pvm.getPathVariableNames()[0]);
//sets invalid value (invalid path)
- IPath invalidPath = new Path("c:\\a\\:\\b");
+ IPath invalidPath = IPath.fromOSString("c:\\a\\:\\b");
prefs.setValue(VARIABLE_PREFIX + "ANOTHER_INVALID_VAR", invalidPath.toPortableString());
- assertTrue("3.0", !Path.EMPTY.isValidPath(invalidPath.toPortableString()));
+ assertTrue("3.0", !IPath.EMPTY.isValidPath(invalidPath.toPortableString()));
assertEquals("3.1", 1, pvm.getPathVariableNames().length);
assertEquals("3.2", "VALID_VAR", pvm.getPathVariableNames()[0]);
}
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/regression/Bug_029851.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/regression/Bug_029851.java
index 2734359e388..33f6d4e4655 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/regression/Bug_029851.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/regression/Bug_029851.java
@@ -16,7 +16,9 @@
import java.util.ArrayList;
import java.util.Collection;
import org.eclipse.core.resources.IResourceVisitor;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.core.tests.resources.ResourceTest;
/**
@@ -44,7 +46,7 @@ private Collection createChildren(int breadth, int depth, IPath prefix)
public String[] defineHierarchy() {
int depth = 3;
int breadth = 3;
- IPath prefix = new Path("/a/");
+ IPath prefix = IPath.fromOSString("/a/");
Collection result = createChildren(breadth, depth, prefix);
result.add(prefix.toString());
return result.toArray(new String[0]);
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/regression/Bug_132510.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/regression/Bug_132510.java
index 3a9d671c756..e9af27f07b4 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/regression/Bug_132510.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/regression/Bug_132510.java
@@ -14,11 +14,12 @@
*******************************************************************************/
package org.eclipse.core.tests.resources.regression;
-import java.util.*;
+import java.util.ConcurrentModificationException;
+import java.util.HashMap;
+import java.util.Iterator;
import org.eclipse.core.internal.resources.LinkDescription;
import org.eclipse.core.internal.resources.ProjectDescription;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.tests.resources.ResourceTest;
/**
@@ -27,8 +28,8 @@
public class Bug_132510 extends ResourceTest {
public void testBug() {
ProjectDescription desc = new ProjectDescription();
- IPath path1 = new Path("/a/b/");
- IPath path2 = new Path("/a/c/");
+ IPath path1 = IPath.fromOSString("/a/b/");
+ IPath path2 = IPath.fromOSString("/a/c/");
LinkDescription link = new LinkDescription();
desc.setLinkLocation(path1, link);
HashMap linkMap = desc.getLinks();
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/regression/Bug_303517.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/regression/Bug_303517.java
index 5497e86e163..ee97c2e5aaa 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/regression/Bug_303517.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/regression/Bug_303517.java
@@ -16,9 +16,12 @@
import java.io.File;
import java.io.InputStream;
-import org.eclipse.core.resources.*;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceStatus;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.InstanceScope;
@@ -60,7 +63,7 @@ protected void tearDown() throws Exception {
*/
public void testExists() throws Exception {
createHierarchy();
- IFile f = getWorkspace().getRoot().getFile(new Path(resources[resources.length - 1]));
+ IFile f = getWorkspace().getRoot().getFile(IPath.fromOSString(resources[resources.length - 1]));
assertTrue("1.0", f.exists());
assertTrue("1.1", f.isSynchronized(IResource.DEPTH_ONE));
@@ -89,7 +92,7 @@ public void testExists() throws Exception {
*/
public void testGetContents() throws Exception {
createHierarchy();
- IFile f = getWorkspace().getRoot().getFile(new Path(resources[resources.length - 1]));
+ IFile f = getWorkspace().getRoot().getFile(IPath.fromOSString(resources[resources.length - 1]));
assertTrue("1.0", f.exists());
assertTrue("1.1", f.isSynchronized(IResource.DEPTH_ONE));
@@ -123,7 +126,7 @@ public void testGetContents() throws Exception {
*/
public void testGetContentsTrue() throws Exception {
createHierarchy();
- IFile f = getWorkspace().getRoot().getFile(new Path(resources[resources.length - 1]));
+ IFile f = getWorkspace().getRoot().getFile(IPath.fromOSString(resources[resources.length - 1]));
assertTrue("1.0", f.exists());
assertTrue("1.1", f.isSynchronized(IResource.DEPTH_ONE));
@@ -162,7 +165,7 @@ public void testGetContentsTrue() throws Exception {
*/
public void testIsSynchronized() throws Exception {
createHierarchy();
- IFile f = getWorkspace().getRoot().getFile(new Path(resources[resources.length - 1]));
+ IFile f = getWorkspace().getRoot().getFile(IPath.fromOSString(resources[resources.length - 1]));
assertTrue("1.0", f.exists());
assertTrue("1.1", f.isSynchronized(IResource.DEPTH_ONE));
@@ -183,7 +186,7 @@ public void testIsSynchronized() throws Exception {
*/
public void testChangeResourceGender() throws Exception {
createHierarchy();
- IResource f = getWorkspace().getRoot().getFile(new Path(resources[resources.length - 1]));
+ IResource f = getWorkspace().getRoot().getFile(IPath.fromOSString(resources[resources.length - 1]));
assertTrue("1.0", f.exists());
assertTrue("1.1", f.isSynchronized(IResource.DEPTH_ONE));
@@ -206,7 +209,7 @@ public void testChangeResourceGender() throws Exception {
assertFalse("1.3", f.exists());
assertFalse("1.4", f.isSynchronized(IResource.DEPTH_ONE));
// Folder + child are now in-sync
- f = getWorkspace().getRoot().getFolder(new Path(resources[resources.length - 1]));
+ f = getWorkspace().getRoot().getFolder(IPath.fromOSString(resources[resources.length - 1]));
assertTrue("1.5", f.exists());
assertTrue("1.6", f.isSynchronized(IResource.DEPTH_INFINITE));
}
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/regression/Bug_331445.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/regression/Bug_331445.java
index 2bbae5db2f5..f3a9a9cc67b 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/regression/Bug_331445.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/regression/Bug_331445.java
@@ -15,9 +15,13 @@
import java.net.URI;
import java.net.URISyntaxException;
-import org.eclipse.core.resources.*;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.tests.resources.ResourceTest;
public class Bug_331445 extends ResourceTest {
@@ -44,13 +48,13 @@ public void testBug() {
IFolder folder = project.getFolder(getUniqueString());
try {
- folder.createLink(new Path(rawLinkFolderLocation), IResource.ALLOW_MISSING_LOCAL, getMonitor());
+ folder.createLink(IPath.fromOSString(rawLinkFolderLocation), IResource.ALLOW_MISSING_LOCAL, getMonitor());
} catch (CoreException e) {
fail("2.0", e);
}
assertNull("3.0", folder.getLocation());
- assertEquals("4.0", new Path(rawLinkFolderLocation), folder.getRawLocation());
+ assertEquals("4.0", IPath.fromOSString(rawLinkFolderLocation), folder.getRawLocation());
try {
assertEquals("5.0", new URI(linkFolderLocation), folder.getLocationURI());
} catch (URISyntaxException e) {
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/regression/IResourceTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/regression/IResourceTest.java
index 78569811aa9..8b181940d49 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/regression/IResourceTest.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/regression/IResourceTest.java
@@ -17,8 +17,27 @@
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import org.eclipse.core.filesystem.EFS;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.IResourceDeltaVisitor;
+import org.eclipse.core.resources.IResourceProxyVisitor;
+import org.eclipse.core.resources.IResourceStatus;
+import org.eclipse.core.resources.ISynchronizer;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.IWorkspaceRunnable;
+import org.eclipse.core.resources.ResourceAttributes;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.core.tests.resources.ResourceDeltaVerifier;
import org.eclipse.core.tests.resources.ResourceTest;
@@ -254,7 +273,7 @@ public void testCopy_1GA6QJP() {
fail("0.99", e);
}
- IPath destinationPath = new Path("copy of file");
+ IPath destinationPath = IPath.fromOSString("copy of file");
try {
source.copy(destinationPath, true, getMonitor());
} catch (CoreException e) {
@@ -506,8 +525,8 @@ public void testDelete_Bug8754() {
}
public void testEquals_1FUOU25() {
- IResource fileResource = getWorkspace().getRoot().getFile(new Path("a/b/c/d"));
- IResource folderResource = getWorkspace().getRoot().getFolder(new Path("a/b/c/d"));
+ IResource fileResource = getWorkspace().getRoot().getFile(IPath.fromOSString("a/b/c/d"));
+ IResource folderResource = getWorkspace().getRoot().getFolder(IPath.fromOSString("a/b/c/d"));
assertTrue("1FUOU25: ITPCORE:ALL - Bug in Resource.equals()", !fileResource.equals(folderResource));
}
@@ -555,11 +574,11 @@ public void testFindMember_1GA6QYV() {
fail("2.0", e);
}
- IPath targetPath = new Path("Folder2/Folder3");
+ IPath targetPath = IPath.fromOSString("Folder2/Folder3");
IFolder target = (IFolder) folder1.findMember(targetPath);
assertTrue("3.0", folder3.equals(target));
- targetPath = new Path("/Folder2/Folder3");
+ targetPath = IPath.fromOSString("/Folder2/Folder3");
target = (IFolder) folder1.findMember(targetPath);
assertTrue("4.0", folder3.equals(target));
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/session/ProjectPreferenceSessionTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/session/ProjectPreferenceSessionTest.java
index f7412bab4e4..5640c2f10cc 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/session/ProjectPreferenceSessionTest.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/session/ProjectPreferenceSessionTest.java
@@ -14,8 +14,14 @@
package org.eclipse.core.tests.resources.session;
import junit.framework.Test;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ProjectScope;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.ILogListener;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.preferences.IScopeContext;
import org.eclipse.core.tests.resources.AutomatedResourceTests;
import org.eclipse.core.tests.resources.WorkspaceSessionTest;
@@ -58,7 +64,7 @@ public void testDeleteFileBeforeLoad1() {
fail("1.99", e);
}
waitForRefresh();
- IFile file = project.getFile(new Path(DIR_NAME).append(qualifier).addFileExtension(FILE_EXTENSION));
+ IFile file = project.getFile(IPath.fromOSString(DIR_NAME).append(qualifier).addFileExtension(FILE_EXTENSION));
assertTrue("2.0", file.exists());
assertTrue("2.1", file.getLocation().toFile().exists());
}
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/session/TestBug30015.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/session/TestBug30015.java
index eec90955c9e..956731eb9fd 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/session/TestBug30015.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/session/TestBug30015.java
@@ -16,7 +16,9 @@
import junit.framework.Test;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectDescription;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.core.tests.resources.AutomatedResourceTests;
import org.eclipse.core.tests.resources.WorkspaceSessionTest;
import org.eclipse.core.tests.session.WorkspaceSessionTestSuite;
@@ -36,7 +38,7 @@ public class TestBug30015 extends WorkspaceSessionTest {
*/
public void test1() {
varValue = Platform.getLocation().removeLastSegments(1);
- rawLocation = new Path(VAR_NAME).append("ProjectLocation");
+ rawLocation = IPath.fromOSString(VAR_NAME).append("ProjectLocation");
//define the variable
try {
getWorkspace().getPathVariableManager().setValue(VAR_NAME, varValue);
@@ -66,7 +68,7 @@ public void test1() {
*/
public void test2() {
varValue = Platform.getLocation().removeLastSegments(1);
- rawLocation = new Path(VAR_NAME).append("ProjectLocation");
+ rawLocation = IPath.fromOSString(VAR_NAME).append("ProjectLocation");
IProject project = getWorkspace().getRoot().getProject(PROJECT_NAME);
assertEquals("1.0", varValue, getWorkspace().getPathVariableManager().getValue(VAR_NAME));
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/usecase/IFileTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/usecase/IFileTest.java
index c592bb86b88..d46cc18fa7b 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/usecase/IFileTest.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/usecase/IFileTest.java
@@ -13,8 +13,14 @@
*******************************************************************************/
package org.eclipse.core.tests.resources.usecase;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
public class IFileTest extends IResourceTest {
@@ -81,10 +87,10 @@ public void testFile() {
}
// Construct a folder handle without creating the folder.
- IFolder folder = proj.getFolder(new Path(FOLDER));
+ IFolder folder = proj.getFolder(IPath.fromOSString(FOLDER));
// Construct a file handle
- IFile file = folder.getFile(new Path(FILE));
+ IFile file = folder.getFile(IPath.fromOSString(FILE));
// Inspection methods with meaninful results invoked on a handle for a nonexistent folder.
assertTrue("3.1", !file.exists());
@@ -92,17 +98,17 @@ public void testFile() {
assertTrue("3.4", file.getProject().equals(proj));
assertTrue("3.5", file.getParent().equals(folder));
assertTrue("3.5", file.getType() == IResource.FILE);
- assertTrue("3.6", file.getFullPath().equals(new Path("/" + PROJECT + "/" + FOLDER + "/" + FILE)));
+ assertTrue("3.6", file.getFullPath().equals(IPath.fromOSString("/" + PROJECT + "/" + FOLDER + "/" + FILE)));
assertTrue("3.7", file.getName().equals(FILE));
- assertTrue("3.8", proj.getFolder(new Path(FOLDER)).equals(folder));
+ assertTrue("3.8", proj.getFolder(IPath.fromOSString(FOLDER)).equals(folder));
assertTrue("3.9", workspace.getRoot().getFile(file.getFullPath()).equals(file));
- IPath projRelativePath = new Path(FOLDER + "/" + FILE);
+ IPath projRelativePath = IPath.fromOSString(FOLDER + "/" + FILE);
assertTrue("3.11", proj.getFile(projRelativePath).equals(file));
- assertTrue("3.12", folder.getFile(new Path(FILE)).equals(file));
+ assertTrue("3.12", folder.getFile(IPath.fromOSString(FILE)).equals(file));
assertTrue("3.13", !workspace.getRoot().exists(file.getFullPath()));
- Path absolutePath = new Path(proj.getLocation().toOSString() + "/" + FOLDER + "/" + FILE);
+ IPath absolutePath = IPath.fromOSString(proj.getLocation().toOSString() + "/" + FOLDER + "/" + FILE);
assertTrue("3.14", file.getLocation().equals(absolutePath));
- assertTrue("3.15", file.getProjectRelativePath().equals(new Path(FOLDER + "/" + FILE)));
+ assertTrue("3.15", file.getProjectRelativePath().equals(IPath.fromOSString(FOLDER + "/" + FILE)));
// Create a folder.
try {
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/usecase/IFolderTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/usecase/IFolderTest.java
index 0e7feaa1613..33b0a2c2571 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/usecase/IFolderTest.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/usecase/IFolderTest.java
@@ -13,8 +13,14 @@
*******************************************************************************/
package org.eclipse.core.tests.resources.usecase;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
public class IFolderTest extends IResourceTest {
@@ -68,7 +74,7 @@ public void testFolder() {
// Construct a project handle.
IProject proj = workspace.getRoot().getProject(PROJECT);
// Construct a folder handle
- IPath path = new Path(FOLDER);
+ IPath path = IPath.fromOSString(FOLDER);
// Inspection methods with meaninful results invoked on a handle for a nonexistent folder
// in a nonexistent project.
@@ -77,12 +83,12 @@ public void testFolder() {
assertTrue("2.2", folder.getWorkspace().equals(workspace));
assertTrue("2.4", folder.getProject().equals(proj));
assertTrue("2.5", folder.getType() == IResource.FOLDER);
- assertTrue("2.6", folder.getFullPath().equals(new Path("/" + PROJECT + "/" + FOLDER)));
+ assertTrue("2.6", folder.getFullPath().equals(IPath.fromOSString("/" + PROJECT + "/" + FOLDER)));
assertTrue("2.7", folder.getName().equals(FOLDER));
assertTrue("2.8", workspace.getRoot().getFolder(folder.getFullPath()).equals(folder));
assertTrue("2.10", proj.getFolder(path).equals(folder));
assertTrue("2.11", folder.getParent().equals(proj));
- assertTrue("2.13", folder.getProjectRelativePath().equals(new Path(FOLDER)));
+ assertTrue("2.13", folder.getProjectRelativePath().equals(IPath.fromOSString(FOLDER)));
// Create a project without opening it.
try {
@@ -103,7 +109,7 @@ public void testFolder() {
// These tests produce failure because the folder does not exist yet.
nonexistentFolderFailureTests(folder, proj, workspace);
- Path absolutePath = new Path(proj.getLocation().toOSString() + "/" + FOLDER);
+ IPath absolutePath = IPath.fromOSString(proj.getLocation().toOSString() + "/" + FOLDER);
assertTrue("5", folder.getLocation().equals(absolutePath));
// Now create folder.
@@ -165,13 +171,13 @@ public void testFolder() {
assertTrue("10.1", nestedFolder.getWorkspace().equals(workspace));
assertTrue("10.3", nestedFolder.getProject().equals(proj));
assertTrue("10.4", nestedFolder.getType() == IResource.FOLDER);
- assertTrue("10.5", nestedFolder.getFullPath().equals(new Path("/" + PROJECT + "/" + FOLDER + "/" + FOLDER)));
+ assertTrue("10.5", nestedFolder.getFullPath().equals(IPath.fromOSString("/" + PROJECT + "/" + FOLDER + "/" + FOLDER)));
assertTrue("10.6", nestedFolder.getName().equals(FOLDER));
assertTrue("10.7", workspace.getRoot().getFolder(nestedFolder.getFullPath()).equals(nestedFolder));
- IPath projRelativePath = new Path(FOLDER + "/" + FOLDER);
+ IPath projRelativePath = IPath.fromOSString(FOLDER + "/" + FOLDER);
assertTrue("10.9", proj.getFolder(projRelativePath).equals(nestedFolder));
assertTrue("10.10", nestedFolder.getParent().equals(folder));
- assertTrue("10.11", nestedFolder.getProjectRelativePath().equals(new Path(FOLDER + "/" + FOLDER)));
+ assertTrue("10.11", nestedFolder.getProjectRelativePath().equals(IPath.fromOSString(FOLDER + "/" + FOLDER)));
// Now the parent folder has a kid.
assertTrue("10.12", folder.isLocal(IResource.DEPTH_ONE));
assertTrue("10.13", folder.isLocal(IResource.DEPTH_INFINITE));
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/usecase/IProjectTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/usecase/IProjectTest.java
index 11d6f63a4b6..3d7dd7e5a66 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/usecase/IProjectTest.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/usecase/IProjectTest.java
@@ -16,8 +16,14 @@
import java.util.Arrays;
import java.util.Hashtable;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.resources.ICommand;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
public class IProjectTest extends IResourceTest {
public static String LOCAL_LOCATION_PATH_STRING_0;
@@ -73,7 +79,7 @@ protected void nonexistentProjectFailureTests(IProject proj) {
// addMapping
try {
// Project must exist.
- proj.getDescription().setLocation(new Path(LOCAL_LOCATION_PATH_STRING_0));
+ proj.getDescription().setLocation(IPath.fromOSString(LOCAL_LOCATION_PATH_STRING_0));
fail(method + "1");
} catch (Exception e) {
// expected
@@ -118,14 +124,14 @@ public void testProject() {
assertTrue("1.1", !proj.exists());
assertTrue("1.2", proj.getWorkspace().equals(wb));
assertTrue("1.4", proj.getType() == IResource.PROJECT);
- assertTrue("1.5", proj.getFullPath().equals(new Path("/" + PROJECT)));
+ assertTrue("1.5", proj.getFullPath().equals(IPath.fromOSString("/" + PROJECT)));
assertTrue("1.6", proj.getName().equals(PROJECT));
assertTrue("1.9", !wb.getRoot().exists(proj.getFullPath()));
assertTrue("1.11", wb.getRoot().findMember(proj.getFullPath()) == null);
assertTrue("1.12", proj.getParent().equals(wb.getRoot()));
// Legal question inherited from IResource: returns the receiver.
assertTrue("1.13", proj.getProject().equals(proj));
- assertTrue("1.14", proj.getProjectRelativePath().equals(new Path("")));
+ assertTrue("1.14", proj.getProjectRelativePath().equals(IPath.fromOSString("")));
// Check that there are no projects.
assertTrue("6.1", wb.getRoot().getProjects().length == 0);
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/usecase/Snapshot2Test.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/usecase/Snapshot2Test.java
index e578236c415..c5d9f05506a 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/usecase/Snapshot2Test.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/usecase/Snapshot2Test.java
@@ -14,11 +14,13 @@
*******************************************************************************/
package org.eclipse.core.tests.resources.usecase;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.IPath;
/**
* This session add some resources to MyProject. All resources
@@ -32,9 +34,9 @@ protected static String[] defineHierarchy1() {
List result = new ArrayList<>();
String[] old = Snapshot1Test.defineHierarchy1();
result.addAll(Arrays.asList(old));
- result.add(new Path(PROJECT_1).append("added file").toString());
- result.add(new Path(PROJECT_1).append("yet another file").toString());
- result.add(new Path(PROJECT_1).append("a folder").addTrailingSeparator().toString());
+ result.add(IPath.fromOSString(PROJECT_1).append("added file").toString());
+ result.add(IPath.fromOSString(PROJECT_1).append("yet another file").toString());
+ result.add(IPath.fromOSString(PROJECT_1).append("a folder").addTrailingSeparator().toString());
return result.toArray(new String[result.size()]);
}
diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/usecase/Snapshot4Test.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/usecase/Snapshot4Test.java
index 3c4591f1e0e..f8ff1f01dee 100644
--- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/usecase/Snapshot4Test.java
+++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/usecase/Snapshot4Test.java
@@ -14,10 +14,16 @@
*******************************************************************************/
package org.eclipse.core.tests.resources.usecase;
-import java.util.*;
-import org.eclipse.core.resources.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.IPath;
/**
* Change some resources mixing full saves and snapshots.
@@ -28,9 +34,9 @@ protected static String[] defineHierarchy1() {
List result = new ArrayList<>();
String[] old = Snapshot3Test.defineHierarchy1();
result.addAll(Arrays.asList(old));
- result.remove(new Path(PROJECT_1).append("added file").toString());
- result.remove(new Path(PROJECT_1).append("yet another file").toString());
- result.remove(new Path(PROJECT_1).append("a folder").addTrailingSeparator().toString());
+ result.remove(IPath.fromOSString(PROJECT_1).append("added file").toString());
+ result.remove(IPath.fromOSString(PROJECT_1).append("yet another file").toString());
+ result.remove(IPath.fromOSString(PROJECT_1).append("a folder").addTrailingSeparator().toString());
return result.toArray(new String[result.size()]);
}
diff --git a/runtime/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/preferences/legacy/ProductPreferencesService.java b/runtime/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/preferences/legacy/ProductPreferencesService.java
index 17d57e1e122..4e11861e872 100644
--- a/runtime/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/preferences/legacy/ProductPreferencesService.java
+++ b/runtime/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/preferences/legacy/ProductPreferencesService.java
@@ -20,12 +20,15 @@
import java.util.Properties;
import org.eclipse.core.internal.preferences.exchange.IProductPreferencesService;
import org.eclipse.core.internal.runtime.InternalPlatform;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProduct;
+import org.eclipse.core.runtime.Platform;
import org.osgi.framework.Bundle;
public class ProductPreferencesService implements IProductPreferencesService {
- private static final IPath NL_DIR = new Path("$nl$"); //$NON-NLS-1$
+ private static final IPath NL_DIR = IPath.fromOSString("$nl$"); //$NON-NLS-1$
// declared in org.eclipse.ui.branding.IProductConstants
public static final String PRODUCT_KEY = "preferenceCustomization"; //$NON-NLS-1$
@@ -78,7 +81,7 @@ public Properties getProductCustomization() {
url = new URL(customizationValue);
} catch (MalformedURLException e) {
// didn't work so treat it as a filename
- url = FileLocator.find(customizationBundle, new Path(customizationValue), null);
+ url = FileLocator.find(customizationBundle, IPath.fromOSString(customizationValue), null);
}
}
diff --git a/runtime/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/InternalPlatform.java b/runtime/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/InternalPlatform.java
index 0fd6a285847..51e41c3afcc 100644
--- a/runtime/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/InternalPlatform.java
+++ b/runtime/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/InternalPlatform.java
@@ -18,7 +18,16 @@
import java.io.File;
import java.net.URL;
-import java.util.*;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.ResourceBundle;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.stream.Stream;
@@ -26,23 +35,51 @@
import org.eclipse.core.internal.preferences.exchange.IProductPreferencesService;
import org.eclipse.core.internal.preferences.legacy.InitLegacyPreferences;
import org.eclipse.core.internal.preferences.legacy.ProductPreferencesService;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IAdapterManager;
+import org.eclipse.core.runtime.IBundleGroupProvider;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.ILog;
+import org.eclipse.core.runtime.ILogListener;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProduct;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Plugin;
+import org.eclipse.core.runtime.RegistryFactory;
+import org.eclipse.core.runtime.ServiceCaller;
import org.eclipse.core.runtime.content.IContentTypeManager;
import org.eclipse.core.runtime.preferences.IPreferencesService;
import org.eclipse.equinox.app.IApplicationContext;
-import org.eclipse.equinox.internal.app.*;
import org.eclipse.equinox.internal.app.Activator;
-import org.eclipse.equinox.log.*;
+import org.eclipse.equinox.internal.app.CommandLineArgs;
+import org.eclipse.equinox.internal.app.EclipseAppContainer;
+import org.eclipse.equinox.internal.app.IBranding;
+import org.eclipse.equinox.log.ExtendedLogReaderService;
+import org.eclipse.equinox.log.ExtendedLogService;
+import org.eclipse.equinox.log.Logger;
import org.eclipse.osgi.container.ModuleContainer;
import org.eclipse.osgi.framework.log.FrameworkLog;
import org.eclipse.osgi.service.datalocation.Location;
import org.eclipse.osgi.service.debug.DebugOptions;
import org.eclipse.osgi.service.environment.EnvironmentInfo;
import org.eclipse.osgi.service.resolver.PlatformAdmin;
-import org.osgi.framework.*;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.Constants;
+import org.osgi.framework.Filter;
+import org.osgi.framework.FrameworkUtil;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceRegistration;
+import org.osgi.framework.VersionRange;
import org.osgi.framework.namespace.HostNamespace;
import org.osgi.framework.namespace.IdentityNamespace;
-import org.osgi.framework.wiring.*;
+import org.osgi.framework.wiring.BundleCapability;
+import org.osgi.framework.wiring.BundleRevision;
+import org.osgi.framework.wiring.BundleRevisions;
+import org.osgi.framework.wiring.BundleWire;
+import org.osgi.framework.wiring.BundleWiring;
+import org.osgi.framework.wiring.FrameworkWiring;
import org.osgi.resource.Namespace;
import org.osgi.util.tracker.ServiceTracker;
@@ -94,7 +131,7 @@ public final class InternalPlatform {
private static final InternalPlatform singleton = new InternalPlatform();
private static final String[] WS_LIST = { Platform.WS_COCOA, Platform.WS_GTK, Platform.WS_WIN32, Platform.WS_WPF };
- private Path cachedInstanceLocation; // Cache the path of the instance location
+ private IPath cachedInstanceLocation; // Cache the path of the instance location
private ServiceTracker configurationLocation = null;
private BundleContext context;
private FrameworkWiring fwkWiring;
@@ -363,7 +400,7 @@ public IPath getLocation() throws IllegalStateException {
}
// This makes the assumption that the instance location is a file: URL
File file = new File(url.getFile());
- cachedInstanceLocation = new Path(file.toString());
+ cachedInstanceLocation = IPath.fromOSString(file.toString());
}
return cachedInstanceLocation;
}
diff --git a/runtime/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/nls/PropertyFileConverter.java b/runtime/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/nls/PropertyFileConverter.java
index 58f88b750c8..2282e7bca22 100644
--- a/runtime/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/nls/PropertyFileConverter.java
+++ b/runtime/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/nls/PropertyFileConverter.java
@@ -13,12 +13,14 @@
*******************************************************************************/
package org.eclipse.core.tools.nls;
-import java.io.*;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.List;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.jdt.core.IType;
import org.eclipse.ltk.core.refactoring.Change;
@@ -184,7 +186,7 @@ public Change[] convertFile(IType accessorType, IFile propertiesFile) throws IOE
String bundleName = propertiesFile.getName();
StringBuilder clazz = new StringBuilder();
// convert the bundle resource (messages.properties) to the simple name (messages)
- String simpleBundleName = new Path(bundleName).removeFileExtension().toString();
+ String simpleBundleName = IPath.fromOSString(bundleName).removeFileExtension().toString();
appendPreText(clazz, pkgName, simpleBundleName, typeName);
StringBuilder bundle = new StringBuilder();
int savings = 0;
diff --git a/runtime/tests/org.eclipse.core.tests.harness/src/org/eclipse/core/tests/harness/FileSystemHelper.java b/runtime/tests/org.eclipse.core.tests.harness/src/org/eclipse/core/tests/harness/FileSystemHelper.java
index d0078a5de56..2c6a9ca2720 100644
--- a/runtime/tests/org.eclipse.core.tests.harness/src/org/eclipse/core/tests/harness/FileSystemHelper.java
+++ b/runtime/tests/org.eclipse.core.tests.harness/src/org/eclipse/core/tests/harness/FileSystemHelper.java
@@ -16,7 +16,6 @@
import java.io.IOException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
/**
@@ -37,7 +36,7 @@ public static IPath getTempDir() {
} catch (IOException e) {
//ignore and use non-canonical path
}
- return new Path(tempPath);
+ return IPath.fromOSString(tempPath);
}
/**
diff --git a/runtime/tests/org.eclipse.core.tests.runtime/META-INF/MANIFEST.MF b/runtime/tests/org.eclipse.core.tests.runtime/META-INF/MANIFEST.MF
index cdb53d32265..b2bdb84da93 100644
--- a/runtime/tests/org.eclipse.core.tests.runtime/META-INF/MANIFEST.MF
+++ b/runtime/tests/org.eclipse.core.tests.runtime/META-INF/MANIFEST.MF
@@ -12,7 +12,7 @@ Export-Package: org.eclipse.core.tests.internal.preferences,
org.eclipse.core.tests.runtime.perf
Require-Bundle: org.junit,
org.eclipse.test.performance;resolution:=optional,
- org.eclipse.core.runtime;bundle-version="3.26.0",
+ org.eclipse.core.runtime;bundle-version="3.27.0",
org.eclipse.core.tests.harness;bundle-version="3.11.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-17
diff --git a/runtime/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/internal/preferences/BadTestScope.java b/runtime/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/internal/preferences/BadTestScope.java
index aec7d856719..13fae072b0c 100644
--- a/runtime/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/internal/preferences/BadTestScope.java
+++ b/runtime/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/internal/preferences/BadTestScope.java
@@ -16,7 +16,6 @@
import java.util.Properties;
import org.eclipse.core.internal.preferences.EclipsePreferences;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.IScopeContext;
import org.osgi.service.prefs.BackingStoreException;
@@ -39,7 +38,7 @@ public BadTestScope() {
private BadTestScope(EclipsePreferences parent, String key) {
super(parent, key);
// cache the segment count
- IPath path = new Path(absolutePath());
+ IPath path = IPath.fromOSString(absolutePath());
segmentCount = path.segmentCount();
if (segmentCount < 2) {
return;
diff --git a/runtime/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/internal/preferences/EclipsePreferencesTest.java b/runtime/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/internal/preferences/EclipsePreferencesTest.java
index d3181dd3f90..76d23ecfd39 100644
--- a/runtime/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/internal/preferences/EclipsePreferencesTest.java
+++ b/runtime/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/internal/preferences/EclipsePreferencesTest.java
@@ -13,13 +13,38 @@
*******************************************************************************/
package org.eclipse.core.tests.internal.preferences;
-import java.io.*;
-import java.util.*;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
import org.eclipse.core.internal.preferences.EclipsePreferences;
import org.eclipse.core.internal.preferences.TestHelper;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.core.runtime.preferences.*;
+import org.eclipse.core.runtime.preferences.DefaultScope;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.IExportedPreferences;
+import org.eclipse.core.runtime.preferences.IPreferenceNodeVisitor;
+import org.eclipse.core.runtime.preferences.IPreferencesService;
+import org.eclipse.core.runtime.preferences.IScopeContext;
+import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.core.tests.runtime.RuntimeTest;
import org.eclipse.core.tests.runtime.RuntimeTestsPlugin;
import org.osgi.service.prefs.BackingStoreException;
@@ -906,7 +931,7 @@ public void testClear() {
}
public void testAbsolutePath() {
- IPath expected = Path.ROOT;
+ IPath expected = IPath.ROOT;
Preferences node = Platform.getPreferencesService().getRootNode();
// root node
@@ -1018,7 +1043,7 @@ public void testNodeChangeListeners() {
// add a child
String name = getUniqueString();
- IPath parent = new Path(root.absolutePath());
+ IPath parent = IPath.fromOSString(root.absolutePath());
IPath child = parent.append(name);
Preferences node = root.node(name);
assertEquals("1.0", "[A:" + parent + ',' + child + ']', tracer.log.toString());
@@ -1077,7 +1102,7 @@ public void test_60590() {
node.put(key, value);
Preferences current = node;
int count = 0;
- while (current != null && current instanceof EclipsePreferences && current.parent() != null && new Path(current.absolutePath()).segment(0).equals(TestScope.SCOPE)) {
+ while (current != null && current instanceof EclipsePreferences && current.parent() != null && IPath.fromOSString(current.absolutePath()).segment(0).equals(TestScope.SCOPE)) {
assertTrue("1.0." + current.absolutePath(), ((EclipsePreferences) current).isDirty());
count++;
current = current.parent();
@@ -1390,7 +1415,7 @@ public void testNode3() {
File rootFile = new File(prop);
File childFile = new File(rootFile, "foo");
assertTrue("3.2", childFile.exists());
- Properties contents = loadProperties(new Path(childFile.getAbsolutePath()));
+ Properties contents = loadProperties(IPath.fromOSString(childFile.getAbsolutePath()));
assertEquals("3.3", "value8", contents.getProperty("key8", null));
// delete the node (which should remove the file)
diff --git a/runtime/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/internal/preferences/IScopeContextTest.java b/runtime/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/internal/preferences/IScopeContextTest.java
index 8e4ea700aa8..1527e6038fc 100644
--- a/runtime/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/internal/preferences/IScopeContextTest.java
+++ b/runtime/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/internal/preferences/IScopeContextTest.java
@@ -14,9 +14,11 @@
*******************************************************************************/
package org.eclipse.core.tests.internal.preferences;
-import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.preferences.*;
+import org.eclipse.core.runtime.preferences.IPreferencesService;
+import org.eclipse.core.runtime.preferences.IScopeContext;
+import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.core.tests.runtime.RuntimeTest;
import org.osgi.service.prefs.Preferences;
@@ -53,7 +55,7 @@ public void testGetNode() {
assertEquals("2.1", expected, actual);
// path
- qualifier = new Path(Long.toString(System.currentTimeMillis())).append("a").toString();
+ qualifier = IPath.fromOSString(Long.toString(System.currentTimeMillis())).append("a").toString();
node = context.getNode(qualifier);
assertNotNull("3.0", node);
expected = "/instance/" + qualifier;
diff --git a/runtime/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/internal/preferences/TestNodeStorage3.java b/runtime/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/internal/preferences/TestNodeStorage3.java
index 7ce7a5c2cc9..1dbf7761219 100644
--- a/runtime/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/internal/preferences/TestNodeStorage3.java
+++ b/runtime/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/internal/preferences/TestNodeStorage3.java
@@ -13,10 +13,17 @@
******************************************************************************/
package org.eclipse.core.tests.internal.preferences;
-import java.io.*;
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
import java.util.Properties;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.preferences.AbstractPreferenceStorage;
import org.eclipse.core.tests.runtime.RuntimeTestsPlugin;
import org.osgi.service.prefs.BackingStoreException;
@@ -44,7 +51,7 @@ public class TestNodeStorage3 extends AbstractPreferenceStorage {
if (root == null) {
throw new BackingStoreException("Problems getting preference location.");
}
- IPath path = new Path(nodePath);
+ IPath path = IPath.fromOSString(nodePath);
return new File(root, path.lastSegment());
}
diff --git a/runtime/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/internal/preferences/TestScope2.java b/runtime/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/internal/preferences/TestScope2.java
index 6b5541c30a0..0eca02ba0e3 100644
--- a/runtime/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/internal/preferences/TestScope2.java
+++ b/runtime/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/internal/preferences/TestScope2.java
@@ -15,7 +15,8 @@
import java.util.Properties;
import org.eclipse.core.internal.preferences.EclipsePreferences;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.IScopeContext;
import org.eclipse.core.tests.harness.CoreTest;
@@ -47,7 +48,7 @@ public TestScope2() {
private TestScope2(EclipsePreferences parent, String key) {
super(parent, key);
// cache the segment count
- IPath path = new Path(absolutePath());
+ IPath path = IPath.fromOSString(absolutePath());
segmentCount = path.segmentCount();
if (segmentCount < 2) {
return;
diff --git a/runtime/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/runtime/PlatformTest.java b/runtime/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/runtime/PlatformTest.java
index 0a3ab18bb9e..9afdfb0d99a 100644
--- a/runtime/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/runtime/PlatformTest.java
+++ b/runtime/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/runtime/PlatformTest.java
@@ -15,15 +15,36 @@
import static java.util.Collections.emptyMap;
-import java.io.*;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.StringWriter;
import java.nio.charset.Charset;
import java.nio.file.Files;
-import java.util.*;
-import java.util.jar.*;
-import org.eclipse.core.runtime.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+import java.util.jar.Attributes;
+import java.util.jar.JarEntry;
+import java.util.jar.JarOutputStream;
+import java.util.jar.Manifest;
+import org.eclipse.core.runtime.ILog;
+import org.eclipse.core.runtime.ILogListener;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.ISafeRunnable;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.SafeRunner;
import org.eclipse.osgi.framework.log.FrameworkLog;
import org.junit.Test;
-import org.osgi.framework.*;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.Constants;
+import org.osgi.framework.ServiceReference;
import org.osgi.util.tracker.ServiceTracker;
/**
@@ -116,13 +137,13 @@ public void testGetLogLocation() throws IOException {
assertNotNull("1.0", initialLocation);
//ensure result is same as log service
- IPath logPath = new Path(logService.getFile().getAbsolutePath());
+ IPath logPath = IPath.fromOSString(logService.getFile().getAbsolutePath());
assertEquals("2.0", logPath, initialLocation);
//changing log service location should change log location
File newLocation = File.createTempFile("testGetLogLocation", null);
logService.setFile(newLocation, true);
- assertEquals("3.0", new Path(newLocation.getAbsolutePath()), Platform.getLogFileLocation());
+ assertEquals("3.0", IPath.fromOSString(newLocation.getAbsolutePath()), Platform.getLogFileLocation());
//when log is non-local, should revert to default location
logService.setWriter(new StringWriter(), true);
diff --git a/runtime/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/runtime/PreferenceExportTest.java b/runtime/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/runtime/PreferenceExportTest.java
index bee851a7971..c4a98a92493 100644
--- a/runtime/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/runtime/PreferenceExportTest.java
+++ b/runtime/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/runtime/PreferenceExportTest.java
@@ -13,7 +13,10 @@
*******************************************************************************/
package org.eclipse.core.tests.runtime;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Plugin;
+import org.eclipse.core.runtime.Preferences;
/**
* Tests the Preferences import/export feature.
@@ -58,7 +61,7 @@ public void testExportEmptyPreference() {
final String key2 = "SomeOtherTestKey";
final String default1 = "SomeTestValue";
final int default2 = 5;
- IPath exportPath = new Path(System.getProperty("java.io.tmpdir")).append(Long.toString(System.currentTimeMillis()));
+ IPath exportPath = IPath.fromOSString(System.getProperty("java.io.tmpdir")).append(Long.toString(System.currentTimeMillis()));
exportPath.toFile().delete();
//add a property change listener that asserts key identity
Plugin testPlugin = RuntimeTestsPlugin.getPlugin();
@@ -111,7 +114,7 @@ public void testExportEmptyPreference() {
public void testKeyIdentityAfterExport() {
final String key = "SomeTestKey";
String initialValue = "SomeTestValue";
- IPath exportPath = new Path(System.getProperty("java.io.tmpdir")).append(Long.toString(System.currentTimeMillis()));
+ IPath exportPath = IPath.fromOSString(System.getProperty("java.io.tmpdir")).append(Long.toString(System.currentTimeMillis()));
exportPath.toFile().delete();
//add a property change listener that asserts key identity
Plugin testPlugin = RuntimeTestsPlugin.getPlugin();
diff --git a/runtime/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/runtime/RuntimeTestsPlugin.java b/runtime/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/runtime/RuntimeTestsPlugin.java
index 162bd4d96f3..90e803d0920 100644
--- a/runtime/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/runtime/RuntimeTestsPlugin.java
+++ b/runtime/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/runtime/RuntimeTestsPlugin.java
@@ -23,9 +23,8 @@
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URL;
-
import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Plugin;
import org.osgi.framework.BundleContext;
@@ -102,7 +101,7 @@ public static File getTestData(String entry) {
if (base == null)
return null;
try {
- String osPath = new Path(FileLocator.toFileURL(base).getPath()).toOSString();
+ String osPath = IPath.fromOSString(FileLocator.toFileURL(base).getPath()).toOSString();
File result = new File(osPath);
return result.getCanonicalPath().equals(result.getPath()) ? result : null;
} catch (IOException e) {
diff --git a/runtime/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/runtime/jobs/PathRule.java b/runtime/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/runtime/jobs/PathRule.java
index 78d6fa63acb..76337763b42 100644
--- a/runtime/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/runtime/jobs/PathRule.java
+++ b/runtime/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/runtime/jobs/PathRule.java
@@ -14,7 +14,6 @@
package org.eclipse.core.tests.runtime.jobs;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
/**
@@ -30,7 +29,7 @@ public PathRule(IPath path) {
}
public PathRule(String pathString) {
- this.path = new Path(pathString);
+ this.path = IPath.fromOSString(pathString);
}
@Override
diff --git a/runtime/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/runtime/perf/BenchPath.java b/runtime/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/runtime/perf/BenchPath.java
index 58e6a596c60..9b89a32af1e 100644
--- a/runtime/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/runtime/perf/BenchPath.java
+++ b/runtime/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/runtime/perf/BenchPath.java
@@ -15,7 +15,6 @@
import java.util.HashMap;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.tests.harness.PerformanceTestRunner;
import org.eclipse.core.tests.runtime.RuntimeTest;
@@ -59,28 +58,28 @@ public void testPathCreation() {
@Override
protected void test() {
//folders (5)
- new Path("/");
- new Path("/Foo");
- new Path("/Foo/bar");
- new Path("/Foo/bar/baz");
- new Path("/Foo/bar/baz/blap");
+ IPath.fromOSString("/");
+ IPath.fromOSString("/Foo");
+ IPath.fromOSString("/Foo/bar");
+ IPath.fromOSString("/Foo/bar/baz");
+ IPath.fromOSString("/Foo/bar/baz/blap");
//files (15)
- new Path("/Foo/abc.txt");
- new Path("/Foo/bar/abc.txt");
- new Path("/Foo/bar/baz/abc.txt");
- new Path("/Foo/bar/baz/blap/abc.txt");
- new Path("/Foo/bar/abc.txt");
- new Path("/Foo/bar/baz/abc.txt");
- new Path("/Foo/bar/baz/blap/abc.txt");
- new Path("/Foo/bar/baz/abc.txt");
- new Path("/Foo/bar/baz/blap/abc.txt");
- new Path("/Foo/bar/baz/abc.txt");
- new Path("/Foo/bar/baz/blap/abc.txt");
- new Path("/Foo/bar/baz/abc.txt");
- new Path("/Foo/bar/baz/blap/abc.txt");
- new Path("/Foo/bar/baz/blap/blam/abc.txt");
- new Path("/Foo/bar/baz/blap/blam/blip/boop/abc.txt");
+ IPath.fromOSString("/Foo/abc.txt");
+ IPath.fromOSString("/Foo/bar/abc.txt");
+ IPath.fromOSString("/Foo/bar/baz/abc.txt");
+ IPath.fromOSString("/Foo/bar/baz/blap/abc.txt");
+ IPath.fromOSString("/Foo/bar/abc.txt");
+ IPath.fromOSString("/Foo/bar/baz/abc.txt");
+ IPath.fromOSString("/Foo/bar/baz/blap/abc.txt");
+ IPath.fromOSString("/Foo/bar/baz/abc.txt");
+ IPath.fromOSString("/Foo/bar/baz/blap/abc.txt");
+ IPath.fromOSString("/Foo/bar/baz/abc.txt");
+ IPath.fromOSString("/Foo/bar/baz/blap/abc.txt");
+ IPath.fromOSString("/Foo/bar/baz/abc.txt");
+ IPath.fromOSString("/Foo/bar/baz/blap/abc.txt");
+ IPath.fromOSString("/Foo/bar/baz/blap/blam/abc.txt");
+ IPath.fromOSString("/Foo/bar/baz/blap/blam/blip/boop/abc.txt");
}
}.run(this, 20, REPEAT);
}
@@ -123,28 +122,28 @@ protected void test() {
private IPath[] generateVariousPaths() {
IPath[] paths = new IPath[20];
int i = 0;
- paths[i++] = new Path("/");
- paths[i++] = new Path("/Foo");
- paths[i++] = new Path("/Foo/bar");
- paths[i++] = new Path("/Foo/bar/baz");
- paths[i++] = new Path("/Foo/bar/baz/blap");
+ paths[i++] = IPath.fromOSString("/");
+ paths[i++] = IPath.fromOSString("/Foo");
+ paths[i++] = IPath.fromOSString("/Foo/bar");
+ paths[i++] = IPath.fromOSString("/Foo/bar/baz");
+ paths[i++] = IPath.fromOSString("/Foo/bar/baz/blap");
//files (15)
- paths[i++] = new Path("/Foo/abc.txt");
- paths[i++] = new Path("/Foo/bar/abc.txt");
- paths[i++] = new Path("/Foo/bar/baz/abc.txt");
- paths[i++] = new Path("/Foo/bar/baz/blap/abc.txt");
- paths[i++] = new Path("/Foo/bar/abc.txt");
- paths[i++] = new Path("/Foo/bar/baz/abc.txt");
- paths[i++] = new Path("/Foo/bar/baz/blap/abc.txt");
- paths[i++] = new Path("/Foo/bar/baz/abc.txt");
- paths[i++] = new Path("/Foo/bar/baz/blap/abc.txt");
- paths[i++] = new Path("/Foo/bar/baz/abc.txt");
- paths[i++] = new Path("/Foo/bar/baz/blap/abc.txt");
- paths[i++] = new Path("/Foo/bar/baz/abc.txt");
- paths[i++] = new Path("/Foo/bar/baz/blap/abc.txt");
- paths[i++] = new Path("/Foo/bar/baz/blap/blam/abc.txt");
- paths[i++] = new Path("/Foo/bar/baz/blap/blam/blip/boop/abc.txt");
+ paths[i++] = IPath.fromOSString("/Foo/abc.txt");
+ paths[i++] = IPath.fromOSString("/Foo/bar/abc.txt");
+ paths[i++] = IPath.fromOSString("/Foo/bar/baz/abc.txt");
+ paths[i++] = IPath.fromOSString("/Foo/bar/baz/blap/abc.txt");
+ paths[i++] = IPath.fromOSString("/Foo/bar/abc.txt");
+ paths[i++] = IPath.fromOSString("/Foo/bar/baz/abc.txt");
+ paths[i++] = IPath.fromOSString("/Foo/bar/baz/blap/abc.txt");
+ paths[i++] = IPath.fromOSString("/Foo/bar/baz/abc.txt");
+ paths[i++] = IPath.fromOSString("/Foo/bar/baz/blap/abc.txt");
+ paths[i++] = IPath.fromOSString("/Foo/bar/baz/abc.txt");
+ paths[i++] = IPath.fromOSString("/Foo/bar/baz/blap/abc.txt");
+ paths[i++] = IPath.fromOSString("/Foo/bar/baz/abc.txt");
+ paths[i++] = IPath.fromOSString("/Foo/bar/baz/blap/abc.txt");
+ paths[i++] = IPath.fromOSString("/Foo/bar/baz/blap/blam/abc.txt");
+ paths[i++] = IPath.fromOSString("/Foo/bar/baz/blap/blam/blip/boop/abc.txt");
return paths;
}
diff --git a/team/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/PatchReader.java b/team/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/PatchReader.java
index 3642c8c20db..7aa6164a1b0 100644
--- a/team/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/PatchReader.java
+++ b/team/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/PatchReader.java
@@ -15,12 +15,20 @@
import java.io.BufferedReader;
import java.io.IOException;
-import java.text.*;
-import java.util.*;
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.StringTokenizer;
import java.util.regex.Pattern;
import org.eclipse.compare.patch.IFilePatch2;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IPath;
public class PatchReader {
private static final boolean DEBUG= false;
@@ -605,7 +613,7 @@ private IPath extractPath(String[] args, int n, String path2) {
if (DEBUG) System.out.println("path mismatch: " + path2); //$NON-NLS-1$
path= path2;
}
- return new Path(path);
+ return IPath.fromOSString(path);
}
return null;
}
diff --git a/team/bundles/org.eclipse.compare.win32/META-INF/MANIFEST.MF b/team/bundles/org.eclipse.compare.win32/META-INF/MANIFEST.MF
index d95e0404a62..640219c06e4 100644
--- a/team/bundles/org.eclipse.compare.win32/META-INF/MANIFEST.MF
+++ b/team/bundles/org.eclipse.compare.win32/META-INF/MANIFEST.MF
@@ -11,7 +11,7 @@ Require-Bundle: org.eclipse.compare;bundle-version="[3.5.0,4.0.0)",
org.eclipse.ui.forms;bundle-version="[3.4.0,4.0.0)",
org.eclipse.ui.workbench;bundle-version="[3.5.0,4.0.0)",
org.eclipse.jface;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.core.runtime;bundle-version="[3.27.0,4.0.0)",
org.eclipse.core.resources;bundle-version="[3.5.0,4.0.0)"
Export-Package: org.eclipse.compare.internal.win32;x-internal:=true
Bundle-Activator: org.eclipse.compare.internal.win32.Activator
diff --git a/team/bundles/org.eclipse.compare.win32/src/org/eclipse/compare/internal/win32/WordMergeViewer.java b/team/bundles/org.eclipse.compare.win32/src/org/eclipse/compare/internal/win32/WordMergeViewer.java
index 7a21bd98f4f..7626e782ab8 100644
--- a/team/bundles/org.eclipse.compare.win32/src/org/eclipse/compare/internal/win32/WordMergeViewer.java
+++ b/team/bundles/org.eclipse.compare.win32/src/org/eclipse/compare/internal/win32/WordMergeViewer.java
@@ -34,7 +34,6 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.ListenerList;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.SafeRunner;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.action.Action;
@@ -183,7 +182,7 @@ private static void initAction(IAction a, ResourceBundle bundle, String prefix)
}
private static ImageDescriptor getImageDescriptor(String relativePath) {
- IPath path= new Path("$nl$/icons/full/").append(relativePath);
+ IPath path= IPath.fromOSString("$nl$/icons/full/").append(relativePath);
URL url= FileLocator.find(Activator.getDefault().getBundle(), path, null);
if (url == null)
return null;
diff --git a/team/bundles/org.eclipse.compare/META-INF/MANIFEST.MF b/team/bundles/org.eclipse.compare/META-INF/MANIFEST.MF
index 183434519e9..824e5a2e232 100644
--- a/team/bundles/org.eclipse.compare/META-INF/MANIFEST.MF
+++ b/team/bundles/org.eclipse.compare/META-INF/MANIFEST.MF
@@ -19,7 +19,7 @@ Require-Bundle: org.eclipse.ui;bundle-version="[3.5.0,4.0.0)",
org.eclipse.ui.ide;bundle-version="[3.3.0,4.0.0)",
org.eclipse.ui.views;bundle-version="[3.2.0,4.0.0)",
org.eclipse.ui.workbench.texteditor;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
+ org.eclipse.core.runtime;bundle-version="[3.27.0,4.0.0)",
org.eclipse.core.expressions;bundle-version="[3.2.0,4.0.0)",
org.eclipse.ui.editors;bundle-version="[3.5.0,4.0.0)",
org.eclipse.ui.forms;bundle-version="[3.2.0,4.0.0)",
diff --git a/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareFilterDescriptor.java b/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareFilterDescriptor.java
index 9bb3d5dd70c..60625959e47 100644
--- a/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareFilterDescriptor.java
+++ b/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareFilterDescriptor.java
@@ -21,7 +21,7 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.resource.ImageDescriptor;
import org.osgi.framework.Bundle;
@@ -83,7 +83,7 @@ public Enumeration getKeys() {
String path = Utilities.getString(fResourceBundle,
FILTER_IMAGE_ATTRIBUTE, FILTER_IMAGE_ATTRIBUTE);
if (path != null)
- url = FileLocator.find(bundle, new Path(path), null);
+ url = FileLocator.find(bundle, IPath.fromOSString(path), null);
}
fImageDescriptor = (url == null) ? null : ImageDescriptor
.createFromURL(url);
diff --git a/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareWithOtherResourceDialog.java b/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareWithOtherResourceDialog.java
index 8f1d0d55d7c..d0b415cf61e 100644
--- a/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareWithOtherResourceDialog.java
+++ b/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareWithOtherResourceDialog.java
@@ -29,7 +29,6 @@
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.dialogs.IMessageProvider;
@@ -601,7 +600,7 @@ private IFile getExternalFile() {
FileDialog dialog = new FileDialog(getShell());
String path = dialog.open();
if (path != null)
- return (IFile) linkResource(new Path(path));
+ return (IFile) linkResource(IPath.fromOSString(path));
return null;
}
@@ -609,7 +608,7 @@ private IFolder getExternalFolder() {
DirectoryDialog dialog = new DirectoryDialog(getShell());
String path = dialog.open();
if (path != null)
- return (IFolder) linkResource(new Path(path));
+ return (IFolder) linkResource(IPath.fromOSString(path));
return null;
}
diff --git a/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/Utilities.java b/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/Utilities.java
index 2ed62bce14e..c0d6c9cb561 100644
--- a/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/Utilities.java
+++ b/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/Utilities.java
@@ -63,7 +63,6 @@
import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.SafeRunner;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubMonitor;
@@ -101,7 +100,7 @@
* Convenience and utility methods.
*/
public class Utilities {
- private static final IPath ICONS_PATH= new Path("$nl$/icons/full/"); //$NON-NLS-1$
+ private static final IPath ICONS_PATH= IPath.fromOSString("$nl$/icons/full/"); //$NON-NLS-1$
public static IWorkbenchPartSite findSite(Control c) {
while (c != null && !c.isDisposed()) {
diff --git a/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/InputPatchPage.java b/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/InputPatchPage.java
index 713c2b2affd..9ee0ae3484f 100644
--- a/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/InputPatchPage.java
+++ b/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/InputPatchPage.java
@@ -39,7 +39,6 @@
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Path;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.IDialogSettings;
@@ -142,7 +141,7 @@ public InputPatchPage(PatchWizard pw) {
* @return org.eclipse.core.runtime.IPath
*/
protected IPath getPathFromText(Text textField) {
- return (new Path(textField.getText())).makeAbsolute();
+ return (IPath.fromOSString(textField.getText())).makeAbsolute();
}
/* package */ String getPatchName() {
@@ -629,7 +628,7 @@ protected void handlePatchFileBrowseButtonPressed() {
return;
patchFilePath= dialog.getFileName();
- IPath filterPath= new Path(dialog.getFilterPath());
+ IPath filterPath= IPath.fromOSString(dialog.getFilterPath());
IPath path= filterPath.append(patchFilePath).makeAbsolute();
patchFilePath= path.toOSString();
//fDialogSettings.put(IUIConstants.DIALOGSTORE_LASTEXTJAR, filterPath.toOSString());
@@ -757,7 +756,7 @@ private void restoreWidgetValues() {
if (workspaceSetting != null && workspaceSetting.length() > 0) {
// See if this resource still exists in the workspace
try {
- IPath path= new Path(workspaceSetting);
+ IPath path= IPath.fromOSString(workspaceSetting);
IFile targetFile= ResourcesPlugin.getWorkspace().getRoot().getFile(path);
if (fTreeViewer != null && targetFile.exists()){
fTreeViewer.expandToLevel(targetFile, 0);
diff --git a/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchTargetPage.java b/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchTargetPage.java
index b5d7c73b724..304437450e7 100644
--- a/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchTargetPage.java
+++ b/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchTargetPage.java
@@ -22,7 +22,6 @@
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.StructuredSelection;
@@ -69,7 +68,7 @@ public PatchTargetPage(WorkspacePatcher patcher) {
* @return org.eclipse.core.runtime.IPath
*/
protected IPath getPathFromText(Text textField) {
- return (new Path(textField.getText())).makeAbsolute();
+ return (IPath.fromOSString(textField.getText())).makeAbsolute();
}
@Override
diff --git a/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java b/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java
index dd1d755ef34..6fbd120760a 100644
--- a/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java
+++ b/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java
@@ -53,7 +53,6 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.core.runtime.preferences.IScopeContext;
@@ -339,7 +338,7 @@ private IPath getRejectFilePath(IPath path) {
pp= path.removeLastSegments(1);
pp= pp.append(path.lastSegment() + REJECT_FILE_EXTENSION);
} else
- pp= new Path(path.lastSegment() + REJECT_FILE_EXTENSION);
+ pp= IPath.fromOSString(path.lastSegment() + REJECT_FILE_EXTENSION);
return pp;
}
diff --git a/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/WorkspacePatcher.java b/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/WorkspacePatcher.java
index 6bebffe49c5..3954763b7f7 100644
--- a/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/WorkspacePatcher.java
+++ b/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/WorkspacePatcher.java
@@ -36,7 +36,6 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.core.runtime.jobs.MultiRule;
@@ -149,7 +148,7 @@ public void applyAll(IProgressMonitor pm, IFileValidator validator) throws CoreE
pp= path.removeLastSegments(1);
pp= pp.append(path.lastSegment() + REJECT_FILE_EXTENSION);
} else
- pp= new Path(path.lastSegment() + REJECT_FILE_EXTENSION);
+ pp= IPath.fromOSString(path.lastSegment() + REJECT_FILE_EXTENSION);
file= createPath(file.getProject(), pp);
if (file != null) {
store(getRejected(failed), file, pm);
diff --git a/team/bundles/org.eclipse.jsch.ui/META-INF/MANIFEST.MF b/team/bundles/org.eclipse.jsch.ui/META-INF/MANIFEST.MF
index dfe33c99476..ebf2b941806 100644
--- a/team/bundles/org.eclipse.jsch.ui/META-INF/MANIFEST.MF
+++ b/team/bundles/org.eclipse.jsch.ui/META-INF/MANIFEST.MF
@@ -7,7 +7,7 @@ Bundle-Activator: org.eclipse.jsch.internal.ui.JSchUIPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.3.0,4.0.0)",
+ org.eclipse.core.runtime;bundle-version="[3.27.0,4.0.0)",
org.eclipse.jsch.core;bundle-version="[1.2.0,2.0.0)",
com.jcraft.jsch;bundle-version="[0.1.50,1.0.0)"
Bundle-ActivationPolicy: lazy
diff --git a/team/bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/JSchUIPlugin.java b/team/bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/JSchUIPlugin.java
index 43d6d49087a..99707679d95 100644
--- a/team/bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/JSchUIPlugin.java
+++ b/team/bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/JSchUIPlugin.java
@@ -19,7 +19,7 @@
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.resource.ImageDescriptor;
@@ -67,7 +67,7 @@ public static ImageDescriptor getImageDescriptor(String id){
* Creates an image and places it in the image registry.
*/
protected void createImageDescriptor(String id){
- URL url=FileLocator.find(JSchUIPlugin.getPlugin().getBundle(), new Path(
+ URL url=FileLocator.find(JSchUIPlugin.getPlugin().getBundle(), IPath.fromOSString(
IUIConstants.ICON_PATH+id), null);
ImageDescriptor desc=ImageDescriptor.createFromURL(url);
imageDescriptors.put(id, desc);
@@ -81,7 +81,7 @@ protected void createImageDescriptor(String id){
* @return the image
*/
public static ImageDescriptor getImageDescriptorFromExtension(IExtension extension, String subdirectoryAndFilename) {
- URL fullPathString = FileLocator.find(Platform.getBundle(extension.getNamespaceIdentifier()), new Path(subdirectoryAndFilename), null);
+ URL fullPathString = FileLocator.find(Platform.getBundle(extension.getNamespaceIdentifier()), IPath.fromOSString(subdirectoryAndFilename), null);
return ImageDescriptor.createFromURL(fullPathString);
}
@@ -118,6 +118,6 @@ public IJSchService getJSchService() {
}
public URL getImageUrl(String relative){
- return FileLocator.find(Platform.getBundle(ID), new Path(IUIConstants.ICON_PATH + relative), null);
+ return FileLocator.find(Platform.getBundle(ID), IPath.fromOSString(IUIConstants.ICON_PATH + relative), null);
}
}
diff --git a/team/bundles/org.eclipse.team.core/META-INF/MANIFEST.MF b/team/bundles/org.eclipse.team.core/META-INF/MANIFEST.MF
index 867996b3286..0a04f866142 100644
--- a/team/bundles/org.eclipse.team.core/META-INF/MANIFEST.MF
+++ b/team/bundles/org.eclipse.team.core/META-INF/MANIFEST.MF
@@ -24,7 +24,7 @@ Export-Package: org.eclipse.team.core,
org.eclipse.team.internal.core.streams;x-friends:="org.eclipse.team.cvs.core,org.eclipse.team.cvs.ssh2,org.eclipse.team.cvs.ui,org.eclipse.team.ui",
org.eclipse.team.internal.core.subscribers;x-friends:="org.eclipse.team.cvs.core,org.eclipse.team.cvs.ssh2,org.eclipse.team.cvs.ui,org.eclipse.team.ui"
Require-Bundle: org.eclipse.core.resources;bundle-version="[3.17.0,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.18.0,4.0.0)",
+ org.eclipse.core.runtime;bundle-version="[3.27.0,4.0.0)",
org.eclipse.core.filesystem;bundle-version="[1.1.0,2.0.0)",
org.eclipse.compare.core;bundle-version="[3.5.200,4.0.0)"
Bundle-ActivationPolicy: lazy
diff --git a/team/bundles/org.eclipse.team.ui/META-INF/MANIFEST.MF b/team/bundles/org.eclipse.team.ui/META-INF/MANIFEST.MF
index de7a36071b4..91e00966ef0 100644
--- a/team/bundles/org.eclipse.team.ui/META-INF/MANIFEST.MF
+++ b/team/bundles/org.eclipse.team.ui/META-INF/MANIFEST.MF
@@ -23,7 +23,7 @@ Export-Package: org.eclipse.team.internal.ui;x-friends:="org.eclipse.team.cvs.ss
org.eclipse.team.ui.synchronize
Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.3.0,4.0.0)";resolution:=optional,
org.eclipse.core.resources;bundle-version="[3.3.0,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
+ org.eclipse.core.runtime;bundle-version="[3.27.0,4.0.0)",
org.eclipse.team.core;bundle-version="[3.6.0,4.0.0)",
org.eclipse.ui;bundle-version="[3.5.0,4.0.0)",
org.eclipse.compare;bundle-version="[3.3.0,4.0.0)",
diff --git a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIPlugin.java b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIPlugin.java
index f783ad06997..30f770bf656 100644
--- a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIPlugin.java
+++ b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIPlugin.java
@@ -26,8 +26,8 @@
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.preferences.InstanceScope;
@@ -334,7 +334,7 @@ private ImageDescriptor privateGetImageDescriptor(String id) {
* @return the image
*/
public static ImageDescriptor getImageDescriptorFromExtension(IExtension extension, String subdirectoryAndFilename) {
- URL iconURL = FileLocator.find(Platform.getBundle(extension.getContributor().getName()), new Path(subdirectoryAndFilename), null);
+ URL iconURL = FileLocator.find(Platform.getBundle(extension.getContributor().getName()), IPath.fromOSString(subdirectoryAndFilename), null);
if (iconURL != null) {
return ImageDescriptor.createFromURL(iconURL);
}
@@ -422,7 +422,7 @@ private void initializeImages(TeamUIPlugin plugin) {
}
private URL getImageUrl(String relative) {
- return FileLocator.find(Platform.getBundle(PLUGIN_ID), new Path(ICON_PATH + relative), null);
+ return FileLocator.find(Platform.getBundle(PLUGIN_ID), IPath.fromOSString(ICON_PATH + relative), null);
}
/**
diff --git a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceModelPersistenceAdapter.java b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceModelPersistenceAdapter.java
index 0479e79521a..b0625117414 100644
--- a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceModelPersistenceAdapter.java
+++ b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceModelPersistenceAdapter.java
@@ -23,7 +23,6 @@
import org.eclipse.core.resources.mapping.ResourceMapping;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.team.internal.ui.Utils;
import org.eclipse.team.ui.mapping.SynchronizationCompareAdapter;
@@ -77,7 +76,7 @@ public ResourceMapping[] restore(IMemento memento) {
String pathString = child.getString(RESOURCE_PATH);
if (pathString == null)
continue;
- IPath path = new Path(pathString);
+ IPath path = IPath.fromOSString(pathString);
IResource resource;
switch (type) {
case IResource.ROOT:
diff --git a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceModelTraversalCalculator.java b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceModelTraversalCalculator.java
index dd95a38d9e0..4a336d8ba23 100644
--- a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceModelTraversalCalculator.java
+++ b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceModelTraversalCalculator.java
@@ -26,7 +26,6 @@
import org.eclipse.core.resources.mapping.ModelProvider;
import org.eclipse.core.resources.mapping.ResourceTraversal;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.osgi.util.NLS;
import org.eclipse.team.core.diff.IDiff;
@@ -180,7 +179,7 @@ public static IResource[] getChildren(IResourceDiffTree diffTree, IResource reso
if (path.segmentCount() == 1) {
child = ((IWorkspaceRoot)resource).getProject(path.lastSegment());
} else {
- child = ((IContainer)resource).getFolder(new Path(path.lastSegment()));
+ child = ((IContainer)resource).getFolder(IPath.fromOSString(path.lastSegment()));
}
} else {
child = diffTree.getResource(delta);
diff --git a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/SynchronizationResourceMappingContext.java b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/SynchronizationResourceMappingContext.java
index 379c81672af..823f398dcea 100644
--- a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/SynchronizationResourceMappingContext.java
+++ b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/SynchronizationResourceMappingContext.java
@@ -28,7 +28,6 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
import org.eclipse.team.core.diff.IDiff;
import org.eclipse.team.core.diff.IThreeWayDiff;
import org.eclipse.team.core.mapping.IResourceDiff;
@@ -133,7 +132,7 @@ public IResource[] fetchMembers(IContainer container, IProgressMonitor monitor)
if (path.segmentCount() == 1) {
child = ((IWorkspaceRoot)container).getProject(path.lastSegment());
} else {
- child = container.getFolder(new Path(path.lastSegment()));
+ child = container.getFolder(IPath.fromOSString(path.lastSegment()));
}
} else {
child = context.getDiffTree().getResource(delta);
diff --git a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ExportProjectSetLocationPage.java b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ExportProjectSetLocationPage.java
index 43a61d5f912..8d3a910adf0 100644
--- a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ExportProjectSetLocationPage.java
+++ b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ExportProjectSetLocationPage.java
@@ -23,9 +23,9 @@
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.TitleAreaDialog;
@@ -326,7 +326,7 @@ protected void okPressed() {
}
//Assert.isNotNull(wsContainer);
- workspaceFile = wsContainer.getFile(new Path(wsFilenameText.getText()));
+ workspaceFile = wsContainer.getFile(IPath.fromOSString(wsFilenameText.getText()));
if (workspaceFile != null) {
workspaceText.setText(workspaceFile.getFullPath().toString());
}
diff --git a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ProjectSetExportWizard.java b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ProjectSetExportWizard.java
index dfeaef74864..dfafd2d05a3 100644
--- a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ProjectSetExportWizard.java
+++ b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ProjectSetExportWizard.java
@@ -30,8 +30,8 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.dialogs.MessageDialog;
@@ -82,7 +82,7 @@ public boolean performFinish() {
@Override
public void run(IProgressMonitor monitor) throws InvocationTargetException {
String filename = locationPage.getFileName();
- Path path = new Path(filename);
+ IPath path = IPath.fromOSString(filename);
if (path.getFileExtension() == null) {
filename = filename + ".psf"; //$NON-NLS-1$
}
diff --git a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/SynchronizationCompareAdapter.java b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/SynchronizationCompareAdapter.java
index 51b256d514d..9948709a8be 100644
--- a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/SynchronizationCompareAdapter.java
+++ b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/SynchronizationCompareAdapter.java
@@ -25,7 +25,6 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.team.core.diff.IDiff;
import org.eclipse.team.core.mapping.ISynchronizationContext;
@@ -104,7 +103,7 @@ public String getPathString(ResourceMapping mapping) {
parent = adapter.getParent(parent);
} while (parent != null);
if (!segments.isEmpty()) {
- IPath path = Path.EMPTY;
+ IPath path = IPath.EMPTY;
for (String segment : segments) {
path = path.append(segment);
}
diff --git a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ResourceScope.java b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ResourceScope.java
index bcbd82e6c65..8a223503b7f 100644
--- a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ResourceScope.java
+++ b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ResourceScope.java
@@ -19,7 +19,6 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.eclipse.team.internal.ui.Utils;
import org.eclipse.ui.IMemento;
@@ -101,7 +100,7 @@ protected void init(IMemento memento) {
if(rootNodes != null) {
List resources = new ArrayList<>();
for (IMemento rootNode : rootNodes) {
- IPath path = new Path(rootNode.getString(CTX_ROOT_PATH));
+ IPath path = IPath.fromOSString(rootNode.getString(CTX_ROOT_PATH));
IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(path, true /* include phantoms */);
if(resource != null) {
resources.add(resource);
diff --git a/team/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/FileSystemProvider.java b/team/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/FileSystemProvider.java
index 11bccccaba4..16043f55806 100644
--- a/team/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/FileSystemProvider.java
+++ b/team/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/FileSystemProvider.java
@@ -22,7 +22,6 @@
import org.eclipse.core.resources.team.ResourceRuleFactory;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.team.core.RepositoryProvider;
import org.eclipse.team.core.TeamException;
@@ -130,7 +129,7 @@ public String getID() {
public void setTargetLocation(String location) throws TeamException {
// set the instance variable to the provided path
- root = new Path(location);
+ root = IPath.fromOSString(location);
// ensure that the location is a folder (if it exists)
File file = new File(location);
@@ -160,7 +159,7 @@ public IPath getRoot() {
if (location == null) {
return null;
}
- root = new Path(location);
+ root = IPath.fromOSString(location);
} catch (CoreException e) {
// log the problem and carry on
FileSystemPlugin.log(e);
diff --git a/team/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/history/FileSystemFileRevision.java b/team/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/history/FileSystemFileRevision.java
index dde68d25022..c426c7dced0 100644
--- a/team/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/history/FileSystemFileRevision.java
+++ b/team/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/history/FileSystemFileRevision.java
@@ -20,7 +20,6 @@
import org.eclipse.core.resources.IStorage;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
import org.eclipse.team.core.history.IFileRevision;
import org.eclipse.team.core.history.provider.FileRevision;
@@ -59,7 +58,7 @@ public InputStream getContents() {
@Override
public IPath getFullPath() {
- return new Path(remoteFile.getAbsolutePath());
+ return IPath.fromOSString(remoteFile.getAbsolutePath());
}
@Override
diff --git a/team/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/ConfigurationWizard.java b/team/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/ConfigurationWizard.java
index 1ecefd95b9b..df53445267d 100644
--- a/team/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/ConfigurationWizard.java
+++ b/team/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/ConfigurationWizard.java
@@ -15,13 +15,15 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.team.core.RepositoryProvider;
import org.eclipse.team.core.TeamException;
-import org.eclipse.team.examples.filesystem.*;
+import org.eclipse.team.examples.filesystem.FileSystemPlugin;
+import org.eclipse.team.examples.filesystem.FileSystemProvider;
+import org.eclipse.team.examples.filesystem.Policy;
import org.eclipse.team.ui.IConfigurationWizard;
import org.eclipse.team.ui.IConfigurationWizardExtension;
import org.eclipse.ui.IWorkbench;
@@ -86,7 +88,7 @@ public boolean performFinish() {
for (IProject project : projects) {
RepositoryProvider.map(project, FileSystemPlugin.PROVIDER_ID);
FileSystemProvider provider = (FileSystemProvider) RepositoryProvider.getProvider(project);
- String path = new Path(mainPage.getLocation()).append(project.getName()).toOSString();
+ String path = IPath.fromOSString(mainPage.getLocation()).append(project.getName()).toOSString();
provider.setTargetLocation(path);
}
}
diff --git a/team/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ModelObjectDefinitionFile.java b/team/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ModelObjectDefinitionFile.java
index bee99ae0875..1fa19de44f2 100644
--- a/team/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ModelObjectDefinitionFile.java
+++ b/team/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ModelObjectDefinitionFile.java
@@ -27,8 +27,8 @@
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.osgi.util.NLS;
import org.eclipse.team.examples.filesystem.FileSystemPlugin;
@@ -129,7 +129,7 @@ private static IFile getFile(String projectName, String path) {
IStatus status = workspace.validatePath("/" + projectName + "/" + path, IResource.FILE);
if (status.isOK()) {
IProject project = workspace.getRoot().getProject(projectName);
- return project.getFile(new Path(path));
+ return project.getFile(IPath.fromOSString(path));
}
FileSystemPlugin.log(status);
return null;
diff --git a/team/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/ModelNavigatorActionProvider.java b/team/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/ModelNavigatorActionProvider.java
index 0ed08bc6654..e53104c391a 100644
--- a/team/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/ModelNavigatorActionProvider.java
+++ b/team/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/ModelNavigatorActionProvider.java
@@ -16,10 +16,12 @@
import java.io.ByteArrayInputStream;
import java.util.Iterator;
-import org.eclipse.core.resources.*;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
import org.eclipse.core.runtime.Adapters;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.dialogs.ErrorDialog;
@@ -28,8 +30,12 @@
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.window.Window;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.team.examples.model.*;
-import org.eclipse.ui.navigator.*;
+import org.eclipse.team.examples.model.ModelContainer;
+import org.eclipse.team.examples.model.ModelObject;
+import org.eclipse.team.examples.model.ModelObjectDefinitionFile;
+import org.eclipse.ui.navigator.CommonActionProvider;
+import org.eclipse.ui.navigator.ICommonActionExtensionSite;
+import org.eclipse.ui.navigator.SaveablesProvider;
/**
* Model action provider for use with the Common Navigator framework. The
@@ -81,7 +87,7 @@ public void run() {
String name = promptForName();
if (name == null)
return;
- IFolder folder = container.getFolder(new Path(name));
+ IFolder folder = container.getFolder(IPath.fromOSString(name));
try {
folder.create(false, true, null);
} catch (CoreException e) {
@@ -109,7 +115,7 @@ public void run() {
return;
if (!name.endsWith(".mod"))
name += ".mod";
- IFile file = container.getFile(new Path(name));
+ IFile file = container.getFile(IPath.fromOSString(name));
try {
file.create(new ByteArrayInputStream("".getBytes()), false, null);
} catch (CoreException e) {
@@ -138,7 +144,7 @@ public void run() {
if (!path.endsWith(".moe"))
path += ".moe";
ModelContainer parent = (ModelContainer)modFile.getParent();
- IFile file = ((IContainer)parent.getResource()).getFile(new Path(path));
+ IFile file = ((IContainer)parent.getResource()).getFile(IPath.fromOSString(path));
try {
file.create(new ByteArrayInputStream("".getBytes()), false, null);
modFile.addMoe(file);
diff --git a/team/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/ModelWorkbenchAdapter.java b/team/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/ModelWorkbenchAdapter.java
index 81ca6cd201d..6af48b85340 100644
--- a/team/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/ModelWorkbenchAdapter.java
+++ b/team/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/ModelWorkbenchAdapter.java
@@ -17,7 +17,7 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.team.examples.filesystem.FileSystemPlugin;
import org.eclipse.team.examples.model.ModelFolder;
@@ -91,7 +91,7 @@ public Object getParent(Object o) {
* Creates an image descriptor.
*/
public static ImageDescriptor createImageDescriptor(String id) {
- URL url = FileLocator.find(FileSystemPlugin.getPlugin().getBundle(), new Path(ICON_PATH + id), null);
+ URL url = FileLocator.find(FileSystemPlugin.getPlugin().getBundle(), IPath.fromOSString(ICON_PATH + id), null);
return ImageDescriptor.createFromURL(url);
}
diff --git a/team/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/mapping/CompareAdapter.java b/team/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/mapping/CompareAdapter.java
index 7f6d5b2fe80..b8fe520235d 100644
--- a/team/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/mapping/CompareAdapter.java
+++ b/team/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/mapping/CompareAdapter.java
@@ -22,7 +22,7 @@
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.resources.mapping.ModelProvider;
import org.eclipse.core.resources.mapping.ResourceMapping;
-import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.team.core.mapping.ISynchronizationContext;
import org.eclipse.team.examples.model.ModelObject;
import org.eclipse.team.examples.model.ModelObjectDefinitionFile;
@@ -113,7 +113,7 @@ private ResourceMapping restoreMapping(IMemento child) {
}
private IResource getResource(String path) {
- Path resourcePath = new Path(path);
+ IPath resourcePath = IPath.fromOSString(path);
if (path.endsWith(ModelObjectDefinitionFile.MODEL_OBJECT_DEFINITION_FILE_EXTENSION)
|| path.endsWith(ModelObjectElementFile.MODEL_OBJECT_ELEMENTFILE_EXTENSION))
return ResourcesPlugin.getWorkspace().getRoot().getFile(resourcePath);
diff --git a/team/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/PessimisticFilesystemProvider.java b/team/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/PessimisticFilesystemProvider.java
index 9e65ce70ffd..f3484771a45 100644
--- a/team/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/PessimisticFilesystemProvider.java
+++ b/team/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/PessimisticFilesystemProvider.java
@@ -39,8 +39,8 @@
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.resources.team.FileModificationValidator;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.team.core.RepositoryProvider;
@@ -220,7 +220,7 @@ private IFile getControlFile(IContainer container, IProgressMonitor monitor) thr
}
child.delete(true, monitor);
}
- IFile controlFile= container.getFile(new Path(CONTROL_FILE_NAME));
+ IFile controlFile= container.getFile(IPath.fromOSString(CONTROL_FILE_NAME));
monitor.beginTask("Creating control file " + controlFile, 2);
controlFile.create(new ByteArrayInputStream(new byte[0]), true, monitor);
controlFile.setDerived(true);
@@ -247,7 +247,7 @@ Set readControlFile(IFile controlFile) {
try {
for(int i= 0; i < count; i++) {
String name= dIn.readUTF();
- IResource resource= getProject().findMember(new Path(name));
+ IResource resource= getProject().findMember(IPath.fromOSString(name));
if (resource != null) {
controlledResources.add(resource);
}
diff --git a/team/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/LineReaderTest.java b/team/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/LineReaderTest.java
index a71864f14ec..6704e6682a2 100644
--- a/team/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/LineReaderTest.java
+++ b/team/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/LineReaderTest.java
@@ -16,13 +16,15 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
-import java.io.*;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
import java.net.URL;
import java.util.List;
import org.eclipse.compare.internal.core.patch.LineReader;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.junit.Test;
public class LineReaderTest {
@@ -62,7 +64,7 @@ public void testReadUnterminatedLastLine() {
}
private BufferedReader getReader(String name) {
- IPath path = new Path("linereaderdata/" + name);
+ IPath path = IPath.fromOSString("linereaderdata/" + name);
URL url;
try {
url = new URL(CompareTestPlugin.getDefault().getBundle().getEntry("/"), path.toString());
diff --git a/team/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchBuilderTest.java b/team/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchBuilderTest.java
index 6f753333dfb..3a538e1ed97 100644
--- a/team/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchBuilderTest.java
+++ b/team/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchBuilderTest.java
@@ -24,10 +24,18 @@
import org.eclipse.compare.internal.core.patch.Hunk;
import org.eclipse.compare.internal.core.patch.LineReader;
import org.eclipse.compare.internal.patch.Utilities;
-import org.eclipse.compare.patch.*;
+import org.eclipse.compare.patch.ApplyPatchOperation;
+import org.eclipse.compare.patch.IFilePatch;
+import org.eclipse.compare.patch.IFilePatch2;
+import org.eclipse.compare.patch.IFilePatchResult;
+import org.eclipse.compare.patch.IHunk;
+import org.eclipse.compare.patch.PatchBuilder;
+import org.eclipse.compare.patch.PatchConfiguration;
import org.eclipse.compare.tests.PatchUtils.StringStorage;
import org.eclipse.core.resources.IStorage;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.junit.Assert;
import org.junit.Test;
@@ -177,7 +185,7 @@ public void testCreateFilePatch() throws CoreException, IOException {
IHunk[] hunks = new IHunk[] { hunk1, hunk0 };
- IFilePatch2 filePatch = PatchBuilder.createFilePatch(new Path(""), IFilePatch2.DATE_UNKNOWN, new Path(""),
+ IFilePatch2 filePatch = PatchBuilder.createFilePatch(IPath.fromOSString(""), IFilePatch2.DATE_UNKNOWN, IPath.fromOSString(""),
IFilePatch2.DATE_UNKNOWN, hunks);
assertEquals(2, filePatch.getHunks().length);
diff --git a/team/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchTest.java b/team/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchTest.java
index 69d0aaa69a7..6c0d0391291 100644
--- a/team/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchTest.java
+++ b/team/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchTest.java
@@ -19,21 +19,49 @@
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
-import java.io.*;
+import java.io.BufferedReader;
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.FileFilter;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.StringReader;
import java.net.JarURLConnection;
import java.net.URL;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
import java.util.Map.Entry;
+import java.util.Properties;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import java.util.zip.ZipEntry;
-import org.eclipse.compare.internal.core.patch.*;
+import org.eclipse.compare.internal.core.patch.FileDiffResult;
+import org.eclipse.compare.internal.core.patch.FilePatch2;
+import org.eclipse.compare.internal.core.patch.LineReader;
import org.eclipse.compare.internal.patch.WorkspacePatcher;
-import org.eclipse.compare.patch.*;
-import org.eclipse.compare.tests.PatchUtils.*;
+import org.eclipse.compare.patch.ApplyPatchOperation;
+import org.eclipse.compare.patch.IFilePatch;
+import org.eclipse.compare.patch.IFilePatchResult;
+import org.eclipse.compare.patch.IHunk;
+import org.eclipse.compare.patch.PatchConfiguration;
+import org.eclipse.compare.tests.PatchUtils.JarEntryStorage;
+import org.eclipse.compare.tests.PatchUtils.PatchTestConfiguration;
+import org.eclipse.compare.tests.PatchUtils.StringStorage;
import org.eclipse.core.resources.IStorage;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.ILog;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
import org.junit.Assert;
import org.junit.Test;
@@ -220,7 +248,7 @@ public void testWorkspacePatch_Delete_Reverse() {
@Test
public void testPatchdataSubfolders() throws IOException, CoreException {
- URL patchdataUrl = new URL(PatchUtils.getBundle().getEntry("/"), new Path(PatchUtils.PATCHDATA).toString());
+ URL patchdataUrl = new URL(PatchUtils.getBundle().getEntry("/"), IPath.fromOSString(PatchUtils.PATCHDATA).toString());
patchdataUrl = FileLocator.resolve(patchdataUrl);
Map map = null;
@@ -356,12 +384,12 @@ private Map extractNamesForFileProtocol(URL patc
Map result = new HashMap<>(); // configuration map
- IPath patchdataFolderPath = new Path(patchdataUrl.getPath());
+ IPath patchdataFolderPath = IPath.fromOSString(patchdataUrl.getPath());
File patchdataFolderFile = patchdataFolderPath.toFile();
assertTrue(patchdataFolderFile.isDirectory());
File[] listOfSubfolders = patchdataFolderFile.listFiles((FileFilter) File::isDirectory);
for (File subfolder : listOfSubfolders) {
- Path pcPath = new Path(subfolder.getPath() + "/" + PATCH_CONFIGURATION);
+ IPath pcPath = IPath.fromOSString(subfolder.getPath() + "/" + PATCH_CONFIGURATION);
File pcFile = pcPath.toFile();
if (subfolder.getName().equals("CVS"))
diff --git a/team/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchUtils.java b/team/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchUtils.java
index ee06b5f0d8b..4d61945cce8 100644
--- a/team/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchUtils.java
+++ b/team/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchUtils.java
@@ -13,7 +13,14 @@
*******************************************************************************/
package org.eclipse.compare.tests;
-import java.io.*;
+import java.io.BufferedInputStream;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
import java.net.URL;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
@@ -22,7 +29,8 @@
import org.eclipse.compare.patch.PatchConfiguration;
import org.eclipse.core.resources.IStorage;
import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.junit.Assert;
import org.osgi.framework.Bundle;
@@ -91,7 +99,7 @@ public InputStream getContents() throws CoreException {
@Override
public IPath getFullPath() {
- return new Path(file.getAbsolutePath());
+ return IPath.fromOSString(file.getAbsolutePath());
}
@Override
@@ -131,7 +139,7 @@ public InputStream getContents() throws CoreException {
@Override
public IPath getFullPath() {
- return new Path(jarFile.getName());
+ return IPath.fromOSString(jarFile.getName());
}
@Override
@@ -155,7 +163,7 @@ public static String asString(InputStream exptStream) throws IOException {
}
public static InputStream asInputStream(String name) {
- IPath path = new Path(PATCHDATA).append(name);
+ IPath path = IPath.fromOSString(PATCHDATA).append(name);
try {
URL url = new URL(getBundle().getEntry("/"), path.toString());
return url.openStream();
diff --git a/update/org.eclipse.update.configurator/META-INF/MANIFEST.MF b/update/org.eclipse.update.configurator/META-INF/MANIFEST.MF
index 616b85ed5b7..8a57057572c 100644
--- a/update/org.eclipse.update.configurator/META-INF/MANIFEST.MF
+++ b/update/org.eclipse.update.configurator/META-INF/MANIFEST.MF
@@ -9,7 +9,7 @@ Bundle-Localization: plugin
Export-Package: org.eclipse.update.configurator,
org.eclipse.update.internal.configurator;x-friends:="org.eclipse.update.core",
org.eclipse.update.internal.configurator.branding;x-friends:="org.eclipse.update.core"
-Require-Bundle: org.eclipse.equinox.common;bundle-version="[3.2.0,4.0.0)",
+Require-Bundle: org.eclipse.equinox.common;bundle-version="[3.18.0,4.0.0)",
org.eclipse.osgi;bundle-version="[3.2.0,4.0.0)"
Bundle-RequiredExecutionEnvironment: JavaSE-17
Import-Package: javax.xml.parsers,
diff --git a/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/PlatformConfiguration.java b/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/PlatformConfiguration.java
index 7bd00d4c30d..aff26f3fe4b 100644
--- a/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/PlatformConfiguration.java
+++ b/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/PlatformConfiguration.java
@@ -39,7 +39,7 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.osgi.service.datalocation.Location;
import org.eclipse.osgi.util.NLS;
import org.eclipse.update.configurator.IPlatformConfiguration;
@@ -124,7 +124,7 @@ private PlatformConfiguration(Location platformConfigLocation) throws CoreExcept
// Retrieve install location with respect to given url if possible
try {
if (url != null && url.getProtocol().equals("file") && url.getPath().endsWith("configuration/org.eclipse.update/platform.xml")) {
- installLocation = new Path(url.getPath()).removeLastSegments(3).toFile().toURL();
+ installLocation = IPath.fromOSString(url.getPath()).removeLastSegments(3).toFile().toURL();
}
} catch (Exception e) {
//
diff --git a/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/Utils.java b/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/Utils.java
index 80c76d204bf..5aa4cb260a9 100644
--- a/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/Utils.java
+++ b/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/Utils.java
@@ -26,11 +26,11 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.osgi.framework.log.FrameworkLog;
import org.eclipse.osgi.framework.log.FrameworkLogEntry;
import org.eclipse.osgi.service.datalocation.Location;
+import org.eclipse.osgi.service.environment.EnvironmentInfo;
import org.eclipse.osgi.service.resolver.PlatformAdmin;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
@@ -408,11 +408,11 @@ public static URL makeAbsolute(URL base, URL relativeLocation) {
if (relativeLocation.getProtocol() != null && !relativeLocation.getProtocol().equals(base.getProtocol()))
// it is not relative, return as is (avoid creating garbage)
return relativeLocation;
- IPath relativePath = new Path(relativeLocation.getPath());
+ IPath relativePath = IPath.fromOSString(relativeLocation.getPath());
if (relativePath.isAbsolute())
return relativeLocation;
try {
- IPath absolutePath = new Path(base.getPath()).append(relativeLocation.getPath());
+ IPath absolutePath = IPath.fromOSString(base.getPath()).append(relativeLocation.getPath());
// File.toURL() is the best way to create a file: URL
return absolutePath.toFile().toURL();
} catch (MalformedURLException e) {
@@ -433,10 +433,10 @@ public static URL makeRelative(URL base, URL location) {
return location;
if (!base.getProtocol().equals(location.getProtocol()))
return location;
- IPath locationPath = new Path(location.getPath());
+ IPath locationPath = IPath.fromOSString(location.getPath());
if (!locationPath.isAbsolute())
return location;
- IPath relativePath = makeRelative(new Path(base.getPath()), locationPath);
+ IPath relativePath = makeRelative(IPath.fromOSString(base.getPath()), locationPath);
try {
return new URL(base.getProtocol(), base.getHost(), base.getPort(), relativePath.toString());
} catch (MalformedURLException e) {
@@ -460,7 +460,7 @@ public static IPath makeRelative(IPath base, IPath location) {
String temp = ""; //$NON-NLS-1$
for (int j = 0; j < baseCount - count; j++)
temp += "../"; //$NON-NLS-1$
- return new Path(temp).append(location.removeFirstSegments(count));
+ return IPath.fromOSString(temp).append(location.removeFirstSegments(count));
}
/**
diff --git a/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/branding/AboutInfo.java b/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/branding/AboutInfo.java
index 01721b79286..42253f2e490 100644
--- a/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/branding/AboutInfo.java
+++ b/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/branding/AboutInfo.java
@@ -13,10 +13,10 @@
*******************************************************************************/
package org.eclipse.update.internal.configurator.branding;
-import java.net.*;
+import java.net.URL;
import java.util.Hashtable;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.IPath;
/**
@@ -125,7 +125,7 @@ public URL getFeatureImageURL() {
*/
public String getFeatureImageName() {
if (featureImageURL != null) {
- IPath path = new Path(featureImageURL.getPath());
+ IPath path = IPath.fromOSString(featureImageURL.getPath());
return path.lastSegment();
}
return null;
diff --git a/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/branding/IniFileReader.java b/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/branding/IniFileReader.java
index fb39d8e7fd3..ae7dcf2430a 100644
--- a/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/branding/IniFileReader.java
+++ b/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/branding/IniFileReader.java
@@ -13,8 +13,9 @@
*******************************************************************************/
package org.eclipse.update.internal.configurator.branding;
-import java.io.*;
-import java.net.*;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
import java.text.MessageFormat; // Can't use ICU, possible launch problem?
import java.util.ArrayList;
import java.util.Enumeration;
@@ -24,11 +25,15 @@
import java.util.PropertyResourceBundle;
import java.util.StringTokenizer;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
import org.eclipse.osgi.util.NLS;
import org.eclipse.update.internal.configurator.Messages;
import org.eclipse.update.internal.configurator.Utils;
-import org.osgi.framework.*;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.Constants;
/**
* Reads the information found in an "INI" file. This file must be in a
@@ -99,7 +104,7 @@ public IStatus load() {
// Determine the ini file location
URL iniURL = null;
IOException ioe = null;
- iniURL = FileLocator.find(bundle, new Path(NLS_TAG).append(iniFilename), null);
+ iniURL = FileLocator.find(bundle, IPath.fromOSString(NLS_TAG).append(iniFilename), null);
if (iniURL == null) {
String message = NLS.bind(Messages.IniFileReader_OpenINIError, (new String[] { iniFilename }));
return new Status(IStatus.ERROR, PID, 0, message, ioe);
@@ -108,13 +113,13 @@ public IStatus load() {
// Determine the properties file location
URL propertiesURL = null;
if (propertiesFilename != null && !propertiesFilename.isEmpty()) {
- propertiesURL = FileLocator.find(bundle, new Path(NLS_TAG).append(propertiesFilename), null);
+ propertiesURL = FileLocator.find(bundle, IPath.fromOSString(NLS_TAG).append(propertiesFilename), null);
}
// Determine the mappings file location
URL mappingsURL = null;
if (mappingsFilename != null && mappingsFilename.length() > 0) {
- mappingsURL = FileLocator.find(bundle, new Path(NLS_TAG).append(mappingsFilename), null);
+ mappingsURL = FileLocator.find(bundle, IPath.fromOSString(NLS_TAG).append(mappingsFilename), null);
}
// OK to pass null properties and/or mapping file
@@ -151,7 +156,7 @@ public URL getURL(String key) {
if (fileName != null) {
if (bundle == null)
return null;
- url = FileLocator.find(bundle, new Path(fileName), null);
+ url = FileLocator.find(bundle, IPath.fromOSString(fileName), null);
}
return url;
}
@@ -177,7 +182,7 @@ public URL[] getURLs(String key) {
ArrayList array = new ArrayList<>(10);
while (tokens.hasMoreTokens()) {
String str = tokens.nextToken().trim();
- array.add(FileLocator.find(bundle, new Path(str), null));
+ array.add(FileLocator.find(bundle, IPath.fromOSString(str), null));
}
URL[] urls = new URL[array.size()];