The perfect situation, in my book, is the following: Any method MAY start with a parameter modification block. This block must not have any blank lines in the middle and end in a blank line. It consists only of parameter-modifying statements. A parameter modifying statement is either a one-liner if statement, or just a one- liner assignment, which modifies only a parameter. I've checked my various source files, and it boils down to that in 95% of the cases, and in the rest of the cases, I refactored the code. Which is somewhat annoying, but you have to draw a line somewhere, and it was sufficiently rare that it won't get in the way too much.
However, this only works if you also allow log statements to precede the block (because logging the original is sometimes more useful than logging the normalized version), but what's a log statement? Eh. All logging methods should have a @Logging annotation or some such (and System needs a log and logf method to whittle down on the ambiguous System.out usage. Is that logging, or legitimate output). Not just for this issue, but so many others where you really would prefer to exclude logging. Robert: You haven't proven anything to me either. Clearly we're both allowing our confirmation biases to shine through. On Feb 17, 3:28 am, Jeff Grigg <[email protected]> wrote: > I've found that FindBugs has an optional rule to suggest where 'final' > can be added to parameters and local variables. It's in the > "controversial" subset. (...along with a rule that suggests removing > 'final' when not needed -- IE: all the places the first rule suggested > adding it. So it's a tool with a multiple personality disorder. ;-) > > ----- Reinier Zwitserloot wrote: > > > [...] losing the protection of final, which is indeed a shame > > and I'd love some sort of keyword or style checker for it. > > I may write one sometime. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "The Java Posse" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/javaposse?hl=en -~----------~----~----~----~------~----~------~--~---
