mbien commented on a change in pull request #3134:
URL: https://github.com/apache/netbeans/pull/3134#discussion_r744487208



##########
File path: 
platform/core.windows/src/org/netbeans/core/windows/model/DefaultModeModel.java
##########
@@ -232,7 +233,23 @@ public int compare(TopComponent tc1, TopComponent tc2) {
     }
 
     private int compareFullFilePath(FileObject f1, FileObject f2) {
-        return FileUtil.toFile(f1).compareTo(FileUtil.toFile(f2));
+        return toFullFilePath(f1).compareToIgnoreCase(toFullFilePath(f2));
+    }
+
+    private String toFullFilePath(FileObject fo) {
+        File f = FileUtil.toFile(fo);
+
+        if (f != null) {
+            return f.getAbsolutePath();
+        }
+
+        FileObject rootFO = FileUtil.getArchiveFile(fo);
+
+        if (rootFO != null) {
+            return toFullFilePath(rootFO) + "/" + fo.getPath();
+        }
+
+        return fo.toURL().getPath();

Review comment:
       working with URLs can be expensive since it involves dns resolution 
which is blocking (never put them as keys in a map). Comparing Srings or URIs 
wouldn't have this issue.




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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



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