Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcrogers2010-10-25 00:18:27 -0400
committercrogers2010-10-25 00:18:27 -0400
commitd28c96dabdb4237a37ad413b4bebb7ebd34576ec (patch)
treeff8e846848aa1f96f103dbc960009adb240f35c4
parent25e78b378ee24a8da46a6c2dbb92355de5082ffe (diff)
downloadwebtools.jsf-d28c96dabdb4237a37ad413b4bebb7ebd34576ec.tar.gz
webtools.jsf-d28c96dabdb4237a37ad413b4bebb7ebd34576ec.tar.xz
webtools.jsf-d28c96dabdb4237a37ad413b4bebb7ebd34576ec.zip
[Bug 327834] Memory leak in AbstractJSFAppConfigManager
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/ContextParamSpecifiedJSFAppConfigLocater.java21
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/internal/AbstractJSFAppConfigManager.java11
2 files changed, 22 insertions, 10 deletions
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/ContextParamSpecifiedJSFAppConfigLocater.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/ContextParamSpecifiedJSFAppConfigLocater.java
index 2ccf1485e..0446045de 100644
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/ContextParamSpecifiedJSFAppConfigLocater.java
+++ b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/ContextParamSpecifiedJSFAppConfigLocater.java
@@ -13,6 +13,7 @@ package org.eclipse.jst.jsf.core.jsfappconfig;
import java.util.Iterator;
import java.util.List;
+import org.eclipse.core.resources.IProject;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.impl.AdapterImpl;
import org.eclipse.emf.common.util.EList;
@@ -58,12 +59,20 @@ public class ContextParamSpecifiedJSFAppConfigLocater extends WebContentRelative
}
private Object getModelObject() {
- Object modelObject = null;
- IModelProvider provider = ModelProviderManager.getModelProvider(getJSFAppConfigManager().getProject());
- if (provider != null) {
- modelObject = provider.getModelObject();
- }
- return modelObject;
+ Object modelObject = null;
+ IProject project = getJSFAppConfigManager().getProject();
+ if (project.isAccessible()) {
+ IModelProvider provider = ModelProviderManager.getModelProvider(project);
+ if (provider != null) {
+ // we can't get the model if the workspace tree is currently locked.
+ // to avoid the logged message, check the workspace tree here.
+ if (!project.getWorkspace().isTreeLocked()) {
+ modelObject = provider.getModelObject();
+ }
+ }
+ }
+
+ return modelObject;
}
/*
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/internal/AbstractJSFAppConfigManager.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/internal/AbstractJSFAppConfigManager.java
index a6ee504e0..7ea764243 100644
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/internal/AbstractJSFAppConfigManager.java
+++ b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/internal/AbstractJSFAppConfigManager.java
@@ -252,6 +252,7 @@ public abstract class AbstractJSFAppConfigManager
* <li>clearing the facesConfigChangeListeners collection</li>
* </ul>
*/
+ @Override
public void dispose() {
//instruct locaters to stop locating
stopConfigLocaters();
@@ -260,10 +261,12 @@ public abstract class AbstractJSFAppConfigManager
configProvidersChangeListeners.clear();
facesConfigChangeListeners.clear();
}
-
- public void destroy() {
- //
- }
+
+ @Override
+ public void destroy() {
+ // no persistent data to cleanup. just call dispose.
+ dispose();
+ }
public void checkpoint() {
//

Back to the top