The Open Type function of Eclipse shows found classes twice

39 views
Skip to first unread message

klhmeyer

unread,
Sep 30, 2015, 12:34:24 PM9/30/15
to bndtools-users
Hi,

When I use the 'Open Type'-Button in Eclipse and I search for a class which is in a bundle which is referenced by another bundle (via -buildpath: ..), then there are 2 matching items found: One for the src-Folder and one for the generated  jar of the bundle. Is this a correct behaviour ? I think before bndtools 3.0 in this case there was only one item (src) found.

Thanks

David Jencks

unread,
Sep 30, 2015, 1:14:41 PM9/30/15
to bndtool...@googlegroups.com
I’ve been meaning to ask about something similar.  The call stack (shift-command H on my mac) always produces 2 entries, source and jar.  Debugging usually lands me in the “jar” version rather than the “source” version of a file.  This has been going on for me with earlier bndtools.  I wondered if it was something special for me since I only work on bnd using bndtools.

thanks
david jencks

--
You received this message because you are subscribed to the Google Groups "bndtools-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

BJ Hargrave

unread,
Sep 30, 2015, 1:40:37 PM9/30/15
to bndtool...@googlegroups.com
The classpath container support was completely rewritten for bndtools 3.0 to much more closely map to the offline compile classpath. The best mapping we could figure out for eclipse can result in both the source folder (src) and the jar (generated/.jar) being on the eclipse classpath. We could have just put the jar (which is the best representation of the offline compile classpath), but wanted to also put the src there so F3 would take you to editable source code. 

This does result in two versions of the source when searching which can be a bit annoying. If someone is an Eclipse classpath container guru and can suggest improvements, I would really love to see them!

-- 

BJ



Neil Bartlett

unread,
Sep 30, 2015, 5:35:38 PM9/30/15
to bndtool...@googlegroups.com
BJ’s description of the cause of the issue is correct. I am currently experimenting with a fix, so I’m optimistic this will be better in 3.1.

Neil

Neil Bartlett

unread,
Oct 1, 2015, 6:45:54 AM10/1/15
to bndtool...@googlegroups.com
I have pushed a fix for this issue in master. Please give it a try.

The key to the solution is to stop Eclipse JDT from indexing the types in the generated JAR. The JDT indexer allows us to provide a pre-calculated index for each classpath entry, so we just supply a fixed, empty index. The source is still indexed normally, of course. This does not affect compilation but it removes the duplicates in the Open Types dialog and various other searches such as “find implementers” etc.

Neil

Reply all
Reply to author
Forward
0 new messages