You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One could argue that unlike for public classes, there is no JLS need that A2, after the change, is in the file A2.java. However in practice, this is what users pretty much always want, given that the rename of the filename only happens if (and only if) the A1 was in the file A1.java to begin with.
For the theoretical case that they don't want the file rename , one could argue to introduce it as a boolean configuration property renameFileOfNonPublicClassWithSameName but I think that's overkill (YAGTNI), so I 'd leave that out until someone asks for it. (And I would predict no one will ever ask for it.)
Given
File:
src/main/java/a/A1.java
Content:
with a ChangeType from
a.A1
toa.A2
, it will result in:File:
src/main/java/a/A1.java
Content:
The resulting content is fine, but the filename should have renamed to
A2.java
too.Even despite the fact that
class A1
isn't public, because the filenameA1.java
matched the original classnameA1
.The text was updated successfully, but these errors were encountered: