[Rev 01] RFR: 8237372: NullPointerException in TabPaneSkin.stopDrag

Robert Lichtenberger rlichten at openjdk.java.net
Fri Jan 24 06:25:41 UTC 2020


On Wed, 22 Jan 2020 08:01:49 GMT, Ambarish Rapte <arapte at openjdk.org> wrote:

>> The pull request has been updated with 1 additional commit.
> 
> modules/javafx.controls/src/main/java/javafx/scene/control/skin/TabPaneSkin.java line 2216:
> 
>> 2215:         // Animate tab header being dragged to its final position.
>> 2216:         if (dragTabHeader != null) {
>> 2217:             dragHeaderSourceX = dragTabHeader.getLayoutX();
> 
> This is a situation when reorder was not started.
> So a check as `else if (dragState == DragState.REORDER)` seems more correct instead of `null` check. With this `else if` the `return;` on line 2213 can be removed.

You're right, this makes the method cleaner and easier to understand. I've adapted the PR.

-------------

PR: https://git.openjdk.java.net/jfx/pull/89


More information about the openjfx-dev mailing list