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 152287

Summary: "Add to favorites" action on JAR under Libraries node does not add JAR itself
Product: platform Reporter: Tomas Danek <musilt2>
Component: FavoritesAssignee: Ondrej Vrabec <ovrabec>
Status: NEW ---    
Severity: blocker CC: jglick, jtulach
Priority: P4    
Version: 6.x   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:

Description Tomas Danek 2008-11-04 10:54:00 UTC
Product Version: NetBeans IDE Dev (Build 200811011401)
Java: 1.6.0_10-beta; Java HotSpot(TM) Client VM 11.0-b11
System: Linux version 2.6.24-21-generic running on i386; UTF-8; en_US (nb)
Userdir: /tmp/ud
------------
- having autoproject with some jar subnodes of Libraries node
- invoked Tools|Add to favorites on some JAR sunbode
- entry with name "Root [/path/to/jar]" and content of JAR was added, expected is to add JAR file itself (as if you add
it using favorites view)
Comment 1 mslama 2008-11-12 13:25:47 UTC
It depends what data object is passed to Add to Favorites action.
Comment 2 mslama 2009-03-25 15:47:39 UTC
I do not know what autoproject means. I tried with regular J2SE project where I have AbsoluteLayout.jar under Libraries
in Projects tab.

When I use add to project on jar file from Favorites tab I get node:
org.netbeans.modules.favorites.Favorites$ProjectFilterNode@10cebf7[Name=cgoban, displayName=cgoban.jar]
and data object:
org.netbeans.modules.java.jarloader.JarDataObject@bd9607[/home/mslama/cgoban.jar]

If I use Tools -> Add to Favorites from main menu on AbsoluteLayout.jar node just below Libraries I get node:
org.openide.nodes.FilterNode@161df2a[Name=jar:file:/home/mslama/local/netbeans/hg-nbsrc/core-main/nbbuild/netbeans/java2/modules/ext/AbsoluteLayout.jar!/,
displayName=Absolute Layout - AbsoluteLayout.jar]
and data object:
org.openide.loaders.DataFolder@cc80[AbstractFileObject@1fac189[root of
/home/mslama/local/netbeans/hg-nbsrc/core-main/nbbuild/netbeans/java2/modules/ext/AbsoluteLayout.jar[org.openide.filesystems.JarFileSystem@1b814a5]]]

So main difference is that in second data object is data folder. I do not know if it is solvable on Favorites side.
Jarda? Closing for now. Please reopen if it is strong requirement.
Comment 3 Jesse Glick 2009-03-25 17:14:55 UTC
"I do not know what autoproject means." - http://wiki.netbeans.org/AutomaticProjects

It is solvable. See FileUtil.getArchiveFile. If it is not null, use it instead.
Comment 4 rmichalsky 2009-06-16 12:56:30 UTC
Reassigning