Ignore:
Timestamp:
2017-04-17T19:36:55+02:00 (7 years ago)
Author:
Don-vip
Message:

findbugs - BC_UNCONFIRMED_CAST_OF_RETURN_VALUE

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/widgets/MultiSplitLayout.java

    r11936 r11948  
    655655                while (splitChildren.hasNext()) {
    656656                    Node splitChild = splitChildren.next();
    657                     Divider dividerChild =
    658                         splitChildren.hasNext() ? (Divider) splitChildren.next() : null;
    659 
    660                         double childHeight;
    661                         if (getFloatingDividers()) {
    662                             childHeight = preferredNodeSize(splitChild).getHeight();
     657                    Node nodeChild = splitChildren.hasNext() ? splitChildren.next() : null;
     658                    Divider dividerChild = nodeChild instanceof Divider ? (Divider) nodeChild : null;
     659                    double childHeight;
     660                    if (getFloatingDividers()) {
     661                        childHeight = preferredNodeSize(splitChild).getHeight();
     662                    } else {
     663                        if (dividerChild != null) {
     664                            childHeight = dividerChild.getBounds().getY() - y;
    663665                        } else {
    664                             if (dividerChild != null) {
    665                                 childHeight = dividerChild.getBounds().getY() - y;
    666                             } else {
    667                                 childHeight = split.getBounds().getMaxY() - y;
    668                             }
     666                            childHeight = split.getBounds().getMaxY() - y;
    669667                        }
    670                         childBounds = boundsWithYandHeight(bounds, y, childHeight);
    671                         layout1(splitChild, childBounds);
    672 
    673                         if (getFloatingDividers() && (dividerChild != null)) {
    674                             double dividerY = childBounds.getMaxY();
    675                             Rectangle dividerBounds = boundsWithYandHeight(bounds, dividerY, dividerSize);
    676                             dividerChild.setBounds(dividerBounds);
    677                         }
    678                         if (dividerChild != null) {
    679                             y = dividerChild.getBounds().getMaxY();
    680                         }
     668                    }
     669                    childBounds = boundsWithYandHeight(bounds, y, childHeight);
     670                    layout1(splitChild, childBounds);
     671
     672                    if (getFloatingDividers() && (dividerChild != null)) {
     673                        double dividerY = childBounds.getMaxY();
     674                        Rectangle dividerBounds = boundsWithYandHeight(bounds, dividerY, dividerSize);
     675                        dividerChild.setBounds(dividerBounds);
     676                    }
     677                    if (dividerChild != null) {
     678                        y = dividerChild.getBounds().getMaxY();
     679                    }
    681680                }
    682681            }
Note: See TracChangeset for help on using the changeset viewer.