Summary: | Call Trees do not handle anonymous inner-classes correctly | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Simon Archer <sja.eclipse> |
Component: | Core | Assignee: | Jerome Lanneluc <jerome_lanneluc> |
Status: | RESOLVED WORKSFORME | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | CC: | nikolaymetchev |
Version: | 3.0 | ||
Target Milestone: | 3.0 M5 | ||
Hardware: | PC | ||
OS: | All | ||
Whiteboard: |
Description
Simon Archer
2003-06-18 18:56:52 EDT
Refactoring the code to use a nested inner-class, rather than an anonymous inner-class causes things to work much better: public class Foo { private final class MyRunnable implements Runnable { public void run() { Foo.this.process(); } } public void bar() { Runnable runnable = new MyRunnable() { Thread thread = new Thread(runnable); thread.start(); } private void process() { System.out.println("Processing..."); } } Creating a Call Tree for the process() methods yields the following "Caller Hierarchy": ^process() - tree.Foo ^run() - tree.Foo.MyRunnable JDT/Core currently has no representation of elements inside methods (e.g. anonymous types, local variables). We are planning to impove this for the 3.0 release. *** This bug has been marked as a duplicate of 8613 *** Reopening as even after adding contructs for local types, the problem is still there. Verified this now works with I20031029. |