Eclipse Clean Up

55 views
Skip to first unread message

SuperJugy

unread,
Jun 27, 2013, 4:25:32 PM6/27/13
to andro...@googlegroups.com
Hi. I was checking your code and I have to admit I'm obsessive about the code being formatted and all. I normally do this with Eclipse Clean Up which can do lots of things like: fixing indentation; removing unused imports, classes, methods, members and variables; adding the final keyword, etc.

So, since I forked your repo I wanted to know if you used any of this. If you do, I could use your configuration so any changes I do, already go with the correct formatting in a pull request. And if you don't, then I would recommend it XD. Thanks.

Nick

unread,
Jun 27, 2013, 9:41:06 PM6/27/13
to andro...@googlegroups.com
Hi SuperJugy,

I personally use IntelliJ which has an equivalent facility.  I'm totally fine with beatifying things like indentation and unused imports but I'd need to know more about how / where things like final get applied.  The same goes for unused methods; if you were let eclipse auto remove the unused methods it found it would break Configurator because It uses reflection to map xml config params to various setters/getters etc at runtime and it's not possible to detect those cases with static analysis.

I'm also leaning towards limiting beautification to files that are already being touched for some other bug or feature related reason, only because it makes it easier to code review what the formatter did.

Nick

SuperJugy

unread,
Jun 28, 2013, 10:27:07 AM6/28/13
to andro...@googlegroups.com
I agree it can complicate the review of changes. and the final keyword gets added to variables, parameters and such that do not get modified for example a setter:

void setEnabled(final boolean enabled)
{
  mEnabled = enabled;
}

as for unused methods, it only checks private methods or classes that are not used inside the class itself. I'm not sure if you can reach those methods throw Configurator, but i guessed Configurator would only reach public methods. Which shouldn't be a problem since only private things would be flagged as unused.

Any way, I won't beautify code then. Thanks.

Nick

unread,
Jun 28, 2013, 11:05:52 AM6/28/13
to andro...@googlegroups.com
Hi SuperJugy,

Your points and clarifications are well taken.  In light of the above reassurances I cannot think of any obvious reasons for concern.  Give me some time to try to come up with a formal definition of Androidplot's existing style conventions so we (both Eclipse and IntelliJ users) can all be on the same page.

Nick
Reply all
Reply to author
Forward
0 new messages