Class NGGroup is in need of some cleanup

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P4
    • tbd
    • Affects Version/s: jfx25
    • Component/s: javafx
    • None

      The class com.sun.javafx.sg.prism.NGGroup has a few unnecessary checks, typos, and other types of small code issues that can be fixed.

      This is a follow-up to JDK-8375227

      Summary of changes:
      L46, L77: Remove unnecessary comments
      L58,59: Make fields viewOrderChildren and children final as they are not reassigned
      L228,L239,L321,L329: Remove null checks for result of getOrderedChildren(). This method will either return the fields viewOrderChildren or children, both of which are now final and always non-null
      L212: Removed unused method
      L408: Fix comment typo
      L259: Remove catch block for List::get() call. The original intention was too guard against concurred modifications, however, looking at the code, this is not needed.
      First of all, every other access to the same list does not guard against it, so even if there are concurrent modifications, this will only catch them rarely.
      If a user performs an operation on the wrong thread, something else outside of this method will break as well.
      L311: Remove unnecessary null check, the statement can only be reached if bot is not null to exit the loop before
      L325: Don't check for list sizes < 0

            Assignee:
            Christopher Schnick
            Reporter:
            Christopher Schnick
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: