Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Fedorenko2011-09-09 10:31:48 -0400
committerIgor Fedorenko2011-09-09 10:31:48 -0400
commit4ca16a591d79e47a4f56d5a7b2886b9814110ba0 (patch)
tree31d5c13a2bbf18bf036b8e0758129c2501c2e446
parentc3f8c57e8f4a80634c43ae97012e8ce7fe2fc046 (diff)
downloadm2e-core-4ca16a591d79e47a4f56d5a7b2886b9814110ba0.tar.gz
m2e-core-4ca16a591d79e47a4f56d5a7b2886b9814110ba0.tar.xz
m2e-core-4ca16a591d79e47a4f56d5a7b2886b9814110ba0.zip
added debug log message about closed projects in project registry
Signed-off-by: Igor Fedorenko <igor@ifedorenko.com>
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/WorkspaceStateWriter.java17
1 files changed, 12 insertions, 5 deletions
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/WorkspaceStateWriter.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/WorkspaceStateWriter.java
index 1878930b..cc3c1c1e 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/WorkspaceStateWriter.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/WorkspaceStateWriter.java
@@ -36,8 +36,9 @@ import org.eclipse.m2e.core.project.IMavenProjectChangedListener;
import org.eclipse.m2e.core.project.IMavenProjectFacade;
import org.eclipse.m2e.core.project.MavenProjectChangedEvent;
+
/**
- * Maintains map file of maven artifacts present in workspace.
+ * Maintains map file of maven artifacts present in workspace.
*/
public class WorkspaceStateWriter implements IMavenProjectChangedListener {
private static final Logger log = LoggerFactory.getLogger(WorkspaceStateWriter.class);
@@ -47,13 +48,18 @@ public class WorkspaceStateWriter implements IMavenProjectChangedListener {
public WorkspaceStateWriter(MavenProjectManager projectManager) {
this.projectManager = projectManager;
}
-
+
public void mavenProjectChanged(MavenProjectChangedEvent[] events, IProgressMonitor monitor) {
try {
Properties state = new Properties();
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
for(IMavenProjectFacade projectFacade : projectManager.getProjects()) {
+ if(!projectFacade.getProject().isAccessible()) {
+ log.debug("Project registry contains closed project {}", projectFacade.getProject());
+ // this is actually a bug somewhere in registry refresh logic, closed projects should not be there
+ continue;
+ }
try {
Artifact artifact = projectFacade.getMavenProject(monitor).getArtifact();
IFile pomFile = projectFacade.getPom();
@@ -66,12 +72,13 @@ public class WorkspaceStateWriter implements IMavenProjectChangedListener {
}
}
IResource outputLocation = root.findMember(projectFacade.getOutputLocation());
- if (!"pom".equals(artifact.getType()) && outputLocation != null && outputLocation.exists()) { //$NON-NLS-1$
+ if(!"pom".equals(artifact.getType()) && outputLocation != null && outputLocation.exists()) { //$NON-NLS-1$
String extension = artifact.getArtifactHandler().getExtension();
- String key = artifact.getGroupId() + ":" + artifact.getArtifactId() + ":" + extension + ":" + artifact.getBaseVersion(); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ String key = artifact.getGroupId()
+ + ":" + artifact.getArtifactId() + ":" + extension + ":" + artifact.getBaseVersion(); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
state.put(key, outputLocation.getLocation().toFile().getCanonicalPath());
}
- } catch (CoreException ex) {
+ } catch(CoreException ex) {
log.error("Error writing workspace state file", ex);
}
}

Back to the top