Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvladt2011-03-25 16:18:43 -0400
committervladt2011-03-25 16:19:17 -0400
commitb435d7b6c59c0160473d58513fa6f9b5dd473097 (patch)
treec4050a438cedcda0ba0ee4a7849cc21514554962 /org.eclipse.m2e.discovery
parentf5ace1823046bc9e4dd5538924b5914545d13b80 (diff)
downloadm2e-core-b435d7b6c59c0160473d58513fa6f9b5dd473097.tar.gz
m2e-core-b435d7b6c59c0160473d58513fa6f9b5dd473097.tar.xz
m2e-core-b435d7b6c59c0160473d58513fa6f9b5dd473097.zip
341000: NPE in MavenImportWizard when MavenDiscoveryService returns null
Diffstat (limited to 'org.eclipse.m2e.discovery')
-rw-r--r--org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/MavenDiscoveryService.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/MavenDiscoveryService.java b/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/MavenDiscoveryService.java
index cfb988de..47055288 100644
--- a/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/MavenDiscoveryService.java
+++ b/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/MavenDiscoveryService.java
@@ -64,10 +64,14 @@ import org.eclipse.ui.statushandlers.StatusManager;
import org.osgi.framework.Bundle;
import org.osgi.framework.ServiceFactory;
import org.osgi.framework.ServiceRegistration;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
@SuppressWarnings({"restriction", "rawtypes"})
public class MavenDiscoveryService implements IImportWizardPageFactory, IMavenDiscovery, ServiceFactory {
+ private static final Logger log = LoggerFactory.getLogger(MavenDiscoveryService.class);
+
public static class CatalogItemCacheEntry {
private final CatalogItem item;
@@ -114,6 +118,7 @@ public class MavenDiscoveryService implements IImportWizardPageFactory, IMavenDi
public Map<ILifecycleMappingRequirement, List<IMavenDiscoveryProposal>> discover(MavenProject mavenProject,
List<MojoExecution> mojoExecutions, List<IMavenDiscoveryProposal> preselected, IProgressMonitor monitor)
throws CoreException {
+ Map<ILifecycleMappingRequirement, List<IMavenDiscoveryProposal>> proposals = new LinkedHashMap<ILifecycleMappingRequirement, List<IMavenDiscoveryProposal>>();
if(items == null) {
items = new ArrayList<MavenDiscoveryService.CatalogItemCacheEntry>();
@@ -122,8 +127,8 @@ public class MavenDiscoveryService implements IImportWizardPageFactory, IMavenDi
IStatus status = catalog.performDiscovery(monitor);
if(!status.isOK()) {
- // XXX log and/or throw something heavy at the caller
- return null;
+ log.error(status.toString());
+ return proposals;
}
IProvisioningAgent p2agent = ProvisioningUI.getDefaultUI().getSession().getProvisioningAgent();
@@ -141,8 +146,6 @@ public class MavenDiscoveryService implements IImportWizardPageFactory, IMavenDi
}
}
- Map<ILifecycleMappingRequirement, List<IMavenDiscoveryProposal>> proposals = new LinkedHashMap<ILifecycleMappingRequirement, List<IMavenDiscoveryProposal>>();
-
MavenPlugin mavenPlugin = MavenPlugin.getDefault();
IMaven maven = mavenPlugin.getMaven();

Back to the top