diff options
author | Michael Valenta | 2002-10-03 20:06:03 +0000 |
---|---|---|
committer | Michael Valenta | 2002-10-03 20:06:03 +0000 |
commit | c5241e870da289b1f2d6cc959bd09876b6080266 (patch) | |
tree | a491761eb36861963d9c709803f8af74bd40f03e | |
parent | ad1a30fd29220c0ef318826f61b25122312e16fa (diff) | |
download | eclipse.platform.team-c5241e870da289b1f2d6cc959bd09876b6080266.tar.gz eclipse.platform.team-c5241e870da289b1f2d6cc959bd09876b6080266.tar.xz eclipse.platform.team-c5241e870da289b1f2d6cc959bd09876b6080266.zip |
24085: [CVS Core] Incompatible port parameter stored in Root file
2 files changed, 26 insertions, 10 deletions
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 765696f08..30ef0aa05 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 @@ -192,9 +192,9 @@ public class CVSRepositoryLocation extends PlatformObject implements ICVSReposit (userFixed?(user + (passwordFixed?(COLON + password):"")//$NON-NLS-1$ + HOST_SEPARATOR):"") +//$NON-NLS-1$ - host + - ((port == USE_DEFAULT_PORT)?"":(PORT_SEPARATOR + new Integer(port).toString())) +//$NON-NLS-1$ - COLON + root; + host + COLON + + ((port == USE_DEFAULT_PORT)?"":(new Integer(port).toString())) + //$NON-NLS-1$ + root; } /* @@ -680,9 +680,24 @@ public class CVSRepositoryLocation extends PlatformObject implements ICVSReposit // Separate the port and host if there is a port start = host.indexOf(PORT_SEPARATOR); if (start != -1) { + // Initially, we used a # between the host and port partId = "CVSRepositoryLocation.parsingPort";//$NON-NLS-1$ port = Integer.parseInt(host.substring(start+1)); host = host.substring(0, start); + } else { + // In the correct CVS format, the port follows the COLON + partId = "CVSRepositoryLocation.parsingPort";//$NON-NLS-1$ + int index = end; + char c = location.charAt(++index); + String portString = new String(); + while (Character.isDigit(c)) { + portString += c; + c = location.charAt(++index); + } + if (portString.length() > 0) { + end = index - 1; + port = Integer.parseInt(portString); + } } // Get the repository path (translating backslashes to slashes) 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 ba531a0c9..c48eb0bef 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 @@ -63,8 +63,7 @@ public class FolderSyncInfo { try { rootDir = getRootDirectory(); } catch (CVSException e) { - // Log this error for now. Using the root will show the error to the user. - CVSProviderPlugin.log(e); + // Ignore the for now. Using the root will show the error to the user. return; } if (repository.startsWith(rootDir)) { @@ -115,8 +114,6 @@ public class FolderSyncInfo { * @return String */ private String getRootDirectory() throws CVSException { - String result; - try { String root = getRoot(); int index = root.indexOf('@'); @@ -132,12 +129,16 @@ public class FolderSyncInfo { // If the username was there, we find the first ':' past the '@' index = root.indexOf(':', index + 1); } - result = getRoot().substring(index + 1); + index++; + // strip off a leading port if there is one + char c = root.charAt(index); + while (Character.isDigit(c)) { + c = root.charAt(++index); + } + return root.substring(index); } catch (IndexOutOfBoundsException e) { throw new CVSException(Policy.bind("FolderSyncInfo_Maleformed_root_4")); //$NON-NLS-1$ } - - return result; } /** |