3 ms·
Just looking at the sample input, a lot of things are inarguably better removed: https://github.com/JnRouvignac/AutoRefactor/tree/master/samples/src/test/java/o
by lnanek2 11y ago
Just looking at the sample input, a lot of things are inarguably better removed:
https://github.com/JnRouvignac/AutoRefactor/tree/master/samples/src/test/java/org/autorefactor/refactoring/rules/samples_in https://github.com/JnRouvignac/AutoRefactor/tree/master/samp...
For example, replacing multiple catch blocks with multi-catch is definitely going to make source code shorter and clearer, easier to maintain, and less likely to develop bugs as people work on it. Especially since the catch blocks usually all do the same exact thing, they just had to be written out. Modern Java just allows you to catch multiple at once:
catch( Exception1|Exception2 e ) {
Instead of:
catch( Exception1 e) {
...
} catch ( Exception2 e) {
...
}
Where the ... is probably duplicate code in danger of falling out of sync.