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

Modernize and lint Dynalink code

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 16
    • Component/s: core-libs
    • Labels:
      None
    • Resolved In Build:
      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

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

              Dates

              Created:
              Updated:
              Resolved: