Community
Participate
Working Groups
This might be seen as related to bug 108219 but has a slightly different focus: when creating a call hiearchy for a method in an anonymous class occurrences show up that can never be called. Consider the attached class CallHiearchyTest. If you look at the call hierarchies of flagged methods you'll see two entries (action12 and action12; test21 and test22) while in reality only one is actually able to invoke this method. Background: we use this pattern quite frequently for db actions where method action actually fetches a connection and automatically committs or rolls back depending on whether an exception occurs. Since there are a lot of these actions the call hiearchy of every single one of them is difficult to view because a lot of invocations are listed which never can happen. Note: during testing of this I found a bug which I'll file in a minute.
Created attachment 30217 [details] Test class to demonstrate the phenomenon