SlickEdit Product Discussion > SlickEdit®
push-tag in Java only finds public members in other files
RobFreundlich:
Suppose I have the following two Java files:
Foo.java
--- Code: ---public class Foo
{
public Foo()
{
}
public Foo(String abc)
{
}
protected Foo(int def)
{
}
}
--- End code ---
Bar.java
--- Code: ---public class Bar
{
public static void main(String[] args)
{
Foo foo = new Foo(3);
}
}
--- End code ---
If I put the cursor on the Foo(3) in Bar's main() method and execute the push-tag command, I get a popup that shows me three things:
1. constructor Foo()
2. constructor Foo(String abc)
3. class Foo
It does not show me "constructor Foo(int def)", which is the one I actually want to go to. I believe it's not showing it because it's protected instead of public.
Is there a way to have it show me protected (and even private or package) members?
jbezem:
Do you see those elements in your 'Defs' windows at the left?
Maybe if you cannot see them there, making them visible there will also change the 'push-tag' selection.
Right-click in the 'Defs' window, and in "Quick filers" choose 'all tags'.
HTH,
Johan
ScottW, VP of Dev:
Hi Rob,
I set up a project to test this problem, but I could not reproduce it. See the screen shot in the attachment. We don't have any settings that would filter out protected functions from that list.
In the Projects Tab, select the workspace, right-click, and select Retag Workspace. Are you still having the problem?
If so, what version are you using? What platform? Can you zip up your workspace and attach it so I can try to reproduce it?
--Scott
Dennis:
If I slightly modify your posted example, I can get the behavior you are seeing:
Foo.java
--- Code: ---package a.b.c;
public class Foo
{
  public Foo()
  {
  }
  public Foo(String abc)
  {
  }
  protected Foo(int def)
  {
  }
}
--- End code ---
Bar.java
--- Code: ---package x.y.z;
import a.b.c.Foo;
public class Bar {
  public static void main(String args[]) {
    Foo foo = new Foo(3);
  }
}
--- End code ---
However, since Foo and Bar are in different packages, the protected constructor is not visible (in fact, the code no longer compiles), so it is correct (and, in fact, intentional) that it is filtered out.
RobFreundlich:
The classes are definitely in packages (as opposed to the example I gave). The question I can't answer right now (I'm at home and the code is at work) is whether they are in the same package or different ones. It's possible that they're in different packages but that Bar is a subclass of Foo (which allows protected access in Java).
I'll take a look on Monday when I'm back in the office.
Navigation
[0] Message Index
[#] Next page
Go to full version