Dynalink has been coded mostly to Java 7 standards, and the code could be improved with some modern Java constructs, such as:
- lambdas and method references, mostly for PrivlegedAction but also few other places
- diamonds. Yes, they have not been used before.
- use of j.l.reflect.Executable instead of AccessibleObject (as Executable didn't exist in Java 8)
- Modern stuff like Collection.removeIf instead of for loops with Iterators and Iterator.remove, or List.sort instead of Collections.sort.
Aside from those, there's some code that could use linting, such as:
unused imports, unused code, extra semicolons, static fields that should be final but aren't, boolean expressions that could be simplified, for loops that could be enhanced ones, explicit int boxing/unboxing that could be eliminated, never used method parameters…
- lambdas and method references, mostly for PrivlegedAction but also few other places
- diamonds. Yes, they have not been used before.
- use of j.l.reflect.Executable instead of AccessibleObject (as Executable didn't exist in Java 8)
- Modern stuff like Collection.removeIf instead of for loops with Iterators and Iterator.remove, or List.sort instead of Collections.sort.
Aside from those, there's some code that could use linting, such as:
unused imports, unused code, extra semicolons, static fields that should be final but aren't, boolean expressions that could be simplified, for loops that could be enhanced ones, explicit int boxing/unboxing that could be eliminated, never used method parameters…