Community
Participate
Working Groups
Build Identifier: 20100917-0705 I have a method that uses varargs in its parameter list and I have a client method that calls it. When I run the call hierarchy on the method with the varargs, it displays that no methods call it. Reproducible: Always Steps to Reproduce: 1. Create a method with varargs. 2. Create a client method that calls the method from (1). 3. Run the call hierarchy tool on the method from (2).
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.