You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2019/02/11 07:08:33 UTC

[GitHub] jlahoda commented on a change in pull request #1128: [NETBEANS-2102] Do not add single files to the Gradle classpath.

jlahoda commented on a change in pull request #1128: [NETBEANS-2102] Do not add single files to the Gradle classpath.
URL: https://github.com/apache/incubator-netbeans/pull/1128#discussion_r255392394
 
 

 ##########
 File path: groovy/gradle.java/src/org/netbeans/modules/gradle/java/classpath/AbstractGradleClassPathImpl.java
 ##########
 @@ -132,8 +128,15 @@ static void addAllFile(Collection<URL> ret, @NonNull Collection<File> files) {
             if (fo != null) {
                 if (FileUtil.isArchiveFile(fo)) {
                     ret.add(FileUtil.getArchiveRoot(fo).toURL());
-                } else {
-                    ret.add(fo.toURL());
+                } if (fo.isFolder()) {
+                    String surl = fo.toURL().toString();
+                    if (!surl.endsWith("/")) {
+                        try {
+                            ret.add(new URL(surl + "/")); //NOI18N
 
 Review comment:
   Not sure if this is necessary - if fo is a folder, then its toURL() should end with a slash? Except for potentially a rare race condition, where the file ceases to exist between the fo.isFolder() and fo.toURL(). Anyway, if you want to keep that, shouldn't hurt.

----------------------------------------------------------------
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

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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