Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Fedorenko2013-04-27 23:12:40 -0400
committerIgor Fedorenko2013-04-27 23:12:40 -0400
commit6395f4980834edff03cea30ed9ab734616026337 (patch)
tree5e74a75bd7df4ba592c7b3d8d0b92ca263f6cd2b
parentc4377bd039acb4d96ca93356699a685f91479a27 (diff)
downloadm2e-core-6395f4980834edff03cea30ed9ab734616026337.tar.gz
m2e-core-6395f4980834edff03cea30ed9ab734616026337.tar.xz
m2e-core-6395f4980834edff03cea30ed9ab734616026337.zip
405880 fixed NPE during sources download in some cases
DownloadSourcesJob needed to call facade.getMavenProject(monitor) to load MavenProject instance after workspace restart. Signed-off-by: Igor Fedorenko <igor@ifedorenko.com>
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/DownloadSourcesJob.java30
1 files changed, 13 insertions, 17 deletions
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/DownloadSourcesJob.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/DownloadSourcesJob.java
index 63c2a06e..dac28f71 100644
--- a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/DownloadSourcesJob.java
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/DownloadSourcesJob.java
@@ -134,24 +134,20 @@ class DownloadSourcesJob extends Job implements IBackgroundProcessingQueue {
Map<IPackageFragmentRoot, File[]> nonMavenProjects = new LinkedHashMap<IPackageFragmentRoot, File[]>();
for(DownloadRequest request : downloadRequests) {
- if(request.artifact != null)
- try {
- IMavenProjectFacade projectFacade = projectManager.create(request.project, monitor);
-
- if(projectFacade != null) {
- downloadMaven(projectFacade, request.artifact, request.downloadSources, request.downloadJavaDoc, monitor);
- mavenProjects.add(request.project);
- } else {
- List<ArtifactRepository> repositories = maven.getArtifactRepositories();
-
- File[] files = downloadAttachments(request.artifact, repositories, request.downloadSources,
- request.downloadJavaDoc, monitor);
-
- nonMavenProjects.put(request.fragment, files);
- }
- } catch(CoreException ex) {
- exceptions.add(ex.getStatus());
+ try {
+ IMavenProjectFacade projectFacade = projectManager.create(request.project, monitor);
+ if(projectFacade != null) {
+ downloadMaven(projectFacade, request.artifact, request.downloadSources, request.downloadJavaDoc, monitor);
+ mavenProjects.add(request.project);
+ } else if(request.artifact != null) {
+ List<ArtifactRepository> repositories = maven.getArtifactRepositories();
+ File[] files = downloadAttachments(request.artifact, repositories, request.downloadSources,
+ request.downloadJavaDoc, monitor);
+ nonMavenProjects.put(request.fragment, files);
}
+ } catch(CoreException ex) {
+ exceptions.add(ex.getStatus());
+ }
}
if(!mavenProjects.isEmpty() || !nonMavenProjects.isEmpty()) {

Back to the top