Rearranger: incorrect rearrangement?

I want to rearrange this simple class:

with the attached settings and I get

instead of the expected



Attachment(s):
rearranger.xml
0
8 comments
Avatar
Permanently deleted user

The problem is that your rule #14 ("All methods") is being matched before rule #20 ("private methods") so both paintGearLevel() and paint() match that rule. You need to set the priority of rules like #20 higher than that of #14, so that private methods will indeed match the more specific rule.

I suggest you set priority of rules 15, 17, 18 and 20 to 2. Leave rule #14 at priority 1.

-Dave

0
Avatar
Permanently deleted user

Thanks. But how do I change the priority?

Tom

0
Avatar
Permanently deleted user

There are three columns on the Class Member Order pane: sequence number, priority, and rule description. Click on the priority (it will be a "1" for all rules by default, except "n/a" for comment rules). It's just a text field that accepts integers greater than zero.

You can also sort the table by priority (or sequence number) by clicking on the corresponding table column header.

-Dave

0
Avatar
Permanently deleted user

The problem is that your rule #14 ("All methods") is being matched before rule #20 ("private methods")


Hmm, rule #14 is "implemented methods", but a private method never can
be an implementation method. Or don't I understand "implemented methods"
correct?

Tom

0
Avatar
Permanently deleted user

BTW, I had the same problems with a public method, which does not
implements an abstract method (no IDEA gutter icon at all), and also is
caught by the "implementing methods" rule.

Tom

0
Avatar
Permanently deleted user

Tom,

Sorry, I must have used an old version of the plugin to load and inspect your configuration file. Rule 14 is indeed "Implementing methods," not "public methods" as the earlier version of the plugin showed me. So ignore what I said. It's a real bug, I'm able to reproduce it, and I'll get to work on it.

-Dave

0
Avatar
Permanently deleted user

Tom,

please give version 3.5 a try. I corrected a rule matching bug for implemented/ing methods.

-Dave

0
Avatar
Permanently deleted user

Thanks, works fine now :)

Tom

0

Please sign in to leave a comment.