Do Eclipse's Refactoring Tools Violate The Java Language Specification?

Posted by Tom Tresansky on Stack Overflow See other posts from Stack Overflow or by Tom Tresansky
Published on 2010-06-16T17:22:34Z Indexed on 2010/06/16 17:32 UTC
Read the original article Hit count: 324

Filed under:
|

In Eclipse 3.5, say I have a package structure like this:

 tom.package1
 tom.package1.packageA
 tom.package1.packageB

if I right click on an the tom.package1 package and go to Refactor->Rename, an option "Rename subpackages" appears as a checkbox. If I select it, and then rename tom.package1 to tom.red my package structure ends up like this:

tom.red
tom.red.packageA
tom.red.packageB

Yet I hear that Java's packages are not hierarchical. The Java Tutorials back that up (see the section on Apparent Hierarchies of Packages). It certainly seems like Eclipse is treating packages as hierarchical in this case.

I was curious why access specifiers couldn't allow/restrict access to "sub-packages" in a previous question because I KNEW I had seen "sub-packages" referenced somewhere before.

So are Eclipse's refactoring tools intentionally misleading impressionable young minds by furthering the "sub-package" myth? Or am I misinterpreting something here?

© Stack Overflow or respective owner

Related posts about java

Related posts about eclipse