| Summary: | [call hierarchy] doesn't recognize calls to method using varargs | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Raffi Khatchadourian <raffi.khatchadourian> |
| Component: | UI | Assignee: | JDT-UI-Inbox <jdt-ui-inbox> |
| Status: | RESOLVED WORKSFORME | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | amj87.iitr, daniel_megert, deepakazad, raffi.khatchadourian |
| Version: | 3.3.2 | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | Mac OS X - Carbon (unsup.) | ||
| Whiteboard: | |||
|
Description
Raffi Khatchadourian
Moving to JDT/UI. Sorry, I cannot reproduce this. Please provide a code snippet to reproduce the problem. > Sorry, I cannot reproduce this.
Same here using N20110113-2000.
(In reply to comment #2) > Sorry, I cannot reproduce this. Please provide a code snippet to reproduce the > problem. Sure. Here is the method with the varargs: //AJUtil.java public static void removeShadowsCorrespondingTo(Set<IJavaElement> addedShadowCol, JoinPointType... joinPointTypesToRemove) { //... } When I construct the call hierarchy for this method, I receive to callers. However, the following method calls this method: public void run(IAction action) { //... AJUtil.removeShadowsCorrespondingTo(addedShadowCol, JoinPointType.FIELD_SET); //... } Nope, it works for me with the following code
-------------------------------------------------------------------------------
package snippet;
import java.util.HashSet;
import java.util.Set;
public class Snippet {
public static void removeShadowsCorrespondingTo(Set<String> addedShadowCol,
int... joinPointTypesToRemove) {
}
public void run() {
Snippet.removeShadowsCorrespondingTo(new HashSet<String>(), new int[10]);
Snippet.removeShadowsCorrespondingTo(new HashSet<String>(), 1,2,3,4);
}
}
-------------------------------------------------------------------------------
Maybe you have another overloaded method? What happens when you select 'removeShadowsCorrespondingTo' here and press F3 (Open Declaration) ?
(In reply to comment #4)
> public void run(IAction action) {
> //...
> AJUtil.removeShadowsCorrespondingTo(addedShadowCol,
> JoinPointType.FIELD_SET);
> //...
> }
Funny enough, the F3 functionality works fine. In fact, when I build a call hierarchy on the client to show all outgoing method calls, again the removeShadows ... method doesn't show up. I just tried your snippet and it works. There must be some other problem. (In reply to comment #5) > Nope, it works for me with the following code > ------------------------------------------------------------------------------- > package snippet; > > import java.util.HashSet; > import java.util.Set; > > public class Snippet { > > public static void removeShadowsCorrespondingTo(Set<String> addedShadowCol, > int... joinPointTypesToRemove) { > } > > public void run() { > Snippet.removeShadowsCorrespondingTo(new HashSet<String>(), new > int[10]); > Snippet.removeShadowsCorrespondingTo(new HashSet<String>(), 1,2,3,4); > } > } > ------------------------------------------------------------------------------- > > Maybe you have another overloaded method? What happens when you select > 'removeShadowsCorrespondingTo' here and press F3 (Open Declaration) ? > > (In reply to comment #4) > > public void run(IAction action) { > > //... > > AJUtil.removeShadowsCorrespondingTo(addedShadowCol, > > JoinPointType.FIELD_SET); > > //... > > } (In reply to comment #6) > Funny enough, the F3 functionality works fine. In fact, when I build a call > hierarchy on the client to show all outgoing method calls, again the > removeShadows ... method doesn't show up. > > I just tried your snippet and it works. There must be some other problem. From the Call Hierarchy view menu double check the settings for 'Search In..', 'Search scope', 'Filters'. (In reply to comment #7) > (In reply to comment #6) > > Funny enough, the F3 functionality works fine. In fact, when I build a call > > hierarchy on the client to show all outgoing method calls, again the > > removeShadows ... method doesn't show up. > > > > I just tried your snippet and it works. There must be some other problem. > From the Call Hierarchy view menu double check the settings for 'Search In..', > 'Search scope', 'Filters'. Well, I feel idiotic now :). The search scope was only on project rather than workspace. Would it make sense to have the default set to workspace rather than project? (In reply to comment #8) > Well, I feel idiotic now :). The search scope was only on project rather than > workspace. Would it make sense to have the default set to workspace rather than > project? It happens :) Also the message at the top in the Call Hierarchy view is something like - "Members calling foo() - in workspace (no JRE)". This gives a clue about the current settings. |