tools subproject: Minor code cleanup (IDE suggestions) for JDK7, JDK8
All changes are logically equivalent to old code.
- Use lambdas in a few places
- <>
- Combine catches
- etc.
I generally agree with these Java7→8 migrations. However I would much prefer to bundle separate commits per IDE suggestion. So e.g. if the suggestion is to use the multi-catch, refactor all such occurrences (entire framework, where allowed) and then put that into one commit with nothing else.
I would much prefer to bundle separate commits per IDE suggestion. So e.g. if the suggestion is to use the multi-catch, refactor all such occurrences (entire framework, where allowed) and then put that into one commit with nothing else.
That would turn this PR into 8 separate PRs and for some of those 8, it might require me to go through all of the other modules to look for possible additional instances of the same refactorings. (obviously no lambdas in core, etc.) That significantly increases the amount of effort to contribute. In this case the work started as I was reviewing BlockImporter and WatchMemPool to see if they could be used for an application I was considering. I started fixing recommendations from the IDE as I saw them and decided to implement most of those changes across the entire tools subproject (since it had recently been updated to JDK 8.)
I understand your preference and it certainly makes sense and will try my best to comply with it in the future. What would you like me to do for this specific PR to help get it merged?
See #2043. In IntelliJ's inspection tool, it's just one click per type of refactoring. Though I admit I review all the changes and correct some formatting issues here and there, so yes you're right it's more work.
separate commits per IDE suggestion.
I had misunderstood this as one PR per IDE suggestion.
See #2043.
Approved. When you merge PR #2043 to master, I'll rebase this PR and we'll see what's left.
In IntelliJ's inspection tool, it's just one click per type of refactoring.
I use IntelliJ, but I didn't know you could do that. Cool!
I've just rebased this and I think the only change that's left is the switch migration.
I've just rebased this and I think the only change that's left is the switch migration.
I rebased and force pushed. Yes only the switch migration is left, so I renamed the PR as well.
Merged.