Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8251538

Modernize and lint Dynalink code

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 16
    • None
    • core-libs
    • None
    • b14

      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…

            attila Attila Szegedi
            attila Attila Szegedi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: