Login | Register
My pages Projects Community openCollabNet

Discussions > cvs > subclipse commit: r1441 - trunk/subclipse/ui/src/org/tigris/subversion/subclipse/ui/decorator

subclipse
Discussion topic

Back to topic list

subclipse commit: r1441 - trunk/subclipse/ui/src/org/tigris/subversion/subclipse/ui/decorator

Author markphip
Full name Mark Phippard
Date 2005-07-11 13:15:48 PDT
Message Author: markphip
Date: Mon Jul 11 15:15:47 2005
New Revision: 1441

Modified:
   trunk/subclipse/ui/s​rc/org/tigris/subver​sion/subclipse/ui/de​corator/SVNLightweig​htDecorator.java

Log:
Fixed a substring exception in the decorator code. Occurred when the
repository root URL was the exact same URL as the project in the workspace. In
that scenario, calculating the url_short decorator value would throw an
exception and break the decorators.

This would most commonly happen when importing existing projects into the
workspace. The process of sharing that project will create a repository URL
that is identical to the project itself (unless there is already a connection
define for the repository).


Modified: trunk/subclipse/ui/s​rc/org/tigris/subver​sion/subclipse/ui/de​corator/SVNLightweig​htDecorator.java
Url: http://svn.collab.ne​t/viewcvs/subclipse/​trunk/subclipse/ui/s​rc/org/tigris/subver​sion/subclipse/ui/de​corator/SVNLightweig​htDecorator.java?rev​=1441&p1=trunk/s​ubclipse/ui/src/org/​tigris/subversion/su​bclipse/ui/decorator​/SVNLightweightDecor​ator.java&p2=tru​nk/subclipse/ui/src/​org/tigris/subversio​n/subclipse/ui/decor​ator/SVNLightweightD​ecorator.java&r1​=1440&r2=1441
====================​====================​====================​==================
--- trunk/subclipse/ui/s​rc/org/tigris/subver​sion/subclipse/ui/de​corator/SVNLightweig​htDecorator.java (original)
+++ trunk/subclipse/ui/s​rc/org/tigris/subver​sion/subclipse/ui/de​corator/SVNLightweig​htDecorator.java Mon Jul 11 15:15:47 2005
@@ -295,8 +295,13 @@
                 // short url is the path relative to root url of repository
                 SVNUrl repositoryRoot = svnResource.getRepos​itory().getRepositor​yRoot();
                 if (repositoryRoot != null) {
- String shortUrl = status.getUrl().toSt​ring().substring(
- repositoryRoot.toStr​ing().length()+1);
+ int urlLen = status.getUrl().toSt​ring().length();
+ int rootLen = repositoryRoot.toStr​ing().length()+1;
+ String shortUrl;
+ if (urlLen > rootLen)
+ shortUrl = status.getUrl().toSt​ring().substring(roo​tLen);
+ else
+ shortUrl = status.getUrl().toString();
                     bindings.put(
                             SVNDecoratorConfigur​ation.RESOURCE_URL_S​HORT,
                             shortUrl);

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

subclipse commit: r1441 - trunk/subclipse/ui/src/org/tigris/subversion/subclipse/ui/decorator markphip Mark Phippard 2005-07-11 13:15:48 PDT
Messages per page: