You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2018/11/08 06:44:50 UTC
[GitHub] Tibor17 commented on a change in pull request #198: [SUREFIRE-1588]
Correcting relativization logic to produce valid URIs on Windows
Tibor17 commented on a change in pull request #198: [SUREFIRE-1588] Correcting relativization logic to produce valid URIs on Windows
URL: https://github.com/apache/maven-surefire/pull/198#discussion_r231778368
##########
File path: maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/JarManifestForkConfiguration.java
##########
@@ -150,8 +150,10 @@ private static String toClasspathElementUri( @Nonnull Path parent,
{
try
{
- return new URI( null, parent.relativize( classPathElement.toPath() ).toString(), null )
- .toASCIIString();
+ return new URI( null,
+ parent.relativize( classPathElement.toPath() ).toString().
Review comment:
You could use a separate variable since this is getting long line. It would be at least easy to debug.
```
Path absolutePath = classPathElement.toPath();
String relativeUriPath = parent.relativize( absolutePath )
.toString()
.replace( File.separatorChar, '/' );
return new URI( null, relativeUriPath, null ).toASCIIString();
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services