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 toJDK-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
This is a follow-up to
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
- relates to
-
JDK-8375227 Silent OOBE in NGGroup::renderContent
-
- Resolved
-
- links to
-
Review(master)
openjdk/jfx/2043