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 2021/08/27 16:08:38 UTC
[GitHub] [netbeans] jlahoda opened a new pull request #3134: [NETBEANS-5901] Handling of FileObjects not backed by j.i.File when sorting by full path is requested.
jlahoda opened a new pull request #3134:
URL: https://github.com/apache/netbeans/pull/3134
Not every FileObject is backed by j.i.File, need to compute some (hopefully) sensible full path for all FileObjects.
--
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: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
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
[GitHub] [netbeans] matthiasblaesing commented on pull request #3134: [NETBEANS-5901] Handling of FileObjects not backed by j.i.File when sorting by full path is requested.
Posted by GitBox <gi...@apache.org>.
matthiasblaesing commented on pull request #3134:
URL: https://github.com/apache/netbeans/pull/3134#issuecomment-1001775714
The only failing unittest is `java.source.nbjavac` which is gone. Let's get this in.
--
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: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
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
[GitHub] [netbeans] matthiasblaesing merged pull request #3134: [NETBEANS-5901] Handling of FileObjects not backed by j.i.File when sorting by full path is requested.
Posted by GitBox <gi...@apache.org>.
matthiasblaesing merged pull request #3134:
URL: https://github.com/apache/netbeans/pull/3134
--
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: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
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
[GitHub] [netbeans] JaroslavTulach commented on a change in pull request #3134: [NETBEANS-5901] Handling of FileObjects not backed by j.i.File when sorting by full path is requested.
Posted by GitBox <gi...@apache.org>.
JaroslavTulach commented on a change in pull request #3134:
URL: https://github.com/apache/netbeans/pull/3134#discussion_r697654018
##########
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:
Can't we just always compare the URL?
--
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: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
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
[GitHub] [netbeans] mbien commented on a change in pull request #3134: [NETBEANS-5901] Handling of FileObjects not backed by j.i.File when sorting by full path is requested.
Posted by GitBox <gi...@apache.org>.
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: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
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