Rearranger messes up package and/or import statement

When I run the rearranger, it often strips off the ';' from the end of
the package statement or sometimes it just removes a blank line from
between the package and first import statements. Sometimes it removes
the 'i' at the beginning of the first import statement.

Note: This happens even if I cancel the operation after viewing the
confirmation dialog. Also, the live rearranger does not do this.

Tim

2 comments
Comment actions Permalink

Could you please send me your configuration (exporting it to a file and emailing it would be fine)? I assume there's nothing unique about the package or import statements so I can supply some source code. You say 'often strips' - is it reproducible, or intermittent?

I am guessing there is something in a global pattern or comment pattern that is removing the semicolon or newline.
-Dave

0
Comment actions Permalink

Dave Kriewall wrote:

Could you please send me your configuration (exporting it to a file and emailing it would be fine)? I assume there's nothing unique about the package or import statements so I can supply some source code. You say 'often strips' - is it reproducible, or intermittent?

I am guessing there is something in a global pattern or comment pattern that is removing the semicolon or newline.
-Dave


Dave,

I am using the default configuration.

I tried to create a simple class file test case and found an interesting
pattern: I have a project containing two modules, the first one is a
Java module the second one is a Web Module (WebLogic). If the test file
is in the Java module, it reformats fine. If it is in the Web Module,
it is messed up every time. The different symptoms happen with the same
files. One of them happens every time, but I can never tell which one
will happen.

Next I tried to set up a test project that would demonstrate the
problem. I created a new project with two Java modules, the second one
depends on the first.
I created a new class in a com.test package in the first module and
invoked the rearranger. It worked fine.
I moved the class to the second module and invoked the rearranger. It
worked fine.
I added a Web module, moved the class to that module, and removed the
second module. I then invoked the rearranger. It removed the ; on the
package statement line.

I moved the class back to the first module and invoked the rearranger.
It worked fine.

I copied the class from the first module to the web module giving each a
new name. Now, invoking the rearranger on either file does one of the
following: removes the ; or the blank line between the package and the
imports or removes a random character from the middle of a package
statement, every time.

Attached is the test project and associated files.

I hope that helps.

Tim



Attachment(s):
ReformatTest.zip
0

Please sign in to leave a comment.