title: Eclipse - Find Java references of a library without attached sources
body: <h1>Environment</h1>
  
  <p>I have a simple <code>test-foo.jar</code> library with just two files:</p>
  
  <ul>
  <li>interface <code>Foo</code> with a single method <code>void doStuff()</code></li>
  <li>class <code>Bar</code> with a single method <code>void executeFoo(Foo foo)</code>, which just calls <code>foo.doStuff()</code></li>
  </ul>
  
  <p>Then I have Eclipse Java project with a single class <code>FooImpl</code> which implements <code>Foo</code>. This project has <code>test-foo.jar</code> as a build path entry. I don't have source codes for this JAR attached.</p>
  
  <p><img src="https://i.stack.imgur.com/2Coyn.png" alt="Eclipse project tree"></p>
  
  <h1>The Problem</h1>
  
  <p>Now lets say I am a bit curious about who actually calls <code>doStuff()</code> method. So I click on the <code>FooImpl#doStuff</code> signature and press <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>G</kbd> (find references). I expect to see <code>Bar#executeFoo</code> in the search results, but the results are actually empty.</p>
  
  <p><img src="https://i.stack.imgur.com/uU6PE.png" alt="Empty search results"></p>
  
  <h1>The Question</h1>
  
  <p>I am bit confused as I thought this works in Eclipse (been using Eclipse for more than a few years now). But it seems it only works for libraries with sources attached (which I didn't notice before).</p>
  
  <p><strong>Is there a way how to find references (or usage) of a type (or method) in project libraries without sources attached?</strong> Why does not Eclipse index and show references from <code>.class</code> files?</p>
  
  <hr>
  
  <p><strong>Additional info</strong>:</p>
  
  <ul>
  <li>Finding references works as soon as I attach source codes to the JAR.</li>
  <li>I am interested in knowing why Eclipse JDT developers decided to <em>not index</em> or <em>search</em> <code>.class</code> without sources.</li>
  <li>Note, that knowing <em>who is calling</em> my method is very useful information even if I don't have source codes.</li>
  <li>Seems to me that Eclipse <a href="http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/tree/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/BinaryIndexer.java#n602" rel="nofollow noreferrer">is indexing method references</a> in <code>.class</code> files.</li>
  <li>And by the way NetBeans "don't work" as well ;).</li>
  </ul>