gbrinkmann commented on a change in pull request #1244: [NETBEANS-1936] Usage 
of remainderDelimiter
URL: https://github.com/apache/netbeans/pull/1244#discussion_r283261630
 
 

 ##########
 File path: 
ide/subversion/src/org/netbeans/modules/subversion/client/cli/commands/VersionCommand.java
 ##########
 @@ -84,7 +84,7 @@ public boolean checkForErrors() {
             if (pos > -1) {
                 String vString = string.substring(pos + 9);
                 Subversion.LOG.log(Level.INFO, "Commandline client version: 
{0}", vString);
-                Version version = Version.parse(vString.replace("-dev", ""));
+                Version version = Version.parse(vString, "-");
 
 Review comment:
   Hello,
   
   the full version string from SlikSvn is `svn, version 1.9.7-SlikSvn 
(SlikSvn/1.9.7)`
   
   The build I'm using is `Apache NetBeans IDE 11.0 (Build 
incubator-netbeans-release-404-on-20190319)`
   
   The parse line (line 87) throws a NumberFormatException for input string 
"7-SlikSvn"
   
   ```
   INFO [org.netbeans.modules.subversion]: Commandline client version: 
1.9.7-SlikSvn (SlikSvn/1.9.7)
   SEVERE [org.netbeans.modules.subversion]: For input string: "7-SlikSvn"
   java.lang.NumberFormatException: For input string: "7-SlikSvn"
        at 
java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
        at java.base/java.lang.Integer.parseInt(Integer.java:652)
        at java.base/java.lang.Integer.parseInt(Integer.java:770)
        at 
org.netbeans.modules.subversion.client.cli.commands.VersionCommand$Version.parse(VersionCommand.java:168)
        at 
org.netbeans.modules.subversion.client.cli.commands.VersionCommand$Version.parse(VersionCommand.java:146)
        at 
org.netbeans.modules.subversion.client.cli.commands.VersionCommand.checkForErrors(VersionCommand.java:87)
        at 
org.netbeans.modules.subversion.client.cli.CommandlineClient.checkSupportedVersion(CommandlineClient.java:132)
        at 
org.netbeans.modules.subversion.client.SvnClientFactory.checkVersion(SvnClientFactory.java:473)
        at 
org.netbeans.modules.subversion.client.SvnClientFactory.checkCLIExecutable(SvnClientFactory.java:430)
        at 
org.netbeans.modules.subversion.client.SvnClientFactory.setupCommandline(SvnClientFactory.java:403)
        at 
org.netbeans.modules.subversion.client.SvnClientFactory.setup(SvnClientFactory.java:222)
        at 
org.netbeans.modules.subversion.client.SvnClientFactory.init(SvnClientFactory.java:95)
        at 
org.netbeans.modules.subversion.client.SvnClientFactory.isClientAvailable(SvnClientFactory.java:240)
        at 
org.netbeans.modules.subversion.Annotator.checkClientAvailable(Annotator.java:638)
        at 
org.netbeans.modules.subversion.Annotator.annotateIcon(Annotator.java:506)
   ```
   
   The last change before mine just filters "-dev" from the version string, but 
the usage of the method signature Version.parse(String, String) is explicitely 
meant for truncating stuff like for example "-SNAPSHOT" from the version 
string, like stated in the javadoc.
   
   I'll try to introduce a test.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to