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

Modernize and lint Dynalink code

    XMLWordPrintable

Details

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

    Description

      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…

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: