Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2003-10-16 20:46:11 +0000
committerMichael Valenta2003-10-16 20:46:11 +0000
commit3e007070c9d866f3515029da805e5e597f256a22 (patch)
tree1052d3de0439be6f11dfcc993b72b5f31da12c3c
parent8a02d4d63aaed031d0a89ed49ed0bec2338837ac (diff)
downloadeclipse.platform.team-3e007070c9d866f3515029da805e5e597f256a22.tar.gz
eclipse.platform.team-3e007070c9d866f3515029da805e5e597f256a22.tar.xz
eclipse.platform.team-3e007070c9d866f3515029da805e5e597f256a22.zip
44985: NPE in CVSSyncInfo.makeInSync
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSSyncInfo.java34
1 files changed, 3 insertions, 31 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSSyncInfo.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSSyncInfo.java
index 7c038c972..8b2068e5a 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSSyncInfo.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSSyncInfo.java
@@ -113,35 +113,6 @@ public class CVSSyncInfo extends SyncInfo {
return kind;
}
-
- /**
- * Return true if the provided phantom folder conyains any outgoing file deletions.
- * We only need to detect if there are any files since a phantom folder can only
- * contain outgoing filre deletions and other folder.
- *
- * @param cvsFolder a phantom folder
- * @return boolean
- */
- private boolean containsOutgoingDeletions(ICVSFolder cvsFolder) {
- final boolean result[] = new boolean[] { false };
- try {
- cvsFolder.accept(new ICVSResourceVisitor() {
- public void visitFile(ICVSFile file) throws CVSException {
- // Do nothing. Files are handled below
- }
- public void visitFolder(ICVSFolder folder) throws CVSException {
- if (folder.members(ICVSFolder.FILE_MEMBERS).length > 0) {
- result[0] = true;
- } else {
- folder.acceptChildren(this);
- }
- }
- });
- } catch (CVSException e) {
- CVSProviderPlugin.log(e);
- }
- return result[0];
- }
/*
* If the resource has a delete/delete conflict then ensure that the local is unmanaged so that the
@@ -269,7 +240,7 @@ public class CVSSyncInfo extends SyncInfo {
boolean outgoing = (getKind() & DIRECTION_MASK) == OUTGOING;
if (outgoing) return;
- ICVSFolder local = (ICVSFolder)CVSWorkspaceRoot.getCVSFolderFor((IContainer)getLocal());
+ ICVSFolder local = CVSWorkspaceRoot.getCVSFolderFor((IContainer)getLocal());
RemoteFolder remote = (RemoteFolder)getRemote();
// The parent must be managed
@@ -283,6 +254,8 @@ public class CVSSyncInfo extends SyncInfo {
// If the folder already has CVS info, check that the remote and local match
if(local.isManaged() && local.isCVSFolder()) {
+ // If there's no remote, assume everything is OK
+ if (remote == null) return;
// Verify that the root and repository are the same
FolderSyncInfo remoteInfo = remote.getFolderSyncInfo();
FolderSyncInfo localInfo = local.getFolderSyncInfo();
@@ -305,7 +278,6 @@ public class CVSSyncInfo extends SyncInfo {
}
public String toString() {
- IResource local = getLocal();
IRemoteResource base = getBase();
IRemoteResource remote = getRemote();
StringBuffer result = new StringBuffer(super.toString());

Back to the top