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

Enhance code consistency: java.desktop/windows

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P5 P5
    • tbd
    • 25
    • client-libs
    • generic
    • windows

      The java.desktop/windows package currently lacks proper use of the @Override annotation for methods and the final modifier for classes. While similar changes were previously made in the JavaSound[1](and some of the classes on demand), these changes are not as critical now due to the new jdk "encapsulation", but they are still useful for improving code consistency.

      The @Override annotation can help catch bugs when parent methods are removed/moved/renamed and subclasses are not updated accordingly. Currently there are several unused methods in peers which have been left unnoticed, but could be identified during the build process if this annotation were in use.

      The final is useful as is, but it additionally helps automated code analyzers to remove the assumption that methods might be overridden somewhere.

      [1] JavaSound https://github.com/openjdk/jdk/commit/e0c7d59246cf36644d494eced76e4b9d96ff1ded#diff-ae3e5f9c40fe25ef03e7a89844de174ef5c15e6179d769e2a4bcb7e73688c9b5

            serb Sergey Bylokhov
            serb Sergey Bylokhov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: