Skip to content

Commit 91e0130

Browse files
committed
Replace org.eclipse.core.runtime.Path by IPath
1 parent 0a606fb commit 91e0130

File tree

56 files changed

+100
-130
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+100
-130
lines changed

org.eclipse.m2e.apt.core/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Bundle-Name: %Bundle-Name
44
Bundle-SymbolicName: org.eclipse.m2e.apt.core;singleton:=true
55
Bundle-Version: 2.2.200.qualifier
66
Bundle-Localization: plugin
7-
Require-Bundle: org.eclipse.core.runtime,
7+
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.27.0,4.0.0)",
88
org.eclipse.core.resources,
99
org.eclipse.jdt.core,
1010
org.eclipse.jdt.apt.core;bundle-version="3.7.50",

org.eclipse.m2e.apt.core/src/org/eclipse/m2e/apt/internal/AbstractAptConfiguratorDelegate.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
import org.eclipse.core.runtime.CoreException;
3636
import org.eclipse.core.runtime.IPath;
3737
import org.eclipse.core.runtime.IProgressMonitor;
38-
import org.eclipse.core.runtime.Path;
3938
import org.eclipse.jdt.apt.core.internal.util.FactoryContainer;
4039
import org.eclipse.jdt.apt.core.internal.util.FactoryContainer.FactoryType;
4140
import org.eclipse.jdt.apt.core.internal.util.FactoryPath;
@@ -189,11 +188,11 @@ public void configureProject(IProgressMonitor monitor) throws CoreException {
189188
IPath m2RepoPath = JavaCore.getClasspathVariable(M2_REPO);
190189

191190
for(File resolvedJarArtifact : resolvedJarArtifactsInReverseOrder) {
192-
IPath absolutePath = new Path(resolvedJarArtifact.getAbsolutePath());
191+
IPath absolutePath = IPath.fromOSString(resolvedJarArtifact.getAbsolutePath());
193192
//reference jars in a portable way
194193
if((m2RepoPath != null) && m2RepoPath.isPrefixOf(absolutePath)) {
195194
IPath relativePath = absolutePath.removeFirstSegments(m2RepoPath.segmentCount()).makeRelative().setDevice(null);
196-
IPath variablePath = new Path(M2_REPO).append(relativePath);
195+
IPath variablePath = IPath.fromOSString(M2_REPO).append(relativePath);
197196
factoryPath.addVarJar(variablePath);
198197
} else {
199198
//fall back on using absolute references.

org.eclipse.m2e.apt.core/src/org/eclipse/m2e/apt/internal/utils/ProjectUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
import java.util.stream.Collectors;
2929

3030
import org.eclipse.core.resources.IProject;
31-
import org.eclipse.core.runtime.Path;
31+
import org.eclipse.core.runtime.IPath;
3232
import org.eclipse.core.runtime.Platform;
3333
import org.eclipse.core.runtime.Status;
3434
import org.eclipse.jdt.apt.core.util.AptConfig;
@@ -288,7 +288,7 @@ public static void disableApt(IProject project) {
288288
}
289289

290290
public static boolean isJar(File file) {
291-
return file.isFile() && "jar".equals(new Path(file.getAbsolutePath()).getFileExtension());
291+
return file.isFile() && "jar".equals(IPath.fromOSString(file.getAbsolutePath()).getFileExtension());
292292
}
293293

294294
private static boolean containsWhitespace(String seq) {

org.eclipse.m2e.apt.tests/src/org/eclipse/m2e/apt/tests/AbstractM2eAptProjectConfiguratorTestCase.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
import org.eclipse.core.runtime.CoreException;
3434
import org.eclipse.core.runtime.IPath;
3535
import org.eclipse.core.runtime.OperationCanceledException;
36-
import org.eclipse.core.runtime.Path;
3736
import org.eclipse.core.runtime.jobs.Job;
3837
import org.eclipse.jdt.apt.core.internal.util.FactoryContainer;
3938
import org.eclipse.jdt.apt.core.internal.util.FactoryPath;
@@ -148,7 +147,7 @@ protected void updateProject(IProject project, String newPomName) throws Excepti
148147
}
149148

150149
protected void assertClasspathEntry(IJavaProject jp, String path, boolean present) throws Exception {
151-
IPath expectedPath = new Path(path);
150+
IPath expectedPath = IPath.fromOSString(path);
152151
for (IClasspathEntry cpe : jp.getRawClasspath()) {
153152
if (expectedPath.equals(cpe.getPath())) {
154153
if (present) {

org.eclipse.m2e.binaryproject/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Require-Bundle: org.eclipse.m2e.core;bundle-version="[2.0.0,3.0.0)",
99
org.eclipse.m2e.sourcelookup;bundle-version="[2.0.0,3.0.0)",
1010
org.eclipse.m2e.jdt;bundle-version="[2.0.0,3.0.0)",
1111
org.eclipse.jdt.core;bundle-version="3.7.0",
12-
org.eclipse.core.runtime;bundle-version="3.7.0",
12+
org.eclipse.core.runtime;bundle-version="[3.27.0,4.0.0)",
1313
org.eclipse.debug.core;bundle-version="3.9.0",
1414
org.eclipse.jdt.launching;bundle-version="3.10.0"
1515
Bundle-RequiredExecutionEnvironment: JavaSE-17

org.eclipse.m2e.binaryproject/src/org/eclipse/m2e/binaryproject/internal/ClasspathConfigurator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
import org.eclipse.core.resources.IResource;
2323
import org.eclipse.core.resources.ProjectScope;
2424
import org.eclipse.core.runtime.CoreException;
25+
import org.eclipse.core.runtime.IPath;
2526
import org.eclipse.core.runtime.IProgressMonitor;
26-
import org.eclipse.core.runtime.Path;
2727
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
2828
import org.eclipse.core.runtime.preferences.IScopeContext;
2929
import org.eclipse.jdt.core.JavaCore;
@@ -79,9 +79,9 @@ protected void invokeJavaProjectConfigurators(IClasspathDescriptor classpath, Pr
7979

8080
Artifact sources =
8181
maven.resolve(groupId, artifactId, version, type, getSourcesClassifier(classifier), repositories, monitor);
82-
IClasspathEntryDescriptor libEntry = classpath.addLibraryEntry(Path.fromOSString(jarLocation));
82+
IClasspathEntryDescriptor libEntry = classpath.addLibraryEntry(IPath.fromOSString(jarLocation));
8383
libEntry.setExported(true);
84-
libEntry.setSourceAttachment(Path.fromOSString(sources.getFile().getAbsolutePath()), null);
84+
libEntry.setSourceAttachment(IPath.fromOSString(sources.getFile().getAbsolutePath()), null);
8585
libEntry.setArtifactKey(new ArtifactKey(groupId, artifactId, version, classifier));
8686
}
8787

org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/MavenPropertyTester.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import org.eclipse.core.runtime.IAdaptable;
2323
import org.eclipse.core.runtime.IPath;
2424
import org.eclipse.core.runtime.NullProgressMonitor;
25-
import org.eclipse.core.runtime.Path;
2625
import org.eclipse.ui.IFileEditorInput;
2726

2827
import org.eclipse.m2e.core.MavenPlugin;
@@ -114,7 +113,7 @@ public boolean test(Object receiver, String property, Object[] args, Object expe
114113
if(projectFacade == null || projectFacade.getMavenProject() == null) {
115114
//If the project facade has not been cached yet (ex. during workspace startup),
116115
//fall back on the default value
117-
outputLocation = new Path(DEFAULT_BUILD_DIR);
116+
outputLocation = IPath.fromOSString(DEFAULT_BUILD_DIR);
118117
} else {
119118
String buildDir = projectFacade.getMavenProject().getBuild().getDirectory();
120119
outputLocation = MavenProjectUtils.getProjectRelativePath(project, buildDir);

org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/StaticMavenStorageEditorInput.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
import org.eclipse.core.resources.IStorage;
1616
import org.eclipse.core.runtime.IPath;
17-
import org.eclipse.core.runtime.Path;
1817
import org.eclipse.jface.resource.ImageDescriptor;
1918
import org.eclipse.ui.IPersistableElement;
2019
import org.eclipse.ui.IStorageEditorInput;
@@ -78,7 +77,7 @@ public <T> T getAdapter(Class<T> adapter) {
7877
}
7978

8079
public IPath getPath() {
81-
return path == null ? null : new Path(path);
80+
return path == null ? null : IPath.fromOSString(path);
8281
}
8382

8483
}
@@ -106,7 +105,7 @@ public String getName() {
106105

107106
@Override
108107
public IPath getFullPath() {
109-
return path == null ? null : new Path(path);
108+
return path == null ? null : IPath.fromOSString(path);
110109
}
111110

112111
@Override

org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/project/MavenProjectConfigurator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@
2828
import org.eclipse.core.runtime.IPath;
2929
import org.eclipse.core.runtime.IProgressMonitor;
3030
import org.eclipse.core.runtime.IStatus;
31-
import org.eclipse.core.runtime.Path;
3231
import org.eclipse.core.runtime.Status;
3332
import org.eclipse.core.runtime.jobs.Job;
33+
import org.eclipse.ui.wizards.datatransfer.ProjectConfigurator;
34+
3435
import org.eclipse.m2e.core.MavenPlugin;
3536
import org.eclipse.m2e.core.internal.IMavenConstants;
3637
import org.eclipse.m2e.core.internal.jobs.MavenJob;
@@ -45,7 +46,6 @@
4546
import org.eclipse.m2e.core.ui.internal.M2EUIPluginActivator;
4647
import org.eclipse.m2e.core.ui.internal.wizards.LifecycleMappingDiscoveryHelper;
4748
import org.eclipse.m2e.core.ui.internal.wizards.MappingDiscoveryJob;
48-
import org.eclipse.ui.wizards.datatransfer.ProjectConfigurator;
4949

5050
public class MavenProjectConfigurator implements ProjectConfigurator {
5151

@@ -263,7 +263,7 @@ public void configure(final IProject project, Set<IPath> excludedDirectories, fi
263263

264264
@Override
265265
public boolean shouldBeAnEclipseProject(IContainer container, IProgressMonitor monitor) {
266-
IFile pomFile = container.getFile(new Path(IMavenConstants.POM_FILE_NAME));
266+
IFile pomFile = container.getFile(IPath.fromOSString(IMavenConstants.POM_FILE_NAME));
267267
return pomFile.exists();
268268
}
269269

0 commit comments

Comments
 (0)