Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Why is Eclipse not finding references in linked JARs (without sources attached)
Why is Eclipse not finding references in linked JARs (without sources attached) [message #1233859] Mon, 20 January 2014 17:22 Go to next message
Pavel Horal is currently offline Pavel HoralFriend
Messages: 2
Registered: January 2014
Junior Member
I've asked a question on SO today - stackoverflow.com/questions/21235807/eclipse-find-java-references-from-a-project-library . I worry that I might not get satisfactory answer there as it requires a bit deeper knowledge about JDT indexation and search functionality. So that is the reason I am here.

The question is pretty simple: Why doesn't JDT find type or method references in JAR files without attached source codes? Is that designed behavior or simply a missing feature?

Thank you... I will copy any acceptable answer from here to SO (or vice-versa).
Re: Why is Eclipse not finding references in linked JARs (without sources attached) [message #1234221 is a reply to message #1233859] Tue, 21 January 2014 13:44 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1853
Registered: July 2009
Senior Member
When JDT reads .class files, it only ever interprets the signatures inside, it doesn't look at compiled method bodies at all. So, anything that can be found by looking at signatures should be included in your search results, only binary method bodies are a black box for JDT.

I wasn't around when this was designed, but I assume performance was one factor in the design.

HTH,
Stephan

PS: There are other plugins out there that do handle compiled method bodies. I don't know if any of those provide search functionality, though.
Re: Why is Eclipse not finding references in linked JARs (without sources attached) [message #1234294 is a reply to message #1234221] Tue, 21 January 2014 16:24 Go to previous message
Pavel Horal is currently offline Pavel HoralFriend
Messages: 2
Registered: January 2014
Junior Member
Thank you for the answer.

I have to say, that I don't fully (maybe not even partialy) understand Eclipse/JDT codebase. But just out from curiosity I was going through the JDT search/index sources. What makes me a bit confused is a piece of code inside BinaryIndexer.java. Not sure whether I undestand context of that code, but it seems to me, that JDT contains code capable of indexing method references. Also if I check ".index" files (just with grep -r 'MyExoticClassName') I can see that there are indexed class names, which does not show when searching for references.

Where did I misinterpret information during my "quick dig into JDT code"? To me it seems that JDT must specifically exclude some search results.

[Updated on: Tue, 21 January 2014 16:28]

Report message to a moderator

Previous Topic:Newbie needs your help! [Android development basics]
Next Topic:What does Fragments in an ASTNode mean?
Goto Forum:
  


Current Time: Thu Apr 25 08:08:32 GMT 2024

Powered by FUDForum. Page generated in 0.03408 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top