Skip to content

Commit

Permalink
8311805: Clean up ScrollPane: drop redundant initialiser, mark scroll…
Browse files Browse the repository at this point in the history
…er final

Reviewed-by: azvegint, serb, prr
  • Loading branch information
aivanov-jdk committed Jul 11, 2023
1 parent 15195e6 commit aac903d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/java.desktop/share/classes/java/awt/ScrollPane.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -507,7 +507,6 @@ public void layout() {
Component c = getComponent(0);
Point p = getScrollPosition();
Dimension cs = calculateChildSize();
Dimension vs = getViewportSize();

c.reshape(- p.x, - p.y, cs.width, cs.height);
ScrollPanePeer peer = (ScrollPanePeer)this.peer;
Expand All @@ -518,7 +517,7 @@ public void layout() {
// update adjustables... the viewport size may have changed
// with the scrollbars coming or going so the viewport size
// is updated before the adjustables.
vs = getViewportSize();
Dimension vs = getViewportSize();
hAdjustable.setSpan(0, cs.width, vs.width);
vAdjustable.setSpan(0, cs.height, vs.height);
}
Expand Down Expand Up @@ -776,7 +775,7 @@ public void adjustmentValueChanged(AdjustmentEvent e) {
}
}

private ScrollPane scroller;
private final ScrollPane scroller;
}


Expand Down

0 comments on commit aac903d

Please sign in to comment.