Rearranger bug report

The rearranger plugin is messing up classes which contain anonymous inner classes. Here's an simple example, all in one file named Tester.java:

public class Tester{
void test(){
X x = new X(){};
}
}
interface X{}

When I run rearranger on the above code the first bracket "{" gets deleted which of course put source into an invalid state. Depending on the starting whitespace in the file the messing up sometimes happens on the 2nd running of rearranger and sometimes a different character gets deleted.

Is this a bug or might I have something misconfigured. I am using version 3.5.

Thanks,

Brian

2 comments
Comment actions Permalink

More information and a fix: This problem seems to be happening because my Spacing configuration was inconsistent. I had checked both "Force 0 blank lines after class open brace" and "Force 1 blank line before method open brace".

So this is fixed for me now but I'd still consider this a bug because a misconfiguration shouldn't allow the running of rearranger to damage one's source code - the misconfiguration should somehow be caught in a friendlier manner.

Brian

0
Comment actions Permalink

Brian,

Thanks for the report! You're absolutely right.

I'll look into it. Glad you found a workaround, though.

-Dave

0

Please sign in to leave a comment.