I'll take a look on Monday when I'm back in the office.
I've explored this further. Here's what I've found (see the attached zipfile). Assume Foo as follows:
package a.b.c;
public class Foo
{
public Foo()
{
}
public Foo(String abc)
{
}
protected Foo(int def)
{
}
}
In the following table, SubFoo* refers to a subclass of Foo.
class | new Foo(3) legal Java? | push-tag shows protected constructor? | push-tag on super(3) shows protected constructor? |
a.b.c.Bar | Yes | No | N/A |
a.b.c.SubFooSamePackage | Yes | Yes | Yes |
x.y.z.SubFooDifferentPackage | No | Yes | Yes |
When Foo isn't in a package, and Bar isn't in a package (see my original example), then push-tag works properly.
So the problem seems to be that for protected members of packaged classes, push-tag cares only about whether the current class is a subclass of the member's class - it is broken for classes that are in the same package but are
not subclasses of the member's class.
I suspect the root of this lies in the difference between the meaning of "protected" in C++ and Java. In C++, there's no "package" concept, and so protecteds are only visible to subclasses. However, in Java, protecteds are visible to subclasses
and anyone in the same class.
I've found that developers who started in C++ and migrated to Java tend to be unaware of the difference (it makes a great interview question
. Given SlickEdit's strong C++ focus, I can see why push-tag might work this way (assuming I'm right, of course).