Class NGGroup is in need of some cleanup

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • jfx27
    • Affects Version/s: jfx25
    • Component/s: javafx
    • None
    • b02

      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
      L49: Remove unused field
      L273,L316: Remove unreachable code due to blendMode field not being set anywhere
      L408: Fix comment typo
      L259: Remove catch block for List::get() call. The original intention was too guard against concurrent 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.
      L325: Don't check for list sizes < 0

      The resulting code should be equivalent to the original, assuming that the catch block for concurrent modifications is not reached (it shouldn't under normal usage)

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

              Created:
              Updated:
              Resolved: