ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Jan.Mate...@rzf.fin-nrw.de>
Subject AW: svn commit: r581055 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ssh/Scp.java
Date Tue, 02 Oct 2007 05:04:30 GMT
>(the { in the while clause is on a separate line because it would break

>the 80 char limit)


The limit is 100 ;)


    <module name="LineLength">
      <property name="max" value="100"/>
      <property name="ignorePattern" value="^ *\* *[^ ]+$"/>
    </module>


BTW, if I read that ignorePattern right, JavaDoc lines could be longer
than 100 ...
I remember of some "too long" uris in javadoc somewhere ...


Jan




>ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ssh/Scp.
java (original)
>> @@ -310,10 +310,21 @@
>>      }
>>  
>>      private String parseUri(String uri) {
>> -        int indexOfAt = uri.lastIndexOf('@');
>> +
>> +        int indexOfAt = uri.indexOf('@');
>>          int indexOfColon = uri.indexOf(':');
>> +
>>          if (indexOfColon > -1 && indexOfColon < indexOfAt) {
>>              // user:password@host:/path notation
>> +            // everything upto the last @ before the last : is
considered
>> +            // password. (so if the path contains an @ and a : it
will not work)
>> +            int indexOfCurrentAt = indexOfAt;
>> +            int indexOfLastColon = uri.lastIndexOf(':');
>> +            while (indexOfCurrentAt > -1 && indexOfCurrentAt <
indexOfLastColon)
>> +            {
>> +                indexOfAt = indexOfCurrentAt;
>> +                indexOfCurrentAt = uri.indexOf('@', indexOfCurrentAt
+ 1);
>> +            }
>>              setUsername(uri.substring(0, indexOfColon));
>>              setPassword(uri.substring(indexOfColon + 1, indexOfAt));
>>          } else {

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message