summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpelder2006-06-14 09:47:39 (EDT)
committerpelder2006-06-14 09:47:39 (EDT)
commit631bf785eaac843b002c84c50447baaaa8c3776a (patch)
treec3ef264374ba0bf74579abeba22034fe853dc82e
parent0b451b97902f003fe0ebbb479ead8773be47810e (diff)
downloadorg.eclipse.jet-631bf785eaac843b002c84c50447baaaa8c3776a.zip
org.eclipse.jet-631bf785eaac843b002c84c50447baaaa8c3776a.tar.gz
org.eclipse.jet-631bf785eaac843b002c84c50447baaaa8c3776a.tar.bz2
[146890] Check for null pointer out of weak reference. Don't issue unactionable messages to Eclipse error log.
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/SavedStateManager.java8
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/builder/JET2Builder.java2
2 files changed, 6 insertions, 4 deletions
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/SavedStateManager.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/SavedStateManager.java
index f6efdf1..a3b3122 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/SavedStateManager.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/SavedStateManager.java
@@ -16,7 +16,6 @@
*/
package org.eclipse.jet.internal;
-import java.lang.ref.Reference;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.HashMap;
@@ -140,9 +139,10 @@ public class SavedStateManager implements ISaveParticipant
{
for (Iterator i = projectSavers.iterator(); i.hasNext();)
{
- final Reference ref = (WeakReference)i.next();
+ final WeakReference ref = (WeakReference)i.next();
final IStateSaver saver = (IStateSaver)ref.get();
-
+ if(saver != null)
+ {
IPath logicalPath = getLogicalStatePath(saver);
final IPath realPath = getActualPath(logicalPath, context.getSaveNumber());
@@ -152,6 +152,7 @@ public class SavedStateManager implements ISaveParticipant
saver.doSave(location);
context.needSaveNumber();
+ }
}
}
@@ -225,6 +226,7 @@ public class SavedStateManager implements ISaveParticipant
private void rememberProjectSaver(IProject project, IStateSaver saver)
{
+ // FIXME This method appears to do nothing. Is it even needed?
List list = (List)saversByProject.get(project);
if(list == null)
{
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/builder/JET2Builder.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/builder/JET2Builder.java
index 87ec0af..b19aeff 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/builder/JET2Builder.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/builder/JET2Builder.java
@@ -339,7 +339,7 @@ public class JET2Builder extends IncrementalProjectBuilder implements SavedState
catch (FileNotFoundException e)
{
// nothing to do, the state was not saved for some reason.
- JETActivatorWrapper.INSTANCE.log(e);
+ // NO NOT log this, this will happen whenever a new project occurs.
}
catch (IOException e)
{