Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/search/util/ControlDecoration.java6
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/archetype/ArchetypeCatalogFactory.java17
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/preferences/MavenConfigurationImpl.java12
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomModelHandler.java11
-rw-r--r--org.eclipse.m2e.importer.tests/src/org/eclipse/m2e/importer/tests/MavenImporterTest.java6
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/AbstractPomRefactoring.java8
6 files changed, 29 insertions, 31 deletions
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/search/util/ControlDecoration.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/search/util/ControlDecoration.java
index e08fb8d2..294218e2 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/search/util/ControlDecoration.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/search/util/ControlDecoration.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008-2010 Sonatype, Inc.
+ * Copyright (c) 2008, 2019 Sonatype, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -125,12 +125,12 @@ public class ControlDecoration {
/**
* Registered selection listeners.
*/
- ListenerList selectionListeners = new ListenerList();
+ ListenerList<SelectionListener> selectionListeners = new ListenerList<>();
/**
* Registered menu detect listeners.
*/
- ListenerList menuDetectListeners = new ListenerList();
+ ListenerList<MenuDetectListener> menuDetectListeners = new ListenerList<>();
/**
* The focus listener
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/archetype/ArchetypeCatalogFactory.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/archetype/ArchetypeCatalogFactory.java
index b1c7d788..eb5919d3 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/archetype/ArchetypeCatalogFactory.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/archetype/ArchetypeCatalogFactory.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008-2010 Sonatype, Inc.
+ * Copyright (c) 2008, 2019 Sonatype, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -27,6 +27,7 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.osgi.util.NLS;
import org.apache.maven.archetype.ArchetypeManager;
+import org.apache.maven.archetype.catalog.Archetype;
import org.apache.maven.archetype.catalog.ArchetypeCatalog;
import org.apache.maven.archetype.catalog.io.xpp3.ArchetypeCatalogXpp3Reader;
import org.apache.maven.archetype.source.ArchetypeDataSource;
@@ -247,15 +248,13 @@ public abstract class ArchetypeCatalogFactory {
final String remoteUrl = url;
@SuppressWarnings("serial")
ArchetypeCatalog catalogWrapper = new ArchetypeCatalog() {
- public void addArchetype(org.apache.maven.archetype.catalog.Archetype archetype) {
+ public void addArchetype(Archetype archetype) {
catalog.addArchetype(archetype);
}
- @SuppressWarnings({"rawtypes", "unchecked"})
- public List getArchetypes() {
- List<org.apache.maven.archetype.catalog.Archetype> archetypes = new ArrayList<org.apache.maven.archetype.catalog.Archetype>(
- catalog.getArchetypes());
- for(org.apache.maven.archetype.catalog.Archetype arch : archetypes) {
+ public List<Archetype> getArchetypes() {
+ List<Archetype> archetypes = new ArrayList<>(catalog.getArchetypes());
+ for(Archetype arch : archetypes) {
if(arch.getRepository() == null || arch.getRepository().trim().isEmpty()) {
arch.setRepository(remoteUrl);
}
@@ -267,7 +266,7 @@ public abstract class ArchetypeCatalogFactory {
return catalog.getModelEncoding();
}
- public void removeArchetype(org.apache.maven.archetype.catalog.Archetype archetype) {
+ public void removeArchetype(Archetype archetype) {
catalog.removeArchetype(archetype);
}
@@ -275,7 +274,7 @@ public abstract class ArchetypeCatalogFactory {
catalog.setModelEncoding(modelEncoding);
}
- public void setArchetypes(List archetypes) {
+ public void setArchetypes(List<Archetype> archetypes) {
catalog.setArchetypes(archetypes);
}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/preferences/MavenConfigurationImpl.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/preferences/MavenConfigurationImpl.java
index bb453db0..1b214b43 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/preferences/MavenConfigurationImpl.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/preferences/MavenConfigurationImpl.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008-2015 Sonatype, Inc.
+ * Copyright (c) 2008, 2019 Sonatype, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -31,6 +31,7 @@ import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChange
import org.eclipse.core.runtime.preferences.IPreferenceFilter;
import org.eclipse.core.runtime.preferences.IPreferencesService;
import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.eclipse.core.runtime.preferences.PreferenceFilterEntry;
import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy;
@@ -49,7 +50,7 @@ public class MavenConfigurationImpl implements IMavenConfiguration, IPreferenceC
private final IPreferencesService preferenceStore;
- private final ListenerList listeners = new ListenerList(ListenerList.IDENTITY);
+ private final ListenerList<IMavenConfigurationChangeListener> listeners = new ListenerList<>(ListenerList.IDENTITY);
public MavenConfigurationImpl() {
preferenceStore = Platform.getPreferencesService();
@@ -182,9 +183,9 @@ public class MavenConfigurationImpl implements IMavenConfiguration, IPreferenceC
public void preferenceChange(PreferenceChangeEvent event) {
MavenConfigurationChangeEvent mavenEvent = new MavenConfigurationChangeEvent(event.getKey(), event.getNewValue(),
event.getOldValue());
- for(Object listener : listeners.getListeners()) {
+ for(IMavenConfigurationChangeListener listener : listeners) {
try {
- ((IMavenConfigurationChangeListener) listener).mavenConfigurationChange(mavenEvent);
+ listener.mavenConfigurationChange(mavenEvent);
} catch(Exception e) {
log.error("Could not deliver maven configuration change event", e);
}
@@ -206,8 +207,7 @@ public class MavenConfigurationImpl implements IMavenConfiguration, IPreferenceC
return new String[] {InstanceScope.SCOPE, DefaultScope.SCOPE};
}
- @SuppressWarnings("rawtypes")
- public Map getMapping(String scope) {
+ public Map<String, PreferenceFilterEntry[]> getMapping(String scope) {
return null;
}
};
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomModelHandler.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomModelHandler.java
index bdcea27b..1b04428e 100644
--- a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomModelHandler.java
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomModelHandler.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008-2010 Sonatype, Inc.
+ * Copyright (c) 2008, 2019 Sonatype, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -56,10 +56,9 @@ public class PomModelHandler extends ModelHandlerForXML {
private static class PomModelLoader extends XMLModelLoader {
- @SuppressWarnings("unchecked")
@Override
- public List getAdapterFactories() {
- List result = new ArrayList();
+ public List<?> getAdapterFactories() {
+ List<Object> result = new ArrayList<>();
INodeAdapterFactory factory = new ModelQueryAdapterFactoryForPom();
result.add(factory);
return result;
@@ -75,8 +74,8 @@ public class PomModelHandler extends ModelHandlerForXML {
protected INodeAdapter createAdapter(INodeNotifier target) {
if(modelQueryAdapterImpl == null) {
ModelQueryAdapter mqa = (ModelQueryAdapter) super.createAdapter(target);
- modelQueryAdapterImpl = new ModelQueryAdapterImpl(mqa.getCMDocumentCache(), new PomModelQueryImpl(
- mqa.getCMDocumentCache(), mqa.getIdResolver()), mqa.getIdResolver());
+ modelQueryAdapterImpl = new ModelQueryAdapterImpl(mqa.getCMDocumentCache(),
+ new PomModelQueryImpl(mqa.getCMDocumentCache(), mqa.getIdResolver()), mqa.getIdResolver());
}
return modelQueryAdapterImpl;
}
diff --git a/org.eclipse.m2e.importer.tests/src/org/eclipse/m2e/importer/tests/MavenImporterTest.java b/org.eclipse.m2e.importer.tests/src/org/eclipse/m2e/importer/tests/MavenImporterTest.java
index e88e8426..35cf6b99 100644
--- a/org.eclipse.m2e.importer.tests/src/org/eclipse/m2e/importer/tests/MavenImporterTest.java
+++ b/org.eclipse.m2e.importer.tests/src/org/eclipse/m2e/importer/tests/MavenImporterTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2016 Red Hat Inc.
+ * Copyright (c) 2016, 2019 Red Hat Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -62,7 +62,7 @@ public class MavenImporterTest extends AbstractMavenProjectTestCase {
@Test
public void test() throws Exception {
Set<IProject> newProjects = null;
- SmartImportJob job = new SmartImportJob(projectDirectory, Collections.EMPTY_SET, true, true);
+ SmartImportJob job = new SmartImportJob(projectDirectory, Collections.emptySet(), true, true);
Map<File, List<ProjectConfigurator>> proposals = job.getImportProposals(monitor);
Assert.assertEquals("Expected 2 projects to import", 2, proposals.size()); //$NON-NLS-1$
@@ -98,7 +98,7 @@ public class MavenImporterTest extends AbstractMavenProjectTestCase {
public void testRootWithoutPom() throws Exception {
Set<IProject> newProjects = null;
// important part here is the "getParentFile()"
- SmartImportJob job = new SmartImportJob(projectDirectory.getParentFile(), Collections.EMPTY_SET, true, true);
+ SmartImportJob job = new SmartImportJob(projectDirectory.getParentFile(), Collections.emptySet(), true, true);
Map<File, List<ProjectConfigurator>> proposals = job.getImportProposals(monitor);
Assert.assertEquals("Expected 2 projects to import", 2, proposals.size()); //$NON-NLS-1$
diff --git a/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/AbstractPomRefactoring.java b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/AbstractPomRefactoring.java
index abd4c652..d6f8d4aa 100644
--- a/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/AbstractPomRefactoring.java
+++ b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/AbstractPomRefactoring.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008-2010 Sonatype, Inc.
+ * Copyright (c) 2008, 2019 Sonatype, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -305,8 +305,8 @@ public abstract class AbstractPomRefactoring extends Refactoring {
// apply changes to temp file
editingDomain.getCommandStack().execute(command);
// create text change comparing temp file and real file
- TextFileChange change = new ChangeCreator(model.getPomFile(), model.getPomBuffer().getDocument(), model
- .getTmpBuffer().getDocument(), file.getParent().getName()).createChange();
+ TextFileChange change = new ChangeCreator(model.getPomFile(), model.getPomBuffer().getDocument(),
+ model.getTmpBuffer().getDocument(), file.getParent().getName()).createChange();
res.add(change);
}
}
@@ -332,7 +332,7 @@ public abstract class AbstractPomRefactoring extends Refactoring {
try {
Resource resource = new PomResourceFactoryImpl().createResource(uri);
- resource.load(new HashMap());
+ resource.load(new HashMap<>());
return (PomResourceImpl) resource;
} catch(Exception ex) {

Back to the top