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 176800 - Double click in a class file doesn't bring the source editor for library wrapper modules
Summary: Double click in a class file doesn't bring the source editor for library wrap...
Status: RESOLVED FIXED
Alias: None
Product: apisupport
Classification: Unclassified
Component: Project (show other bugs)
Version: 6.x
Hardware: PC Windows Vista
: P4 normal with 1 vote (vote)
Assignee: Martin Kozeny
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-13 07:58 UTC by ecerulm
Modified: 2012-12-14 15:06 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
screenshot (19.89 KB, image/png)
2009-11-13 07:59 UTC, ecerulm
Details
suite containing core-renderer.jar and core-renderer-src.zip (4.86 MB, application/x-zip-compressed)
2009-11-16 05:56 UTC, ecerulm
Details
the xhtmlrenderer library description. (814 bytes, text/xml)
2009-11-16 06:00 UTC, ecerulm
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ecerulm 2009-11-13 07:58:13 UTC
I tried to attach the source in three ways

1) Creating a library in Tools->Libraries and putting the release/module/ext/core-renderer.jar in classpath tab and the source zip file in sources tab
2) Using modules properties -> Libraries -> Wrapped JARs -> Edit
3) Putting a core-renderer-src.jar next to release/module/ext/core-renderer.jar

All of them seem to put the sources in the system as the core-renderer-src.zip url appears in the Sources view, and I can open the type with Go to Type (Ctrl-O). 

But if I double click on the class file in the project explorer nothing happens. 

Also if I open the type with Ctrl-O and I right-click on Select in -> Projects nothing happens

Moreover, I cannot set breakpoint in the sources I get a 

Not able to submit breakpoint LineBreakpoint SwingReplacedElementFactory.java : 73, reason: No source root found for URL 'jar:file:/C:/Users/ecerulm/Documents/NetBeansProjects/test/suite9/core-renderer/release/modules/ext/core-renderer-src.zip!/org/xhtmlrenderer/swing/SwingReplacedElementFactory.java'. Verify the setup of project sources.
Invalid LineBreakpoint SwingReplacedElementFactory.java : 73
Comment 1 ecerulm 2009-11-13 07:59:53 UTC
Created attachment 91008 [details]
screenshot

screenshot showing that the source attachment core-renderer-src.zip appear in the Sources view
Comment 2 Peter Pis 2009-11-15 13:42:18 UTC
Reassigning.
Comment 3 Tomas Zezula 2009-11-16 02:51:08 UTC
Works for me.
Please be sure that the archive containing the sources has correct layout (it contains directly the sources).
If you still have the problem please attach the core-renderer-src.zip as well as the library file description, located in the ${nbuser.dir}/config/org-netbeans-api-project-libraries/Libraries.
Thanks
Comment 4 ecerulm 2009-11-16 05:56:45 UTC
Created attachment 91080 [details]
suite containing core-renderer.jar and core-renderer-src.zip

I included a zip file with a suite containing just one module core-renderer. 

core-renderer is  a library wrapper module and the sources are included 
suite9\core-renderer\release\modules\ext\core-renderer.jar
suite9\core-renderer\release\modules\ext\core-renderer-src.jar

I will include the library definition in another attachment but I understand that just placing a -src.zip file next to the jar is enough. 

Please note that the -src.zip has the proper structure (I think). 

$ unzip -l core-renderer-src.zip
Archive:  core-renderer-src.zip
  Length     Date   Time    Name
 --------    ----   ----    ----
        0  09-11-13 12:45   eeze/
    33465  08-05-30 18:07   eeze/Eeze.java
     1715  05-11-22 16:02   eeze/eeze_help.html
        0  09-11-13 12:45   org/
        0  09-11-13 12:45   org/xhtmlrenderer/
        0  09-11-13 12:45   org/xhtmlrenderer/context/
    12386  08-01-22 22:25   org/xhtmlrenderer/context/AWTFontResolver.java
    12272  08-01-26 23:15   org/xhtmlrenderer/context/ContentFunctionFactory.jav
a
     4633  07-08-20 00:22   org/xhtmlrenderer/context/StandardAttributeResolver.
java
...
...
...
     1203  05-06-13 10:47   org/xhtmlrenderer/Version.java
        0  09-11-13 12:45   utilities/
     1604  07-07-14 19:51   utilities/Thumbnails.java
 --------                   -------
  2456498                   328 files
Comment 5 ecerulm 2009-11-16 06:00:40 UTC
Created attachment 91082 [details]
the xhtmlrenderer library description. 

xhtmlrenderer library description
Comment 6 ecerulm 2009-11-16 06:10:13 UTC
Thanks for the answer, I think that the zip file has the proper structure. 

I want to stress the fact that the same files work ok with NB 6.7.

I also tried a regular Java Application including the library "Swing Layout Extensions " (that comes with NB 6.8). I added the existing library to the project with Properties -> Libraries and I can't open any class file from swing-layout-1.0.3.jar. (for example org.jdesktop.layout.Baseline). I checked the library definitions and there is a Sources attachment for swing-layout-1.0.3.jar. I, though, can open Baseline.class's sources via Ctrl-O. 

If the same examples work in your environment then maybe it's really a problem in my environment (maybe something specific to Vista and NB 6.8 as NB 6.7 works ok). I already started looking for "regular support" in the forums. 


Thanks anyway.
Comment 7 Tomas Zezula 2009-11-16 06:34:57 UTC
Thanks for files. I will check them immediately.
>I added the existing library to the project with Properties -> Libraries and I can't open any class file from swing-layout-1.0.3.jar
This library has exactly the problem I've described above. The library description says that the src root is jar:nbinst://org.jdesktop.layout/docs/swing-layout-1.0.4-src.zip!/ but if you look into the zip file you will find that the source root is jar:nbinst://org.jdesktop.layout/docs/swing-layout-1.0.4-src.zip!/swing-layout-1.0.4/src/
It's really BAD that the bundled libraries have wrong description file. I will fill an issue about this and let you know.
Comment 8 ecerulm 2009-11-16 06:48:15 UTC
Wow, I really expected the bundled libraries to be correctly defined. I didn't even think that those could be wrong too. 

Looking forward to know what's the problem with the other jar. (thanks again for answering so quick).
Comment 9 Tomas Zezula 2009-11-16 06:53:31 UTC
I've tested the core-renderer library. It seems to be a problem in the api support project type.
If you copy both the core-renderer-src.zip and core-renderer.jar outside the suite, create a library (Tools/Library Manager) from them and add the library into the j2se project it works fine.
I will try to find what's the problem and reassign it to api support to be fixed.
Comment 10 Tomas Zezula 2009-11-16 07:04:29 UTC
The swing-layout-1.0.4-src.zip issue number is 176905.
Comment 11 Tomas Zezula 2009-11-16 07:33:30 UTC
The attached suite works fine for me as it is.
I've created a new java class in the suite9/core-renderer/src and added a field of type org.xhtmlrenderer.DefaultCSSMarker into it. The Ctrl+click on it opens the DefaultCSSMarker source file.
Under debugger I've found that the source was provided by the org.netbeans.modules.apisupport.project.queries.SourceForBinaryImpl using the
// convention-over-cfg per mkleint's suggestion: <jarname>-src(.zip) folder or ZIP first
block integrated by rmichalsky on 8/27/2009.
Reassigning to API support for evaluation.
Comment 12 ecerulm 2009-11-16 08:17:42 UTC
Ctrl-click works also for me in Dev (NB 6.8 gives an exception see Issue #172651). Ctrl-O also works. 

But double clicking on the class file in the "project explorer view" doesn't work. It opens the "navigator" view but not the source editor. When I say double click in the class file I mean opening "core-renderer" module -> Libraries -> core-renderer.jar (Wrapped Library) -> double click in a class file there. 

The "Not able to submit breakpoint LineBreakpoint" error is gone though, I don't know why.
Comment 13 Tomas Zezula 2009-11-16 08:25:49 UTC
>But double clicking on the class file in the "project explorer view" doesn't work.
Caused by API support copy of the LibrariesNode which has not a fix for lazy actions. The api support project should use common java apis as other libraries.

>The "Not able to submit breakpoint LineBreakpoint" error is gone...
As the SourceForBinaryQuery works all its clients including debugger should work fine.
Comment 14 ecerulm 2009-11-17 04:59:27 UTC
>>The "Not able to submit breakpoint LineBreakpoint" error is gone...
>As the SourceForBinaryQuery works all its clients including debugger should
>work fine.

I realized that "Not able to submit breakpoint.." goes away only if I have a library for core-renderer.jar. If I have just the source attachment by name convention without a library (tools->libraries) then when the debugger starts I get the error again. I filed this as another Issue #176983 against the debugger itself.
Comment 15 Jesse Glick 2010-02-04 16:27:10 UTC
Not sure I can follow the history here after so many corrections. All I can see still valid is that double-click does not open source files from a wrapped library. Ctrl-click from the editor etc. does, so this is not a high priority to fix.
Comment 16 ecerulm 2010-02-06 14:21:42 UTC
Yes, that's right. Double-click does not open source files from a wrapped
library the other methods (including Go To Type) work.
Comment 17 Martin Kozeny 2012-12-14 15:06:54 UTC
Works also for me to create wrapped library and double click from class file to source code. Also setting break point makes me no difficulties. Please reopen this bug when it makes any further problems.