Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Piggott2011-04-18 18:00:22 -0400
committerMatthew Piggott2011-04-18 18:01:11 -0400
commit9f19aec6fae3d804d260e7ee5f5a26723211861a (patch)
tree856c0a166d1097077cbfbe1d3f80aa51dd249895
parent7b4c4ea01cbfa6e3bf9733235039056b38b2c31e (diff)
downloadm2e-core-9f19aec6fae3d804d260e7ee5f5a26723211861a.tar.gz
m2e-core-9f19aec6fae3d804d260e7ee5f5a26723211861a.tar.xz
m2e-core-9f19aec6fae3d804d260e7ee5f5a26723211861a.zip
Cleanup - unused code, NON-NLS
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/UpdateConfigurationJob.java4
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/AddPluginAction.java27
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/MavenActionSupport.java27
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/OpenPomAction.java13
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/SelectionUtil.java2
5 files changed, 38 insertions, 35 deletions
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/UpdateConfigurationJob.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/UpdateConfigurationJob.java
index 98f29189..a630b598 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/UpdateConfigurationJob.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/UpdateConfigurationJob.java
@@ -68,7 +68,7 @@ public class UpdateConfigurationJob extends WorkspaceJob {
monitor.beginTask(getName(), projects.length);
long l1 = System.currentTimeMillis();
- log.info("Update started");
+ log.info("Update started"); //$NON-NLS-1$
MultiStatus status = null;
//project names to the errors encountered when updating them
@@ -103,7 +103,7 @@ public class UpdateConfigurationJob extends WorkspaceJob {
handleErrors(updateErrors);
}
long l2 = System.currentTimeMillis();
- log.info(NLS.bind("Update completed: {0} sec", ((l2 - l1) / 1000)));
+ log.info(NLS.bind("Update completed: {0} sec", ((l2 - l1) / 1000))); //$NON-NLS-1$
return status != null ? status : Status.OK_STATUS;
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/AddPluginAction.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/AddPluginAction.java
index 61281bbd..ee76d967 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/AddPluginAction.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/AddPluginAction.java
@@ -11,26 +11,35 @@
package org.eclipse.m2e.core.ui.internal.actions;
-import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.*;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.BUILD;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.PLUGINS;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.getChild;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.performOnDOMDocument;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
-import org.apache.maven.project.MavenProject;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.window.Window;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+
+import org.apache.maven.project.MavenProject;
+
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.core.IMavenConstants;
import org.eclipse.m2e.core.index.IndexedArtifactFile;
import org.eclipse.m2e.core.project.IMavenProjectFacade;
import org.eclipse.m2e.core.ui.internal.Messages;
import org.eclipse.m2e.core.ui.internal.dialogs.MavenRepositorySearchDialog;
+import org.eclipse.m2e.core.ui.internal.editing.PomEdits.Operation;
+import org.eclipse.m2e.core.ui.internal.editing.PomEdits.OperationTuple;
import org.eclipse.m2e.core.ui.internal.editing.PomHelper;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
public class AddPluginAction extends MavenActionSupport implements IWorkbenchWindowActionDelegate {
@@ -67,7 +76,7 @@ public class AddPluginAction extends MavenActionSupport implements IWorkbenchWin
}
}));
} catch(Exception ex) {
- log.error("Can't add plugin to " + file, ex);
+ log.error("Can't add plugin to " + file, ex); //$NON-NLS-1$
}
}
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/MavenActionSupport.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/MavenActionSupport.java
index aea8d1c6..74370bf8 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/MavenActionSupport.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/MavenActionSupport.java
@@ -14,19 +14,15 @@ package org.eclipse.m2e.core.ui.internal.actions;
import java.util.Collections;
import java.util.Set;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.m2e.core.MavenPlugin;
-import org.eclipse.m2e.core.core.IMavenConstants;
-import org.eclipse.m2e.core.embedder.ArtifactKey;
-import org.eclipse.m2e.core.embedder.ArtifactRef;
-import org.eclipse.m2e.core.project.IMavenProjectFacade;
-import org.eclipse.m2e.core.project.IMavenProjectRegistry;
-import org.eclipse.m2e.core.ui.internal.M2EUIPluginActivator;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
@@ -37,8 +33,14 @@ import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.embedder.ArtifactRef;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.ui.internal.M2EUIPluginActivator;
+
/**
*
@@ -54,16 +56,15 @@ public abstract class MavenActionSupport implements IObjectActionDelegate {
protected Set<ArtifactKey> getArtifacts(IFile file, MavenPlugin plugin) {
try {
- IMavenProjectRegistry projectManager = plugin.getMavenProjectRegistry();
//TODO: mkleint: this is a bit troubling as it can take considerate amount of time
// and it's being called in action's run() before the search dialog appearing.
- IMavenProjectFacade projectFacade = projectManager.create(file, true, new NullProgressMonitor());
+ IMavenProjectFacade projectFacade = MavenPlugin.getMavenProjectRegistry().create(file, true,
+ new NullProgressMonitor());
if(projectFacade != null) {
return ArtifactRef.toArtifactKey(projectFacade.getMavenProjectArtifacts());
}
} catch(Exception ex) {
- String msg = "Can't read Maven project: " + ex.getMessage();
- log.error(msg, ex);
+ log.error("Can't read Maven project: " + ex.getMessage(), ex); //$NON-NLS-1$
}
return Collections.emptySet();
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/OpenPomAction.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/OpenPomAction.java
index 7171fb28..f461b552 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/OpenPomAction.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/OpenPomAction.java
@@ -8,7 +8,6 @@
* Contributors:
* Sonatype, Inc. - initial API and implementation
*******************************************************************************/
-
package org.eclipse.m2e.core.ui.internal.actions;
import java.io.ByteArrayInputStream;
@@ -81,8 +80,6 @@ import org.eclipse.m2e.core.ui.internal.dialogs.MavenRepositorySearchDialog;
public class OpenPomAction extends ActionDelegate implements IWorkbenchWindowActionDelegate {
private static final Logger log = LoggerFactory.getLogger(OpenPomAction.class);
- private static final String ID = "org.eclipse.m2e.openPomAction"; //$NON-NLS-1$
-
String type = IIndex.SEARCH_ARTIFACT;
private IStructuredSelection selection;
@@ -335,13 +332,11 @@ public class OpenPomAction extends ActionDelegate implements IWorkbenchWindowAct
return null;
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings("rawtypes")
public Object getAdapter(Class adapter) {
return null;
}
- // IPathEditorInput
-
public IPath getPath() {
return path == null ? null : new Path(path);
}
@@ -352,6 +347,7 @@ public class OpenPomAction extends ActionDelegate implements IWorkbenchWindowAct
public MavenPathStorageEditorInput(String name, String tooltip, String path, byte[] content) {
super(name, tooltip, path, content);
}
+
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
@@ -394,12 +390,9 @@ public class OpenPomAction extends ActionDelegate implements IWorkbenchWindowAct
return true;
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings("rawtypes")
public Object getAdapter(Class adapter) {
return null;
}
-
-
}
-
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/SelectionUtil.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/SelectionUtil.java
index fa312112..3eac5c60 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/SelectionUtil.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/SelectionUtil.java
@@ -293,7 +293,7 @@ public class SelectionUtil {
IOUtil.copy(is, os);
return readMavenProject(tempPomFile, monitor);
} catch(IOException ex) {
- log.error("Can't close stream", ex);
+ log.error("Can't close stream", ex); //$NON-NLS-1$
} finally {
IOUtil.close(is);
IOUtil.close(os);

Back to the top