--- a/jdk/src/share/classes/javax/swing/JViewport.java Tue Aug 26 12:16:23 2008 +0400
+++ b/jdk/src/share/classes/javax/swing/JViewport.java Tue Aug 26 15:12:54 2008 +0400
@@ -389,7 +389,7 @@
// could be bigger than invalid size.
validateView();
}
- int dx = 0, dy = 0;
+ int dx, dy;
dx = positionAdjustment(getWidth(), contentRect.width, contentRect.x);
dy = positionAdjustment(getHeight(), contentRect.height, contentRect.y);
@@ -682,10 +682,7 @@
* @see JComponent#isPaintingOrigin()
*/
boolean isPaintingOrigin() {
- if (scrollMode == BACKINGSTORE_SCROLL_MODE) {
- return true;
- }
- return false;
+ return scrollMode == BACKINGSTORE_SCROLL_MODE;
}
@@ -903,11 +900,7 @@
*/
public void setScrollMode(int mode) {
scrollMode = mode;
- if (mode == BACKINGSTORE_SCROLL_MODE) {
- backingStore = true;
- } else {
- backingStore = false;
- }
+ backingStore = mode == BACKINGSTORE_SCROLL_MODE;
}
/**
@@ -958,10 +951,10 @@
}
}
- private final boolean isBlitting() {
+ private boolean isBlitting() {
Component view = getView();
return (scrollMode == BLIT_SCROLL_MODE) &&
- (view instanceof JComponent) && ((JComponent)view).isOpaque();
+ (view instanceof JComponent) && view.isOpaque();
}
@@ -1380,8 +1373,7 @@
* @since 1.4
*/
public ChangeListener[] getChangeListeners() {
- return (ChangeListener[])listenerList.getListeners(
- ChangeListener.class);
+ return listenerList.getListeners(ChangeListener.class);
}
/**