This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 144985 - AssertionError at org.netbeans.modules.favorites.Actions$Add.chooseFileObject
Summary: AssertionError at org.netbeans.modules.favorites.Actions$Add.chooseFileObject
Status: VERIFIED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Filesystems (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P4 blocker (vote)
Assignee: Jiri Skrivanek
URL: http://statistics.netbeans.org/except...
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-25 10:55 UTC by Peter Pis
Modified: 2008-12-22 14:12 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 7318


Attachments
stacktrace (2.64 KB, text/plain)
2008-08-25 10:55 UTC, Peter Pis
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Pis 2008-08-25 10:55:53 UTC
Build: NetBeans IDE Dev (Build 200808210201)
VM: Java HotSpot(TM) Client VM, 11.0-b15, Java(TM) SE Runtime Environment, 1.6.0_10-rc-b28
OS: Windows XP, 5.1, x86

User Comments: 
Mounting network drive throws AE

Stacktrace: 
java.lang.AssertionError
        at org.netbeans.modules.favorites.Actions$Add.chooseFileObject(Actions.java:425)
        at org.netbeans.modules.favorites.Actions$Add.performAction(Actions.java:374)
        at org.openide.util.actions.NodeAction$DelegateAction$1.run(NodeAction.java:581)
        at org.netbeans.modules.openide.util.ActionsBridge.doPerformAction(ActionsBridge.java:77)
        at org.openide.util.actions.NodeAction$DelegateAction.actionPerformed(NodeAction.java:577)
        at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
Comment 1 Peter Pis 2008-08-25 10:55:58 UTC
Created attachment 68226 [details]
stacktrace
Comment 2 mslama 2008-08-29 14:15:48 UTC
I need more details. I just setup simple samba share (I shared my Linux home dir using Samba, mounted it as drive F: and
I am able to add this into Favorites. (Though I got many FileNotFound exceptions for dot files in my home dir.
Comment 3 Peter Pis 2008-09-03 13:36:27 UTC
The network drive is disconnected. Lowering the priority - for connected drives it works fine.
Comment 4 mslama 2008-09-18 15:30:26 UTC
I do not know what to do with this issue. There is java.io.File its exists() method returns true but
FileUtil.toFileObject(java.io.File) returns null. Only thing I can do is either to show warning that this file is
invalid or just do nothing but this is weird so probably first variant is better. Passing to filesystems for evaluation
ie. why FileUtil.toFileObject(java.io.File) returns null in such case? Is it correct?
Comment 5 mslama 2008-09-18 15:32:04 UTC
Is network drive disconnected by server or by client? (just in case it makes any difference)
Comment 6 Jiri Skrivanek 2008-09-24 15:21:16 UTC
It also applies for all removable drives without media. It is because File instance returned from JFileChooser is
decorated and exists returns true but plain File.exists() returns false. To reproduce:

- let's have e.g. CD disk drive F:/ without media

  System.out.println("File.exists="+new File("F:/").exists()); // false
  System.out.println("FSV.exists="+FileSystemView.getFileSystemView().createFileObject("F:/").exists());  // true

I added a workaround to org.netbeans.modules.favorites.Actions. It will show a message that file doesn't exist. I am not
able to workaround it better in filesystems. I also filed JDK bug 6751997.

http://hg.netbeans.org/core-main/rev/c6254aa7adf2


Comment 7 Quality Engineering 2008-09-25 06:36:26 UTC
Integrated into 'main-golden', will be available in build *200809250201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/c6254aa7adf2
User: Jiri Skrivanek <jskrivanek@netbeans.org>
Log: #144985 - Create new File because of inconsistence in File.exists (JDK bug 6751997).
Comment 8 Peter Pis 2008-09-30 10:33:46 UTC
Verified.