Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2002-06-07 16:09:50 +0000
committerMichael Valenta2002-06-07 16:09:50 +0000
commit607873f4701989f62e1f96f5fd770506476f39cc (patch)
tree465d4b0b3ca3f7079c82cffb72d922b88bf6767b /bundles
parent1952e3a5233d9650c886acac02f4e2b5257f619f (diff)
downloadeclipse.platform.team-607873f4701989f62e1f96f5fd770506476f39cc.tar.gz
eclipse.platform.team-607873f4701989f62e1f96f5fd770506476f39cc.tar.xz
eclipse.platform.team-607873f4701989f62e1f96f5fd770506476f39cc.zip
19416: CVS: NPE in decorator thread
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFile.java7
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseResource.java11
2 files changed, 13 insertions, 5 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFile.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFile.java
index 5c0cab35f..3eb694058 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFile.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFile.java
@@ -107,10 +107,10 @@ public class EclipseFile extends EclipseResource implements ICVSFile {
* @see ICVSFile#isModified()
*/
public boolean isModified() throws CVSException {
- if (!exists() || !isManaged()) {
+ ResourceSyncInfo info = getSyncInfo();
+ if (!exists() || !isManaged(info)) {
return true;
} else {
- ResourceSyncInfo info = getSyncInfo();
// consider a merged file as always modified.
if(info.isMerged()) return true;
return !getTimeStamp().equals(info.getTimeStamp());
@@ -211,7 +211,8 @@ public class EclipseFile extends EclipseResource implements ICVSFile {
* @see ICVSFile#getLogEntries(IProgressMonitor)
*/
public ILogEntry[] getLogEntries(IProgressMonitor monitor) throws TeamException {
- if(isManaged() && !getSyncInfo().isAdded()) {
+ ResourceSyncInfo info = getSyncInfo();
+ if(isManaged(info) && !info.isAdded()) {
ICVSRemoteResource remoteFile = CVSWorkspaceRoot.getRemoteResourceFor(resource);
return ((ICVSRemoteFile)remoteFile).getLogEntries(monitor);
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseResource.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseResource.java
index 8898dc76b..df1f6f7d4 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseResource.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseResource.java
@@ -175,9 +175,16 @@ abstract class EclipseResource implements ICVSResource, Comparable {
* @see ICVSResource#isManaged()
*/
public boolean isManaged() throws CVSException {
- return getSyncInfo() != null;
+ return isManaged(getSyncInfo());
}
-
+
+ /*
+ * Helper method that captures the sematics of isManaged given a ResourceSyncInfo
+ */
+ public boolean isManaged(ResourceSyncInfo info) {
+ return info != null;
+ }
+
/**
* Two ManagedResources are equal, if there cvsResources are
* equal (and that is, if the point to the same file)

Back to the top