Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2003-09-04 10:39:15 -0400
committerMichael Valenta2003-09-04 10:39:15 -0400
commit5be1fe5a3973fa576eb93a2acbdee49e7118e7aa (patch)
treeedeec0ea0e2219882a0c2b0c3782f6458af39474
parentec80f3c0aac4b8e2e972a4cc353949290819cc66 (diff)
downloadeclipse.platform.team-5be1fe5a3973fa576eb93a2acbdee49e7118e7aa.tar.gz
eclipse.platform.team-5be1fe5a3973fa576eb93a2acbdee49e7118e7aa.tar.xz
eclipse.platform.team-5be1fe5a3973fa576eb93a2acbdee49e7118e7aa.zip
Modified CVSRepositoryLocation to hide password when toString is called.
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSRepositoryLocation.java8
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/CVSTestSetup.java10
2 files changed, 11 insertions, 7 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 bdb1d76c5..45a0e8205 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
@@ -199,9 +199,13 @@ public class CVSRepositoryLocation extends PlatformObject implements ICVSReposit
* The port is included if it is not the default port.
*/
public String getLocation() {
+ return getLocation(false);
+ }
+
+ public String getLocation(boolean forDisplay) {
return COLON + method.getName() + COLON +
(userFixed?(user +
- (passwordFixed?(COLON + password):"")//$NON-NLS-1$
+ ((passwordFixed && !forDisplay)?(COLON + password):"")//$NON-NLS-1$
+ HOST_SEPARATOR):"") +//$NON-NLS-1$
host + COLON +
((port == USE_DEFAULT_PORT)?"":(new Integer(port).toString())) + //$NON-NLS-1$
@@ -383,7 +387,7 @@ public class CVSRepositoryLocation extends PlatformObject implements ICVSReposit
* Implementation of inherited toString()
*/
public String toString() {
- return getLocation();
+ return getLocation(true);
}
public boolean equals(Object o) {
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/CVSTestSetup.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/CVSTestSetup.java
index bff8c3eaf..789269652 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/CVSTestSetup.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/CVSTestSetup.java
@@ -168,18 +168,18 @@ public class CVSTestSetup extends TestSetup {
}
protected CVSRepositoryLocation setupRepository(String location) throws CVSException {
-
- // Give some info about which repository the tests are running with
- System.out.println("Connecting to: " + location);
// Validate that we can connect, also creates and caches the repository location. This
// is important for the UI tests.
CVSRepositoryLocation repository = (CVSRepositoryLocation)CVSProviderPlugin.getPlugin().getRepository(location);
- //CVSRepositoryLocation repository = CVSRepositoryLocation.fromString(location);
+
+ // Give some info about which repository the tests are running with
+ System.out.println("Connecting to: " + repository.toString());
+
try {
repository.validateConnection(new NullProgressMonitor());
} catch (CVSException e) {
- System.out.println("Unable to connect to remote repository: " + repository.getLocation());
+ System.out.println("Unable to connect to remote repository: " + repository.toString());
throw e;
}

Back to the top