From 91e0130577d8931e3bd3057cc86c1abb7ded76be Mon Sep 17 00:00:00 2001 From: Hannes Wellmann Date: Sat, 18 Nov 2023 22:09:40 +0100 Subject: [PATCH] Replace org.eclipse.core.runtime.Path by IPath --- m2e-core-tests | 2 +- org.eclipse.m2e.apt.core/META-INF/MANIFEST.MF | 2 +- .../internal/AbstractAptConfiguratorDelegate.java | 5 ++--- .../m2e/apt/internal/utils/ProjectUtils.java | 4 ++-- .../AbstractM2eAptProjectConfiguratorTestCase.java | 3 +-- org.eclipse.m2e.binaryproject/META-INF/MANIFEST.MF | 2 +- .../internal/ClasspathConfigurator.java | 6 +++--- .../ui/internal/actions/MavenPropertyTester.java | 3 +-- .../actions/StaticMavenStorageEditorInput.java | 5 ++--- .../internal/project/MavenProjectConfigurator.java | 6 +++--- .../eclipse/m2e/core/ui/internal/util/XmlUtils.java | 3 +-- .../ui/internal/wizards/MavenImportWizardPage.java | 3 +-- .../ui/internal/wizards/MavenLocationComponent.java | 3 +-- .../wizards/MavenModuleWizardParentPage.java | 6 +++--- .../core/ui/internal/wizards/MavenPomWizard.java | 6 +++--- .../ui/internal/wizards/MavenPomWizardPage.java | 6 +++--- .../wizards/MavenProjectSelectionDialog.java | 4 ++-- .../wizards/MavenProjectWizardLocationPage.java | 5 ++--- org.eclipse.m2e.core/META-INF/MANIFEST.MF | 2 +- .../src/org/eclipse/m2e/core/internal/Bundles.java | 4 ++-- .../src/org/eclipse/m2e/core/internal/M2EUtils.java | 3 +-- .../plexusbuildapi/AbstractEclipseBuildContext.java | 3 +-- .../EclipseIncrementalBuildContext.java | 3 +-- .../plexusbuildapi/EclipseResourceBuildDelta.java | 3 +-- .../internal/project/PomFacadeAdapterFactory.java | 3 +-- .../project/ProjectConfigurationManager.java | 3 +-- .../project/registry/ProjectRegistryManager.java | 7 +++---- .../project/registry/ProjectRegistryReader.java | 5 ++--- .../eclipse/m2e/core/project/MavenProjectUtils.java | 3 +-- org.eclipse.m2e.editor/META-INF/MANIFEST.MF | 2 +- .../org/eclipse/m2e/editor/pom/MavenPomEditor.java | 5 +++-- .../org/eclipse/m2e/editor/pom/OverviewPage.java | 3 +-- .../m2e/editor/pom/PomHyperlinkDetector.java | 4 ++-- org.eclipse.m2e.jdt/META-INF/MANIFEST.MF | 2 +- .../internal/AbstractJavaProjectConfigurator.java | 13 ++++++------- .../eclipse/m2e/jdt/internal/BuildPathManager.java | 13 ++++++------- .../internal/DefaultClasspathManagerDelegate.java | 3 +-- .../internal/MavenClasspathContainerSaveHelper.java | 3 +-- .../m2e/jdt/internal/MavenClasspathHelpers.java | 5 ++--- .../org/eclipse/m2e/jdt/internal/ModuleSupport.java | 4 ++-- .../launch/MavenRuntimeClasspathProvider.java | 5 ++--- org.eclipse.m2e.launching/META-INF/MANIFEST.MF | 2 +- .../org/eclipse/m2e/actions/ExecutePomAction.java | 5 ++--- .../internal/launch/MavenConsoleLineTracker.java | 2 +- .../m2e/internal/launch/MavenLaunchDelegate.java | 5 ++--- .../internal/launch/MavenSourcePathComputer.java | 6 +++--- org.eclipse.m2e.mavenarchiver/META-INF/MANIFEST.MF | 2 +- .../internal/AbstractMavenArchiverConfigurator.java | 6 +++--- .../m2e/pde/connector/tests/BNDConnectorTest.java | 3 +-- org.eclipse.m2e.pde.connector/META-INF/MANIFEST.MF | 2 +- .../pde/connector/PDEBuildProjectFileResolver.java | 7 +++---- .../connector/PDEMavenBundlePluginConfigurator.java | 3 +-- .../eclipse/m2e/pde/connector/PDEProjectHelper.java | 2 +- org.eclipse.m2e.pde.target/META-INF/MANIFEST.MF | 2 +- .../pde/target/MavenPluginSourcePathLocator.java | 5 ++--- .../eclipse/m2e/tests/common/ClasspathHelpers.java | 3 +-- 56 files changed, 100 insertions(+), 130 deletions(-) diff --git a/m2e-core-tests b/m2e-core-tests index a129b55566..056b30ee95 160000 --- a/m2e-core-tests +++ b/m2e-core-tests @@ -1 +1 @@ -Subproject commit a129b55566fa7fdea9f25f695a6ada4885689d60 +Subproject commit 056b30ee9530790ade82bb92251d3fa658ebb38a diff --git a/org.eclipse.m2e.apt.core/META-INF/MANIFEST.MF b/org.eclipse.m2e.apt.core/META-INF/MANIFEST.MF index c97900c82f..9d20a8bcce 100644 --- a/org.eclipse.m2e.apt.core/META-INF/MANIFEST.MF +++ b/org.eclipse.m2e.apt.core/META-INF/MANIFEST.MF @@ -4,7 +4,7 @@ Bundle-Name: %Bundle-Name Bundle-SymbolicName: org.eclipse.m2e.apt.core;singleton:=true Bundle-Version: 2.2.200.qualifier Bundle-Localization: plugin -Require-Bundle: org.eclipse.core.runtime, +Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.27.0,4.0.0)", org.eclipse.core.resources, org.eclipse.jdt.core, org.eclipse.jdt.apt.core;bundle-version="3.7.50", diff --git a/org.eclipse.m2e.apt.core/src/org/eclipse/m2e/apt/internal/AbstractAptConfiguratorDelegate.java b/org.eclipse.m2e.apt.core/src/org/eclipse/m2e/apt/internal/AbstractAptConfiguratorDelegate.java index 24cdeff7b7..e6cb9587d2 100644 --- a/org.eclipse.m2e.apt.core/src/org/eclipse/m2e/apt/internal/AbstractAptConfiguratorDelegate.java +++ b/org.eclipse.m2e.apt.core/src/org/eclipse/m2e/apt/internal/AbstractAptConfiguratorDelegate.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.jdt.apt.core.internal.util.FactoryContainer; import org.eclipse.jdt.apt.core.internal.util.FactoryContainer.FactoryType; import org.eclipse.jdt.apt.core.internal.util.FactoryPath; @@ -189,11 +188,11 @@ public void configureProject(IProgressMonitor monitor) throws CoreException { IPath m2RepoPath = JavaCore.getClasspathVariable(M2_REPO); for(File resolvedJarArtifact : resolvedJarArtifactsInReverseOrder) { - IPath absolutePath = new Path(resolvedJarArtifact.getAbsolutePath()); + IPath absolutePath = IPath.fromOSString(resolvedJarArtifact.getAbsolutePath()); //reference jars in a portable way if((m2RepoPath != null) && m2RepoPath.isPrefixOf(absolutePath)) { IPath relativePath = absolutePath.removeFirstSegments(m2RepoPath.segmentCount()).makeRelative().setDevice(null); - IPath variablePath = new Path(M2_REPO).append(relativePath); + IPath variablePath = IPath.fromOSString(M2_REPO).append(relativePath); factoryPath.addVarJar(variablePath); } else { //fall back on using absolute references. diff --git a/org.eclipse.m2e.apt.core/src/org/eclipse/m2e/apt/internal/utils/ProjectUtils.java b/org.eclipse.m2e.apt.core/src/org/eclipse/m2e/apt/internal/utils/ProjectUtils.java index 2aec80f63b..6cf49c3ae5 100644 --- a/org.eclipse.m2e.apt.core/src/org/eclipse/m2e/apt/internal/utils/ProjectUtils.java +++ b/org.eclipse.m2e.apt.core/src/org/eclipse/m2e/apt/internal/utils/ProjectUtils.java @@ -28,7 +28,7 @@ import java.util.stream.Collectors; import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.Path; +import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Status; import org.eclipse.jdt.apt.core.util.AptConfig; @@ -288,7 +288,7 @@ public static void disableApt(IProject project) { } public static boolean isJar(File file) { - return file.isFile() && "jar".equals(new Path(file.getAbsolutePath()).getFileExtension()); + return file.isFile() && "jar".equals(IPath.fromOSString(file.getAbsolutePath()).getFileExtension()); } private static boolean containsWhitespace(String seq) { diff --git a/org.eclipse.m2e.apt.tests/src/org/eclipse/m2e/apt/tests/AbstractM2eAptProjectConfiguratorTestCase.java b/org.eclipse.m2e.apt.tests/src/org/eclipse/m2e/apt/tests/AbstractM2eAptProjectConfiguratorTestCase.java index e48090ada4..4e18772f77 100644 --- a/org.eclipse.m2e.apt.tests/src/org/eclipse/m2e/apt/tests/AbstractM2eAptProjectConfiguratorTestCase.java +++ b/org.eclipse.m2e.apt.tests/src/org/eclipse/m2e/apt/tests/AbstractM2eAptProjectConfiguratorTestCase.java @@ -33,7 +33,6 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.OperationCanceledException; -import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.jobs.Job; import org.eclipse.jdt.apt.core.internal.util.FactoryContainer; import org.eclipse.jdt.apt.core.internal.util.FactoryPath; @@ -148,7 +147,7 @@ protected void updateProject(IProject project, String newPomName) throws Excepti } protected void assertClasspathEntry(IJavaProject jp, String path, boolean present) throws Exception { - IPath expectedPath = new Path(path); + IPath expectedPath = IPath.fromOSString(path); for (IClasspathEntry cpe : jp.getRawClasspath()) { if (expectedPath.equals(cpe.getPath())) { if (present) { diff --git a/org.eclipse.m2e.binaryproject/META-INF/MANIFEST.MF b/org.eclipse.m2e.binaryproject/META-INF/MANIFEST.MF index a5570e76bd..0d8ecb4c90 100644 --- a/org.eclipse.m2e.binaryproject/META-INF/MANIFEST.MF +++ b/org.eclipse.m2e.binaryproject/META-INF/MANIFEST.MF @@ -9,7 +9,7 @@ Require-Bundle: org.eclipse.m2e.core;bundle-version="[2.0.0,3.0.0)", org.eclipse.m2e.sourcelookup;bundle-version="[2.0.0,3.0.0)", org.eclipse.m2e.jdt;bundle-version="[2.0.0,3.0.0)", org.eclipse.jdt.core;bundle-version="3.7.0", - org.eclipse.core.runtime;bundle-version="3.7.0", + org.eclipse.core.runtime;bundle-version="[3.27.0,4.0.0)", org.eclipse.debug.core;bundle-version="3.9.0", org.eclipse.jdt.launching;bundle-version="3.10.0" Bundle-RequiredExecutionEnvironment: JavaSE-17 diff --git a/org.eclipse.m2e.binaryproject/src/org/eclipse/m2e/binaryproject/internal/ClasspathConfigurator.java b/org.eclipse.m2e.binaryproject/src/org/eclipse/m2e/binaryproject/internal/ClasspathConfigurator.java index 889d03ba9e..c0e3ef6614 100644 --- a/org.eclipse.m2e.binaryproject/src/org/eclipse/m2e/binaryproject/internal/ClasspathConfigurator.java +++ b/org.eclipse.m2e.binaryproject/src/org/eclipse/m2e/binaryproject/internal/ClasspathConfigurator.java @@ -22,8 +22,8 @@ import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.ProjectScope; 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.preferences.IEclipsePreferences; import org.eclipse.core.runtime.preferences.IScopeContext; import org.eclipse.jdt.core.JavaCore; @@ -79,9 +79,9 @@ protected void invokeJavaProjectConfigurators(IClasspathDescriptor classpath, Pr Artifact sources = maven.resolve(groupId, artifactId, version, type, getSourcesClassifier(classifier), repositories, monitor); - IClasspathEntryDescriptor libEntry = classpath.addLibraryEntry(Path.fromOSString(jarLocation)); + IClasspathEntryDescriptor libEntry = classpath.addLibraryEntry(IPath.fromOSString(jarLocation)); libEntry.setExported(true); - libEntry.setSourceAttachment(Path.fromOSString(sources.getFile().getAbsolutePath()), null); + libEntry.setSourceAttachment(IPath.fromOSString(sources.getFile().getAbsolutePath()), null); libEntry.setArtifactKey(new ArtifactKey(groupId, artifactId, version, classifier)); } diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/MavenPropertyTester.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/MavenPropertyTester.java index 6dd8f394b2..ccd628693c 100644 --- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/MavenPropertyTester.java +++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/MavenPropertyTester.java @@ -22,7 +22,6 @@ import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Path; import org.eclipse.ui.IFileEditorInput; import org.eclipse.m2e.core.MavenPlugin; @@ -114,7 +113,7 @@ public boolean test(Object receiver, String property, Object[] args, Object expe if(projectFacade == null || projectFacade.getMavenProject() == null) { //If the project facade has not been cached yet (ex. during workspace startup), //fall back on the default value - outputLocation = new Path(DEFAULT_BUILD_DIR); + outputLocation = IPath.fromOSString(DEFAULT_BUILD_DIR); } else { String buildDir = projectFacade.getMavenProject().getBuild().getDirectory(); outputLocation = MavenProjectUtils.getProjectRelativePath(project, buildDir); diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/StaticMavenStorageEditorInput.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/StaticMavenStorageEditorInput.java index dead7ff8b2..641a6f2335 100644 --- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/StaticMavenStorageEditorInput.java +++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/StaticMavenStorageEditorInput.java @@ -14,7 +14,6 @@ import org.eclipse.core.resources.IStorage; import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.ui.IPersistableElement; import org.eclipse.ui.IStorageEditorInput; @@ -78,7 +77,7 @@ public T getAdapter(Class adapter) { } public IPath getPath() { - return path == null ? null : new Path(path); + return path == null ? null : IPath.fromOSString(path); } } @@ -106,7 +105,7 @@ public String getName() { @Override public IPath getFullPath() { - return path == null ? null : new Path(path); + return path == null ? null : IPath.fromOSString(path); } @Override diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/project/MavenProjectConfigurator.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/project/MavenProjectConfigurator.java index d5b5c55061..1ff06d8304 100644 --- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/project/MavenProjectConfigurator.java +++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/project/MavenProjectConfigurator.java @@ -28,9 +28,10 @@ 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.wizards.datatransfer.ProjectConfigurator; + import org.eclipse.m2e.core.MavenPlugin; import org.eclipse.m2e.core.internal.IMavenConstants; import org.eclipse.m2e.core.internal.jobs.MavenJob; @@ -45,7 +46,6 @@ import org.eclipse.m2e.core.ui.internal.M2EUIPluginActivator; import org.eclipse.m2e.core.ui.internal.wizards.LifecycleMappingDiscoveryHelper; import org.eclipse.m2e.core.ui.internal.wizards.MappingDiscoveryJob; -import org.eclipse.ui.wizards.datatransfer.ProjectConfigurator; public class MavenProjectConfigurator implements ProjectConfigurator { @@ -263,7 +263,7 @@ public void configure(final IProject project, Set excludedDirectories, fi @Override public boolean shouldBeAnEclipseProject(IContainer container, IProgressMonitor monitor) { - IFile pomFile = container.getFile(new Path(IMavenConstants.POM_FILE_NAME)); + IFile pomFile = container.getFile(IPath.fromOSString(IMavenConstants.POM_FILE_NAME)); return pomFile.exists(); } diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/util/XmlUtils.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/util/XmlUtils.java index 9876477cb4..f82d5a907e 100644 --- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/util/XmlUtils.java +++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/util/XmlUtils.java @@ -34,7 +34,6 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.ITextViewer; import org.eclipse.wst.sse.core.StructuredModelManager; @@ -104,7 +103,7 @@ public static IProject extractProject(ITextViewer sourceViewer) { } IFileStore folder = buf.getFileStore(); File file = new File(folder.toURI()); - IPath path = Path.fromOSString(file.getAbsolutePath()); + IPath path = IPath.fromOSString(file.getAbsolutePath()); Stack stack = new Stack<>(); //here we need to find the most inner project to the path. //we do so by shortening the path and remembering all the resources identified. diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenImportWizardPage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenImportWizardPage.java index 07eba25542..dffd36df02 100644 --- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenImportWizardPage.java +++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenImportWizardPage.java @@ -37,7 +37,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.dialogs.IMessageProvider; import org.eclipse.jface.viewers.CheckboxTreeViewer; import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider; @@ -371,7 +370,7 @@ public boolean hasChildren(Object parentElement) { protected boolean rootDirectoryChanged() { String _rootDirectory = rootDirectory; rootDirectory = rootDirectoryCombo.getText().trim(); - IPath p = new Path(rootDirectory); + IPath p = IPath.fromOSString(rootDirectory); if(p.isRoot()) { setErrorMessage(Messages.MavenImportWizardPage_forbiddenImportFromRoot); return false; diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenLocationComponent.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenLocationComponent.java index dd1dbb963d..f5d0c3a80c 100644 --- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenLocationComponent.java +++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenLocationComponent.java @@ -15,7 +15,6 @@ import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Platform; import org.eclipse.swt.SWT; import org.eclipse.swt.events.ModifyListener; @@ -150,7 +149,7 @@ public IPath getLocationPath() { if(isInWorkspace()) { return Platform.getLocation(); } - return Path.fromOSString(locationCombo.getText().trim()); + return IPath.fromOSString(locationCombo.getText().trim()); } /** diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenModuleWizardParentPage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenModuleWizardParentPage.java index e3e556de15..1e7475e1da 100644 --- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenModuleWizardParentPage.java +++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenModuleWizardParentPage.java @@ -26,8 +26,8 @@ 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.IStatus; -import org.eclipse.core.runtime.Path; import org.eclipse.jface.window.Window; import org.eclipse.jface.wizard.IWizardPage; import org.eclipse.swt.SWT; @@ -172,7 +172,7 @@ void validate() { } // check if the given folder already exists - if(parentContainer != null && parentContainer.exists(new Path(moduleName))) { + if(parentContainer != null && parentContainer.exists(IPath.fromOSString(moduleName))) { setErrorMessage(Messages.wizardModulePageParentValidatorNameExists); setPageComplete(false); return; @@ -214,7 +214,7 @@ protected void loadParent() { workingSetGroup.selectWorkingSets(WorkingSets.getAssignedWorkingSets(project)); } else if(parentObject instanceof IContainer container) { - pom = container.getFile(new Path(IMavenConstants.POM_FILE_NAME)); + pom = container.getFile(IPath.fromOSString(IMavenConstants.POM_FILE_NAME)); } if(pom != null && pom.exists()) { diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenPomWizard.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenPomWizard.java index 08fbe386df..3e8f5a2dbb 100644 --- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenPomWizard.java +++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenPomWizard.java @@ -25,8 +25,8 @@ 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.Path; import org.eclipse.core.runtime.Status; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.operation.IRunnableWithProgress; @@ -119,14 +119,14 @@ public boolean performFinish() { void doFinish(String projectName, final Model model, IProgressMonitor monitor) throws CoreException { // monitor.beginTask("Creating " + fileName, 2); IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); - IResource resource = root.findMember(new Path(projectName)); + IResource resource = root.findMember(IPath.fromOSString(projectName)); if(!resource.exists() || (resource.getType() & IResource.FOLDER | IResource.PROJECT) == 0) { // TODO show warning popup throw new CoreException(Status.error(NLS.bind(Messages.MavenPomWizard_status_not_exists, projectName))); } IContainer container = (IContainer) resource; - final IFile file = container.getFile(new Path(IMavenConstants.POM_FILE_NAME)); + final IFile file = container.getFile(IPath.fromOSString(IMavenConstants.POM_FILE_NAME)); if(file.exists()) { // TODO show warning popup throw new CoreException(Status.error(Messages.MavenPomWizard_error_exists)); diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenPomWizardPage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenPomWizardPage.java index 5ff6d43297..a50b86c6e4 100644 --- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenPomWizardPage.java +++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenPomWizardPage.java @@ -20,8 +20,8 @@ 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.IStatus; -import org.eclipse.core.runtime.Path; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.window.Window; @@ -136,7 +136,7 @@ void handleBrowse() { if(dialog.open() == Window.OK) { Object[] result = dialog.getResult(); if(result.length == 1) { - projectText.setText(((Path) result[0]).toString()); + projectText.setText(((IPath) result[0]).toString()); } } @@ -173,7 +173,7 @@ void handleBrowse() { * Ensures that both text fields are set. */ void dialogChanged() { - IResource container = ResourcesPlugin.getWorkspace().getRoot().findMember(new Path(getProject())); + IResource container = ResourcesPlugin.getWorkspace().getRoot().findMember(IPath.fromOSString(getProject())); if(getProject().length() == 0) { updateStatus(Messages.MavenPomWizardPage_error_folder); diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectSelectionDialog.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectSelectionDialog.java index 0d37ab16a4..0e93630633 100644 --- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectSelectionDialog.java +++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectSelectionDialog.java @@ -25,7 +25,7 @@ import org.eclipse.core.resources.IWorkspace; 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.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.ITreeContentProvider; import org.eclipse.jface.viewers.TreeViewer; @@ -152,7 +152,7 @@ public Object[] getChildren(Object parent) { IResource[] members = container.members(); for(IResource member : members) { if(member instanceof IContainer memberContainer - && memberContainer.exists(new Path(IMavenConstants.POM_FILE_NAME))) { + && memberContainer.exists(IPath.fromOSString(IMavenConstants.POM_FILE_NAME))) { children.add(member); } } diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizardLocationPage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizardLocationPage.java index cf8f5c2108..40e8105652 100644 --- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizardLocationPage.java +++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizardLocationPage.java @@ -19,7 +19,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.Platform; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionListener; @@ -195,7 +194,7 @@ public IPath getLocationPath() { if(isInWorkspace()) { return ResourcesPlugin.getWorkspace().getRoot().getLocation(); } - return Path.fromOSString(locationCombo.getText().trim()); + return IPath.fromOSString(locationCombo.getText().trim()); } public void setLocationPath(IPath location) { @@ -283,7 +282,7 @@ protected void validate() { } // check whether the location is a syntactically correct path - if(!Path.ROOT.isValidPath(location)) { + if(!IPath.ROOT.isValidPath(location)) { setErrorMessage(Messages.wizardProjectPageProjectValidatorInvalidLocation); setPageComplete(false); return; diff --git a/org.eclipse.m2e.core/META-INF/MANIFEST.MF b/org.eclipse.m2e.core/META-INF/MANIFEST.MF index afd16a6522..fca7d3c362 100644 --- a/org.eclipse.m2e.core/META-INF/MANIFEST.MF +++ b/org.eclipse.m2e.core/META-INF/MANIFEST.MF @@ -8,7 +8,7 @@ Bundle-Vendor: %Bundle-Vendor Bundle-Localization: plugin Require-Bundle: org.eclipse.m2e.maven.runtime;bundle-version="[3.8.6,4.0.0)", org.eclipse.m2e.workspace.cli;bundle-version="0.1.0", - org.eclipse.core.runtime;bundle-version="3.12.0", + org.eclipse.core.runtime;bundle-version="[3.27.0,4.0.0)", org.eclipse.core.resources;bundle-version="3.9.0", org.eclipse.core.filesystem;bundle-version="1.7.700" Bundle-ActivationPolicy: lazy diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/Bundles.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/Bundles.java index 43dce1e795..31f65884e8 100644 --- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/Bundles.java +++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/Bundles.java @@ -31,7 +31,7 @@ import org.slf4j.LoggerFactory; import org.eclipse.core.runtime.FileLocator; -import org.eclipse.core.runtime.Path; +import org.eclipse.core.runtime.IPath; import org.eclipse.osgi.util.ManifestElement; @@ -84,7 +84,7 @@ public static String getClasspathEntryPath(Bundle bundle, String cp) { URL url = bundle.getEntry(cp); if(url != null) { String path = FileLocator.toFileURL(url).getFile(); - return new Path(path).toOSString(); + return IPath.fromOSString(path).toOSString(); } } catch(IOException | NoSuchElementException ex) { log.warn("Could not get entry {} for bundle {}", cp, bundle, ex); diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/M2EUtils.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/M2EUtils.java index d1c2b09381..3fb33d41cb 100644 --- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/M2EUtils.java +++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/M2EUtils.java @@ -30,7 +30,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.apache.maven.model.Plugin; import org.apache.maven.project.MavenProject; @@ -103,7 +102,7 @@ public static IFile getPomFile(MavenProject project) { } //XXX copied from XmlUtils.extractProject() File file = new File(project.getFile().toURI()); - IPath path = Path.fromOSString(file.getAbsolutePath()); + IPath path = IPath.fromOSString(file.getAbsolutePath()); Stack stack = new Stack<>(); //here we need to find the most inner project to the path. //we do so by shortening the path and remembering all the resources identified. diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/plexusbuildapi/AbstractEclipseBuildContext.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/plexusbuildapi/AbstractEclipseBuildContext.java index 7bbaa45959..f2e55df55d 100644 --- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/plexusbuildapi/AbstractEclipseBuildContext.java +++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/plexusbuildapi/AbstractEclipseBuildContext.java @@ -21,7 +21,6 @@ import org.eclipse.core.resources.IContainer; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; import org.sonatype.plexus.build.incremental.BuildContext; import org.sonatype.plexus.build.incremental.ThreadBuildContext; @@ -59,7 +58,7 @@ public OutputStream newFileOutputStream(File file) throws IOException { */ protected IPath getRelativePath(File file) { IPath basepath = getBaseResource().getLocation(); - IPath path = Path.fromOSString(file.getAbsolutePath()); + IPath path = IPath.fromOSString(file.getAbsolutePath()); if(!basepath.isPrefixOf(path)) { return null; diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/plexusbuildapi/EclipseIncrementalBuildContext.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/plexusbuildapi/EclipseIncrementalBuildContext.java index 6eebcf8a97..01a7a3a6d8 100644 --- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/plexusbuildapi/EclipseIncrementalBuildContext.java +++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/plexusbuildapi/EclipseIncrementalBuildContext.java @@ -24,7 +24,6 @@ import org.eclipse.core.resources.IResourceDelta; import org.eclipse.core.runtime.Adapters; import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; import org.codehaus.plexus.util.DirectoryScanner; import org.codehaus.plexus.util.Scanner; @@ -111,7 +110,7 @@ private IPath getRelativePath(File file) { return null; } IPath basepath = adapt.getLocation(); - IPath path = Path.fromOSString(file.getAbsolutePath()); + IPath path = IPath.fromOSString(file.getAbsolutePath()); if(!basepath.isPrefixOf(path)) { return null; } diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/plexusbuildapi/EclipseResourceBuildDelta.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/plexusbuildapi/EclipseResourceBuildDelta.java index f161a0ff6e..e7f2c23aca 100644 --- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/plexusbuildapi/EclipseResourceBuildDelta.java +++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/plexusbuildapi/EclipseResourceBuildDelta.java @@ -20,7 +20,6 @@ import org.eclipse.core.resources.IResourceDelta; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; import org.eclipse.m2e.core.internal.builder.IIncrementalBuildFramework; @@ -53,7 +52,7 @@ private boolean hasDelta(IPath path) { */ private IPath getRelativePath(File file) { IPath basepath = this.resource.getLocation(); - IPath path = Path.fromOSString(file.getAbsolutePath()); + IPath path = IPath.fromOSString(file.getAbsolutePath()); if(!basepath.isPrefixOf(path)) { return null; diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/PomFacadeAdapterFactory.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/PomFacadeAdapterFactory.java index 6dbba86e31..7952a2a93a 100644 --- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/PomFacadeAdapterFactory.java +++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/PomFacadeAdapterFactory.java @@ -26,7 +26,6 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IAdapterFactory; import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; import org.eclipse.m2e.core.embedder.IComponentLookup; import org.eclipse.m2e.core.embedder.IMavenExecutableLocation; @@ -65,7 +64,7 @@ public T getAdapter(Object adaptableObject, Class adapterType) { IComponentLookup lookup = containerManager.getComponentLookup(basedir); return IMavenToolbox.of(lookup).locatePom(basedir); })// - .map(pomfile -> container.getFile(Path.fromPortableString(pomfile.getName())))// + .map(pomfile -> container.getFile(IPath.fromPortableString(pomfile.getName())))// .map(this::getFacadeForPom)// .orElse(null); return adapterType.cast(facade); diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/ProjectConfigurationManager.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/ProjectConfigurationManager.java index 88bc3385e3..caf9d732b0 100644 --- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/ProjectConfigurationManager.java +++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/ProjectConfigurationManager.java @@ -53,7 +53,6 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.SubMonitor; import org.eclipse.core.runtime.jobs.ISchedulingRule; @@ -837,7 +836,7 @@ IProject create(MavenProjectInfo projectInfo, ProjectImportConfiguration configu project.create(monitor); } else { IProjectDescription description = workspace.newProjectDescription(projectName); - description.setLocation(new Path(projectDir.getAbsolutePath())); + description.setLocation(IPath.fromOSString(projectDir.getAbsolutePath())); project.create(description, monitor); } diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryManager.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryManager.java index f26b0c48c7..6af2f12ff6 100644 --- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryManager.java +++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryManager.java @@ -63,7 +63,6 @@ import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.MultiStatus; import org.eclipse.core.runtime.OperationCanceledException; -import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.SubMonitor; import org.eclipse.core.runtime.jobs.ISchedulingRule; @@ -145,8 +144,8 @@ public class ProjectRegistryManager implements ISaveParticipant { * need to be updated. */ public static final List METADATA_PATH = List.of( // - new Path("pom.xml"), // //$NON-NLS-1$ - new Path(".settings/" + IMavenConstants.PLUGIN_ID + ".prefs")); // dirty trick! //$NON-NLS-1$ //$NON-NLS-2$ + IPath.fromOSString("pom.xml"), // //$NON-NLS-1$ + IPath.fromOSString(".settings/" + IMavenConstants.PLUGIN_ID + ".prefs")); // dirty trick! //$NON-NLS-1$ //$NON-NLS-2$ private ProjectRegistry projectRegistry; @@ -853,7 +852,7 @@ IMavenMarkerManager getMarkerManager() { } public IFile getModulePom(IFile pom, String moduleName) { - return pom.getParent().getFile(new Path(moduleName).append(IMavenConstants.POM_FILE_NAME)); + return pom.getParent().getFile(IPath.fromOSString(moduleName).append(IMavenConstants.POM_FILE_NAME)); } private Set refreshWorkspaceModules(MutableProjectRegistry state, ArtifactKey mavenProject) { diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryReader.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryReader.java index a745e8fee0..afe8e6b2c2 100644 --- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryReader.java +++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryReader.java @@ -37,7 +37,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.core.runtime.Platform; @@ -184,7 +183,7 @@ public IPathReplace(IPath path) { } public IPath getPath() { - return Path.fromPortableString(path); + return IPath.fromPortableString(path); } } @@ -202,7 +201,7 @@ public IFileReplace(IFile file) { public IFile getFile() { IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); - return root.getFile(Path.fromPortableString(path)); + return root.getFile(IPath.fromPortableString(path)); } } diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/MavenProjectUtils.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/MavenProjectUtils.java index 8ac05b6ca7..3a89d576f6 100644 --- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/MavenProjectUtils.java +++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/MavenProjectUtils.java @@ -20,7 +20,6 @@ import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; import org.apache.maven.model.Resource; @@ -46,7 +45,7 @@ public static IPath getProjectRelativePath(IProject project, String resourceLoca return null; } IPath projectLocation = project.getLocation(); - IPath directory = Path.fromOSString(resourceLocation); // this is an absolute path! + IPath directory = IPath.fromOSString(resourceLocation); // this is an absolute path! if(projectLocation == null || !projectLocation.isPrefixOf(directory)) { return null; } diff --git a/org.eclipse.m2e.editor/META-INF/MANIFEST.MF b/org.eclipse.m2e.editor/META-INF/MANIFEST.MF index dd0fcdae36..92a43c03a1 100644 --- a/org.eclipse.m2e.editor/META-INF/MANIFEST.MF +++ b/org.eclipse.m2e.editor/META-INF/MANIFEST.MF @@ -4,7 +4,7 @@ Bundle-Name: %Bundle-Name Bundle-SymbolicName: org.eclipse.m2e.editor;singleton:=true Bundle-Version: 2.0.302.qualifier Bundle-Activator: org.eclipse.m2e.editor.MavenEditorPlugin -Require-Bundle: org.eclipse.core.runtime, +Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.27.0,4.0.0)", org.eclipse.core.resources, org.eclipse.search, org.eclipse.ui.ide, diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditor.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditor.java index 7020243cef..0b25be3443 100644 --- a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditor.java +++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditor.java @@ -40,9 +40,9 @@ import org.eclipse.core.runtime.IExtension; import org.eclipse.core.runtime.IExtensionPoint; import org.eclipse.core.runtime.IExtensionRegistry; +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.jobs.Job; @@ -657,7 +657,8 @@ public synchronized org.eclipse.aether.graph.DependencyNode readDependencyTree(b } IMavenProjectFacade facade = null; - if(pomFile != null && new Path(IMavenConstants.POM_FILE_NAME).equals(pomFile.getProjectRelativePath())) { + if(pomFile != null + && IPath.fromOSString(IMavenConstants.POM_FILE_NAME).equals(pomFile.getProjectRelativePath())) { facade = MavenPlugin.getMavenProjectRegistry().getProject(pomFile.getProject()); } diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/OverviewPage.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/OverviewPage.java index baf807ceca..ef868d21c6 100644 --- a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/OverviewPage.java +++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/OverviewPage.java @@ -69,7 +69,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.emf.common.notify.Notification; @@ -1354,7 +1353,7 @@ private void addSelectedModules(Object[] result, boolean updateParentSection) { container = pomFile.getParent(); } else if(selection instanceof IContainer c && !selection.equals(getProject())) { container = c; - pomFile = container.getFile(new Path(IMavenConstants.POM_FILE_NAME)); + pomFile = container.getFile(IPath.fromOSString(IMavenConstants.POM_FILE_NAME)); } if(pomFile == null || !pomFile.exists() || container == null) { diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/PomHyperlinkDetector.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/PomHyperlinkDetector.java index 0d8f82dbf9..8da6aa16ea 100644 --- a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/PomHyperlinkDetector.java +++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/PomHyperlinkDetector.java @@ -39,9 +39,9 @@ import org.eclipse.core.filesystem.EFS; import org.eclipse.core.filesystem.IFileStore; import org.eclipse.core.resources.IMarker; +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.jface.text.BadLocationException; @@ -453,7 +453,7 @@ public void open() { IMarker marker = mark.getAnnotation().getMarker(); String loc = marker.getAttribute(IMavenConstants.MARKER_CAUSE_RESOURCE_PATH, null); if(loc != null) { - IFileStore fileStore = EFS.getLocalFileSystem().getStore(new Path(loc)); + IFileStore fileStore = EFS.getLocalFileSystem().getStore(IPath.fromOSString(loc)); int row = marker.getAttribute(IMavenConstants.MARKER_CAUSE_LINE_NUMBER, 0); int column = marker.getAttribute(IMavenConstants.MARKER_CAUSE_COLUMN_START, 0); String name = marker.getAttribute(IMavenConstants.MARKER_CAUSE_RESOURCE_ID, null); diff --git a/org.eclipse.m2e.jdt/META-INF/MANIFEST.MF b/org.eclipse.m2e.jdt/META-INF/MANIFEST.MF index 2c6f405737..d44e80dc90 100644 --- a/org.eclipse.m2e.jdt/META-INF/MANIFEST.MF +++ b/org.eclipse.m2e.jdt/META-INF/MANIFEST.MF @@ -7,7 +7,7 @@ Bundle-Localization: plugin Export-Package: org.eclipse.m2e.jdt, org.eclipse.m2e.jdt.internal;x-friends:="org.eclipse.m2e.jdt.ui", org.eclipse.m2e.jdt.internal.launch;x-friends:="org.eclipse.m2e.jdt.ui" -Require-Bundle: org.eclipse.core.runtime, +Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.27.0,4.0.0)", org.eclipse.debug.core, org.eclipse.jdt.core;bundle-version="3.18.0", org.eclipse.jdt.launching, diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/AbstractJavaProjectConfigurator.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/AbstractJavaProjectConfigurator.java index 5ae81a90c9..593febb513 100644 --- a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/AbstractJavaProjectConfigurator.java +++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/AbstractJavaProjectConfigurator.java @@ -33,7 +33,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.jdt.core.IAccessRule; import org.eclipse.jdt.core.IClasspathAttribute; @@ -419,7 +418,7 @@ private IPath[] toPaths(String[] values) { IPath[] paths = new IPath[values.length]; for(int i = 0; i < values.length; i++ ) { if(values[i] != null && !"".equals(values[i].trim())) { - paths[i] = new Path(values[i]); + paths[i] = IPath.fromOSString(values[i]); } } return paths; @@ -548,7 +547,7 @@ private void addResourceFolder(IClasspathDescriptor classpath, IPath resourceFol boolean addTestFlag) { log.info("Adding resource folder " + resourceFolder); IClasspathEntryDescriptor descriptor = classpath.addSourceEntry(resourceFolder, outputPath, DEFAULT_INCLUSIONS, - new IPath[] {new Path("**")}, false /*optional*/); + new IPath[] {IPath.fromOSString("**")}, false /*optional*/); descriptor.setClasspathAttribute(IClasspathManager.TEST_ATTRIBUTE, addTestFlag ? "true" : null); descriptor.setClasspathAttribute(IClasspathAttribute.OPTIONAL, "true"); //$NON-NLS-1$ } @@ -557,8 +556,8 @@ private void configureOverlapWithSource(IClasspathDescriptor classpath, IClasspa IPath resourceFolder) { // resources and sources folders overlap. make sure JDT only processes java sources. log.info("Resources folder " + resourceFolder + " overlaps with sources folder " + enclosing.getPath()); - enclosing.addInclusionPattern(new Path("**/*.java")); - enclosing.removeExclusionPattern(new Path("**")); + enclosing.addInclusionPattern(IPath.fromOSString("**/*.java")); + enclosing.removeExclusionPattern(IPath.fromOSString("**")); classpath.touchEntry(resourceFolder); } @@ -866,7 +865,7 @@ private void removeMavenClasspathContainer(IProject project) throws JavaModelExc } protected IFolder getFolder(IProject project, String absolutePath) { - if(project.getLocation().makeAbsolute().equals(Path.fromOSString(absolutePath))) { + if(project.getLocation().makeAbsolute().equals(IPath.fromOSString(absolutePath))) { return project.getFolder(project.getLocation()); } return project.getFolder(getProjectRelativePath(project, absolutePath)); @@ -882,7 +881,7 @@ protected IPath getProjectRelativePath(IProject project, String absolutePath) { } else { relative = absolutePath; } - return new Path(relative.replace('\\', '/')); + return IPath.fromOSString(relative.replace('\\', '/')); } /** diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/BuildPathManager.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/BuildPathManager.java index 3ef853172c..e8a02f1333 100644 --- a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/BuildPathManager.java +++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/BuildPathManager.java @@ -57,7 +57,6 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.SubMonitor; import org.eclipse.core.runtime.jobs.Job; @@ -197,7 +196,7 @@ public void updateClasspath(IProject project, IProgressMonitor monitor) { if(javaProject != null) { try { IClasspathEntry containerEntry = getMavenContainerEntry(javaProject); - IPath path = containerEntry != null ? containerEntry.getPath() : new Path(CONTAINER_ID); + IPath path = containerEntry != null ? containerEntry.getPath() : IPath.fromOSString(CONTAINER_ID); IClasspathEntry[] classpath = getClasspath(project, monitor); IClasspathContainer container = new MavenClasspathContainer(path, classpath); JavaCore.setClasspathContainer(container.getPath(), new IJavaProject[] {javaProject}, @@ -271,9 +270,9 @@ private void configureAttachedSourcesAndJavadoc(IMavenProjectFacade facade, Prop IPath srcPath = desc.getSourceAttachmentPath(); IPath srcRoot = desc.getSourceAttachmentRootPath(); if(srcPath == null && sourceAttachment != null && sourceAttachment.containsKey(key + PROPERTY_SRC_PATH)) { - srcPath = Path.fromPortableString((String) sourceAttachment.get(key + PROPERTY_SRC_PATH)); + srcPath = IPath.fromPortableString((String) sourceAttachment.get(key + PROPERTY_SRC_PATH)); if(sourceAttachment.containsKey(key + PROPERTY_SRC_ROOT)) { - srcRoot = Path.fromPortableString((String) sourceAttachment.get(key + PROPERTY_SRC_ROOT)); + srcRoot = IPath.fromPortableString((String) sourceAttachment.get(key + PROPERTY_SRC_ROOT)); } } if(srcPath == null && a != null) { @@ -637,7 +636,7 @@ public boolean setupVariables() { try { File localRepositoryDir = new File(maven.getLocalRepository().getBasedir()); IPath oldPath = JavaCore.getClasspathVariable(M2_REPO); - IPath newPath = new Path(localRepositoryDir.getAbsolutePath()); + IPath newPath = IPath.fromOSString(localRepositoryDir.getAbsolutePath()); JavaCore.setClasspathVariable(M2_REPO, // newPath, // new NullProgressMonitor()); @@ -679,7 +678,7 @@ private IPath getSourcePath(ArtifactKey a) { File file = getAttachedArtifactFile(a, getSourcesClassifier(a.classifier())); if(file != null) { - return Path.fromOSString(file.getAbsolutePath()); + return IPath.fromOSString(file.getAbsolutePath()); } return null; @@ -866,7 +865,7 @@ ArtifactKey[] getAttachedSourcesAndJavadoc(ArtifactKey a, List entries = new ArrayList<>(); if(jreEntry != null) { @@ -294,7 +293,7 @@ private void addResolvedJUnit5Dependency(Set resolved, S .resolve(groupId, artifactId, version, "jar", null, mavenProject.getRemoteArtifactRepositories(), monitor) //$NON-NLS-1$ .getFile(); if(file != null) { - resolved.add(JavaRuntime.newArchiveRuntimeClasspathEntry(Path.fromOSString(file.getAbsolutePath()), + resolved.add(JavaRuntime.newArchiveRuntimeClasspathEntry(IPath.fromOSString(file.getAbsolutePath()), IRuntimeClasspathEntry.USER_CLASSES)); } } catch(CoreException ex) { diff --git a/org.eclipse.m2e.launching/META-INF/MANIFEST.MF b/org.eclipse.m2e.launching/META-INF/MANIFEST.MF index c0de36bdbb..523d712280 100644 --- a/org.eclipse.m2e.launching/META-INF/MANIFEST.MF +++ b/org.eclipse.m2e.launching/META-INF/MANIFEST.MF @@ -4,7 +4,7 @@ Bundle-Name: %Bundle-Name Bundle-SymbolicName: org.eclipse.m2e.launching;singleton:=true Bundle-Version: 2.0.601.qualifier Bundle-Localization: plugin -Require-Bundle: org.eclipse.core.runtime, +Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.27.0,4.0.0)", org.eclipse.core.variables, org.eclipse.jface, org.eclipse.jface.text, diff --git a/org.eclipse.m2e.launching/src/org/eclipse/m2e/actions/ExecutePomAction.java b/org.eclipse.m2e.launching/src/org/eclipse/m2e/actions/ExecutePomAction.java index 4b4bae5017..69c2ef633f 100644 --- a/org.eclipse.m2e.launching/src/org/eclipse/m2e/actions/ExecutePomAction.java +++ b/org.eclipse.m2e.launching/src/org/eclipse/m2e/actions/ExecutePomAction.java @@ -31,7 +31,6 @@ import org.eclipse.core.runtime.IExecutableExtension; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Path; import org.eclipse.debug.core.DebugPlugin; import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchConfigurationType; @@ -228,7 +227,7 @@ private ILaunchConfiguration createLaunchConfiguration(IContainer basedir, Strin private void setProjectConfiguration(ILaunchConfigurationWorkingCopy workingCopy, IContainer basedir) { IMavenProjectRegistry projectManager = MavenPlugin.getMavenProjectRegistry(); - IFile pomFile = basedir.getFile(new Path(IMavenConstants.POM_FILE_NAME)); + IFile pomFile = basedir.getFile(IPath.fromOSString(IMavenConstants.POM_FILE_NAME)); IMavenProjectFacade projectFacade = projectManager.create(pomFile, false, new NullProgressMonitor()); if(projectFacade != null) { IProjectConfiguration configuration = projectFacade.getConfiguration(); @@ -348,7 +347,7 @@ static List getMatchingConfigurations(IPath basedirLocatio if(workDir == null) { continue; } - IPath workPath = new Path(workDir); + IPath workPath = IPath.fromOSString(workDir); if(basedirLocation.equals(workPath)) { matchingConfigs.add(configuration); } diff --git a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenConsoleLineTracker.java b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenConsoleLineTracker.java index 325fcf52c5..923df503c7 100644 --- a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenConsoleLineTracker.java +++ b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenConsoleLineTracker.java @@ -405,7 +405,7 @@ public void linkActivated() { projectFile = project.project().getFile(IMavenConstants.POM_FILE_NAME); } else { Optional resolvedPomfile = resolvePath(filename); - IPath projectFilePath = org.eclipse.core.runtime.Path.fromOSString(relativePath.toString()); + IPath projectFilePath = IPath.fromOSString(relativePath.toString()); if(resolvedPomfile.isPresent()) { projectFilePath = projectFilePath.removeLastSegments(1).append(resolvedPomfile.get()); } diff --git a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchDelegate.java b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchDelegate.java index e59f16abcb..3fad7104e1 100644 --- a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchDelegate.java +++ b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchDelegate.java @@ -38,7 +38,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.Platform; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.preferences.IPreferencesService; @@ -213,7 +212,7 @@ public static File getPomDirectory(ILaunchConfiguration configuration) { public static Optional getContainer(File file) { // try to retrieve associated Eclipse project - return Optional.ofNullable(file).map(f -> Path.fromOSString(f.toString())) + return Optional.ofNullable(file).map(f -> IPath.fromOSString(f.toString())) .map(ResourcesPlugin.getWorkspace().getRoot()::getContainerForLocation); } @@ -245,7 +244,7 @@ public static String readEnforcedJavaVersion(File pomDirectory, IProgressMonitor try { Optional container = getContainer(pomDirectory); if(container.isPresent()) { - IPath pomPath = Path.fromOSString(IMavenConstants.POM_FILE_NAME); + IPath pomPath = IPath.fromOSString(IMavenConstants.POM_FILE_NAME); if(container.get().exists(pomPath)) { IFile pomFile = container.get().getFile(pomPath); IMavenProjectRegistry projectManager = MavenPlugin.getMavenProjectRegistry(); diff --git a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenSourcePathComputer.java b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenSourcePathComputer.java index 183675965a..eaccb73c78 100644 --- a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenSourcePathComputer.java +++ b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenSourcePathComputer.java @@ -25,8 +25,8 @@ import java.util.jar.JarFile; 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.ILaunchConfiguration; import org.eclipse.debug.core.sourcelookup.ISourceContainer; import org.eclipse.debug.core.sourcelookup.ISourcePathComputer; @@ -147,8 +147,8 @@ private void addArchiveRuntimeClasspathEntry(List entrie File sourcesJar = getSourcesJar(groupId, artifactId, version); if(sourcesJar != null) { IRuntimeClasspathEntry entry = null; - entry = JavaRuntime.newArchiveRuntimeClasspathEntry(Path.fromOSString(entryPath)); - entry.setSourceAttachmentPath(Path.fromOSString(sourcesJar.getAbsolutePath())); + entry = JavaRuntime.newArchiveRuntimeClasspathEntry(IPath.fromOSString(entryPath)); + entry.setSourceAttachmentPath(IPath.fromOSString(sourcesJar.getAbsolutePath())); entries.add(entry); } } diff --git a/org.eclipse.m2e.mavenarchiver/META-INF/MANIFEST.MF b/org.eclipse.m2e.mavenarchiver/META-INF/MANIFEST.MF index b52b08aab3..f43d4acfaa 100644 --- a/org.eclipse.m2e.mavenarchiver/META-INF/MANIFEST.MF +++ b/org.eclipse.m2e.mavenarchiver/META-INF/MANIFEST.MF @@ -6,7 +6,7 @@ Bundle-Version: 2.0.401.qualifier Bundle-Vendor: Eclipse.org - m2e Bundle-RequiredExecutionEnvironment: JavaSE-17 Require-Bundle: org.eclipse.core.resources;bundle-version="[3.4.0,4.0.0)", - org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)", + org.eclipse.core.runtime;bundle-version="[3.27.0,4.0.0)", org.eclipse.m2e.core;bundle-version="[2.0.0,3.0.0)", org.eclipse.m2e.maven.runtime;bundle-version="[3.0.0,4.0.0)", org.eclipse.jdt.core;bundle-version="[3.0.0,4.0.0)" diff --git a/org.eclipse.m2e.mavenarchiver/src/org/eclipse/m2e/mavenarchiver/internal/AbstractMavenArchiverConfigurator.java b/org.eclipse.m2e.mavenarchiver/src/org/eclipse/m2e/mavenarchiver/internal/AbstractMavenArchiverConfigurator.java index b5b5676c9b..4e012477d8 100644 --- a/org.eclipse.m2e.mavenarchiver/src/org/eclipse/m2e/mavenarchiver/internal/AbstractMavenArchiverConfigurator.java +++ b/org.eclipse.m2e.mavenarchiver/src/org/eclipse/m2e/mavenarchiver/internal/AbstractMavenArchiverConfigurator.java @@ -223,7 +223,7 @@ public void mavenProjectChanged(MavenProjectChangedEvent event, IProgressMonitor protected void mavenProjectChanged(IMavenProjectFacade newFacade, IMavenProjectFacade oldFacade, boolean forceGeneration, IProgressMonitor monitor) throws CoreException { IContainer outputdir = getBuildOutputDir(newFacade); - IFile manifest = outputdir.getFile(org.eclipse.core.runtime.Path.forPosix(JarFile.MANIFEST_NAME)); + IFile manifest = outputdir.getFile(IPath.forPosix(JarFile.MANIFEST_NAME)); if (forceGeneration || needsNewManifest(manifest, oldFacade, newFacade)) { generateManifest(newFacade, manifest, monitor); refresh(outputdir, monitor); @@ -825,8 +825,8 @@ private IContainer getBuildOutputDir(IMavenProjectFacade facade) { private IFile getOutputPomXML(IMavenProjectFacade facade) { ArtifactKey project = facade.getArtifactKey(); - return getBuildOutputDir(facade).getFile(org.eclipse.core.runtime.Path - .forPosix("META-INF/maven/" + project.groupId() + "/" + project.artifactId() + "/" + POM_XML)); + return getBuildOutputDir(facade).getFile( + IPath.forPosix("META-INF/maven/" + project.groupId() + "/" + project.artifactId() + "/" + POM_XML)); } } diff --git a/org.eclipse.m2e.pde.connector.tests/src/org/eclipse/m2e/pde/connector/tests/BNDConnectorTest.java b/org.eclipse.m2e.pde.connector.tests/src/org/eclipse/m2e/pde/connector/tests/BNDConnectorTest.java index 6969dc2559..f6cf70856f 100644 --- a/org.eclipse.m2e.pde.connector.tests/src/org/eclipse/m2e/pde/connector/tests/BNDConnectorTest.java +++ b/org.eclipse.m2e.pde.connector.tests/src/org/eclipse/m2e/pde/connector/tests/BNDConnectorTest.java @@ -25,7 +25,6 @@ import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IncrementalProjectBuilder; import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; import org.eclipse.jdt.core.IClasspathEntry; import org.eclipse.jdt.core.JavaCore; import org.eclipse.m2e.core.internal.IMavenConstants; @@ -44,7 +43,7 @@ public void importBNDProject() throws Exception { Set.of(JavaCore.BUILDER_ID, IMavenConstants.BUILDER_ID)); assertPluginProjectExists(project, "m2e.pde.connector.tests.bnd"); - IPath expectedJavaxLibPath = Path.fromOSString("/bnd/target/m2e-bundleClassPath/slf4j-api-1.7.36.jar"); + IPath expectedJavaxLibPath = IPath.fromOSString("/bnd/target/m2e-bundleClassPath/slf4j-api-1.7.36.jar"); List javaxLibEntries = Arrays.stream(JavaCore.create(project).getRawClasspath()) .filter(e -> e.getEntryKind() == IClasspathEntry.CPE_LIBRARY) .filter(e -> e.getPath().equals(expectedJavaxLibPath)).toList(); diff --git a/org.eclipse.m2e.pde.connector/META-INF/MANIFEST.MF b/org.eclipse.m2e.pde.connector/META-INF/MANIFEST.MF index f740ae5bee..df61c036da 100644 --- a/org.eclipse.m2e.pde.connector/META-INF/MANIFEST.MF +++ b/org.eclipse.m2e.pde.connector/META-INF/MANIFEST.MF @@ -9,7 +9,7 @@ Bundle-Vendor: Eclipse.org - m2e Bundle-ActivationPolicy: lazy Require-Bundle: org.eclipse.m2e.core;bundle-version="[2.0.0,3.0.0)", org.eclipse.m2e.jdt;bundle-version="[2.0.0,3.0.0)", - org.eclipse.core.runtime;bundle-version="3.24.0", + org.eclipse.core.runtime;bundle-version="[3.27.0,4.0.0)", org.eclipse.core.resources;bundle-version="3.16.0", org.eclipse.m2e.maven.runtime;bundle-version="[3.8.6,4.0.0)", org.eclipse.pde.core, diff --git a/org.eclipse.m2e.pde.connector/src/org/eclipse/m2e/pde/connector/PDEBuildProjectFileResolver.java b/org.eclipse.m2e.pde.connector/src/org/eclipse/m2e/pde/connector/PDEBuildProjectFileResolver.java index b2bea967cb..3341aff3df 100644 --- a/org.eclipse.m2e.pde.connector/src/org/eclipse/m2e/pde/connector/PDEBuildProjectFileResolver.java +++ b/org.eclipse.m2e.pde.connector/src/org/eclipse/m2e/pde/connector/PDEBuildProjectFileResolver.java @@ -16,7 +16,6 @@ import java.util.Map; import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; import org.eclipse.m2e.core.project.IBuildProjectFileResolver; import org.osgi.service.component.annotations.Component; @@ -24,8 +23,8 @@ public class PDEBuildProjectFileResolver implements IBuildProjectFileResolver { private static final Map POM_NAME_2_PROJECT_FILE = Map.of( // - ".polyglot.META-INF", Path.forPosix("META-INF/MANIFEST.MF"), // - ".polyglot.feature.xml", Path.forPosix("feature.xml")); + ".polyglot.META-INF", IPath.forPosix("META-INF/MANIFEST.MF"), // + ".polyglot.feature.xml", IPath.forPosix("feature.xml")); @Override public IPath resolveProjectFile(String pomFilename) { @@ -35,7 +34,7 @@ public IPath resolveProjectFile(String pomFilename) { } if (pomFilename.startsWith(".polyglot.") && (pomFilename.endsWith(".product") || pomFilename.endsWith(".target"))) { - return Path.forPosix(pomFilename.substring(".polyglot.".length())); + return IPath.forPosix(pomFilename.substring(".polyglot.".length())); } return null; } diff --git a/org.eclipse.m2e.pde.connector/src/org/eclipse/m2e/pde/connector/PDEMavenBundlePluginConfigurator.java b/org.eclipse.m2e.pde.connector/src/org/eclipse/m2e/pde/connector/PDEMavenBundlePluginConfigurator.java index 427d08e1a6..66a4c91bfc 100644 --- a/org.eclipse.m2e.pde.connector/src/org/eclipse/m2e/pde/connector/PDEMavenBundlePluginConfigurator.java +++ b/org.eclipse.m2e.pde.connector/src/org/eclipse/m2e/pde/connector/PDEMavenBundlePluginConfigurator.java @@ -320,8 +320,7 @@ private static IClasspathEntry createLibraryEntry(IPath libPath, IProgressMonito IFile libFile = ResourcesPlugin.getWorkspace().getRoot().getFile(libPath); Collection artifacts = MavenArtifactIdentifier.identify(libFile.getLocation().toFile()); IPath sourcePath = artifacts.stream().map(a -> MavenArtifactIdentifier.resolveSourceLocation(a, monitor)) - .filter(Objects::nonNull).map(Path::toString).map(org.eclipse.core.runtime.Path::fromOSString) - .findFirst().orElse(null); + .filter(Objects::nonNull).map(Path::toString).map(IPath::fromOSString).findFirst().orElse(null); return JavaCore.newLibraryEntry(libPath, sourcePath, null, null, attributes, true); } } diff --git a/org.eclipse.m2e.pde.connector/src/org/eclipse/m2e/pde/connector/PDEProjectHelper.java b/org.eclipse.m2e.pde.connector/src/org/eclipse/m2e/pde/connector/PDEProjectHelper.java index 1b19e00243..c802757b76 100644 --- a/org.eclipse.m2e.pde.connector/src/org/eclipse/m2e/pde/connector/PDEProjectHelper.java +++ b/org.eclipse.m2e.pde.connector/src/org/eclipse/m2e/pde/connector/PDEProjectHelper.java @@ -154,7 +154,7 @@ private static IPath getDefaultLibraryOutputFolder(IProject project, IProgressMo monitor.done(); IBuildEntry entry = model.getBuild().getEntry("output." + "."); if (entry != null) { - return org.eclipse.core.runtime.Path.forPosix(entry.getTokens()[0]); + return IPath.forPosix(entry.getTokens()[0]); } } return null; diff --git a/org.eclipse.m2e.pde.target/META-INF/MANIFEST.MF b/org.eclipse.m2e.pde.target/META-INF/MANIFEST.MF index d700876b18..ddbfc7e92a 100644 --- a/org.eclipse.m2e.pde.target/META-INF/MANIFEST.MF +++ b/org.eclipse.m2e.pde.target/META-INF/MANIFEST.MF @@ -5,7 +5,7 @@ Bundle-SymbolicName: org.eclipse.m2e.pde.target;singleton:=true Bundle-Version: 2.0.500.qualifier Automatic-Module-Name: org.eclipse.m2e.pde.target Bundle-RequiredExecutionEnvironment: JavaSE-17 -Require-Bundle: org.eclipse.core.runtime;bundle-version="3.19.0", +Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.27.0,4.0.0)", org.eclipse.pde.core;bundle-version="3.14.0", org.eclipse.equinox.frameworkadmin;bundle-version="2.1.400", org.eclipse.m2e.maven.runtime;bundle-version="[3.8.0,4.0.0)", diff --git a/org.eclipse.m2e.pde.target/src/org/eclipse/m2e/pde/target/MavenPluginSourcePathLocator.java b/org.eclipse.m2e.pde.target/src/org/eclipse/m2e/pde/target/MavenPluginSourcePathLocator.java index 24d4dbe595..2335d1c73c 100644 --- a/org.eclipse.m2e.pde.target/src/org/eclipse/m2e/pde/target/MavenPluginSourcePathLocator.java +++ b/org.eclipse.m2e.pde.target/src/org/eclipse/m2e/pde/target/MavenPluginSourcePathLocator.java @@ -19,7 +19,6 @@ import org.eclipse.aether.artifact.Artifact; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; import org.eclipse.m2e.core.embedder.ArtifactKey; import org.eclipse.m2e.core.internal.MavenArtifactIdentifier; import org.eclipse.pde.core.IPluginSourcePathLocator; @@ -44,7 +43,7 @@ public IPath locateSource(IPluginBase plugin) { String baseName = FilenameUtils.getBaseName(installLocation); File localFile = new File(file.getParentFile(), baseName + "-sources." + ext); if (localFile.isFile()) { - return new Path(localFile.getAbsolutePath()); + return IPath.fromOSString(localFile.getAbsolutePath()); } ArtifactKey artifact = aquireFromTargetState(file); if (artifact == null) { @@ -55,7 +54,7 @@ public IPath locateSource(IPluginBase plugin) { } java.nio.file.Path location = MavenArtifactIdentifier.resolveSourceLocation(artifact, null); if (location != null) { - return new Path(location.toFile().getAbsolutePath()); + return IPath.fromOSString(location.toFile().getAbsolutePath()); } } } diff --git a/org.eclipse.m2e.tests.common/src/org/eclipse/m2e/tests/common/ClasspathHelpers.java b/org.eclipse.m2e.tests.common/src/org/eclipse/m2e/tests/common/ClasspathHelpers.java index 9d5e7cf8a3..417d9caa23 100644 --- a/org.eclipse.m2e.tests.common/src/org/eclipse/m2e/tests/common/ClasspathHelpers.java +++ b/org.eclipse.m2e.tests.common/src/org/eclipse/m2e/tests/common/ClasspathHelpers.java @@ -25,7 +25,6 @@ import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; import org.eclipse.jdt.core.IClasspathAttribute; import org.eclipse.jdt.core.IClasspathEntry; import org.eclipse.jdt.core.IJavaProject; @@ -55,7 +54,7 @@ public static IClasspathEntry getClasspathEntry(IClasspathEntry[] cp, IPath path } public static IClasspathEntry getClasspathEntry(IClasspathEntry[] cp, String path) { - return getClasspathEntry(cp, new Path(path)); + return getClasspathEntry(cp, IPath.fromOSString(path)); } /**