Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSException.java31
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSStatus.java78
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSSyncInfo.java16
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSTag.java3
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSTeamProvider.java18
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/AbstractStructureVisitor.java16
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Command.java10
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/CommandOutputListener.java6
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Commit.java2
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Diff.java2
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ModTimeHandler.java7
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RemoveEntryHandler.java8
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RemovedHandler.java6
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Request.java4
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ResponseHandler.java2
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Session.java3
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/SyncUpdate.java2
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/TemplateHandler.java2
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Update.java7
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Version.java8
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/AnnotateListener.java4
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/LogListener.java2
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/ServerMessageLineMatcher.java13
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/StatusListener.java2
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/TagListener.java2
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/UpdateListener.java14
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSAuthenticationException.java49
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSCommunicationException.java37
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSRepositoryLocation.java29
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSServerException.java3
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/Connection.java25
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/PServerConnection.java8
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSEntryLineTag.java3
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSWorkspaceRoot.java7
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseResource.java4
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java26
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolder.java27
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolderMemberFetcher.java3
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolderTreeBuilder.java9
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/SessionPropertySyncInfoCache.java6
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/BaserevInfo.java13
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/CVSResourceVariantTree.java12
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/FolderSyncInfo.java4
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/NotifyInfo.java10
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/SyncFileWriter.java3
-rw-r--r--bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/CVSSSH2ServerConnection.java8
-rw-r--r--bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/PServerSSH2ServerConnection.java6
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/RemoteRevisionQuickDiffProvider.java6
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CheckoutProjectOperation.java9
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/FileDiffOperation.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/ShowAnnotationOperation.java2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RepositoryManager.java18
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSubscriberOperation.java12
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java3
54 files changed, 372 insertions, 242 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSException.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSException.java
index 9a65eba3d..5df771c31 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSException.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSException.java
@@ -15,8 +15,7 @@ import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.*;
import org.eclipse.team.core.TeamException;
/**
@@ -33,25 +32,13 @@ public class CVSException extends TeamException {
private static final long serialVersionUID = 1L;
public CVSException(CoreException e) {
- super(e);
- }
-
- public CVSException(int severity, int code, String message, Throwable e) {
- super(new CVSStatus(severity, code, message, e));
- }
-
- public CVSException(int severity, int code, String message) {
- this(severity, code, message, null);
+ super(e);
}
public CVSException(String message) {
- super(new CVSStatus(IStatus.ERROR, UNABLE, message, null));
+ this(new CVSStatus(IStatus.ERROR, message));
}
-
- public CVSException(String message, Throwable e) {
- this(IStatus.ERROR, UNABLE, message, e);
- }
-
+
public CVSException(IStatus status) {
super(status);
}
@@ -60,16 +47,14 @@ public class CVSException extends TeamException {
* Static helper methods for creating exceptions
*/
public static CVSException wrapException(IResource resource, String message, IOException e) {
- // NOTE: we should record the resource somehow
- // We should also inlcude the IO message
- return new CVSException(new CVSStatus(IStatus.ERROR, IO_FAILED, message, e));
+ return new CVSException(new CVSStatus(IStatus.ERROR, IO_FAILED, message, e, resource));
}
/*
* Static helper methods for creating exceptions
*/
public static CVSException wrapException(IResource resource, String message, CoreException e) {
- return new CVSException(new CVSStatus(IStatus.ERROR, e.getStatus().getCode(), message, e));
+ return new CVSException(new CVSStatus(IStatus.ERROR, e.getStatus().getCode(), message, e, resource));
}
/*
@@ -84,7 +69,9 @@ public class CVSException extends TeamException {
}
t = target;
}
- return new CVSException(new CVSStatus(IStatus.ERROR, UNABLE, t.getMessage() != null ? t.getMessage() : "", t)); //$NON-NLS-1$
+ //TODO: fix the caller to include a resource
+ //TODO: fix the caller to setup the error code
+ return new CVSException(new CVSStatus(IStatus.ERROR, UNABLE, t.getMessage() != null ? t.getMessage() : "", t, (IResource)null)); //$NON-NLS-1$
}
public static CVSException wrapException(CoreException e) {
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSStatus.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSStatus.java
index 34da4fef3..edc1bd149 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSStatus.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSStatus.java
@@ -10,11 +10,15 @@
*******************************************************************************/
package org.eclipse.team.internal.ccvs.core;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
import org.eclipse.osgi.util.NLS;
+import org.eclipse.team.core.TeamStatus;
+import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
+import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo;
+import org.eclipse.team.internal.ccvs.core.util.KnownRepositories;
-public class CVSStatus extends Status {
+public class CVSStatus extends TeamStatus {
/*** Status codes ***/
public static final int SERVER_ERROR = -10;
@@ -35,30 +39,52 @@ public class CVSStatus extends Status {
public static final int UNMEGERED_BINARY_CONFLICT = -26;
public static final int INVALID_LOCAL_RESOURCE_PATH = -27;
public static final int RESPONSE_HANDLING_FAILURE = -28;
+ public static final int COMMUNICATION_FAILURE = -29;
+ public static final int AUTHENTICATION_FAILURE = -30;
// Path for resource related status
private ICVSFolder commandRoot;
+ // Server information
+ private ICVSRepositoryLocation cvsLocation;
- public CVSStatus(int severity, int code, String message, Throwable t) {
- super(severity, CVSProviderPlugin.ID, code, message, t);
+ public CVSStatus(int severity, int code, String message, Throwable t, ICVSRepositoryLocation cvsLocation) {
+ super(severity, CVSProviderPlugin.ID, code, message, t,null);
+ this.cvsLocation = cvsLocation;
}
- public CVSStatus(int severity, int code, String message) {
- this(severity, code, message, null);
+ public CVSStatus(int severity, int code, String message,ICVSRepositoryLocation cvsLocation) {
+ this(severity, code, message, null, cvsLocation);
}
- public CVSStatus(int severity, int code, ICVSFolder commandRoot, String message) {
- this(severity, code, message, null);
+ public CVSStatus(int severity, int code, String message, Throwable t, IResource cvsResource) {
+ super(severity, CVSProviderPlugin.ID, code, message, t, cvsResource);
+ }
+
+ public CVSStatus(int severity, int code, String message, IResource resource) {
+ this(severity, code, message, null, resource);
+ }
+
+ public CVSStatus(int severity, int code, String message, Throwable t, ICVSFolder commandRoot) {
+ super(severity, CVSProviderPlugin.ID, code, message, t, null);
this.commandRoot = commandRoot;
}
+ public CVSStatus(int severity, int code, String message, ICVSFolder commandRoot) {
+ this(severity, code, message, null, commandRoot);
+ }
+
+ public CVSStatus(int severity, int code, String message, Throwable t) {
+ super(severity, CVSProviderPlugin.ID, code, message, t, null);
+ }
+
public CVSStatus(int severity, String message, Throwable t) {
- this(severity, 0, message, t);
+ super(severity, CVSProviderPlugin.ID, CVSStatus.ERROR, message, t, null);
}
public CVSStatus(int severity, String message) {
- this(severity, severity, message, null);
- }
+ super(severity, CVSProviderPlugin.ID, CVSStatus.ERROR, message, null, null);
+ }
+
/**
* @see IStatus#getMessage()
*/
@@ -111,4 +137,34 @@ public class CVSStatus extends Status {
return true;
}
+ public ICVSRepositoryLocation getCvsLocation() {
+ if (cvsLocation==null){
+ try {
+ if (commandRoot!=null){
+ FolderSyncInfo info = commandRoot.getFolderSyncInfo();
+ if (info!=null){
+ String repoString = info.getRoot();
+ cvsLocation = KnownRepositories.getInstance().getRepository(repoString);
+ }
+ } else if (getResource()!=null){
+ ICVSFolder folder = CVSWorkspaceRoot.getCVSFolderFor(getResource().getProject());
+ FolderSyncInfo info = folder.getFolderSyncInfo();
+ if (info!=null){
+ String repoString = info.getRoot();
+ cvsLocation = KnownRepositories.getInstance().getRepository(repoString);
+ }
+ }
+ } catch (CVSException e){
+ // do nothing as we are already creating a status for an exception
+ // we may need to trace it though
+ }
+ }
+ return cvsLocation;
+ }
+
+ public ICVSFolder getCommandRoot() {
+ return commandRoot;
+ }
+
+
}
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 74ef3f7a4..57701a528 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
@@ -234,7 +234,7 @@ public class CVSSyncInfo extends SyncInfo {
if(info!=null) {
FolderSyncInfo parentInfo = local.getParent().getFolderSyncInfo();
if (parentInfo == null) {
- return new CVSStatus(IStatus.ERROR, PARENT_NOT_MANAGED, NLS.bind(CVSMessages.CVSSyncInfo_9, new String[] { getLocal().getFullPath().toString() }));
+ return new CVSStatus(IStatus.ERROR, PARENT_NOT_MANAGED, NLS.bind(CVSMessages.CVSSyncInfo_9, new String[] { getLocal().getFullPath().toString()}), getLocal());
}
info.setTag(parentInfo.getTag());
}
@@ -269,19 +269,19 @@ public class CVSSyncInfo extends SyncInfo {
// Only works on folders
if (getLocal().getType() == IResource.FILE) {
- return new CVSStatus(IStatus.WARNING, INVALID_RESOURCE_TYPE, NLS.bind(CVSMessages.CVSSyncInfo_7, new String[] { getLocal().getFullPath().toString() }));
- }
+ return new CVSStatus(IStatus.WARNING, INVALID_RESOURCE_TYPE, NLS.bind(CVSMessages.CVSSyncInfo_7, new String[] { getLocal().getFullPath().toString()}), getLocal());
+ }
// Only works on outgoing and conflicting changes
boolean outgoing = (getKind() & DIRECTION_MASK) == OUTGOING;
if (outgoing) {
- return new CVSStatus(IStatus.WARNING, INVALID_SYNC_KIND, NLS.bind(CVSMessages.CVSSyncInfo_8, new String[] { getLocal().getFullPath().toString() }));
+ return new CVSStatus(IStatus.WARNING, INVALID_SYNC_KIND, NLS.bind(CVSMessages.CVSSyncInfo_8, new String[] { getLocal().getFullPath().toString() }), getLocal());
}
// The parent must be managed
ICVSFolder local = CVSWorkspaceRoot.getCVSFolderFor((IContainer)getLocal());
if (getLocal().getType() == IResource.FOLDER && ! local.getParent().isCVSFolder())
- return new CVSStatus(IStatus.ERROR, PARENT_NOT_MANAGED, NLS.bind(CVSMessages.CVSSyncInfo_9, new String[] { getLocal().getFullPath().toString() }));
+ return new CVSStatus(IStatus.ERROR, PARENT_NOT_MANAGED, NLS.bind(CVSMessages.CVSSyncInfo_9, new String[] { getLocal().getFullPath().toString() }), getLocal());
// Ensure that the folder exists locally
if (! local.exists()) {
@@ -297,9 +297,9 @@ public class CVSSyncInfo extends SyncInfo {
FolderSyncInfo remoteInfo = remote.getFolderSyncInfo();
FolderSyncInfo localInfo = local.getFolderSyncInfo();
if ( ! localInfo.getRoot().equals(remoteInfo.getRoot())) {
- return new CVSStatus(IStatus.ERROR, SYNC_INFO_CONFLICTS, NLS.bind(CVSMessages.CVSRemoteSyncElement_rootDiffers, (new Object[] {local.getName(), remoteInfo.getRoot(), localInfo.getRoot()})));
+ return new CVSStatus(IStatus.ERROR, SYNC_INFO_CONFLICTS, NLS.bind(CVSMessages.CVSRemoteSyncElement_rootDiffers, (new Object[] {local.getName(), remoteInfo.getRoot(), localInfo.getRoot()})),getLocal());
} else if ( ! localInfo.getRepository().equals(remoteInfo.getRepository())) {
- return new CVSStatus(IStatus.ERROR, SYNC_INFO_CONFLICTS, NLS.bind(CVSMessages.CVSRemoteSyncElement_repositoryDiffers, (new Object[] {local.getName(), remoteInfo.getRepository(), localInfo.getRepository()})));
+ return new CVSStatus(IStatus.ERROR, SYNC_INFO_CONFLICTS, NLS.bind(CVSMessages.CVSRemoteSyncElement_repositoryDiffers, (new Object[] {local.getName(), remoteInfo.getRepository(), localInfo.getRepository()})),getLocal());
}
// The folders are in sync so just return
return Status.OK_STATUS;
@@ -307,7 +307,7 @@ public class CVSSyncInfo extends SyncInfo {
// The remote must exist if the local is not managed
if (remote == null) {
- return new CVSStatus(IStatus.ERROR, REMOTE_DOES_NOT_EXIST, NLS.bind(CVSMessages.CVSSyncInfo_10, new String[] { getLocal().getFullPath().toString() }));
+ return new CVSStatus(IStatus.ERROR, REMOTE_DOES_NOT_EXIST, NLS.bind(CVSMessages.CVSSyncInfo_10, new String[] { getLocal().getFullPath().toString() }),getLocal());
}
// Since the parent is managed, this will also set the resource sync info. It is
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSTag.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSTag.java
index c7ecac061..a18b8aa40 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSTag.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSTag.java
@@ -46,7 +46,8 @@ public class CVSTag implements ITag {
try {
return tagNameFormat.parse(name);
} catch (ParseException e) {
- CVSProviderPlugin.log(new CVSException("Tag name " + name + " is not of the expected format " + DATE_TAG_NAME_FORMAT, e)); //$NON-NLS-1$ //$NON-NLS-2$
+ IStatus status = new CVSStatus(IStatus.ERROR, CVSStatus.ERROR,"Tag name " + name + " is not of the expected format " + DATE_TAG_NAME_FORMAT,e ); //$NON-NLS-1$ //$NON-NLS-2$
+ CVSProviderPlugin.log(new CVSException(status));
return null;
}
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSTeamProvider.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSTeamProvider.java
index e45db5d42..7b5e5779d 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSTeamProvider.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSTeamProvider.java
@@ -170,7 +170,8 @@ public class CVSTeamProvider extends RepositoryProvider {
this.workspaceRoot = new CVSWorkspaceRoot(project);
// Ensure that the project has CVS info
if (workspaceRoot.getLocalRoot().getFolderSyncInfo() == null) {
- CVSProviderPlugin.log(new CVSException(new CVSStatus(IStatus.ERROR, NLS.bind(CVSMessages.CVSTeamProvider_noFolderInfo, new String[] { project.getName() }))));
+ IStatus status = new CVSStatus(IStatus.ERROR, CVSStatus.RESOURCE_SYNC_INFO_ERROR, NLS.bind(CVSMessages.CVSTeamProvider_noFolderInfo, new String[] { project.getName() }),project);
+ CVSProviderPlugin.log(status);
}
} catch (CVSException e) {
// Ignore exceptions here. They will be surfaced elsewhere
@@ -648,7 +649,7 @@ public class CVSTeamProvider extends RepositoryProvider {
if (property == null) return CVSProviderPlugin.getPlugin().getFetchAbsentDirectories();
return Boolean.valueOf(property).booleanValue();
} catch (CoreException e) {
- throw new CVSException(new CVSStatus(IStatus.ERROR, NLS.bind(CVSMessages.CVSTeamProvider_errorGettingFetchProperty, new String[] { project.getName() }), e));
+ throw new CVSException(new CVSStatus(IStatus.ERROR, CVSStatus.ERROR, NLS.bind(CVSMessages.CVSTeamProvider_errorGettingFetchProperty, new String[] { project.getName() }), e, project));
}
}
@@ -664,7 +665,8 @@ public class CVSTeamProvider extends RepositoryProvider {
try {
getProject().setPersistentProperty(FETCH_ABSENT_DIRECTORIES_PROP_KEY, fetchAbsentDirectories);
} catch (CoreException e) {
- throw new CVSException(new CVSStatus(IStatus.ERROR, NLS.bind(CVSMessages.CVSTeamProvider_errorSettingFetchProperty, new String[] { project.getName() }), e));
+ IStatus status = new CVSStatus(IStatus.ERROR, CVSStatus.ERROR, NLS.bind(CVSMessages.CVSTeamProvider_errorSettingFetchProperty, new String[] { project.getName() }), e, project);
+ throw new CVSException(status);
}
}
@@ -694,12 +696,12 @@ public class CVSTeamProvider extends RepositoryProvider {
try {
if (cvsFolder.isCVSFolder()) {
// There is a remote folder that overlaps with the link so disallow
- return new CVSStatus(IStatus.ERROR, NLS.bind(CVSMessages.CVSTeamProvider_overlappingRemoteFolder, new String[] { resource.getFullPath().toString() }));
+ return new CVSStatus(IStatus.ERROR, CVSStatus.ERROR, NLS.bind(CVSMessages.CVSTeamProvider_overlappingRemoteFolder, new String[] { resource.getFullPath().toString() }),resource);
} else {
ICVSFile cvsFile = CVSWorkspaceRoot.getCVSFileFor(resource.getParent().getFile(new Path(resource.getName())));
if (cvsFile.isManaged()) {
// there is an outgoing file deletion that overlaps the link so disallow
- return new CVSStatus(IStatus.ERROR, NLS.bind(CVSMessages.CVSTeamProvider_overlappingFileDeletion, new String[] { resource.getFullPath().toString() }));
+ return new CVSStatus(IStatus.ERROR, CVSStatus.ERROR, NLS.bind(CVSMessages.CVSTeamProvider_overlappingFileDeletion, new String[] { resource.getFullPath().toString() }),resource);
}
}
} catch (CVSException e) {
@@ -836,7 +838,8 @@ public class CVSTeamProvider extends RepositoryProvider {
} catch (CoreException e) {
if (project.isAccessible()) {
// We only care if the project still exists
- throw new CVSException(new CVSStatus(IStatus.ERROR, NLS.bind(CVSMessages.CVSTeamProvider_errorGettingWatchEdit, new String[] { project.getName() }), e));
+ IStatus status = new CVSStatus(IStatus.ERROR, CVSStatus.ERROR, NLS.bind(CVSMessages.CVSTeamProvider_errorGettingWatchEdit, new String[] { project.getName() }), e, project);
+ throw new CVSException(status);
}
}
return false;
@@ -852,7 +855,8 @@ public class CVSTeamProvider extends RepositoryProvider {
project.setPersistentProperty(WATCH_EDIT_PROP_KEY, enabled);
project.setSessionProperty(WATCH_EDIT_PROP_KEY, enabled);
} catch (CoreException e) {
- throw new CVSException(new CVSStatus(IStatus.ERROR, NLS.bind(CVSMessages.CVSTeamProvider_errorSettingWatchEdit, new String[] { project.getName() }), e));
+ IStatus status = new CVSStatus(IStatus.ERROR, CVSStatus.ERROR, NLS.bind(CVSMessages.CVSTeamProvider_errorSettingWatchEdit, new String[] { project.getName() }), e, project);
+ throw new CVSException(status);
}
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/AbstractStructureVisitor.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/AbstractStructureVisitor.java
index 3b9b1b622..f825e0462 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/AbstractStructureVisitor.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/AbstractStructureVisitor.java
@@ -10,15 +10,12 @@
*******************************************************************************/
package org.eclipse.team.internal.ccvs.core.client;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
+import java.util.*;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.osgi.util.NLS;
import org.eclipse.team.internal.ccvs.core.*;
import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption;
@@ -128,7 +125,8 @@ abstract class AbstractStructureVisitor implements ICVSResourceVisitor {
// Send the directory to the server
String remotePath = mFolder.getRemoteLocation(session.getLocalRoot());
if (remotePath == null) {
- throw new CVSException(CVSMessages.AbstractStructureVisitor_noRemote);
+ IStatus status = new CVSStatus(IStatus.ERROR,CVSStatus.ERROR, CVSMessages.AbstractStructureVisitor_noRemote, session.getLocalRoot());
+ throw new CVSException(status);
}
session.sendDirectory(localPath, remotePath);
@@ -192,7 +190,7 @@ abstract class AbstractStructureVisitor implements ICVSResourceVisitor {
final IResource resource = mFile.getIResource();
try {
if (resource != null)
- Platform.getJobManager().beginRule(resource, monitor);
+ Job.getJobManager().beginRule(resource, monitor);
sendEntryLineToServer(mFile, syncBytes);
if (mFile.exists() && mFile.isModified(null)) {
@@ -207,7 +205,7 @@ abstract class AbstractStructureVisitor implements ICVSResourceVisitor {
}
} finally {
if (resource != null)
- Platform.getJobManager().endRule(resource);
+ Job.getJobManager().endRule(resource);
}
} else {
sendEntryLineToServer(mFile, syncBytes);
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Command.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Command.java
index 0ff7c767d..449a5f15a 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Command.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Command.java
@@ -253,18 +253,19 @@ public abstract class Command extends Request {
*/
protected void sendFileStructure(Session session, ICVSResource[] resources,
LocalOption[] localOptions, boolean emptyFolders, IProgressMonitor monitor) throws CVSException {
- checkResourcesManaged(resources);
+ checkResourcesManaged(session, resources);
new FileStructureVisitor(session, localOptions, emptyFolders, true).visit(session, resources, monitor);
}
/**
* Checks that all work resources are managed.
- *
+ * @param session TODO
* @param resources the resource arguments for the command
+ *
* @throws CVSException if some resources are not managed
*/
- protected void checkResourcesManaged(ICVSResource[] resources) throws CVSException {
+ protected void checkResourcesManaged(Session session, ICVSResource[] resources) throws CVSException {
for (int i = 0; i < resources.length; ++i) {
ICVSFolder folder;
if (resources[i].isFolder()) {
@@ -274,7 +275,8 @@ public abstract class Command extends Request {
folder = resources[i].getParent();
}
if (!folder.isCVSFolder() && folder.exists()) {
- throw new CVSException(NLS.bind(CVSMessages.Command_argumentNotManaged, new String[] { folder.getName() }));
+ IStatus status = new CVSStatus(IStatus.ERROR,CVSStatus.ERROR,NLS.bind(CVSMessages.Command_argumentNotManaged, new String[] { folder.getName() }),session.getLocalRoot());
+ throw new CVSException(status);
}
}
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/CommandOutputListener.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/CommandOutputListener.java
index fa8e672f8..6810d4eeb 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/CommandOutputListener.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/CommandOutputListener.java
@@ -33,13 +33,13 @@ public class CommandOutputListener implements ICommandOutputListener {
public IStatus errorLine(String line, ICVSRepositoryLocation location, ICVSFolder commandRoot, IProgressMonitor monitor) {
String protocolError = getProtocolError(line, location);
if (protocolError != null) {
- return new CVSStatus(IStatus.ERROR, CVSStatus.PROTOCOL_ERROR, commandRoot, protocolError);
+ return new CVSStatus(IStatus.ERROR, CVSStatus.PROTOCOL_ERROR, protocolError, commandRoot);
}
if (line.equals(ROOT_CVSIGNORE_READ_FAILURE) || getServerMessage(ROOT_CVSIGNORE_READ_FAILURE, location).equals(getServerMessage(line, location))) {
// Don't report this as an error since it does not affect the command
- return new CVSStatus(IStatus.WARNING, CVSStatus.ERROR_LINE, commandRoot, line);
+ return new CVSStatus(IStatus.WARNING, CVSStatus.ERROR_LINE, line, commandRoot);
}
- return new CVSStatus(IStatus.ERROR, CVSStatus.ERROR_LINE, commandRoot, line);
+ return new CVSStatus(IStatus.ERROR, CVSStatus.ERROR_LINE, line, commandRoot);
}
/**
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Commit.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Commit.java
index f1fc09803..1d85d3e33 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Commit.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Commit.java
@@ -44,7 +44,7 @@ public class Commit extends Command {
throws CVSException {
// Get the folders we want to work on
- checkResourcesManaged(resources);
+ checkResourcesManaged(session, resources);
// Send all changed files to the server
ModifiedFileSender visitor = new ModifiedFileSender(session, localOptions);
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Diff.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Diff.java
index 8ed90e6f3..5c9b104c1 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Diff.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Diff.java
@@ -64,7 +64,7 @@ public class Diff extends Command {
LocalOption[] localOptions, ICVSResource[] resources, IProgressMonitor monitor)
throws CVSException {
- checkResourcesManaged(resources);
+ checkResourcesManaged(session, resources);
DiffStructureVisitor visitor = new DiffStructureVisitor(session, localOptions);
visitor.visit(session, resources, monitor);
return resources;
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ModTimeHandler.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ModTimeHandler.java
index 022202af0..da1093e44 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ModTimeHandler.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ModTimeHandler.java
@@ -14,9 +14,9 @@ package org.eclipse.team.internal.ccvs.core.client;
import java.text.ParseException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.osgi.util.NLS;
-import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.core.CVSMessages;
+import org.eclipse.team.internal.ccvs.core.*;
import org.eclipse.team.internal.ccvs.core.util.CVSDateFormatter;
/**
@@ -43,7 +43,8 @@ class ModTimeHandler extends ResponseHandler {
try {
session.setModTime(CVSDateFormatter.serverStampToDate(timeStamp));
} catch (ParseException e) {
- throw new CVSException(NLS.bind(CVSMessages.ModTimeHandler_invalidFormat, new String[] { timeStamp }), e);
+ IStatus status = new CVSStatus(IStatus.ERROR,CVSStatus.ERROR,NLS.bind(CVSMessages.ModTimeHandler_invalidFormat, new String[] { timeStamp }), e, session.getLocalRoot());
+ throw new CVSException(status);
}
}
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RemoveEntryHandler.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RemoveEntryHandler.java
index 7c3b5379d..856bc9129 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RemoveEntryHandler.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RemoveEntryHandler.java
@@ -12,12 +12,9 @@ package org.eclipse.team.internal.ccvs.core.client;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.osgi.util.NLS;
import org.eclipse.team.internal.ccvs.core.*;
-import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin;
-import org.eclipse.team.internal.ccvs.core.ICVSFile;
-import org.eclipse.team.internal.ccvs.core.ICVSFolder;
/**
* Handles a "Remove-entry" response from the CVS server.
@@ -53,7 +50,8 @@ class RemoveEntryHandler extends ResponseHandler {
ICVSFolder mParent = session.getLocalRoot().getFolder(localDir);
ICVSFile mFile = mParent.getFile(fileName);
if (mFile.exists()) {
- CVSProviderPlugin.log(new CVSException(NLS.bind(CVSMessages.RemoveEntryHandler_2, new String[] { mFile.getRepositoryRelativePath() })));
+ IStatus status = new CVSStatus(IStatus.ERROR,CVSStatus.ERROR, NLS.bind(CVSMessages.RemoveEntryHandler_2, new String[] { mFile.getRepositoryRelativePath() }),session.getLocalRoot());
+ CVSProviderPlugin.log(status);
} else {
mFile.unmanage(null);
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RemovedHandler.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RemovedHandler.java
index 35df0b5bc..9de798ffd 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RemovedHandler.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RemovedHandler.java
@@ -50,7 +50,8 @@ class RemovedHandler extends ResponseHandler {
ICVSFile mFile = mParent.getFile(fileName);
if ( ! mFile.isManaged()) {
- throw new CVSException(NLS.bind(CVSMessages.RemovedHandler_invalid, new String[] { new Path(null, localDir).append(fileName).toString() }));
+ IStatus status = new CVSStatus(IStatus.ERROR,CVSStatus.ERROR,NLS.bind(CVSMessages.RemovedHandler_invalid, new String[] { new Path(null, localDir).append(fileName).toString() }),session.getLocalRoot());
+ throw new CVSException(status);
}
// delete then unmanage the file
@@ -59,7 +60,8 @@ class RemovedHandler extends ResponseHandler {
mFile.delete();
mFile.unmanage(null);
} catch (CVSException e) {
- session.handleResponseError(new CVSStatus(IStatus.ERROR, CVSStatus.RESPONSE_HANDLING_FAILURE, NLS.bind(CVSMessages.RemovedHandler_0, new String[] { getPath(mFile) }), e));
+ IStatus status = new CVSStatus(IStatus.ERROR, CVSStatus.RESPONSE_HANDLING_FAILURE, NLS.bind(CVSMessages.RemovedHandler_0, new String[] { getPath(mFile) }), e, session.getLocalRoot());
+ session.handleResponseError(status);
}
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Request.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Request.java
index cea29e9b5..584465fec 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Request.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Request.java
@@ -161,13 +161,13 @@ public abstract class Request {
} else {
argument = NLS.bind(CVSMessages.Command_seriousServerError, new String[] { argument });
if (!session.hasErrors()) {
- session.addError(new CVSStatus(IStatus.ERROR, CVSStatus.SERVER_ERROR, argument));
+ session.addError(new CVSStatus(IStatus.ERROR, CVSStatus.SERVER_ERROR, argument,session.getLocalRoot()));
}
serious = true;
}
if (!session.hasErrors()) {
- session.addError(new CVSStatus(IStatus.ERROR, CVSStatus.SERVER_ERROR, CVSMessages.Command_noMoreInfoAvailable));
+ session.addError(new CVSStatus(IStatus.ERROR, CVSStatus.SERVER_ERROR, CVSMessages.Command_noMoreInfoAvailable,session.getLocalRoot()));
}
IStatus status = new MultiStatus(CVSProviderPlugin.ID, CVSStatus.SERVER_ERROR,
session.getErrors(),
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ResponseHandler.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ResponseHandler.java
index 88db2aa5f..0f8d81422 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ResponseHandler.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ResponseHandler.java
@@ -174,7 +174,7 @@ public abstract class ResponseHandler {
} else {
path = local.getFullPath().toString();
}
- IStatus status = new CVSStatus(IStatus.ERROR, CVSStatus.INVALID_LOCAL_RESOURCE_PATH, NLS.bind(CVSMessages.ResponseHandler_0, new String[] { path, e.getMessage() }), e);
+ IStatus status = new CVSStatus(IStatus.ERROR, CVSStatus.INVALID_LOCAL_RESOURCE_PATH, NLS.bind(CVSMessages.ResponseHandler_0, new String[] { path, e.getMessage() }), e, session.getLocalRoot());
session.handleResponseError(status);
} catch (CVSException e1) {
CVSProviderPlugin.log(e1);
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Session.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Session.java
index 24c7f0c8a..1f97b68f3 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Session.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Session.java
@@ -763,7 +763,8 @@ public class Session {
handleErrorLine(sizeLine.substring(1).trim(), org.eclipse.core.runtime.Status.OK_STATUS);
return;
} else {
- throw new CVSException(CVSMessages.Session_badInt, e);
+ IStatus status = new CVSStatus(IStatus.ERROR,CVSStatus.ERROR,CVSMessages.Session_badInt, e, localRoot);
+ throw new CVSException(status);
}
}
// create an input stream that spans the next 'size' bytes from the connection
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/SyncUpdate.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/SyncUpdate.java
index eae96894a..9515b51d1 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/SyncUpdate.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/SyncUpdate.java
@@ -24,7 +24,7 @@ public class SyncUpdate extends Update {
protected void sendFileStructure(Session session, ICVSResource[] resources,
LocalOption[] localOptions, boolean emptyFolders, IProgressMonitor monitor) throws CVSException {
- checkResourcesManaged(resources);
+ checkResourcesManaged(session, resources);
new FileStructureVisitor(session, localOptions, emptyFolders, true, false).visit(session, resources, monitor);
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/TemplateHandler.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/TemplateHandler.java
index 5efe2a5da..a09cddb71 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/TemplateHandler.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/TemplateHandler.java
@@ -51,7 +51,7 @@ public class TemplateHandler extends ResponseHandler {
templateFile = CVSWorkspaceRoot.getCVSFileFor(SyncFileWriter.getTemplateFile(container));
} catch (CVSException e) {
// Log the inability to create the template file
- CVSProviderPlugin.log(new CVSStatus(IStatus.ERROR, "Could not write template file in " + container.getFullPath() + ": " + e.getMessage(), e)); //$NON-NLS-1$ //$NON-NLS-2$
+ CVSProviderPlugin.log(new CVSStatus(IStatus.ERROR, CVSStatus.ERROR, "Could not write template file in " + container.getFullPath() + ": " + e.getMessage(), e, session.getLocalRoot())); //$NON-NLS-1$ //$NON-NLS-2$
}
}
if (container == null || templateFile == null) {
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Update.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Update.java
index c3d5a93e4..adb84ed72 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Update.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Update.java
@@ -152,9 +152,9 @@ public class Update extends Command {
/**
* We allow unmanaged resources as long as there parents are managed.
*
- * @see Command#checkResourcesManaged(ICVSResource[])
+ * @see Command#checkResourcesManaged(Session, ICVSResource[])
*/
- protected void checkResourcesManaged(ICVSResource[] resources) throws CVSException {
+ protected void checkResourcesManaged(Session session, ICVSResource[] resources) throws CVSException {
for (int i = 0; i < resources.length; ++i) {
ICVSFolder folder;
if (resources[i].isFolder()) {
@@ -170,7 +170,8 @@ public class Update extends Command {
if (folder==null || (!folder.isCVSFolder() && folder.exists())) {
if (folder == null)
folder = (ICVSFolder)resources[i];
- throw new CVSException(NLS.bind(CVSMessages.Command_argumentNotManaged, new String[] { folder.getName() }));
+ IStatus status = new CVSStatus(IStatus.ERROR,CVSStatus.ERROR,NLS.bind(CVSMessages.Command_argumentNotManaged, new String[] { folder.getName() }),session.getLocalRoot());
+ throw new CVSException(status);
}
}
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Version.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Version.java
index 9ae181a88..3f59b2062 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Version.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Version.java
@@ -45,7 +45,7 @@ public class Version extends RemoteCommand {
// The server may not support the version request
if ( ! session.isValidRequest(getRequestId())) {
- IStatus status = new CVSStatus(IStatus.WARNING, CVSStatus.SERVER_IS_UNKNOWN, NLS.bind(CVSMessages.Version_versionNotValidRequest, new String[] { location.getHost() }));
+ IStatus status = new CVSStatus(IStatus.WARNING, CVSStatus.SERVER_IS_UNKNOWN, NLS.bind(CVSMessages.Version_versionNotValidRequest, new String[] { location.getHost() }), session.getLocalRoot());
((CVSRepositoryLocation)location).setServerPlaform(CVSRepositoryLocation.UNKNOWN_SERVER);
CVSProviderPlugin.log(status);
return status;
@@ -70,19 +70,19 @@ public class Version extends RemoteCommand {
String versionNumber = line.substring(knownPrefix.length(), line.indexOf(' ', knownPrefix.length() + 1));
if (versionNumber.startsWith("1.10") || versionNumber.equals("1.11") || versionNumber.equals("1.11.1")) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
serverType = CVSRepositoryLocation.UNSUPPORTED_SERVER;
- status = new CVSStatus(IStatus.WARNING, CVSStatus.UNSUPPORTED_SERVER_VERSION, NLS.bind(CVSMessages.Version_unsupportedVersion, new String[] { location.getHost(), versionNumber }));
+ status = new CVSStatus(IStatus.WARNING, CVSStatus.UNSUPPORTED_SERVER_VERSION, NLS.bind(CVSMessages.Version_unsupportedVersion, new String[] { location.getHost(), versionNumber }),location);
} else if (isCVSNT) {
serverType = CVSRepositoryLocation.CVSNT_SERVER;
}
} else {
serverType = CVSRepositoryLocation.UNKNOWN_SERVER;
- status = new CVSStatus(IStatus.INFO, CVSStatus.SERVER_IS_UNKNOWN, NLS.bind(CVSMessages.Version_unknownVersionFormat, new String[] { location.getHost(), line }));
+ status = new CVSStatus(IStatus.INFO, CVSStatus.SERVER_IS_UNKNOWN, NLS.bind(CVSMessages.Version_unknownVersionFormat, new String[] { location.getHost(), line }), location);
}
((CVSRepositoryLocation)location).setServerPlaform(serverType);
return status;
}
public IStatus errorLine(String line, ICVSRepositoryLocation location, ICVSFolder commandRoot, IProgressMonitor monitor) {
- return new CVSStatus(IStatus.ERROR, CVSStatus.ERROR_LINE, line);
+ return new CVSStatus(IStatus.ERROR, CVSStatus.ERROR_LINE, line, commandRoot);
}
};
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/AnnotateListener.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/AnnotateListener.java
index ce991ce80..3d6456bf8 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/AnnotateListener.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/AnnotateListener.java
@@ -47,7 +47,7 @@ public class AnnotateListener extends CommandOutputListener {
}
add(aBlock);
if (error != null)
- return new CVSStatus(IStatus.ERROR, CVSStatus.ERROR_LINE_PARSE_FAILURE, commandRoot, error);
+ return new CVSStatus(IStatus.ERROR, CVSStatus.ERROR_LINE_PARSE_FAILURE, error, commandRoot);
return OK;
}
@@ -84,7 +84,7 @@ public class AnnotateListener extends CommandOutputListener {
public IStatus errorLine(String line, ICVSRepositoryLocation location, ICVSFolder commandRoot, IProgressMonitor monitor) {
if(line.startsWith(CVSMessages.AnnotateListener_3)) {
String error = CVSMessages.AnnotateListener_4;
- return new CVSStatus(IStatus.ERROR, CVSStatus.SERVER_ERROR, commandRoot, error);
+ return new CVSStatus(IStatus.ERROR, CVSStatus.SERVER_ERROR, error, commandRoot);
}
return super.errorLine(line, location, commandRoot, monitor);
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/LogListener.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/LogListener.java
index 47dcefb07..d93fe1343 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/LogListener.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/LogListener.java
@@ -96,7 +96,7 @@ public class LogListener extends CommandOutputListener {
// look for the following condition
// E cvs server: nothing known about fileName
if (serverMessage.startsWith(NOTHING_KNOWN_ABOUT)) {
- return new CVSStatus(IStatus.ERROR, CVSStatus.DOES_NOT_EXIST, commandRoot, line);
+ return new CVSStatus(IStatus.ERROR, CVSStatus.DOES_NOT_EXIST, line, commandRoot);
}
}
return OK;
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/ServerMessageLineMatcher.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/ServerMessageLineMatcher.java
index 197e6c5fc..ecfaaa736 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/ServerMessageLineMatcher.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/ServerMessageLineMatcher.java
@@ -20,9 +20,9 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.osgi.util.NLS;
-import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.core.CVSMessages;
+import org.eclipse.team.internal.ccvs.core.*;
/**
* This class extracts matches server lines to expected patterns and extracts
@@ -41,7 +41,8 @@ public class ServerMessageLineMatcher {
List variables = new ArrayList();
while (matcher.find()) {
if (matcher.groupCount() != 2) {
- throw new CVSException(NLS.bind(CVSMessages.ServerMessageLineMatcher_5, new String[] { template }));
+ IStatus status = new CVSStatus(IStatus.ERROR,NLS.bind(CVSMessages.ServerMessageLineMatcher_5, new String[] { template }));
+ throw new CVSException(status);
}
variables.add(matcher.group(2));
}
@@ -63,7 +64,8 @@ public class ServerMessageLineMatcher {
count++;
}
if (count != variables.size()) {
- throw new CVSException(NLS.bind(CVSMessages.ServerMessageLineMatcher_6, new String[] { template }));
+ IStatus status = new CVSStatus(IStatus.ERROR,NLS.bind(CVSMessages.ServerMessageLineMatcher_6, new String[] { template }));
+ throw new CVSException(status);
}
// Create the pattern fir matching lines from the server
@@ -77,7 +79,8 @@ public class ServerMessageLineMatcher {
for (int i = 0; i < expectedVariables.length; i++) {
String expected = expectedVariables[i];
if (!variables.contains(expected)) {
- throw new CVSException(NLS.bind(CVSMessages.ServerMessageLineMatcher_7, new String[] { expected, template }));
+ IStatus status = new CVSStatus(IStatus.ERROR,NLS.bind(CVSMessages.ServerMessageLineMatcher_7, new String[] { expected, template }));
+ throw new CVSException(status);
}
}
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/StatusListener.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/StatusListener.java
index 4d6fc27a9..ad3488811 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/StatusListener.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/StatusListener.java
@@ -49,7 +49,7 @@ public class StatusListener extends CommandOutputListener {
if (serverMessage.startsWith("conflict:")) {//$NON-NLS-1$
// We get this because we made up an entry line to send to the server
// Therefore, we make this a warning!!!
- return new CVSStatus(IStatus.WARNING, CVSStatus.CONFLICT, commandRoot, line);
+ return new CVSStatus(IStatus.WARNING, CVSStatus.CONFLICT, line, commandRoot);
}
if (serverMessage.startsWith("Examining")) {//$NON-NLS-1$
isFolder = true;
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/TagListener.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/TagListener.java
index f90658878..d4b6c388d 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/TagListener.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/TagListener.java
@@ -33,7 +33,7 @@ public class TagListener extends CommandOutputListener {
// W folder/file : v1 already exists on version 1.2 : NOT MOVING tag to version 1.3
// Indicate this as an error since no tagging was done
if(line.length() >= 2 && line.charAt(0) == 'W' && line.charAt(1) == ' ') {
- return new CVSStatus(IStatus.ERROR, CVSStatus.TAG_ALREADY_EXISTS, commandRoot, line.substring(2));
+ return new CVSStatus(IStatus.ERROR, CVSStatus.TAG_ALREADY_EXISTS, line.substring(2), commandRoot);
}
return OK;
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/UpdateListener.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/UpdateListener.java
index 483ff1c86..a90c31dcc 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/UpdateListener.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/UpdateListener.java
@@ -195,7 +195,7 @@ public class UpdateListener extends CommandOutputListener {
updateMessageListener.fileDoesNotExist(commandRoot, filename);
}
}
- return new CVSStatus(IStatus.WARNING, CVSStatus.CONFLICT, commandRoot, line);
+ return new CVSStatus(IStatus.WARNING, CVSStatus.CONFLICT, line, commandRoot);
} else if (message.startsWith("warning:")) { //$NON-NLS-1$
/*
* We can get the following conflict warnings
@@ -208,10 +208,10 @@ public class UpdateListener extends CommandOutputListener {
updateMessageListener.fileDoesNotExist(commandRoot, filename);
}
}
- return new CVSStatus(IStatus.WARNING, CVSStatus.CONFLICT, commandRoot, line);
+ return new CVSStatus(IStatus.WARNING, CVSStatus.CONFLICT, line, commandRoot);
} else if (message.startsWith("conflicts")) { //$NON-NLS-1$
// This line is info only. The server doesn't report an error.
- return new CVSStatus(IStatus.INFO, CVSStatus.CONFLICT, commandRoot, line);
+ return new CVSStatus(IStatus.INFO, CVSStatus.CONFLICT, line, commandRoot);
} else if (message.startsWith("nonmergeable file needs merge")) { //$NON-NLS-1$
mergingBinary = true;
mergedBinaryFileRevision = null;
@@ -237,7 +237,7 @@ public class UpdateListener extends CommandOutputListener {
NLS.bind(CVSMessages.UpdateListener_0, (new Object[] {
resource.getFullPath().toString(),
mergedBinaryFileRevision,
- resource.getFullPath().removeLastSegments(1).append(backupFile).toString()})));
+ resource.getFullPath().removeLastSegments(1).append(backupFile).toString()})), commandRoot);
}
}
} catch (CVSException e1) {
@@ -260,7 +260,7 @@ public class UpdateListener extends CommandOutputListener {
if (message.startsWith("no such tag")) { //$NON-NLS-1$
// This is reported from CVS when a tag is used on the update there are no files in the directory
// To get the folders, the update request should be re-issued for HEAD
- return new CVSStatus(IStatus.WARNING, CVSStatus.NO_SUCH_TAG, commandRoot, line);
+ return new CVSStatus(IStatus.WARNING, CVSStatus.NO_SUCH_TAG, line, commandRoot);
} else if (message.startsWith("Numeric join") && message.endsWith("may not contain a date specifier")) { //$NON-NLS-1$ //$NON-NLS-2$
// This error indicates a join failed because a date tag was used
return super.errorLine(line, location, commandRoot, monitor);
@@ -269,7 +269,7 @@ public class UpdateListener extends CommandOutputListener {
}
} else if (line.equals("rcsmerge: warning: conflicts during merge")) { //$NON-NLS-1$
// There were conflicts in the merge
- return new CVSStatus(IStatus.WARNING, CVSStatus.CONFLICT, commandRoot, line);
+ return new CVSStatus(IStatus.WARNING, CVSStatus.CONFLICT, line, commandRoot);
}
}
} catch (StringIndexOutOfBoundsException e) {
@@ -278,7 +278,7 @@ public class UpdateListener extends CommandOutputListener {
if (CVSProviderPlugin.getPlugin().isDebugging()) {
System.out.println("Error parsing E line: " + line); //$NON-NLS-1$
}
- return new CVSStatus(IStatus.ERROR, CVSStatus.ERROR_LINE_PARSE_FAILURE, commandRoot, line);
+ return new CVSStatus(IStatus.ERROR, CVSStatus.ERROR_LINE_PARSE_FAILURE, line, commandRoot);
}
return super.errorLine(line, location, commandRoot, monitor);
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSAuthenticationException.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSAuthenticationException.java
index e1712985a..09ec7141f 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSAuthenticationException.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSAuthenticationException.java
@@ -11,6 +11,7 @@
package org.eclipse.team.internal.ccvs.core.connection;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.osgi.util.NLS;
import org.eclipse.team.internal.ccvs.core.*;
@@ -18,6 +19,8 @@ import org.eclipse.team.internal.ccvs.core.*;
public class CVSAuthenticationException extends CVSException {
private static final long serialVersionUID = 1L;
+
+ private int retryStatus = 0;
/**
* Code indicating that authentication can be retried after
@@ -33,25 +36,49 @@ public class CVSAuthenticationException extends CVSException {
/**
* Creates a new <code>CVSAuthenticationException</code>
*
+ * @param status the status result describing this exception.
+ */
+ private CVSAuthenticationException(IStatus status) {
+ super(status);
+ }
+
+ /**
+ * Creates a new <code>CVSAuthenticationException</code>
+ *
* @param detail a message that describes the exception in detail.
* @param code indicates whether authentication can be retried or not
*/
- public CVSAuthenticationException(String detail, int code) {
- this(new CVSStatus(IStatus.ERROR, code,
- NLS.bind(CVSMessages.CVSAuthenticationException_detail, (new Object[] { detail })))); //
+ public CVSAuthenticationException(String detail, int retryStatus) {
+ this(new CVSStatus(IStatus.ERROR, CVSStatus.AUTHENTICATION_FAILURE,NLS.bind(CVSMessages.CVSAuthenticationException_detail, (new Object[] { detail })), (IResource) null)); //
+ this.retryStatus = retryStatus;
}
/**
* Creates a new <code>CVSAuthenticationException</code>
*
- * @param status the status result describing this exception.
+ * @param detail a message that describes the exception in detail.
+ * @param code indicates whether authentication can be retried or not
+ * @param the location of the CVS server
*/
- public CVSAuthenticationException(IStatus status) {
- super(status);
- }
-
- public CVSAuthenticationException(String string, int code, Exception e) {
- this(new CVSStatus(IStatus.ERROR, code,
- NLS.bind(CVSMessages.CVSAuthenticationException_detail, (new Object[] { string })), e)); //
+ public CVSAuthenticationException(String detail, int retryStatus, ICVSRepositoryLocation cvsLocation) {
+ this(new CVSStatus(IStatus.ERROR, CVSStatus.AUTHENTICATION_FAILURE,NLS.bind(CVSMessages.CVSAuthenticationException_detail, (new Object[] { detail })),cvsLocation)); //
+ this.retryStatus = retryStatus;
+ }
+
+ /**
+ * Creates a new <code>CVSAuthenticationException</code>
+ *
+ * @param detail a message that describes the exception in detail.
+ * @param code indicates whether authentication can be retried or not
+ * @param the location of the CVS server
+ * @param the exception
+ */
+ public CVSAuthenticationException(String detail, int retryStatus,ICVSRepositoryLocation cvsLocation, Exception e) {
+ this(new CVSStatus(IStatus.ERROR, CVSStatus.AUTHENTICATION_FAILURE , NLS.bind(CVSMessages.CVSAuthenticationException_detail, (new Object[] { detail })), e, cvsLocation)); //
+ this.retryStatus = retryStatus;
}
+
+ public int getRetryStatus() {
+ return retryStatus;
+ }
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSCommunicationException.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSCommunicationException.java
index 570b03d2c..da69119e3 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSCommunicationException.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSCommunicationException.java
@@ -13,8 +13,7 @@ package org.eclipse.team.internal.ccvs.core.connection;
import java.io.InterruptedIOException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.core.runtime.*;
import org.eclipse.osgi.util.NLS;
import org.eclipse.team.internal.ccvs.core.*;
@@ -23,49 +22,53 @@ public class CVSCommunicationException extends CVSException {
private static final long serialVersionUID = 1L;
/**
- * Create a new <code>CVSCommunicationException with the
+ * Create a new <code>CVSCommunicationException</code> with the
* given status.
*/
private CVSCommunicationException(IStatus status) {
super(status);
}
/**
- * Create a new <code>CVSCommunicationException with the
+ * Create a new <code>CVSCommunicationException</code> with the
* given message.
*/
public CVSCommunicationException(String message) {
super(message);
}
+
/**
- * Create a new <code>CVSCommunicationException.
+ * Create a new <code>CVSCommunicationException</code>.
*
* @param message a message describing the exception in detail.
+ * @param the CVS server
* @param the caught exception that has caused the communication
* exception.
*/
- public CVSCommunicationException(String message, Exception e) {
- super(message, e);
+ public CVSCommunicationException(String message, ICVSRepositoryLocation cvsLocation, Exception e) {
+ this(new CVSStatus(IStatus.ERROR, CVSStatus.COMMUNICATION_FAILURE, message, e, cvsLocation));
}
+
/**
- * Create a new <code>CVSCommunicationException.
+ * Create a new <code>CVSCommunicationException </code>.
*
* @param the caught exception that has caused the communication
* exception.
+ * @param the location of the CVS server.
*/
- public CVSCommunicationException(Exception e) {
- this(getStatusFor(e));
- }
+ public CVSCommunicationException(ICVSRepositoryLocation cvsLocation,Exception e) {
+ this(getStatusFor(e,cvsLocation));
+ }
- public static IStatus getStatusFor(Exception e) {
+ private static IStatus getStatusFor(Exception e,ICVSRepositoryLocation cvsLocation) {
if (e instanceof InterruptedIOException) {
MultiStatus status = new MultiStatus(CVSProviderPlugin.ID, 0, getMessageFor(e), e);
- status.add(new CVSStatus(IStatus.ERROR, CVSMessages.CVSCommunicationException_interruptCause));
- status.add(new CVSStatus(IStatus.ERROR, CVSMessages.CVSCommunicationException_interruptSolution));
- status.add(new CVSStatus(IStatus.ERROR, CVSMessages.CVSCommunicationException_alternateInterruptCause));
- status.add(new CVSStatus(IStatus.ERROR, CVSMessages.CVSCommunicationException_alternateInterruptSolution));
+ status.add(new CVSStatus(IStatus.ERROR, CVSStatus.COMMUNICATION_FAILURE, CVSMessages.CVSCommunicationException_interruptCause, cvsLocation));
+ status.add(new CVSStatus(IStatus.ERROR, CVSStatus.COMMUNICATION_FAILURE, CVSMessages.CVSCommunicationException_interruptSolution, cvsLocation));
+ status.add(new CVSStatus(IStatus.ERROR, CVSStatus.COMMUNICATION_FAILURE, CVSMessages.CVSCommunicationException_alternateInterruptCause, cvsLocation));
+ status.add(new CVSStatus(IStatus.ERROR, CVSStatus.COMMUNICATION_FAILURE, CVSMessages.CVSCommunicationException_alternateInterruptSolution, cvsLocation));
return status;
}
- return new CVSStatus(IStatus.ERROR, getMessageFor(e), e);
+ return new CVSStatus(IStatus.ERROR,CVSStatus.COMMUNICATION_FAILURE, getMessageFor(e), e, cvsLocation);
}
public static String getMessageFor(Throwable throwable) {
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSRepositoryLocation.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSRepositoryLocation.java
index b7b9612c3..0f93d7448 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSRepositoryLocation.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSRepositoryLocation.java
@@ -14,17 +14,13 @@ package org.eclipse.team.internal.ccvs.core.connection;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.StringTokenizer;
+import java.util.*;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.*;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.ILock;
+import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.core.runtime.preferences.DefaultScope;
import org.eclipse.osgi.util.NLS;
import org.eclipse.team.core.TeamException;
@@ -401,11 +397,13 @@ public class CVSRepositoryLocation extends PlatformObject implements ICVSReposit
}
catch (IndexOutOfBoundsException e) {
// We'll get here if anything funny happened while extracting substrings
- throw new CVSException(errorMessage);
+ IStatus status = new CVSStatus(IStatus.ERROR, errorMessage);
+ throw new CVSException(status);
}
catch (NumberFormatException e) {
+ IStatus status = new CVSStatus(IStatus.ERROR, errorMessage);
// We'll get here if we couldn't parse a number
- throw new CVSException(errorMessage);
+ throw new CVSException(status);
}
}
@@ -660,8 +658,11 @@ public class CVSRepositoryLocation extends PlatformObject implements ICVSReposit
}
return (ICVSRemoteResource[]) folders.toArray(new ICVSRemoteResource[folders.size()]);
}
- } catch(TeamException e) {
- throw new CVSException(e.getStatus());
+ } catch (CVSException e){
+ // keep current CVSException
+ throw e;
+ } catch(TeamException e1) {
+ throw new CVSException(e1.getStatus());
}
}
@@ -747,7 +748,7 @@ public class CVSRepositoryLocation extends PlatformObject implements ICVSReposit
synchronized(hostLocks) {
hostLock = (ILock)hostLocks.get(getHost());
if (hostLock == null) {
- hostLock = Platform.getJobManager().newLock();
+ hostLock = Job.getJobManager().newLock();
hostLocks.put(getHost(), hostLock);
}
}
@@ -773,7 +774,7 @@ public class CVSRepositoryLocation extends PlatformObject implements ICVSReposit
}
if (user == null) {
// This is possible if the cache was cleared somehow for a location with a mutable username
- throw new CVSAuthenticationException(new CVSStatus(IStatus.ERROR, CVSAuthenticationException.RETRY, CVSMessages.CVSRepositoryLocation_usernameRequired));
+ throw new CVSAuthenticationException(CVSMessages.CVSRepositoryLocation_usernameRequired, CVSAuthenticationException.RETRY, this, null);
}
//if (password == null)
// password = "";//$NON-NLS-1$
@@ -784,7 +785,7 @@ public class CVSRepositoryLocation extends PlatformObject implements ICVSReposit
return connection;
} catch (CVSAuthenticationException ex) {
previousAuthenticationFailed = true;
- if (ex.getStatus().getCode() == CVSAuthenticationException.RETRY) {
+ if (ex.getRetryStatus() == CVSAuthenticationException.RETRY) {
String message = ex.getMessage();
promptForUserInfo(message);
// The authentication information has been change so update the cache
@@ -806,7 +807,7 @@ public class CVSRepositoryLocation extends PlatformObject implements ICVSReposit
private void promptForUserInfo(String message) throws CVSException {
IUserAuthenticator authenticator = getAuthenticator();
if (authenticator == null) {
- throw new CVSAuthenticationException(CVSMessages.CVSRepositoryLocation_noAuthenticator, CVSAuthenticationException.NO_RETRY);//
+ throw new CVSAuthenticationException(CVSMessages.CVSRepositoryLocation_noAuthenticator, CVSAuthenticationException.NO_RETRY,this);//
}
authenticator.promptForUserInfo(this, this, message);
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSServerException.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSServerException.java
index 38159a9df..4bb84739d 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSServerException.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSServerException.java
@@ -55,6 +55,9 @@ public class CVSServerException extends CVSException {
return false;
}
+ /** The status should have a status code of CVSStatus.SERVER_ERROR
+ * @param status
+ */
public CVSServerException(IStatus status) {
super(status);
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/Connection.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/Connection.java
index c1fa92ea5..bbd283fe6 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/Connection.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/Connection.java
@@ -15,6 +15,7 @@ package org.eclipse.team.internal.ccvs.core.connection;
import java.io.*;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.osgi.util.NLS;
import org.eclipse.team.internal.ccvs.core.*;
@@ -72,7 +73,7 @@ public class Connection {
// Generally, errors on close are of no interest.
// However, log them if debugging is on
if (CVSProviderPlugin.getPlugin().isDebugging()) {
- CVSProviderPlugin.log(new CVSCommunicationException(CVSMessages.Connection_cannotClose, ex));
+ CVSProviderPlugin.log(new CVSCommunicationException(CVSMessages.Connection_cannotClose, fCVSRoot, ex));
}
} finally {
fResponseStream = null;
@@ -88,7 +89,7 @@ public class Connection {
try {
getOutputStream().flush();
} catch(IOException e) {
- throw new CVSCommunicationException(e);
+ throw new CVSCommunicationException(fCVSRoot,e);
}
}
@@ -130,17 +131,17 @@ public class Connection {
try {
serverConnection.open(monitor);
} catch (IOException e) {
- throw new CVSCommunicationException(NLS.bind(CVSMessages.Connection_0, new String[] { fCVSRoot.getLocation(true), CVSCommunicationException.getMessageFor(e) }), e);
+ throw new CVSCommunicationException(NLS.bind(CVSMessages.Connection_0, new String[] { fCVSRoot.getLocation(true), CVSCommunicationException.getMessageFor(e) }), fCVSRoot, e);
}
- fIsEstablished= true;
+ fIsEstablished= true;
}
/**
* Reads a line from the response stream.
*/
public String readLine() throws CVSException {
if (!isEstablished())
- throw new CVSCommunicationException(CVSMessages.Connection_readUnestablishedConnection);
- try {
+ throw new CVSCommunicationException(CVSMessages.Connection_readUnestablishedConnection,fCVSRoot,null);
+ try {
InputStream in = getInputStream();
int index = 0;
int r;
@@ -153,7 +154,7 @@ public class Connection {
if (Policy.isDebugProtocol()) Policy.printProtocolLine(result);
return result;
} catch (IOException e) {
- throw new CVSCommunicationException(e);
+ throw new CVSCommunicationException(fCVSRoot,e);
}
}
@@ -182,7 +183,8 @@ public class Connection {
try {
write(s.getBytes(fServerEncoding), false);
} catch (UnsupportedEncodingException e) {
- throw new CVSException (e.getMessage());
+ IStatus status = new CVSStatus(IStatus.ERROR, CVSStatus.SERVER_ERROR, e.getMessage(), e, fCVSRoot);
+ throw new CVSException (status);
}
}
@@ -201,7 +203,8 @@ public class Connection {
try {
write(s.getBytes(fServerEncoding), true);
} catch (UnsupportedEncodingException e) {
- throw new CVSException (e.getMessage());
+ IStatus status = new CVSStatus(IStatus.ERROR, CVSStatus.SERVER_ERROR, e.getMessage(), e, fCVSRoot);
+ throw new CVSException (status);
}
}
@@ -215,7 +218,7 @@ public class Connection {
*/
void write(byte[] b, int off, int len, boolean newline) throws CVSException {
if (!isEstablished())
- throw new CVSCommunicationException(CVSMessages.Connection_writeUnestablishedConnection);
+ throw new CVSCommunicationException(CVSMessages.Connection_writeUnestablishedConnection,fCVSRoot,null);
if (Policy.isDebugProtocol())
Policy.printProtocol(new String(b, off, len), newline);
@@ -227,7 +230,7 @@ public class Connection {
out.write(NEWLINE);
} catch (IOException e) {
- throw new CVSCommunicationException(e);
+ throw new CVSCommunicationException(fCVSRoot,e);
}
}
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/PServerConnection.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/PServerConnection.java
index b2dfdbb7e..48df82134 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/PServerConnection.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/PServerConnection.java
@@ -245,9 +245,9 @@ public class PServerConnection implements IServerConnection {
// If the last line is the login failed (I HATE YOU) message, return authentication failure
if (LOGIN_FAILED.equals(line)) {
if (message.length() == 0) {
- throw new CVSAuthenticationException(CVSMessages.PServerConnection_loginRefused, CVSAuthenticationException.RETRY);
+ throw new CVSAuthenticationException(CVSMessages.PServerConnection_loginRefused, CVSAuthenticationException.RETRY,cvsroot);
} else {
- throw new CVSAuthenticationException(message, CVSAuthenticationException.RETRY);
+ throw new CVSAuthenticationException(message, CVSAuthenticationException.RETRY,cvsroot);
}
}
@@ -257,7 +257,7 @@ public class PServerConnection implements IServerConnection {
else
message += separator + line;
if (message.indexOf(NO_SUCH_USER) != -1)
- throw new CVSAuthenticationException(NLS.bind(CVSMessages.PServerConnection_invalidUser, (new Object[] {message})), CVSAuthenticationException.RETRY);
+ throw new CVSAuthenticationException(NLS.bind(CVSMessages.PServerConnection_invalidUser, (new Object[] {message})), CVSAuthenticationException.RETRY,cvsroot);
throw new IOException(NLS.bind(CVSMessages.PServerConnection_connectionRefused, (new Object[] { message })));
}
/*
@@ -318,7 +318,7 @@ public class PServerConnection implements IServerConnection {
}
private void throwInValidCharacter() throws CVSAuthenticationException {
- throw new CVSAuthenticationException(CVSMessages.PServerConnection_invalidChars, CVSAuthenticationException.RETRY);
+ throw new CVSAuthenticationException(CVSMessages.PServerConnection_invalidChars, CVSAuthenticationException.RETRY, cvsroot);
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSEntryLineTag.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSEntryLineTag.java
index 30e7cf184..59a6aba4a 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSEntryLineTag.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSEntryLineTag.java
@@ -15,6 +15,7 @@ import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.team.internal.ccvs.core.*;
public class CVSEntryLineTag extends CVSTag {
@@ -61,7 +62,7 @@ public class CVSEntryLineTag extends CVSTag {
entryLineDateTagFormatter.setTimeZone(TimeZone.getTimeZone("GMT")); //$NON-NLS-1$
return entryLineDateTagFormatter.parse(text);
} catch (ParseException e) {
- CVSProviderPlugin.log(new CVSException("Tag name " + text + " is not of the expected format " + ENTRY_LINE_DATE_TAG_FORMAT, e)); //$NON-NLS-1$ //$NON-NLS-2$
+ CVSProviderPlugin.log(new CVSStatus(IStatus.ERROR, CVSStatus.ERROR, "Tag name " + text + " is not of the expected format " + ENTRY_LINE_DATE_TAG_FORMAT, e)); //$NON-NLS-1$ //$NON-NLS-2$
return null;
}
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSWorkspaceRoot.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSWorkspaceRoot.java
index e9f1605d3..55c34f47d 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSWorkspaceRoot.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSWorkspaceRoot.java
@@ -100,7 +100,7 @@ public class CVSWorkspaceRoot {
// parent handle. If this is the case, isManaged should return false
// now. If it doesn't, then we should log an error.
if (resource.isManaged()) {
- CVSProviderPlugin.log(new CVSException(NLS.bind(CVSMessages.CVSWorkspaceRoot_11, new String[] { Util.getFullestPath(resource) })));
+ CVSProviderPlugin.log(new CVSStatus(IStatus.ERROR,CVSStatus.ERROR, NLS.bind(CVSMessages.CVSWorkspaceRoot_11, new String[] { Util.getFullestPath(resource) }),resource.getIResource()));
}
} else {
return RemoteFile.getBase(parent, (ICVSFile)resource);
@@ -133,7 +133,7 @@ public class CVSWorkspaceRoot {
}
// The types need to match or we're in trouble
if (remote != null && !(remote.isContainer() == managed.isFolder()))
- throw new CVSException(new CVSStatus(IStatus.ERROR, NLS.bind(CVSMessages.CVSTeamProvider_typesDiffer, new String[] { resource.getFullPath().toString() }), null));
+ throw new CVSException(new CVSStatus(IStatus.ERROR, CVSStatus.ERROR, NLS.bind(CVSMessages.CVSTeamProvider_typesDiffer, new String[] { resource.getFullPath().toString() }), resource));
}
return remote;
}
@@ -207,7 +207,8 @@ public class CVSWorkspaceRoot {
public ICVSRepositoryLocation getRemoteLocation() throws CVSException {
FolderSyncInfo info = localRoot.getFolderSyncInfo();
if (info == null) {
- throw new CVSException(NLS.bind(CVSMessages.CVSWorkspaceRoot_notCVSFolder, new String[] { localRoot.getName() }));
+ IStatus status = new CVSStatus(IStatus.ERROR,CVSStatus.RESOURCE_SYNC_INFO_ERROR,NLS.bind(CVSMessages.CVSWorkspaceRoot_notCVSFolder, new String[] { localRoot.getName() }),localRoot);
+ throw new CVSException(status);
}
return KnownRepositories.getInstance().getRepository(info.getRoot());
}
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 7baff35b1..f26923d40 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
@@ -20,6 +20,7 @@ import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo;
import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
import org.eclipse.team.internal.ccvs.core.util.Util;
+
/**
* Represents handles to CVS resource on the local file system. Synchronization
* information is taken from the CVS subdirectories.
@@ -61,7 +62,8 @@ abstract class EclipseResource implements ICVSResource, Comparable {
if (result.length() == 0) return CURRENT_LOCAL_FOLDER;
return result;
} catch (ClassCastException e) {
- throw new CVSException(CVSMessages.EclipseResource_invalidResourceClass, e);
+ IStatus status = new CVSStatus(IStatus.ERROR, CVSStatus.ERROR, CVSMessages.EclipseResource_invalidResourceClass, e, root);
+ throw new CVSException(status);
}
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java
index ad87f79e8..3963f1eb7 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java
@@ -64,14 +64,14 @@ public class EclipseSynchronizer implements IFlushOperation {
private static EclipseSynchronizer instance;
// track resources that have changed in a given operation
- private ILock lock = Platform.getJobManager().newLock();
+ private ILock lock = Job.getJobManager().newLock();
private ReentrantLock resourceLock = new ReentrantLock();
private SynchronizerSyncInfoCache synchronizerCache = new SynchronizerSyncInfoCache();
private SessionPropertySyncInfoCache sessionPropertyCache = new SessionPropertySyncInfoCache(synchronizerCache);
/*
- * Package private contructor to allow specialized subclass for handling folder deletions
+ * Package private constructor to allow specialized subclass for handling folder deletions
*/
EclipseSynchronizer() {
}
@@ -87,7 +87,7 @@ public class EclipseSynchronizer implements IFlushOperation {
}
public SyncInfoCache getSyncInfoCacheFor(IResource resource) {
- if (resource.exists() && resource.isLocal(IResource.DEPTH_ZERO)) {
+ if (resource.exists()) {
return sessionPropertyCache;
} else {
return synchronizerCache;
@@ -115,8 +115,9 @@ public class EclipseSynchronizer implements IFlushOperation {
// Allow the set if the parent is a CVS folder since
// this can occur when creating phantom folders
if (getFolderSync(folder.getParent()) == null) {
- throw new CVSException(IStatus.ERROR, TeamException.UNABLE,
- NLS.bind(CVSMessages.EclipseSynchronizer_ErrorSettingFolderSync, new String[] { folder.getFullPath().toString() }));
+ IStatus status = new CVSStatus(IStatus.ERROR, TeamException.UNABLE,
+ NLS.bind(CVSMessages.EclipseSynchronizer_ErrorSettingFolderSync, new String[] { folder.getFullPath().toString() }),folder);
+ throw new CVSException(status);
}
}
ISchedulingRule rule = null;
@@ -220,8 +221,9 @@ public class EclipseSynchronizer implements IFlushOperation {
Assert.isNotNull(info); // enforce the use of deleteResourceSync
IContainer parent = resource.getParent();
if (parent == null || parent.getType() == IResource.ROOT || !isValid(parent)) {
- throw new CVSException(IStatus.ERROR, TeamException.UNABLE,
- NLS.bind(CVSMessages.EclipseSynchronizer_ErrorSettingResourceSync, new String[] { resource.getFullPath().toString() }));
+ IStatus status = new CVSStatus(IStatus.ERROR, TeamException.UNABLE,
+ NLS.bind(CVSMessages.EclipseSynchronizer_ErrorSettingResourceSync, new String[] { resource.getFullPath().toString() }), resource);
+ throw new CVSException(status);
}
ISchedulingRule rule = null;
try {
@@ -302,8 +304,9 @@ public class EclipseSynchronizer implements IFlushOperation {
Assert.isNotNull(syncBytes); // enforce the use of deleteResourceSync
IContainer parent = resource.getParent();
if (parent == null || parent.getType() == IResource.ROOT || !isValid(parent)) {
- throw new CVSException(IStatus.ERROR, TeamException.UNABLE,
- NLS.bind(CVSMessages.EclipseSynchronizer_ErrorSettingResourceSync, new String[] { resource.getFullPath().toString() }));
+ IStatus status = new CVSStatus(IStatus.ERROR, TeamException.UNABLE,
+ NLS.bind(CVSMessages.EclipseSynchronizer_ErrorSettingResourceSync, new String[] { resource.getFullPath().toString() }),resource);
+ throw new CVSException(status);
}
ISchedulingRule rule = null;
try {
@@ -393,8 +396,9 @@ public class EclipseSynchronizer implements IFlushOperation {
*/
public void addIgnored(IContainer folder, String pattern) throws CVSException {
if (folder.getType() == IResource.ROOT || ! folder.exists()) {
- throw new CVSException(IStatus.ERROR, TeamException.UNABLE,
- NLS.bind(CVSMessages.EclipseSynchronizer_ErrorSettingIgnorePattern, new String[] { folder.getFullPath().toString() }));
+ IStatus status = new CVSStatus(IStatus.ERROR, TeamException.UNABLE,
+ NLS.bind(CVSMessages.EclipseSynchronizer_ErrorSettingIgnorePattern, new String[] { folder.getFullPath().toString() }),folder);
+ throw new CVSException(status);
}
ISchedulingRule rule = null;
try {
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolder.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolder.java
index b3ed9eb4d..b71e37135 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolder.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolder.java
@@ -261,7 +261,8 @@ public class RemoteFolder extends RemoteResource implements ICVSRemoteFolder, IC
ICVSResource child = getChild(name);
if (child.isFolder())
return (ICVSFolder)child;
- throw new CVSException(IStatus.ERROR, CHILD_DOES_NOT_EXIST, NLS.bind(CVSMessages.RemoteFolder_invalidChild, new String[] { name, getName() }));
+ IStatus status = new CVSStatus(IStatus.ERROR, CHILD_DOES_NOT_EXIST, NLS.bind(CVSMessages.RemoteFolder_invalidChild, new String[] { name, getName() }),child.getIResource());
+ throw new CVSException(status);
}
/**
@@ -271,7 +272,8 @@ public class RemoteFolder extends RemoteResource implements ICVSRemoteFolder, IC
ICVSResource child = getChild(name);
if (!child.isFolder())
return (ICVSFile)child;
- throw new CVSException(IStatus.ERROR, CHILD_DOES_NOT_EXIST, NLS.bind(CVSMessages.RemoteFolder_invalidChild, new String[] { name, getName() }));
+ IStatus status = new CVSStatus(IStatus.ERROR, CHILD_DOES_NOT_EXIST, NLS.bind(CVSMessages.RemoteFolder_invalidChild, new String[] { name, getName() }),child.getIResource());
+ throw new CVSException(status);
}
public LocalOption[] getLocalOptions() {
@@ -291,7 +293,8 @@ public class RemoteFolder extends RemoteResource implements ICVSRemoteFolder, IC
if (ancestor == this) return Session.CURRENT_LOCAL_FOLDER;
// Otherwise, we need a parent to continue
if (parent == null) {
- throw new CVSException(NLS.bind(CVSMessages.RemoteFolder_invalidChild, new String[] { getName(), ancestor.getName() }));
+ IStatus status = new CVSStatus(IStatus.ERROR, CVSStatus.ERROR, NLS.bind(CVSMessages.RemoteFolder_invalidChild, new String[] { getName(), ancestor.getName() }),this);
+ throw new CVSException(status);
}
return super.getRelativePath(ancestor);
}
@@ -341,25 +344,30 @@ public class RemoteFolder extends RemoteResource implements ICVSRemoteFolder, IC
return ((RemoteFolder)getChild(p.segment(0))).getChild(p.removeFirstSegments(1).toString());
} catch (CVSException e) {
// regenerate the exception to give as much info as possible
- throw new CVSException(IStatus.ERROR, CHILD_DOES_NOT_EXIST, NLS.bind(CVSMessages.RemoteFolder_invalidChild, new String[] { path, getName() }));
+ IStatus status = new CVSStatus(IStatus.ERROR, CHILD_DOES_NOT_EXIST, NLS.bind(CVSMessages.RemoteFolder_invalidChild, new String[] { path, getName() }),e,repository);
+ throw new CVSException(status);
}
} else {
ICVSRemoteResource[] children = getChildren();
- if (children == null)
- throw new CVSException(IStatus.ERROR, CHILD_DOES_NOT_EXIST, NLS.bind(CVSMessages.RemoteFolder_invalidChild, new String[] { path, getName() }));
+ if (children == null){
+ IStatus status = new CVSStatus(IStatus.ERROR, CHILD_DOES_NOT_EXIST, NLS.bind(CVSMessages.RemoteFolder_invalidChild, new String[] { path, getName() }),repository);
+ throw new CVSException(status);
+ }
for (int i=0;i<children.length;i++) {
if (children[i].getName().equals(path))
return children[i];
}
}
- throw new CVSException(IStatus.ERROR, CHILD_DOES_NOT_EXIST, NLS.bind(CVSMessages.RemoteFolder_invalidChild, new String[] { path, getName() }));
+ IStatus status = new CVSStatus(IStatus.ERROR, CHILD_DOES_NOT_EXIST, NLS.bind(CVSMessages.RemoteFolder_invalidChild, new String[] { path, getName() }),repository);
+ throw new CVSException(status);
}
/**
* @see ICVSFolder#mkdir()
*/
public void mkdir() throws CVSException {
- throw new CVSException(CVSMessages.RemoteResource_invalidOperation);
+ IStatus status = new CVSStatus(IStatus.ERROR, CVSMessages.RemoteResource_invalidOperation);
+ throw new CVSException(status);
}
/**
@@ -396,7 +404,8 @@ public class RemoteFolder extends RemoteResource implements ICVSRemoteFolder, IC
* @see ICVSFolder#acceptChildren(ICVSResourceVisitor)
*/
public void acceptChildren(ICVSResourceVisitor visitor) throws CVSException {
- throw new CVSException(CVSMessages.RemoteResource_invalidOperation);
+ IStatus status = new CVSStatus(IStatus.ERROR, CVSMessages.RemoteResource_invalidOperation);
+ throw new CVSException(status);
}
/*
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolderMemberFetcher.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolderMemberFetcher.java
index 03eefd611..17eb23724 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolderMemberFetcher.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolderMemberFetcher.java
@@ -151,7 +151,8 @@ public class RemoteFolderMemberFetcher implements IUpdateMessageListener, IStatu
}
}
if (!exists) {
- throw new CVSException(new CVSStatus(IStatus.ERROR, CVSStatus.DOES_NOT_EXIST, NLS.bind(CVSMessages.RemoteFolder_doesNotExist, new String[] { this.parentFolder.getRepositoryRelativePath() })));
+ IStatus notExistStatus = new CVSStatus(IStatus.ERROR, CVSStatus.DOES_NOT_EXIST, NLS.bind(CVSMessages.RemoteFolder_doesNotExist, new String[] { this.parentFolder.getRepositoryRelativePath() }), parentFolder);
+ throw new CVSException(notExistStatus);
}
// Report any internal exceptions that occured fetching the members
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolderTreeBuilder.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolderTreeBuilder.java
index d3e41fe62..235ea8877 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolderTreeBuilder.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolderTreeBuilder.java
@@ -197,7 +197,8 @@ public class RemoteFolderTreeBuilder {
// We cannot handle the case where a project (i.e. the top-most CVS folder)
// has been deleted directly on the sever (i.e. deleted using rm -rf)
if (root.isCVSFolder() && ! root.isManaged()) {
- throw new CVSException(NLS.bind(CVSMessages.RemoteFolderTreeBuild_folderDeletedFromServer, new String[] { root.getFolderSyncInfo().getRepository() }));
+ IStatus status = new CVSStatus(IStatus.ERROR, CVSStatus.ERROR, NLS.bind(CVSMessages.RemoteFolderTreeBuild_folderDeletedFromServer, new String[] { root.getFolderSyncInfo().getRepository() }),root);
+ throw new CVSException(status);
} else {
return false;
}
@@ -226,7 +227,8 @@ public class RemoteFolderTreeBuilder {
} else {
path = resource.getFullPath().toString();
}
- throw new CVSException(NLS.bind(CVSMessages.RemoteFolderTreeBuilder_0, new String[] { path }));
+ IStatus status = new CVSStatus(IStatus.ERROR, CVSStatus.ERROR, NLS.bind(CVSMessages.RemoteFolderTreeBuilder_0, new String[] { path }), root);
+ throw new CVSException(status);
} else {
// Just return. The remote tree will be null
return;
@@ -775,7 +777,8 @@ public class RemoteFolderTreeBuilder {
private void updateRevision(String path, String revision) throws CVSException {
RemoteFolderTree folder = getRecoredRemoteFolder(Util.removeLastSegment(path));
if (folder == null) {
- throw new CVSException(NLS.bind(CVSMessages.RemoteFolderTreeBuilder_missingParent, new String[] { path.toString(), revision }));
+ IStatus status = new CVSStatus(IStatus.ERROR, CVSStatus.ERROR, NLS.bind(CVSMessages.RemoteFolderTreeBuilder_missingParent, new String[] { path.toString(), revision }), root);
+ throw new CVSException(status);
}
((RemoteFile)folder.getFile(Util.getLastSegment(path))).setRevision(revision);
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/SessionPropertySyncInfoCache.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/SessionPropertySyncInfoCache.java
index 6941a5f52..8f48147b3 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/SessionPropertySyncInfoCache.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/SessionPropertySyncInfoCache.java
@@ -125,8 +125,10 @@ import org.eclipse.team.internal.ccvs.core.util.SyncFileWriter;
if (info == null) {
// There should be sync info but it was missing. Report the error.
// Only report the error is the folder is not derived (see bug 97023)
- if (container.exists() && !container.isDerived())
- throw new CVSException(NLS.bind(CVSMessages.EclipseSynchronizer_folderSyncInfoMissing, new String[] { container.getFullPath().toString() }));
+ if (container.exists() && !container.isDerived()){
+ IStatus status = new CVSStatus(IStatus.ERROR, CVSStatus.ERROR, NLS.bind(CVSMessages.EclipseSynchronizer_folderSyncInfoMissing, new String[] { container.getFullPath().toString() }), container);
+ throw new CVSException(status);
+ }
}
if (info == NULL_FOLDER_SYNC_INFO) return null;
return info;
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/BaserevInfo.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/BaserevInfo.java
index 852428294..c7532c033 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/BaserevInfo.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/BaserevInfo.java
@@ -10,9 +10,9 @@
*******************************************************************************/
package org.eclipse.team.internal.ccvs.core.syncinfo;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.osgi.util.NLS;
-import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.core.CVSMessages;
+import org.eclipse.team.internal.ccvs.core.*;
import org.eclipse.team.internal.ccvs.core.util.Util;
/**
@@ -53,19 +53,22 @@ public class BaserevInfo {
// Accept either a length of 2 or 3. If the length is 3, we ignore the last
// string as per the CVS spec.
if(strings.length != 2 && strings.length != 3) {
- throw new CVSException(NLS.bind(CVSMessages.BaseRevInfo_malformedEntryLine, new String[] { entryLine }));
+ IStatus status = new CVSStatus(IStatus.ERROR,NLS.bind(CVSMessages.BaseRevInfo_malformedEntryLine, new String[] { entryLine }));
+ throw new CVSException(status);
}
name = strings[0];
if(name.length()==0) {
- throw new CVSException(NLS.bind(CVSMessages.BaseRevInfo_malformedEntryLine, new String[] { entryLine }));
+ IStatus status = new CVSStatus(IStatus.ERROR,NLS.bind(CVSMessages.BaseRevInfo_malformedEntryLine, new String[] { entryLine }));
+ throw new CVSException(status);
}
revision = strings[1];
if(revision.length()==0) {
- throw new CVSException(NLS.bind(CVSMessages.BaseRevInfo_malformedEntryLine, new String[] { entryLine }));
+ IStatus status = new CVSStatus(IStatus.ERROR,NLS.bind(CVSMessages.BaseRevInfo_malformedEntryLine, new String[] { entryLine }));
+ throw new CVSException(status);
}
}
/**
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/CVSResourceVariantTree.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/CVSResourceVariantTree.java
index 8936e046a..403cbc963 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/CVSResourceVariantTree.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/CVSResourceVariantTree.java
@@ -10,11 +10,7 @@
*******************************************************************************/
package org.eclipse.team.internal.ccvs.core.syncinfo;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
+import java.util.*;
import org.eclipse.core.resources.*;
import org.eclipse.core.runtime.*;
@@ -136,8 +132,8 @@ public class CVSResourceVariantTree extends ResourceVariantTree {
if (parentBytes == null) {
IProject project = resource.getProject();
if (project.exists() && RepositoryProvider.getProvider(project, CVSProviderPlugin.getTypeId()) != null) {
- CVSProviderPlugin.log(new CVSException(
- NLS.bind(CVSMessages.ResourceSynchronizer_missingParentBytesOnGet, new String[] { getSyncName(getByteStore()).toString(), resource.getFullPath().toString() })));
+ IStatus status = new CVSStatus(IStatus.ERROR, CVSStatus.ERROR,NLS.bind(CVSMessages.ResourceSynchronizer_missingParentBytesOnGet, new String[] { getSyncName(getByteStore()).toString(), resource.getFullPath().toString() }),resource);
+ CVSProviderPlugin.log(status);
// Assume there is no remote and the problem is a programming error
}
return null;
@@ -344,7 +340,7 @@ public class CVSResourceVariantTree extends ResourceVariantTree {
}
private boolean isJobInFamilyRunning(Object family) {
- Job[] jobs = Platform.getJobManager().find(family);
+ Job[] jobs = Job.getJobManager().find(family);
if (jobs != null && jobs.length > 0) {
for (int i = 0; i < jobs.length; i++) {
Job job = jobs[i];
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/FolderSyncInfo.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/FolderSyncInfo.java
index e0b51b551..2c4af97ca 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/FolderSyncInfo.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/FolderSyncInfo.java
@@ -14,6 +14,7 @@ package org.eclipse.team.internal.ccvs.core.syncinfo;
import java.io.*;
import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.team.internal.ccvs.core.*;
import org.eclipse.team.internal.ccvs.core.connection.CVSRepositoryLocation;
import org.eclipse.team.internal.ccvs.core.resources.CVSEntryLineTag;
@@ -153,7 +154,8 @@ public class FolderSyncInfo {
}
return root.substring(index);
} catch (IndexOutOfBoundsException e) {
- throw new CVSException(CVSMessages.FolderSyncInfo_Maleformed_root_4);
+ IStatus status = new CVSStatus(IStatus.ERROR,CVSMessages.FolderSyncInfo_Maleformed_root_4, e);
+ throw new CVSException(status);
}
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/NotifyInfo.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/NotifyInfo.java
index a7767e382..d75e3fd43 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/NotifyInfo.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/NotifyInfo.java
@@ -16,6 +16,7 @@ import java.text.ParseException;
import java.util.Date;
import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.osgi.util.NLS;
import org.eclipse.team.internal.ccvs.core.*;
import org.eclipse.team.internal.ccvs.core.util.CVSDateFormatter;
@@ -57,13 +58,15 @@ public class NotifyInfo {
public NotifyInfo(IContainer parent, String line) throws CVSException {
String[] strings = Util.parseIntoSubstrings(line, ResourceSyncInfo.SEPARATOR);
if(strings.length != 4) {
- throw new CVSException(NLS.bind(CVSMessages.NotifyInfo_MalformedLine, new String[] { line }));
+ IStatus status = new CVSStatus(IStatus.ERROR, CVSStatus.ERROR_LINE, NLS.bind(CVSMessages.NotifyInfo_MalformedLine, new String[] { line }), parent);
+ throw new CVSException(status);
}
this.filename = strings[0];
String type = strings[1];
if (type.length() != 1) {
- throw new CVSException(NLS.bind(CVSMessages.NotifyInfo_MalformedNotificationType, new String[] { line }));
+ IStatus status = new CVSStatus(IStatus.ERROR, CVSStatus.ERROR_LINE, NLS.bind(CVSMessages.NotifyInfo_MalformedNotificationType, new String[] { line }), parent);
+ throw new CVSException(status);
}
this.notificationType = type.charAt(0);
@@ -71,7 +74,8 @@ public class NotifyInfo {
try {
this.timeStamp = CVSDateFormatter.entryLineToDate(date);
} catch(ParseException e) {
- throw new CVSException(NLS.bind(CVSMessages.NotifyInfo_MalformedNotifyDate, new String[] { line }));
+ IStatus status = new CVSStatus(IStatus.ERROR, CVSStatus.ERROR_LINE, NLS.bind(CVSMessages.NotifyInfo_MalformedNotifyDate, new String[] { line }), parent);
+ throw new CVSException(status);
}
String watchesString = strings[3];
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/SyncFileWriter.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/SyncFileWriter.java
index 692faa335..7468dd1aa 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/SyncFileWriter.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/SyncFileWriter.java
@@ -619,7 +619,8 @@ public class SyncFileWriter {
IFolder baseFolder = getBaseDirectory(file);
IFile source = baseFolder.getFile(new Path(null, file.getName()));
if (!source.exists()) {
- throw new CVSException(NLS.bind(CVSMessages.SyncFileWriter_baseNotAvailable, new String[] { file.getFullPath().toString() }));
+ IStatus status = new CVSStatus(IStatus.ERROR, CVSStatus.ERROR, NLS.bind(CVSMessages.SyncFileWriter_baseNotAvailable, new String[] { file.getFullPath().toString() }), file);
+ throw new CVSException(status);
}
if (file.exists()) {
file.delete(false /* force */, true /* keep history */, Policy.subMonitorFor(monitor, 10));
diff --git a/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/CVSSSH2ServerConnection.java b/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/CVSSSH2ServerConnection.java
index da1024ecf..12037887c 100644
--- a/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/CVSSSH2ServerConnection.java
+++ b/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/CVSSSH2ServerConnection.java
@@ -34,7 +34,7 @@ public class CVSSSH2ServerConnection implements IServerConnection {
private final JSchException e;
- private SSH2IOException(String s, JSchException e) {
+ SSH2IOException(String s, JSchException e) {
super(s);
this.e = e;
}
@@ -148,13 +148,13 @@ public class CVSSSH2ServerConnection implements IServerConnection {
}
int timeout = location.getTimeout();
inputStream = new PollingInputStream(new TimeoutInputStream(new FilterInputStream(channel_in) {
- public void close() throws IOException {
+ public void close() {
// Don't close the underlying stream as it belongs to the session
}
},
8192 /*bufferSize*/, 1000 /*readTimeout*/, -1 /*closeTimeout*/, true /* growWhenFull */), timeout > 0 ? timeout : 1, monitor);
outputStream = new PollingOutputStream(new TimeoutOutputStream(new FilterOutputStream(channel_out) {
- public void close() throws IOException {
+ public void close() {
// Don't close the underlying stream as it belongs to the session
}
},
@@ -170,7 +170,7 @@ public class CVSSSH2ServerConnection implements IServerConnection {
String message = e.getMessage();
if (JSchSession.isAuthenticationFailure(e)) {
// Do not retry as the Jsh library has it's own retry logic
- throw new CVSAuthenticationException(CVSSSH2Messages.CVSSSH2ServerConnection_0, CVSAuthenticationException.NO_RETRY, e);
+ throw new CVSAuthenticationException(CVSSSH2Messages.CVSSSH2ServerConnection_0, CVSAuthenticationException.NO_RETRY,location, e);
} else if (message.startsWith("Session.connect: ")) { //$NON-NLS-1$
// Jsh has messages formatted like "Session.connect: java.net.NoRouteToHostException: ..."
// Strip of the exception and try to convert it to a more meaningfull string
diff --git a/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/PServerSSH2ServerConnection.java b/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/PServerSSH2ServerConnection.java
index 52343c23d..f69c61a05 100644
--- a/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/PServerSSH2ServerConnection.java
+++ b/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/PServerSSH2ServerConnection.java
@@ -76,6 +76,7 @@ public class PServerSSH2ServerConnection implements IServerConnection {
ssh_port = Integer.parseInt(ssh_host.substring(ssh_host.lastIndexOf('#') + 1));
ssh_host = ssh_host.substring(0, ssh_host.lastIndexOf('#'));
} catch (Exception e) {
+ // Ignore
}
}
@@ -97,6 +98,7 @@ public class PServerSSH2ServerConnection implements IServerConnection {
String foo = list[i].substring(0, list[i].indexOf(':'));
lport = Integer.parseInt(foo);
} catch (Exception ee) {
+ // Ignore
}
done = true;
break;
@@ -109,7 +111,7 @@ public class PServerSSH2ServerConnection implements IServerConnection {
} catch (JSchException ee) {
retry--;
if(retry<0){
- throw new CVSAuthenticationException(CVSSSH2Messages.CVSSSH2ServerConnection_3, CVSAuthenticationException.NO_RETRY);
+ throw new CVSAuthenticationException(CVSSSH2Messages.CVSSSH2ServerConnection_3, CVSAuthenticationException.NO_RETRY, location);
}
if(session != null && session.isConnected()){
session.disconnect();
@@ -140,7 +142,7 @@ public class PServerSSH2ServerConnection implements IServerConnection {
IConnectionMethod method = cvsrl.getMethod();
psc = method.createConnection(cvsrl, _password);
} catch (Exception e) {
- throw new CVSAuthenticationException(e.toString(), CVSAuthenticationException.NO_RETRY);
+ throw new CVSAuthenticationException(e.toString(), CVSAuthenticationException.NO_RETRY, location);
}
psc.open(monitor);
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/RemoteRevisionQuickDiffProvider.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/RemoteRevisionQuickDiffProvider.java
index 58dd7c83b..a906876e2 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/RemoteRevisionQuickDiffProvider.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/RemoteRevisionQuickDiffProvider.java
@@ -289,13 +289,15 @@ public class RemoteRevisionQuickDiffProvider implements IQuickDiffReferenceProvi
document.set(caw.toString());
//System.out.println("+ CVSQuickDiff: updating document : " + caw.toString());
} catch (IOException x) {
- throw new CVSException(CVSUIMessages.RemoteRevisionQuickDiffProvider_readingFile, x);
+ IStatus status = new CVSStatus(IStatus.ERROR, CVSStatus.ERROR, CVSUIMessages.RemoteRevisionQuickDiffProvider_readingFile, x);
+ throw new CVSException(status);
} finally {
if (in != null) {
try {
in.close();
} catch (IOException x) {
- throw new CVSException(CVSUIMessages.RemoteRevisionQuickDiffProvider_closingFile, x);
+ IStatus status = new CVSStatus(IStatus.ERROR, CVSStatus.ERROR, CVSUIMessages.RemoteRevisionQuickDiffProvider_closingFile, x);
+ throw new CVSException(status);
}
}
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CheckoutProjectOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CheckoutProjectOperation.java
index 3beeac87b..ec67c25d8 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CheckoutProjectOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CheckoutProjectOperation.java
@@ -17,8 +17,7 @@ import java.util.*;
import org.eclipse.core.resources.*;
import org.eclipse.core.runtime.*;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.core.runtime.jobs.MultiRule;
+import org.eclipse.core.runtime.jobs.*;
import org.eclipse.osgi.util.NLS;
import org.eclipse.team.core.RepositoryProvider;
import org.eclipse.team.core.TeamException;
@@ -156,7 +155,7 @@ public abstract class CheckoutProjectOperation extends CheckoutOperation {
// One of the projects is mapped to a provider that locks the workspace.
// Just return the workspace root rule
try {
- Platform.getJobManager().beginRule(schedulingRule, pm);
+ Job.getJobManager().beginRule(schedulingRule, pm);
// Still use the projects as the inner rule so we get the proper batching of sync info write
EclipseSynchronizer.getInstance().run(MultiRule.combine(targetProjects), new ICVSRunnable() {
public void run(IProgressMonitor monitor) throws CVSException {
@@ -164,7 +163,7 @@ public abstract class CheckoutProjectOperation extends CheckoutOperation {
}
}, Policy.subMonitorFor(pm, 90));
} finally {
- Platform.getJobManager().endRule(schedulingRule);
+ Job.getJobManager().endRule(schedulingRule);
}
} else {
EclipseSynchronizer.getInstance().run(schedulingRule, new ICVSRunnable() {
@@ -365,7 +364,7 @@ public abstract class CheckoutProjectOperation extends CheckoutOperation {
Policy.checkCanceled(monitor);
if (needsPromptForOverwrite(project) && !promptToOverwrite(remoteFolder, project)) {
// User said no to this project but not no to all
- return new CVSStatus(IStatus.INFO, IStatus.CANCEL, NLS.bind(CVSUIMessages.CheckoutProjectOperation_0, new String[] { remoteFolder.getRepositoryRelativePath() }));
+ return new CVSStatus(IStatus.INFO, IStatus.CANCEL, NLS.bind(CVSUIMessages.CheckoutProjectOperation_0, new String[] { remoteFolder.getRepositoryRelativePath() }), remoteFolder);
}
}
// Create the projects and remove any previous content
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/FileDiffOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/FileDiffOperation.java
index 8fa2adf1c..5a0feb183 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/FileDiffOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/FileDiffOperation.java
@@ -16,6 +16,7 @@ import java.nio.channels.FileChannel;
import org.eclipse.core.resources.mapping.ResourceMapping;
import org.eclipse.core.runtime.*;
import org.eclipse.team.internal.ccvs.core.CVSException;
+import org.eclipse.team.internal.ccvs.core.CVSStatus;
import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption;
import org.eclipse.team.internal.ccvs.ui.CVSUIMessages;
import org.eclipse.team.internal.core.TeamPlugin;
@@ -98,7 +99,8 @@ public class FileDiffOperation extends DiffOperation {
os = new FileOutputStream(tempFile);
return new PrintStream(os);
} catch (FileNotFoundException e) {
- throw new CVSException(CVSUIMessages.GenerateDiffFileOperation_0, e);
+ IStatus status = new CVSStatus(IStatus.ERROR, CVSStatus.ERROR, CVSUIMessages.GenerateDiffFileOperation_0, e);
+ throw new CVSException(status);
}
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/ShowAnnotationOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/ShowAnnotationOperation.java
index 8f7285f82..dd55dd070 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/ShowAnnotationOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/ShowAnnotationOperation.java
@@ -247,7 +247,7 @@ public class ShowAnnotationOperation extends CVSOperation {
throw e;
} catch (TeamException e) {
// XXX why does getLogEntries throw TeamException?
- throw new CVSException("", e); //$NON-NLS-1$
+ throw CVSException.wrapException(e);
}
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RepositoryManager.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RepositoryManager.java
index 1fe858ad0..32d20cb0e 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RepositoryManager.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RepositoryManager.java
@@ -475,9 +475,11 @@ public class RepositoryManager {
SAXParser parser = factory.newSAXParser();
parser.parse(new InputSource(stream), new RepositoriesViewContentHandler(this));
} catch (SAXException ex) {
- throw new CVSException(NLS.bind(CVSUIMessages.RepositoryManager_parsingProblem, new String[] { REPOSITORIES_VIEW_FILE }), ex);
+ IStatus status = new CVSStatus(IStatus.ERROR, CVSStatus.ERROR, NLS.bind(CVSUIMessages.RepositoryManager_parsingProblem, new String[] { REPOSITORIES_VIEW_FILE }), ex);
+ throw new CVSException(status);
} catch (ParserConfigurationException ex) {
- throw new CVSException(NLS.bind(CVSUIMessages.RepositoryManager_parsingProblem, new String[] { REPOSITORIES_VIEW_FILE }), ex);
+ IStatus status = new CVSStatus(IStatus.ERROR, CVSStatus.ERROR, NLS.bind(CVSUIMessages.RepositoryManager_parsingProblem, new String[] { REPOSITORIES_VIEW_FILE }), ex);
+ throw new CVSException(status);
}
}
@@ -487,9 +489,11 @@ public class RepositoryManager {
SAXParser parser = factory.newSAXParser();
parser.parse(new InputSource(stream), new CommentHistoryContentHandler());
} catch (SAXException ex) {
- throw new CVSException(NLS.bind(CVSUIMessages.RepositoryManager_parsingProblem, new String[] { COMMENT_HIST_FILE }), ex);
+ IStatus status = new CVSStatus(IStatus.ERROR, CVSStatus.ERROR, NLS.bind(CVSUIMessages.RepositoryManager_parsingProblem, new String[] { COMMENT_HIST_FILE }), ex);
+ throw new CVSException(status);
} catch (ParserConfigurationException ex) {
- throw new CVSException(NLS.bind(CVSUIMessages.RepositoryManager_parsingProblem, new String[] { COMMENT_HIST_FILE }), ex);
+ IStatus status = new CVSStatus(IStatus.ERROR, CVSStatus.ERROR, NLS.bind(CVSUIMessages.RepositoryManager_parsingProblem, new String[] { COMMENT_HIST_FILE }), ex);
+ throw new CVSException(status);
}
}
@@ -892,13 +896,15 @@ public class RepositoryManager {
parser.parse(new InputSource(stream),
new CommentTemplatesContentHandler());
} catch (SAXException ex) {
- throw new CVSException(NLS.bind(
+ IStatus status = new CVSStatus(IStatus.ERROR, CVSStatus.ERROR, NLS.bind(
CVSUIMessages.RepositoryManager_parsingProblem,
new String[] { COMMENT_TEMPLATES_FILE }), ex);
+ throw new CVSException(status);
} catch (ParserConfigurationException ex) {
- throw new CVSException(NLS.bind(
+ IStatus status = new CVSStatus(IStatus.ERROR, CVSStatus.ERROR, NLS.bind(
CVSUIMessages.RepositoryManager_parsingProblem,
new String[] { COMMENT_TEMPLATES_FILE }), ex);
+ throw new CVSException(status);
}
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSubscriberOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSubscriberOperation.java
index ef2c8c413..5a35bb2e1 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSubscriberOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSubscriberOperation.java
@@ -28,20 +28,17 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.window.Window;
import org.eclipse.osgi.util.NLS;
+import org.eclipse.team.internal.ccvs.core.CVSStatus;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.synchronize.SyncInfo;
import org.eclipse.team.core.synchronize.SyncInfoSet;
import org.eclipse.team.core.variants.IResourceVariant;
-import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin;
-import org.eclipse.team.internal.ccvs.core.CVSSyncInfo;
-import org.eclipse.team.internal.ccvs.core.ICVSFolder;
-import org.eclipse.team.internal.ccvs.core.ICVSResource;
-import org.eclipse.team.internal.ccvs.core.ICVSRunnable;
+import org.eclipse.team.internal.ccvs.core.*;
import org.eclipse.team.internal.ccvs.core.client.PruneFolderVisitor;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.core.resources.EclipseSynchronizer;
import org.eclipse.team.internal.ccvs.ui.*;
+import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
import org.eclipse.team.ui.synchronize.SynchronizeModelOperation;
@@ -295,7 +292,8 @@ public abstract class CVSSubscriberOperation extends SynchronizeModelOperation {
}
}
} catch(CoreException e) {
- throw new CVSException(CVSUIMessages.UpdateMergeActionProblems_merging_remote_resources_into_workspace_1, e);
+ IStatus status = new CVSStatus(IStatus.ERROR, CVSStatus.ERROR, CVSUIMessages.UpdateMergeActionProblems_merging_remote_resources_into_workspace_1,e, local);
+ throw new CVSException(status);
}
}
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java
index f27e7f865..f81bedc4c 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java
@@ -925,7 +925,8 @@ public class EclipseTest extends ResourceTest {
try {
file.setContents(new ByteArrayInputStream(getFileContents(file).getBytes()), false, false, null);
} catch (IOException e) {
- throw new CVSException("Error reading file contents", e);
+ CVSStatus status = new CVSStatus(IStatus.ERROR, "Error reading file contents", e);
+ throw new CVSException(status);
}
}
} while (!cvsFile.isModified(null));

Back to the top