Mercurial > hg > release > icedtea6-1.6
view patches/security/icedtea-6657026.patch @ 1693:15ba41d0ff2e
Add remaining security patches.
2009-11-09 Andrew John Hughes <ahughes@redhat.com>
* Makefile.am:
Add remaining security patches.
* NEWS: Updated with security patches.
* patches/security/icedtea-6631533.patch,
* patches/security/icedtea-6632445.patch,
* patches/security/icedtea-6636650.patch,
* patches/security/icedtea-6657026.patch,
* patches/security/icedtea-6657138.patch,
* patches/security/icedtea-6664512.patch,
* patches/security/icedtea-6822057.patch,
* patches/security/icedtea-6824265.patch,
* patches/security/icedtea-6861062.patch,
* patches/security/icedtea-6872358.patch:
New security patches.
author | Andrew John Hughes <ahughes@redhat.com> |
---|---|
date | Mon, 09 Nov 2009 17:42:27 +0000 |
parents | |
children |
line wrap: on
line source
--- old/src/share/classes/javax/swing/ToolTipManager.java 2009-08-11 12:05:32.501050200 +0400 +++ openjdk/jdk/src/share/classes/javax/swing/ToolTipManager.java 2009-08-11 12:05:31.670050200 +0400 @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. 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 @@ -27,10 +27,7 @@ package javax.swing; import java.awt.event.*; -import java.applet.*; import java.awt.*; -import java.io.Serializable; -import sun.swing.UIAction; /** * Manages all the <code>ToolTips</code> in the system. @@ -60,7 +57,7 @@ JComponent insideComponent; MouseEvent mouseEvent; boolean showImmediately; - final static ToolTipManager sharedInstance = new ToolTipManager(); + private static final Object TOOL_TIP_MANAGER_KEY = new Object(); transient Popup tipWindow; /** The Window tip is being displayed in. This will be non-null if * the Window tip is in differs from that of insideComponent's Window. @@ -345,7 +342,13 @@ * @return a shared <code>ToolTipManager</code> object */ public static ToolTipManager sharedInstance() { - return sharedInstance; + Object value = SwingUtilities.appContextGet(TOOL_TIP_MANAGER_KEY); + if (value instanceof ToolTipManager) { + return (ToolTipManager) value; + } + ToolTipManager manager = new ToolTipManager(); + SwingUtilities.appContextPut(TOOL_TIP_MANAGER_KEY, manager); + return manager; } // add keylistener here to trigger tip for access --- old/src/share/classes/javax/swing/UIManager.java 2009-08-11 12:05:43.423050200 +0400 +++ openjdk/jdk/src/share/classes/javax/swing/UIManager.java 2009-08-11 12:05:42.671050200 +0400 @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. 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 @@ -194,6 +194,8 @@ Vector auxLookAndFeels = null; SwingPropertyChangeSupport changeSupport; + LookAndFeelInfo[] installedLAFs; + UIDefaults getLookAndFeelDefaults() { return tables[0]; } void setLookAndFeelDefaults(UIDefaults x) { tables[0] = x; } @@ -224,18 +226,6 @@ */ private static final Object classLock = new Object(); - - /* Cache the last referenced LAFState to improve performance - * when accessing it. The cache is based on last thread rather - * than last AppContext because of the cost of looking up the - * AppContext each time. Since most Swing UI work is on the - * EventDispatchThread, this hits often enough to justify the - * overhead. (4193032) - */ - private static Thread currentLAFStateThread = null; - private static LAFState currentLAFState = null; - - /** * Return the <code>LAFState</code> object, lazily create one if necessary. * All access to the <code>LAFState</code> fields is done via this method, @@ -245,13 +235,6 @@ * </pre> */ private static LAFState getLAFState() { - // First check whether we're running on the same thread as - // the last request. - Thread thisThread = Thread.currentThread(); - if (thisThread == currentLAFStateThread) { - return currentLAFState; - } - LAFState rv = (LAFState)SwingUtilities.appContextGet( SwingUtilities2.LAF_STATE_KEY); if (rv == null) { @@ -265,10 +248,6 @@ } } } - - currentLAFStateThread = thisThread; - currentLAFState = rv; - return rv; } @@ -427,7 +406,10 @@ */ public static LookAndFeelInfo[] getInstalledLookAndFeels() { maybeInitialize(); - LookAndFeelInfo[] ilafs = installedLAFs; + LookAndFeelInfo[] ilafs = getLAFState().installedLAFs; + if (ilafs == null) { + ilafs = installedLAFs; + } LookAndFeelInfo[] rv = new LookAndFeelInfo[ilafs.length]; System.arraycopy(ilafs, 0, rv, 0, ilafs.length); return rv; @@ -449,9 +431,10 @@ public static void setInstalledLookAndFeels(LookAndFeelInfo[] infos) throws SecurityException { + maybeInitialize(); LookAndFeelInfo[] newInfos = new LookAndFeelInfo[infos.length]; System.arraycopy(infos, 0, newInfos, 0, infos.length); - installedLAFs = newInfos; + getLAFState().installedLAFs = newInfos; } @@ -1304,10 +1287,11 @@ } } - installedLAFs = new LookAndFeelInfo[ilafs.size()]; + LookAndFeelInfo[] installedLAFs = new LookAndFeelInfo[ilafs.size()]; for(int i = 0; i < ilafs.size(); i++) { installedLAFs[i] = (LookAndFeelInfo)(ilafs.elementAt(i)); } + getLAFState().installedLAFs = installedLAFs; } - --- old/src/share/classes/javax/swing/plaf/metal/MetalBorders.java 2009-08-11 12:05:53.917050200 +0400 +++ openjdk/jdk/src/share/classes/javax/swing/plaf/metal/MetalBorders.java 2009-08-11 12:05:53.184050200 +0400 @@ -1,5 +1,5 @@ /* - * Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-2009 Sun Microsystems, Inc. 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 @@ -33,14 +33,11 @@ import java.awt.Component; import java.awt.Insets; -import java.awt.Dimension; -import java.awt.Rectangle; import java.awt.Color; import java.awt.Dialog; import java.awt.Frame; import java.awt.Graphics; import java.awt.Window; -import java.io.Serializable; import sun.swing.StringUIClientPropertyKey; @@ -62,8 +59,6 @@ public static class Flush3DBorder extends AbstractBorder implements UIResource{ - private static final Insets insets = new Insets(2, 2, 2, 2); - public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) { if (c.isEnabled()) { @@ -73,13 +68,13 @@ } } public Insets getBorderInsets(Component c) { - return insets; + return new Insets(2, 2, 2, 2); } public Insets getBorderInsets(Component c, Insets newInsets) { - newInsets.top = insets.top; - newInsets.left = insets.left; - newInsets.bottom = insets.bottom; - newInsets.right = insets.right; + newInsets.top = 2; + newInsets.left = 2; + newInsets.bottom = 2; + newInsets.right = 2; return newInsets; } } @@ -190,21 +185,19 @@ } public Insets getBorderInsets( Component c ) { - return borderInsets; + return new Insets(3, 3, 3, 3); } public Insets getBorderInsets(Component c, Insets newInsets) { - newInsets.top = borderInsets.top; - newInsets.left = borderInsets.left; - newInsets.bottom = borderInsets.bottom; - newInsets.right = borderInsets.right; + newInsets.top = 3; + newInsets.left = 3; + newInsets.bottom = 3; + newInsets.right = 3; return newInsets; } } public static class InternalFrameBorder extends AbstractBorder implements UIResource { - private static final Insets insets = new Insets(5, 5, 5, 5); - private static final int corner = 14; public void paintBorder(Component c, Graphics g, int x, int y, @@ -256,13 +249,13 @@ } public Insets getBorderInsets(Component c) { - return insets; + return new Insets(5, 5, 5, 5); } public Insets getBorderInsets(Component c, Insets newInsets) { - newInsets.top = insets.top; - newInsets.left = insets.left; - newInsets.bottom = insets.bottom; - newInsets.right = insets.right; + newInsets.top = 5; + newInsets.left = 5; + newInsets.bottom = 5; + newInsets.right = 5; return newInsets; } } @@ -273,8 +266,6 @@ */ static class FrameBorder extends AbstractBorder implements UIResource { - private static final Insets insets = new Insets(5, 5, 5, 5); - private static final int corner = 14; public void paintBorder(Component c, Graphics g, int x, int y, @@ -326,15 +317,15 @@ } public Insets getBorderInsets(Component c) { - return insets; + return new Insets(5, 5, 5, 5); } public Insets getBorderInsets(Component c, Insets newInsets) { - newInsets.top = insets.top; - newInsets.left = insets.left; - newInsets.bottom = insets.bottom; - newInsets.right = insets.right; + newInsets.top = 5; + newInsets.left = 5; + newInsets.bottom = 5; + newInsets.right = 5; return newInsets; } } @@ -345,7 +336,6 @@ */ static class DialogBorder extends AbstractBorder implements UIResource { - private static final Insets insets = new Insets(5, 5, 5, 5); private static final int corner = 14; protected Color getActiveBackground() @@ -427,15 +417,15 @@ } public Insets getBorderInsets(Component c) { - return insets; + return new Insets(5, 5, 5, 5); } public Insets getBorderInsets(Component c, Insets newInsets) { - newInsets.top = insets.top; - newInsets.left = insets.left; - newInsets.bottom = insets.bottom; - newInsets.right = insets.right; + newInsets.top = 5; + newInsets.left = 5; + newInsets.bottom = 5; + newInsets.right = 5; return newInsets; } } @@ -482,7 +472,6 @@ * @since 1.3 */ public static class PaletteBorder extends AbstractBorder implements UIResource { - private static final Insets insets = new Insets(1, 1, 1, 1); int titleHeight = 0; public void paintBorder( Component c, Graphics g, int x, int y, int w, int h ) { @@ -499,20 +488,19 @@ } public Insets getBorderInsets(Component c) { - return insets; + return new Insets(1, 1, 1, 1); } public Insets getBorderInsets(Component c, Insets newInsets) { - newInsets.top = insets.top; - newInsets.left = insets.left; - newInsets.bottom = insets.bottom; - newInsets.right = insets.right; + newInsets.top = 1; + newInsets.left = 1; + newInsets.bottom = 1; + newInsets.right = 1; return newInsets; } } public static class OptionDialogBorder extends AbstractBorder implements UIResource { - private static final Insets insets = new Insets(3, 3, 3, 3); int titleHeight = 0; public void paintBorder( Component c, Graphics g, int x, int y, int w, int h ) { @@ -568,14 +556,14 @@ } public Insets getBorderInsets(Component c) { - return insets; + return new Insets(3, 3, 3, 3); } public Insets getBorderInsets(Component c, Insets newInsets) { - newInsets.top = insets.top; - newInsets.left = insets.left; - newInsets.bottom = insets.bottom; - newInsets.right = insets.right; + newInsets.top = 3; + newInsets.left = 3; + newInsets.bottom = 3; + newInsets.right = 3; return newInsets; } } @@ -615,10 +603,10 @@ newInsets.set(0, 0, 2, 0); } else { - newInsets.top = borderInsets.top; - newInsets.left = borderInsets.left; - newInsets.bottom = borderInsets.bottom; - newInsets.right = borderInsets.right; + newInsets.top = 1; + newInsets.left = 0; + newInsets.bottom = 1; + newInsets.right = 0; } return newInsets; } @@ -663,14 +651,14 @@ } public Insets getBorderInsets( Component c ) { - return borderInsets; + return new Insets(2, 2, 2, 2); } public Insets getBorderInsets(Component c, Insets newInsets) { - newInsets.top = borderInsets.top; - newInsets.left = borderInsets.left; - newInsets.bottom = borderInsets.bottom; - newInsets.right = borderInsets.right; + newInsets.top = 2; + newInsets.left = 2; + newInsets.bottom = 2; + newInsets.right = 2; return newInsets; } } @@ -694,14 +682,14 @@ } public Insets getBorderInsets( Component c ) { - return borderInsets; + return new Insets(3, 1, 2, 1); } public Insets getBorderInsets(Component c, Insets newInsets) { - newInsets.top = borderInsets.top; - newInsets.left = borderInsets.left; - newInsets.bottom = borderInsets.bottom; - newInsets.right = borderInsets.right; + newInsets.top = 3; + newInsets.left = 1; + newInsets.bottom = 2; + newInsets.right = 1; return newInsets; } } @@ -911,8 +899,6 @@ public static class ScrollPaneBorder extends AbstractBorder implements UIResource { - private static final Insets insets = new Insets(1, 1, 2, 2); - public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) { @@ -946,7 +932,7 @@ } public Insets getBorderInsets(Component c) { - return insets; + return new Insets(1, 1, 2, 2); } } --- old/src/share/classes/javax/swing/plaf/metal/MetalBumps.java 2009-08-11 12:06:04.423050200 +0400 +++ openjdk/jdk/src/share/classes/javax/swing/plaf/metal/MetalBumps.java 2009-08-11 12:06:03.678050200 +0400 @@ -1,5 +1,5 @@ /* - * Copyright 1998-2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-2009 Sun Microsystems, Inc. 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 @@ -25,11 +25,22 @@ package javax.swing.plaf.metal; -import java.awt.*; -import java.awt.image.*; -import javax.swing.*; -import java.io.*; -import java.util.*; +import sun.awt.AppContext; + +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.GraphicsConfiguration; +import java.awt.Image; +import java.awt.Transparency; +import java.awt.image.BufferedImage; +import java.awt.image.DataBuffer; +import java.awt.image.IndexColorModel; +import java.util.ArrayList; +import java.util.List; +import javax.swing.Icon; /** * Implements the bumps used throughout the Metal Look and Feel. @@ -49,19 +60,9 @@ protected Color shadowColor; protected Color backColor; - protected static Vector buffers = new Vector(); + private static final Object METAL_BUMPS = new Object(); protected BumpBuffer buffer; - public MetalBumps( Dimension bumpArea ) { - this( bumpArea.width, bumpArea.height ); - } - - public MetalBumps( int width, int height ) { - this(width, height, MetalLookAndFeel.getPrimaryControlHighlight(), - MetalLookAndFeel.getPrimaryControlDarkShadow(), - MetalLookAndFeel.getPrimaryControlShadow()); - } - /** * Creates MetalBumps of the specified size with the specified colors. * If <code>newBackColor</code> is null, the background will be @@ -73,29 +74,22 @@ setBumpColors( newTopColor, newShadowColor, newBackColor ); } - private BumpBuffer getBuffer(GraphicsConfiguration gc, Color aTopColor, - Color aShadowColor, Color aBackColor) { - if (buffer != null && buffer.hasSameConfiguration( - gc, aTopColor, aShadowColor, aBackColor)) { - return buffer; - } - BumpBuffer result = null; - - Enumeration elements = buffers.elements(); - - while ( elements.hasMoreElements() ) { - BumpBuffer aBuffer = (BumpBuffer)elements.nextElement(); - if ( aBuffer.hasSameConfiguration(gc, aTopColor, aShadowColor, - aBackColor)) { - result = aBuffer; - break; + private static BumpBuffer createBuffer(GraphicsConfiguration gc, + Color topColor, Color shadowColor, Color backColor) { + AppContext context = AppContext.getAppContext(); + List<BumpBuffer> buffers = (List<BumpBuffer>) context.get(METAL_BUMPS); + if (buffers == null) { + buffers = new ArrayList<BumpBuffer>(); + context.put(METAL_BUMPS, buffers); + } + for (BumpBuffer buffer : buffers) { + if (buffer.hasSameConfiguration(gc, topColor, shadowColor, backColor)) { + return buffer; } } - if (result == null) { - result = new BumpBuffer(gc, topColor, shadowColor, backColor); - buffers.addElement(result); - } - return result; + BumpBuffer buffer = new BumpBuffer(gc, topColor, shadowColor, backColor); + buffers.add(buffer); + return buffer; } public void setBumpArea( Dimension bumpArea ) { @@ -123,10 +117,12 @@ (GraphicsConfiguration)((Graphics2D)g). getDeviceConfiguration() : null; - buffer = getBuffer(gc, topColor, shadowColor, backColor); + if ((buffer == null) || !buffer.hasSameConfiguration(gc, topColor, shadowColor, backColor)) { + buffer = createBuffer(gc, topColor, shadowColor, backColor); + } - int bufferWidth = buffer.getImageSize().width; - int bufferHeight = buffer.getImageSize().height; + int bufferWidth = BumpBuffer.IMAGE_SIZE; + int bufferHeight = BumpBuffer.IMAGE_SIZE; int iconWidth = getIconWidth(); int iconHeight = getIconHeight(); int x2 = x + iconWidth; @@ -159,7 +155,6 @@ class BumpBuffer { static final int IMAGE_SIZE = 64; - static Dimension imageSize = new Dimension( IMAGE_SIZE, IMAGE_SIZE ); transient Image image; Color topColor; @@ -201,10 +196,6 @@ return image; } - public Dimension getImageSize() { - return imageSize; - } - /** * Paints the bumps into the current image. */ --- old/src/share/classes/javax/swing/plaf/metal/MetalInternalFrameUI.java 2009-08-11 12:06:14.763050200 +0400 +++ openjdk/jdk/src/share/classes/javax/swing/plaf/metal/MetalInternalFrameUI.java 2009-08-11 12:06:14.053050200 +0400 @@ -1,5 +1,5 @@ /* - * Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-2009 Sun Microsystems, Inc. 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 @@ -31,10 +31,8 @@ import javax.swing.event.*; import javax.swing.border.*; import javax.swing.plaf.basic.*; -import java.util.EventListener; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; -import java.beans.PropertyVetoException; import javax.swing.plaf.*; /** @@ -51,7 +49,7 @@ private static final Border handyEmptyBorder = new EmptyBorder(0,0,0,0); protected static String IS_PALETTE = "JInternalFrame.isPalette"; - + private static String IS_PALETTE_KEY = "JInternalFrame.isPalette"; private static String FRAME_TYPE = "JInternalFrame.frameType"; private static String NORMAL_FRAME = "normal"; private static String PALETTE_FRAME = "palette"; @@ -68,7 +66,7 @@ public void installUI(JComponent c) { super.installUI(c); - Object paletteProp = c.getClientProperty( IS_PALETTE ); + Object paletteProp = c.getClientProperty(IS_PALETTE_KEY); if ( paletteProp != null ) { setPalette( ((Boolean)paletteProp).booleanValue() ); } @@ -187,7 +185,7 @@ ui.setFrameType( (String) e.getNewValue() ); } } - else if ( name.equals( IS_PALETTE ) ) + else if ( name.equals(IS_PALETTE_KEY) ) { if ( e.getNewValue() != null ) { --- old/src/share/classes/javax/swing/plaf/metal/MetalSliderUI.java 2009-08-11 12:06:25.043050200 +0400 +++ openjdk/jdk/src/share/classes/javax/swing/plaf/metal/MetalSliderUI.java 2009-08-11 12:06:24.344050200 +0400 @@ -1,5 +1,5 @@ /* - * Copyright 1998-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-2009 Sun Microsystems, Inc. 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 @@ -27,23 +27,12 @@ import javax.swing.plaf.basic.BasicSliderUI; -import java.awt.Component; -import java.awt.Container; import java.awt.Graphics; import java.awt.Dimension; import java.awt.Rectangle; -import java.awt.Point; -import java.awt.Insets; import java.awt.Color; -import java.io.Serializable; -import java.awt.IllegalComponentStateException; -import java.awt.Polygon; import java.beans.*; - -import javax.swing.border.AbstractBorder; - import javax.swing.*; -import javax.swing.event.*; import javax.swing.plaf.*; /** @@ -64,12 +53,13 @@ protected final int TICK_BUFFER = 4; protected boolean filledSlider = false; - // NOTE: these next three variables are currently unused. + // NOTE: these next five variables are currently unused. protected static Color thumbColor; protected static Color highlightColor; protected static Color darkShadowColor; protected static int trackWidth; protected static int tickLength; + private int safeLength; /** * A default horizontal thumb <code>Icon</code>. This field might not be @@ -117,7 +107,7 @@ public void installUI( JComponent c ) { trackWidth = ((Integer)UIManager.get( "Slider.trackWidth" )).intValue(); - tickLength = ((Integer)UIManager.get( "Slider.majorTickLength" )).intValue(); + tickLength = safeLength = ((Integer)UIManager.get( "Slider.majorTickLength" )).intValue(); horizThumbIcon = SAFE_HORIZ_THUMB_ICON = UIManager.getIcon( "Slider.horizontalThumbIcon" ); vertThumbIcon = SAFE_VERT_THUMB_ICON = @@ -465,8 +455,8 @@ * determine the tick area rectangle. */ public int getTickLength() { - return slider.getOrientation() == JSlider.HORIZONTAL ? tickLength + TICK_BUFFER + 1 : - tickLength + TICK_BUFFER + 3; + return slider.getOrientation() == JSlider.HORIZONTAL ? safeLength + TICK_BUFFER + 1 : + safeLength + TICK_BUFFER + 3; } /** @@ -511,22 +501,22 @@ protected void paintMinorTickForHorizSlider( Graphics g, Rectangle tickBounds, int x ) { g.setColor( slider.isEnabled() ? slider.getForeground() : MetalLookAndFeel.getControlShadow() ); - g.drawLine( x, TICK_BUFFER, x, TICK_BUFFER + (tickLength / 2) ); + g.drawLine( x, TICK_BUFFER, x, TICK_BUFFER + (safeLength / 2) ); } protected void paintMajorTickForHorizSlider( Graphics g, Rectangle tickBounds, int x ) { g.setColor( slider.isEnabled() ? slider.getForeground() : MetalLookAndFeel.getControlShadow() ); - g.drawLine( x, TICK_BUFFER , x, TICK_BUFFER + (tickLength - 1) ); + g.drawLine( x, TICK_BUFFER , x, TICK_BUFFER + (safeLength - 1) ); } protected void paintMinorTickForVertSlider( Graphics g, Rectangle tickBounds, int y ) { g.setColor( slider.isEnabled() ? slider.getForeground() : MetalLookAndFeel.getControlShadow() ); if (MetalUtils.isLeftToRight(slider)) { - g.drawLine( TICK_BUFFER, y, TICK_BUFFER + (tickLength / 2), y ); + g.drawLine( TICK_BUFFER, y, TICK_BUFFER + (safeLength / 2), y ); } else { - g.drawLine( 0, y, tickLength/2, y ); + g.drawLine( 0, y, safeLength/2, y ); } } @@ -534,10 +524,10 @@ g.setColor( slider.isEnabled() ? slider.getForeground() : MetalLookAndFeel.getControlShadow() ); if (MetalUtils.isLeftToRight(slider)) { - g.drawLine( TICK_BUFFER, y, TICK_BUFFER + tickLength, y ); + g.drawLine( TICK_BUFFER, y, TICK_BUFFER + safeLength, y ); } else { - g.drawLine( 0, y, tickLength, y ); + g.drawLine( 0, y, safeLength, y ); } } } - --- old/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java 2009-08-11 12:06:35.519050200 +0400 +++ openjdk/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java 2009-08-11 12:06:34.752050200 +0400 @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. 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 @@ -31,14 +31,12 @@ import sun.swing.UIAction; import javax.swing.*; import javax.swing.border.Border; -import javax.swing.event.*; import java.awt.*; import java.awt.event.*; import java.awt.peer.ComponentPeer; import java.awt.peer.LightweightPeer; import java.beans.*; import java.util.*; -import javax.swing.plaf.ActionMapUIResource; import javax.swing.plaf.SplitPaneUI; import javax.swing.plaf.ComponentUI; import javax.swing.plaf.UIResource; @@ -106,13 +104,13 @@ * Keys to use for forward focus traversal when the JComponent is * managing focus. */ - private static Set managingFocusForwardTraversalKeys; + private Set managingFocusForwardTraversalKeys; /** * Keys to use for backward focus traversal when the JComponent is * managing focus. */ - private static Set managingFocusBackwardTraversalKeys; + private Set managingFocusBackwardTraversalKeys; /** @@ -674,7 +672,7 @@ * @return increment via keyboard methods. */ int getKeyboardMoveIncrement() { - return KEYBOARD_DIVIDER_MOVE_OFFSET; + return 3; } /** --- old/src/share/classes/javax/swing/plaf/basic/BasicLabelUI.java 2009-08-11 12:06:46.036050200 +0400 +++ openjdk/jdk/src/share/classes/javax/swing/plaf/basic/BasicLabelUI.java 2009-08-11 12:06:45.272050200 +0400 @@ -65,6 +65,9 @@ protected static BasicLabelUI labelUI = new BasicLabelUI(); private final static BasicLabelUI SAFE_BASIC_LABEL_UI = new BasicLabelUI(); + private Rectangle paintIconR = new Rectangle(); + private Rectangle paintTextR = new Rectangle(); + static void loadActionMap(LazyActionMap map) { map.put(new Actions(Actions.PRESS)); map.put(new Actions(Actions.RELEASE)); @@ -135,17 +138,6 @@ textX, textY); } - - /* These rectangles/insets are allocated once for this shared LabelUI - * implementation. Re-using rectangles rather than allocating - * them in each paint call halved the time it took paint to run. - */ - private static Rectangle paintIconR = new Rectangle(); - private static Rectangle paintTextR = new Rectangle(); - private static Rectangle paintViewR = new Rectangle(); - private static Insets paintViewInsets = new Insets(0, 0, 0, 0); - - /** * Paint the label text in the foreground color, if the label * is opaque then paint the entire background with the background @@ -194,10 +186,11 @@ private String layout(JLabel label, FontMetrics fm, int width, int height) { - Insets insets = label.getInsets(paintViewInsets); + Insets insets = label.getInsets(null); String text = label.getText(); Icon icon = (label.isEnabled()) ? label.getIcon() : label.getDisabledIcon(); + Rectangle paintViewR = new Rectangle(); paintViewR.x = insets.left; paintViewR.y = insets.top; paintViewR.width = width - (insets.left + insets.right); @@ -208,24 +201,13 @@ paintTextR); } - - /* These rectangles/insets are allocated once for this shared LabelUI - * implementation. Re-using rectangles rather than allocating - * them in each getPreferredSize call sped up the method substantially. - */ - private static Rectangle iconR = new Rectangle(); - private static Rectangle textR = new Rectangle(); - private static Rectangle viewR = new Rectangle(); - private static Insets viewInsets = new Insets(0, 0, 0, 0); - - public Dimension getPreferredSize(JComponent c) { JLabel label = (JLabel)c; String text = label.getText(); Icon icon = (label.isEnabled()) ? label.getIcon() : label.getDisabledIcon(); - Insets insets = label.getInsets(viewInsets); + Insets insets = label.getInsets(null); Font font = label.getFont(); int dx = insets.left + insets.right; @@ -243,6 +225,9 @@ else { FontMetrics fm = label.getFontMetrics(font); + Rectangle iconR = new Rectangle(); + Rectangle textR = new Rectangle(); + Rectangle viewR = new Rectangle(); iconR.x = iconR.y = iconR.width = iconR.height = 0; textR.x = textR.y = textR.width = textR.height = 0; viewR.x = dx; --- old/src/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java 2009-08-11 12:06:52.019050200 +0400 +++ openjdk/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java 2009-08-11 12:06:51.308050200 +0400 @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-2009 Sun Microsystems, Inc. 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 @@ -27,7 +27,6 @@ import java.awt.*; import java.lang.reflect.*; -import java.security.*; import java.util.*; import javax.swing.*; import javax.swing.plaf.*; @@ -908,7 +907,7 @@ static class GTKStockIconInfo { private static Map<String,Integer> ICON_TYPE_MAP; - private static final Object ICON_SIZE_KEY = new StringBuffer("IconSize"); + private static final Object ICON_SIZE_KEY = new Object(); // IconSize private static Dimension[] getIconSizesMap() { AppContext appContext = AppContext.getAppContext(); --- old/src/share/classes/javax/swing/JComponent.java 2009-08-11 12:06:58.204050200 +0400 +++ openjdk/jdk/src/share/classes/javax/swing/JComponent.java 2009-08-11 12:06:57.513050200 +0400 @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. 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 @@ -27,22 +27,15 @@ import java.util.HashSet; import java.util.Hashtable; -import java.util.Dictionary; import java.util.Enumeration; import java.util.Locale; import java.util.Vector; import java.util.EventListener; import java.util.Set; -import java.util.Map; -import java.util.HashMap; import java.awt.*; import java.awt.event.*; -import java.awt.image.VolatileImage; -import java.awt.Graphics2D; import java.awt.peer.LightweightPeer; -import java.awt.dnd.DropTarget; -import java.awt.font.FontRenderContext; import java.beans.*; import java.applet.Applet; @@ -220,8 +213,7 @@ * indicates the EDT is calling into the InputVerifier from the * returned component. */ - private static final Object INPUT_VERIFIER_SOURCE_KEY = - new StringBuilder("InputVerifierSourceKey"); + private static final Object INPUT_VERIFIER_SOURCE_KEY = new Object(); // InputVerifierSourceKey /* The following fields support set methods for the corresponding * java.awt.Component properties. @@ -369,8 +361,7 @@ private static final String defaultLocale = "JComponent.defaultLocale"; private static Component componentObtainingGraphicsFrom; - private static Object componentObtainingGraphicsFromLock = new - StringBuilder("componentObtainingGraphicsFrom"); + private static Object componentObtainingGraphicsFromLock = new Object(); // componentObtainingGraphicsFrom /** * AA text hints. --- old/src/share/classes/javax/swing/JDialog.java 2009-08-11 12:07:04.991050200 +0400 +++ openjdk/jdk/src/share/classes/javax/swing/JDialog.java 2009-08-11 12:07:04.288050200 +0400 @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. 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 @@ -26,12 +26,7 @@ import java.awt.*; import java.awt.event.*; -import java.beans.PropertyChangeListener; -import java.util.Locale; -import java.util.Vector; -import java.io.Serializable; import javax.accessibility.*; -import java.applet.Applet; /** * The main class for creating a dialog window. You can use this class @@ -108,8 +103,7 @@ * Key into the AppContext, used to check if should provide decorations * by default. */ - private static final Object defaultLookAndFeelDecoratedKey = - new StringBuffer("JDialog.defaultLookAndFeelDecorated"); + private static final Object defaultLookAndFeelDecoratedKey = new Object(); // JDialog.defaultLookAndFeelDecorated private int defaultCloseOperation = HIDE_ON_CLOSE; --- old/src/share/classes/javax/swing/JEditorPane.java 2009-08-11 12:07:11.080050200 +0400 +++ openjdk/jdk/src/share/classes/javax/swing/JEditorPane.java 2009-08-11 12:07:10.427050200 +0400 @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. 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 @@ -25,12 +25,10 @@ package javax.swing; import java.awt.*; -import java.awt.event.*; import java.lang.reflect.*; import java.net.*; import java.util.*; import java.io.*; -import java.util.*; import javax.swing.plaf.*; import javax.swing.text.*; @@ -1598,12 +1596,9 @@ /* * Private AppContext keys for this class's static variables. */ - private static final Object kitRegistryKey = - new StringBuffer("JEditorPane.kitRegistry"); - private static final Object kitTypeRegistryKey = - new StringBuffer("JEditorPane.kitTypeRegistry"); - private static final Object kitLoaderRegistryKey = - new StringBuffer("JEditorPane.kitLoaderRegistry"); + private static final Object kitRegistryKey = new Object(); // JEditorPane.kitRegistry + private static final Object kitTypeRegistryKey = new Object(); // JEditorPane.kitTypeRegistry + private static final Object kitLoaderRegistryKey = new Object(); // JEditorPane.kitLoaderRegistry /** * @see #getUIClassID --- old/src/share/classes/javax/swing/JFrame.java 2009-08-11 12:07:17.419050200 +0400 +++ openjdk/jdk/src/share/classes/javax/swing/JFrame.java 2009-08-11 12:07:16.686050200 +0400 @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. 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 @@ -26,11 +26,6 @@ import java.awt.*; import java.awt.event.*; -import java.beans.PropertyChangeListener; -import java.util.Locale; -import java.util.Vector; -import java.io.Serializable; - import javax.accessibility.*; @@ -130,8 +125,7 @@ * Key into the AppContext, used to check if should provide decorations * by default. */ - private static final Object defaultLookAndFeelDecoratedKey = - new StringBuffer("JFrame.defaultLookAndFeelDecorated"); + private static final Object defaultLookAndFeelDecoratedKey = new Object(); // JFrame.defaultLookAndFeelDecorated private int defaultCloseOperation = HIDE_ON_CLOSE; --- old/src/share/classes/javax/swing/JInternalFrame.java 2009-08-11 12:07:23.366050200 +0400 +++ openjdk/jdk/src/share/classes/javax/swing/JInternalFrame.java 2009-08-11 12:07:22.658050200 +0400 @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. 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 @@ -26,13 +26,10 @@ package javax.swing; import java.awt.*; -import java.awt.event.*; import java.beans.PropertyVetoException; import java.beans.PropertyChangeEvent; -import java.util.EventListener; -import javax.swing.border.Border; import javax.swing.event.InternalFrameEvent; import javax.swing.event.InternalFrameListener; import javax.swing.plaf.*; @@ -40,9 +37,7 @@ import javax.accessibility.*; import java.io.ObjectOutputStream; -import java.io.ObjectInputStream; import java.io.IOException; -import java.lang.StringBuilder; import java.beans.PropertyChangeListener; import sun.awt.AppContext; import sun.swing.SwingUtilities2; @@ -226,8 +221,7 @@ /** Constrained property name indicating that the internal frame is iconified. */ public final static String IS_ICON_PROPERTY = "icon"; - private static final Object PROPERTY_CHANGE_LISTENER_KEY = - new StringBuilder("InternalFramePropertyChangeListener"); + private static final Object PROPERTY_CHANGE_LISTENER_KEY = new Object(); // InternalFramePropertyChangeListener private static void addPropertyChangeListenerIfNecessary() { if (AppContext.getAppContext().get(PROPERTY_CHANGE_LISTENER_KEY) == --- old/src/share/classes/javax/swing/JPopupMenu.java 2009-08-11 12:07:29.900050200 +0400 +++ openjdk/jdk/src/share/classes/javax/swing/JPopupMenu.java 2009-08-11 12:07:29.192050200 +0400 @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. 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 @@ -33,17 +33,12 @@ import java.io.Serializable; import java.beans.*; -import java.util.Locale; import java.util.Vector; -import java.util.Hashtable; import javax.accessibility.*; import javax.swing.plaf.PopupMenuUI; -import javax.swing.plaf.ComponentUI; import javax.swing.plaf.basic.BasicComboPopup; import javax.swing.event.*; -import java.applet.Applet; - /** * An implementation of a popup menu -- a small window that pops up * and displays a series of choices. A <code>JPopupMenu</code> is used for the @@ -91,8 +86,7 @@ /** * Key used in AppContext to determine if light way popups are the default. */ - private static final Object defaultLWPopupEnabledKey = - new StringBuffer("JPopupMenu.defaultLWPopupEnabledKey"); + private static final Object defaultLWPopupEnabledKey = new Object(); // JPopupMenu.defaultLWPopupEnabledKey /** Bug#4425878-Property javax.swing.adjustPopupLocationToFit introduced */ static boolean popupPostionFixDisabled = false; --- old/src/share/classes/javax/swing/MenuSelectionManager.java 2009-08-11 12:07:36.023050200 +0400 +++ openjdk/jdk/src/share/classes/javax/swing/MenuSelectionManager.java 2009-08-11 12:07:35.359050200 +0400 @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. 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 @@ -44,8 +44,7 @@ private static final boolean VERBOSE = false; // show reuse hits/misses private static final boolean DEBUG = false; // show bad params, misc. - private static final StringBuilder MENU_SELECTION_MANAGER_KEY = - new StringBuilder("javax.swing.MenuSelectionManager"); + private static final Object MENU_SELECTION_MANAGER_KEY = new Object(); // javax.swing.MenuSelectionManager /** * Returns the default menu selection manager. --- old/src/share/classes/javax/swing/PopupFactory.java 2009-08-11 12:07:42.008050200 +0400 +++ openjdk/jdk/src/share/classes/javax/swing/PopupFactory.java 2009-08-11 12:07:41.328050200 +0400 @@ -1,5 +1,5 @@ /* - * Copyright 1999-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-2009 Sun Microsystems, Inc. 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 @@ -61,8 +61,7 @@ * <code>AppContext</code>. This is the key used in the * <code>AppContext</code> to locate the <code>PopupFactory</code>. */ - private static final Object SharedInstanceKey = - new StringBuffer("PopupFactory.SharedInstanceKey"); + private static final Object SharedInstanceKey = new Object(); // PopupFactory.SharedInstanceKey /** * Max number of items to store in any one particular cache. @@ -291,8 +290,7 @@ * Popup implementation that uses a Window as the popup. */ private static class HeavyWeightPopup extends Popup { - private static final Object heavyWeightPopupCacheKey = - new StringBuffer("PopupFactory.heavyWeightPopupCache"); + private static final Object heavyWeightPopupCacheKey = new Object(); // PopupFactory.heavyWeightPopupCache /** * Returns either a new or recycled <code>Popup</code> containing @@ -641,8 +639,7 @@ * Popup implementation that uses a JPanel as the popup. */ private static class LightWeightPopup extends ContainerPopup { - private static final Object lightWeightPopupCacheKey = - new StringBuffer("PopupFactory.lightPopupCache"); + private static final Object lightWeightPopupCacheKey = new Object(); // PopupFactory.lightPopupCache /** * Returns a light weight <code>Popup</code> implementation. If @@ -796,8 +793,7 @@ * Popup implementation that uses a Panel as the popup. */ private static class MediumWeightPopup extends ContainerPopup { - private static final Object mediumWeightPopupCacheKey = - new StringBuffer("PopupFactory.mediumPopupCache"); + private static final Object mediumWeightPopupCacheKey = new Object(); // PopupFactory.mediumPopupCache /** Child of the panel. The contents are added to this. */ private JRootPane rootPane; --- old/src/share/classes/javax/swing/SwingUtilities.java 2009-08-11 12:07:48.053050200 +0400 +++ openjdk/jdk/src/share/classes/javax/swing/SwingUtilities.java 2009-08-11 12:07:47.366050200 +0400 @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. 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 @@ -33,9 +33,6 @@ import java.awt.event.*; import java.awt.dnd.DropTarget; -import java.util.Vector; -import java.util.Hashtable; - import java.lang.reflect.*; import javax.accessibility.*; @@ -1750,8 +1747,7 @@ // Don't use String, as it's not guaranteed to be unique in a Hashtable. - private static final Object sharedOwnerFrameKey = - new StringBuffer("SwingUtilities.sharedOwnerFrame"); + private static final Object sharedOwnerFrameKey = new Object(); // SwingUtilities.sharedOwnerFrame static class SharedOwnerFrame extends Frame implements WindowListener { public void addNotify() { --- old/src/share/classes/javax/swing/SwingWorker.java 2009-08-11 12:07:54.496050200 +0400 +++ openjdk/jdk/src/share/classes/javax/swing/SwingWorker.java 2009-08-11 12:07:53.575050200 +0400 @@ -1,5 +1,5 @@ /* - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-2009 Sun Microsystems, Inc. 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 @@ -28,16 +28,12 @@ import java.beans.PropertyChangeSupport; import java.beans.PropertyChangeEvent; import java.util.List; -import java.util.ArrayList; -import java.util.Collections; import java.util.concurrent.*; import java.util.concurrent.locks.*; import java.awt.event.*; -import javax.swing.SwingUtilities; - import sun.awt.AppContext; import sun.swing.AccumulativeRunnable; @@ -860,7 +856,7 @@ return (ExecutorService)obj; } - private static final Object DO_SUBMIT_KEY = new StringBuilder("doSubmit"); + private static final Object DO_SUBMIT_KEY = new Object(); // doSubmit private static AccumulativeRunnable<Runnable> getDoSubmit() { synchronized (DO_SUBMIT_KEY) { final AppContext appContext = AppContext.getAppContext(); --- old/src/share/classes/javax/swing/TimerQueue.java 2009-08-11 12:08:00.562050200 +0400 +++ openjdk/jdk/src/share/classes/javax/swing/TimerQueue.java 2009-08-11 12:07:59.868050200 +0400 @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. 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 @@ -29,7 +29,6 @@ -import java.util.*; import java.util.concurrent.*; import java.util.concurrent.atomic.AtomicLong; import sun.awt.AppContext; @@ -46,10 +45,7 @@ */ class TimerQueue implements Runnable { - private static final Object sharedInstanceKey = - new StringBuffer("TimerQueue.sharedInstanceKey"); - private static final Object expiredTimersKey = - new StringBuffer("TimerQueue.expiredTimersKey"); + private static final Object sharedInstanceKey = new Object(); // TimerQueue.sharedInstanceKey private final DelayQueue<DelayedTimer> queue; volatile boolean running; --- old/src/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java 2009-08-11 12:08:06.552050200 +0400 +++ openjdk/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java 2009-08-11 12:08:05.879050200 +0400 @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. 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 @@ -29,9 +29,7 @@ import java.awt.event.*; import javax.swing.*; import javax.accessibility.*; -import javax.swing.FocusManager; import javax.swing.plaf.*; -import javax.swing.border.*; import javax.swing.text.*; import javax.swing.event.*; import java.beans.PropertyChangeListener; @@ -176,11 +174,9 @@ private Dimension cachedDisplaySize = new Dimension( 0, 0 ); // Key used for lookup of the DefaultListCellRenderer in the AppContext. - private static final Object COMBO_UI_LIST_CELL_RENDERER_KEY = - new StringBuffer("DefaultListCellRendererKey"); + private static final Object COMBO_UI_LIST_CELL_RENDERER_KEY = new Object(); // DefaultListCellRendererKey - static final StringBuffer HIDE_POPUP_KEY - = new StringBuffer("HidePopupKey"); + static final Object HIDE_POPUP_KEY = new Object(); // HidePopupKey /** * Whether or not all cells have the same baseline. --- old/src/share/classes/javax/swing/plaf/basic/BasicListUI.java 2009-08-11 12:08:12.745050200 +0400 +++ openjdk/jdk/src/share/classes/javax/swing/plaf/basic/BasicListUI.java 2009-08-11 12:08:12.055050200 +0400 @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. 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 @@ -56,8 +56,7 @@ */ public class BasicListUI extends ListUI { - private static final StringBuilder BASELINE_COMPONENT_KEY = - new StringBuilder("List.baselineComponent"); + private static final Object BASELINE_COMPONENT_KEY = new Object(); // List.baselineComponent protected JList list = null; protected CellRendererPane rendererPane; --- old/src/share/classes/javax/swing/plaf/basic/BasicPopupMenuUI.java 2009-08-11 12:08:19.099050200 +0400 +++ openjdk/jdk/src/share/classes/javax/swing/plaf/basic/BasicPopupMenuUI.java 2009-08-11 12:08:18.377050200 +0400 @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. 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 @@ -28,26 +28,18 @@ import javax.swing.*; import javax.swing.event.*; import javax.swing.plaf.*; -import javax.swing.plaf.basic.*; -import javax.swing.border.*; import java.applet.Applet; import java.awt.Component; -import java.awt.Container; -import java.awt.Dimension; import java.awt.KeyboardFocusManager; import java.awt.Window; import java.awt.event.*; import java.awt.AWTEvent; import java.awt.Toolkit; -import java.beans.PropertyChangeListener; -import java.beans.PropertyChangeEvent; - import java.util.*; -import sun.swing.DefaultLookup; import sun.swing.UIAction; import sun.awt.AppContext; @@ -61,10 +53,8 @@ * @author Arnaud Weber */ public class BasicPopupMenuUI extends PopupMenuUI { - static final StringBuilder MOUSE_GRABBER_KEY = new StringBuilder( - "javax.swing.plaf.basic.BasicPopupMenuUI.MouseGrabber"); - static final StringBuilder MENU_KEYBOARD_HELPER_KEY = new StringBuilder( - "javax.swing.plaf.basic.BasicPopupMenuUI.MenuKeyboardHelper"); + static final Object MOUSE_GRABBER_KEY = new Object(); // javax.swing.plaf.basic.BasicPopupMenuUI.MouseGrabber + static final Object MENU_KEYBOARD_HELPER_KEY = new Object(); // javax.swing.plaf.basic.BasicPopupMenuUI.MenuKeyboardHelper protected JPopupMenu popupMenu = null; private transient PopupMenuListener popupMenuListener = null; --- old/src/share/classes/javax/swing/plaf/basic/BasicTableUI.java 2009-08-11 12:08:25.175050200 +0400 +++ openjdk/jdk/src/share/classes/javax/swing/plaf/basic/BasicTableUI.java 2009-08-11 12:08:24.502050200 +0400 @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. 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 @@ -27,16 +27,11 @@ import java.awt.*; import java.awt.datatransfer.*; -import java.awt.dnd.*; import java.awt.event.*; import java.util.Enumeration; -import java.util.EventObject; -import java.util.Hashtable; -import java.util.TooManyListenersException; import javax.swing.*; import javax.swing.event.*; import javax.swing.plaf.*; -import javax.swing.text.*; import javax.swing.table.*; import javax.swing.plaf.basic.DragRecognitionSupport.BeforeDrag; import sun.swing.SwingUtilities2; @@ -56,8 +51,7 @@ */ public class BasicTableUI extends TableUI { - private static final StringBuilder BASELINE_COMPONENT_KEY = - new StringBuilder("Table.baselineComponent"); + private static final Object BASELINE_COMPONENT_KEY = new Object(); // Table.baselineComponent // // Instance Variables --- old/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java 2009-08-11 12:08:32.053050200 +0400 +++ openjdk/jdk/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java 2009-08-11 12:08:30.695050200 +0400 @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. 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 @@ -30,16 +30,12 @@ import java.awt.*; import java.awt.event.*; import java.awt.datatransfer.*; -import java.awt.dnd.*; import java.beans.*; -import java.io.*; import java.util.Enumeration; import java.util.Hashtable; -import java.util.TooManyListenersException; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; -import javax.swing.plaf.ActionMapUIResource; import javax.swing.plaf.ComponentUI; import javax.swing.plaf.UIResource; import javax.swing.plaf.TreeUI; @@ -61,8 +57,7 @@ public class BasicTreeUI extends TreeUI { - private static final StringBuilder BASELINE_COMPONENT_KEY = - new StringBuilder("Tree.baselineComponent"); + private static final Object BASELINE_COMPONENT_KEY = new Object(); // Tree.baselineComponent // Old actions forward to an instance of this. static private final Actions SHARED_ACTION = new Actions(); --- old/src/share/classes/javax/swing/plaf/synth/ImagePainter.java 2009-08-11 12:08:38.675050200 +0400 +++ openjdk/jdk/src/share/classes/javax/swing/plaf/synth/ImagePainter.java 2009-08-11 12:08:37.988050200 +0400 @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-2009 Sun Microsystems, Inc. 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 @@ -41,8 +41,7 @@ * @author Scott Violet */ class ImagePainter extends SynthPainter { - private static final StringBuffer CACHE_KEY = - new StringBuffer("SynthCacheKey"); + private static final Object CACHE_KEY = new Object(); // SynthCacheKey private Image image; private Insets sInsets; --- old/src/share/classes/javax/swing/plaf/synth/SynthLookAndFeel.java 2009-08-11 12:08:44.720050200 +0400 +++ openjdk/jdk/src/share/classes/javax/swing/plaf/synth/SynthLookAndFeel.java 2009-08-11 12:08:44.005050200 +0400 @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-2009 Sun Microsystems, Inc. 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 @@ -73,8 +73,7 @@ /** * AppContext key to get the current SynthStyleFactory. */ - private static final Object STYLE_FACTORY_KEY = - new StringBuffer("com.sun.java.swing.plaf.gtk.StyleCache"); + private static final Object STYLE_FACTORY_KEY = new Object(); // com.sun.java.swing.plaf.gtk.StyleCache /** * The last SynthStyleFactory that was asked for from AppContext --- old/src/share/classes/javax/swing/text/JTextComponent.java 2009-08-11 12:08:50.823050200 +0400 +++ openjdk/jdk/src/share/classes/javax/swing/text/JTextComponent.java 2009-08-11 12:08:50.146050200 +0400 @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. 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 @@ -34,10 +34,7 @@ import java.util.Hashtable; import java.util.Enumeration; import java.util.Vector; -import java.util.Iterator; import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; import java.util.concurrent.*; @@ -4041,8 +4038,7 @@ return modifiers; } - private static final Object KEYMAP_TABLE = - new StringBuilder("JTextComponent_KeymapTable"); + private static final Object KEYMAP_TABLE = new Object(); // JTextComponent_KeymapTable private JTextComponent editor; // // member variables used for on-the-spot input method @@ -4376,8 +4372,7 @@ } } - private static final Object FOCUSED_COMPONENT = - new StringBuilder("JTextComponent_FocusedComponent"); + private static final Object FOCUSED_COMPONENT = new Object(); // JTextComponent_FocusedComponent /** * The default keymap that will be shared by all --- old/src/share/classes/sun/swing/DefaultLookup.java 2009-08-11 12:08:57.514050200 +0400 +++ openjdk/jdk/src/share/classes/sun/swing/DefaultLookup.java 2009-08-11 12:08:56.800050200 +0400 @@ -46,8 +46,7 @@ /** * Key used to store DefaultLookup for AppContext. */ - private static final Object DEFAULT_LOOKUP_KEY = new - StringBuffer("DefaultLookup"); + private static final Object DEFAULT_LOOKUP_KEY = new Object(); // DefaultLookup /** * Thread that last asked for a default. */ --- old/src/share/classes/sun/swing/SwingUtilities2.java 2009-08-11 12:09:03.402050200 +0400 +++ openjdk/jdk/src/share/classes/sun/swing/SwingUtilities2.java 2009-08-11 12:09:02.664050200 +0400 @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-2009 Sun Microsystems, Inc. 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 @@ -32,25 +32,18 @@ import static java.awt.RenderingHints.*; import java.awt.event.*; import java.awt.font.*; -import java.awt.geom.*; import java.awt.print.PrinterGraphics; -import java.text.Bidi; import java.text.AttributedCharacterIterator; import java.text.AttributedString; import javax.swing.*; -import javax.swing.plaf.*; import javax.swing.text.Highlighter; import javax.swing.text.JTextComponent; import javax.swing.text.DefaultHighlighter; import javax.swing.text.DefaultCaret; import javax.swing.table.TableCellRenderer; -import sun.swing.PrintColorUIResource; -import sun.swing.ImageIconUIResource; import sun.print.ProxyPrintGraphics; import sun.awt.*; -import sun.security.action.GetPropertyAction; -import sun.security.util.SecurityConstants; import java.io.*; import java.util.*; import sun.font.FontDesignMetrics; @@ -74,8 +67,7 @@ * The <code>AppContext</code> key for our one <code>LAFState</code> * instance. */ - public static final Object LAF_STATE_KEY = - new StringBuffer("LookAndFeel State"); + public static final Object LAF_STATE_KEY = new Object(); // LookAndFeel State // Most of applications use 10 or less fonts simultaneously private static final int STRONG_BEARING_CACHE_SIZE = 10; @@ -97,15 +89,13 @@ * To avoid having this property persist between look and feels changes * the value of the property is set to null in JComponent.setUI */ - public static final Object AA_TEXT_PROPERTY_KEY = - new StringBuffer("AATextInfoPropertyKey"); + public static final Object AA_TEXT_PROPERTY_KEY = new Object(); // AATextInfoPropertyKey /** * Used to tell a text component, being used as an editor for table * or tree, how many clicks it took to start editing. */ - private static final StringBuilder SKIP_CLICK_COUNT = - new StringBuilder("skipClickCount"); + private static final Object SKIP_CLICK_COUNT = new Object(); // skipClickCount /* Presently this class assumes default fractional metrics. * This may need to change to emulate future platform L&Fs. @@ -165,8 +155,7 @@ * Key used in client properties used to indicate that the * <code>ComponentUI</code> of the JComponent instance should be returned. */ - public static final Object COMPONENT_UI_PROPERTY_KEY = - new StringBuffer("ComponentUIPropertyKey"); + public static final Object COMPONENT_UI_PROPERTY_KEY = new Object(); // ComponentUIPropertyKey /** Client Property key for the text maximal offsets for BasicMenuItemUI */ public static final StringUIClientPropertyKey BASICMENUITEMUI_MAX_TEXT_OFFSET =