changeset 3864:6230c920833f

Merge
author lana
date Mon, 04 Apr 2011 17:20:24 -0700
parents 3b2378b84d5e 39a71949f1a4
children a6677292a936
files
diffstat 101 files changed, 5993 insertions(+), 4128 deletions(-) [+]
line wrap: on
line diff
--- a/make/mkdemo/jfc/Makefile	Mon Apr 04 17:18:35 2011 -0700
+++ b/make/mkdemo/jfc/Makefile	Mon Apr 04 17:20:24 2011 -0700
@@ -39,7 +39,8 @@
     Notepad         \
     SampleTree      \
     SwingApplet     \
-    TableExample
+    TableExample    \
+    TransparentRuler
 
 # Some demos aren't currently included in OpenJDK
 ifndef OPENJDK
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/mkdemo/jfc/TransparentRuler/Makefile	Mon Apr 04 17:20:24 2011 -0700
@@ -0,0 +1,44 @@
+#
+# Copyright (c) 2011, 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
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+#
+# Makefile to build the TransparentRuler demo.
+#
+
+BUILDDIR = ../../..
+PRODUCT = demo/jfc
+DEMONAME = TransparentRuler
+include $(BUILDDIR)/common/Defs.gmk
+
+DEMO_ROOT       = $(SHARE_SRC)/demo/jfc/$(DEMONAME)
+DEMO_TOPFILES	= ./README.txt
+DEMO_MAINCLASS  = transparentruler.Ruler
+DEMO_DESTDIR    = $(DEMODIR)/jfc/$(DEMONAME)
+
+
+#
+# Demo jar building rules.
+#
+include $(BUILDDIR)/common/Demo.gmk
--- a/make/sun/javazic/tzdata/VERSION	Mon Apr 04 17:18:35 2011 -0700
+++ b/make/sun/javazic/tzdata/VERSION	Mon Apr 04 17:20:24 2011 -0700
@@ -21,4 +21,4 @@
 # or visit www.oracle.com if you need additional information or have any
 # questions.
 #
-tzdata2011d
+tzdata2011e
--- a/make/sun/javazic/tzdata/africa	Mon Apr 04 17:18:35 2011 -0700
+++ b/make/sun/javazic/tzdata/africa	Mon Apr 04 17:20:24 2011 -0700
@@ -734,6 +734,48 @@
 # http://www.timeanddate.com/news/time/morocco-starts-dst-2010.html
 # </a>
 
+# From Dan Abitol (2011-03-30):
+# ...Rules for Africa/Casablanca are the following (24h format)
+# The 3rd april 2011 at 00:00:00, [it] will be 3rd april 1:00:00
+# The 31th july 2011 at 00:59:59,  [it] will be 31th July 00:00:00
+# ...Official links of change in morocco
+# The change was broadcast on the FM Radio
+# I ve called ANRT (telecom regulations in Morocco) at
+# +212.537.71.84.00
+# <a href="http://www.anrt.net.ma/fr/">
+# http://www.anrt.net.ma/fr/
+# </a>
+# They said that
+# <a href="http://www.map.ma/fr/sections/accueil/l_heure_legale_au_ma/view">
+# http://www.map.ma/fr/sections/accueil/l_heure_legale_au_ma/view
+# </a>
+# is the official publication to look at.
+# They said that the decision was already taken.
+#
+# More articles in the press
+# <a href="http://www.yabiladi.com/articles/details/5058/secret-l-heure-d-ete-maroc-lev">
+# http://www.yabiladi.com/articles/details/5058/secret-l-heure-d-ete-maroc-lev
+# </a>
+# e.html
+# <a href="http://www.lematin.ma/Actualite/Express/Article.asp?id=148923">
+# http://www.lematin.ma/Actualite/Express/Article.asp?id=148923
+# </a>
+# <a href="http://www.lavieeco.com/actualite/Le-Maroc-passe-sur-GMT%2B1-a-partir-de-dim">
+# http://www.lavieeco.com/actualite/Le-Maroc-passe-sur-GMT%2B1-a-partir-de-dim
+# anche-prochain-5538.html
+# </a>
+
+# From Petr Machata (2011-03-30):
+# They have it written in English here:
+# <a href="http://www.map.ma/eng/sections/home/morocco_to_spring_fo/view">
+# http://www.map.ma/eng/sections/home/morocco_to_spring_fo/view
+# </a>
+#
+# It says there that "Morocco will resume its standard time on July 31,
+# 2011 at midnight." Now they don't say whether they mean midnight of
+# wall clock time (i.e. 11pm UTC), but that's what I would assume. It has
+# also been like that in the past.
+
 # RULE	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 
 Rule	Morocco	1939	only	-	Sep	12	 0:00	1:00	S
@@ -757,6 +799,8 @@
 Rule	Morocco	2009	only	-	Aug	 21	 0:00	0	-
 Rule	Morocco	2010	only	-	May	 2	 0:00	1:00	S
 Rule	Morocco	2010	only	-	Aug	 8	 0:00	0	-
+Rule	Morocco	2011	only	-	Apr	 3	 0:00	1:00	S
+Rule	Morocco	2011	only	-	Jul	 31	 0	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Africa/Casablanca	-0:30:20 -	LMT	1913 Oct 26
 			 0:00	Morocco	WE%sT	1984 Mar 16
--- a/make/sun/javazic/tzdata/southamerica	Mon Apr 04 17:18:35 2011 -0700
+++ b/make/sun/javazic/tzdata/southamerica	Mon Apr 04 17:20:24 2011 -0700
@@ -1193,6 +1193,19 @@
 # From Arthur David Olson (2011-03-02):
 # The emol.com article mentions a water shortage as the cause of the
 # postponement, which may mean that it's not a permanent change.
+
+# From Glenn Eychaner (2011-03-28):
+# The article:
+# <a href="http://diario.elmercurio.com/2011/03/28/_portada/_portada/noticias/7565897A-CA86-49E6-9E03-660B21A4883E.htm?id=3D{7565897A-CA86-49E6-9E03-660B21A4883E}">
+# http://diario.elmercurio.com/2011/03/28/_portada/_portada/noticias/7565897A-CA86-49E6-9E03-660B21A4883E.htm?id=3D{7565897A-CA86-49E6-9E03-660B21A4883E}
+# </a>
+#
+# In English:
+# Chile's clocks will go back an hour this year on the 7th of May instead
+# of this Saturday. They will go forward again the 3rd Saturday in
+# August, not in October as they have since 1968. This is a pilot plan
+# which will be reevaluated in 2012.
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Chile	1927	1932	-	Sep	 1	0:00	1:00	S
 Rule	Chile	1928	1932	-	Apr	 1	0:00	0	-
@@ -1222,13 +1235,16 @@
 Rule	Chile	1998	only	-	Mar	Sun>=9	3:00u	0	-
 Rule	Chile	1998	only	-	Sep	27	4:00u	1:00	S
 Rule	Chile	1999	only	-	Apr	 4	3:00u	0	-
-Rule	Chile	1999	max	-	Oct	Sun>=9	4:00u	1:00	S
+Rule	Chile	1999	2010	-	Oct	Sun>=9	4:00u	1:00	S
+Rule	Chile	2011	only	-	Aug	Sun>=16	4:00u	1:00	S
+Rule	Chile	2012	max	-	Oct	Sun>=9	4:00u	1:00	S
 Rule	Chile	2000	2007	-	Mar	Sun>=9	3:00u	0	-
 # N.B.: the end of March 29 in Chile is March 30 in Universal time,
 # which is used below in specifying the transition.
 Rule	Chile	2008	only	-	Mar	30	3:00u	0	-
 Rule	Chile	2009	only	-	Mar	Sun>=9	3:00u	0	-
-Rule	Chile	2010	2011	-	Apr	Sun>=1	3:00u	0	-
+Rule	Chile	2010	only	-	Apr	Sun>=1	3:00u	0	-
+Rule	Chile	2011	only	-	May	Sun>=2	3:00u	0	-
 Rule	Chile	2012	max	-	Mar	Sun>=9	3:00u	0	-
 # IATA SSIM anomalies: (1992-02) says 1992-03-14;
 # (1996-09) says 1998-03-08.  Ignore these.
--- a/src/share/classes/java/awt/Component.java	Mon Apr 04 17:18:35 2011 -0700
+++ b/src/share/classes/java/awt/Component.java	Mon Apr 04 17:20:24 2011 -0700
@@ -5821,7 +5821,7 @@
      * <code>InputMethodRequests</code> instance.
      * If listener <code>l</code> is <code>null</code>,
      * no exception is thrown and no action is performed.
-     * <p>Refer to <a href="doc-files/AWTThreadIssues.html#ListenersThreads"
+     * <p>Refer to <a href="{@docRoot}/java/awt/doc-files/AWTThreadIssues.html#ListenersThreads"
      * >AWT Threading Issues</a> for details on AWT's threading model.
      *
      * @param    l   the input method listener
--- a/src/share/classes/java/lang/CharSequence.java	Mon Apr 04 17:18:35 2011 -0700
+++ b/src/share/classes/java/lang/CharSequence.java	Mon Apr 04 17:20:24 2011 -0700
@@ -66,7 +66,7 @@
      * indexing. </p>
      *
      * <p>If the <code>char</code> value specified by the index is a
-     * <a href="Character.html#unicode">surrogate</a>, the surrogate
+     * <a href="{@docRoot}/java/lang/Character.html#unicode">surrogate</a>, the surrogate
      * value is returned.
      *
      * @param   index   the index of the <code>char</code> value to be returned
--- a/src/share/classes/java/lang/Character.java	Mon Apr 04 17:18:35 2011 -0700
+++ b/src/share/classes/java/lang/Character.java	Mon Apr 04 17:20:24 2011 -0700
@@ -31,10 +31,10 @@
 import java.util.Locale;
 
 /**
- * The <code>Character</code> class wraps a value of the primitive
- * type <code>char</code> in an object. An object of type
- * <code>Character</code> contains a single field whose type is
- * <code>char</code>.
+ * The {@code Character} class wraps a value of the primitive
+ * type {@code char} in an object. An object of type
+ * {@code Character} contains a single field whose type is
+ * {@code char}.
  * <p>
  * In addition, this class provides several methods for determining
  * a character's category (lowercase letter, digit, etc.) and for converting
@@ -42,7 +42,7 @@
  * <p>
  * Character information is based on the Unicode Standard, version 6.0.0.
  * <p>
- * The methods and data of class <code>Character</code> are defined by
+ * The methods and data of class {@code Character} are defined by
  * the information in the <i>UnicodeData</i> file that is part of the
  * Unicode Character Database maintained by the Unicode
  * Consortium. This file specifies various properties including name
@@ -56,8 +56,8 @@
  *
  * <h4><a name="unicode">Unicode Character Representations</a></h4>
  *
- * <p>The <code>char</code> data type (and therefore the value that a
- * <code>Character</code> object encapsulates) are based on the
+ * <p>The {@code char} data type (and therefore the value that a
+ * {@code Character} object encapsulates) are based on the
  * original Unicode specification, which defined characters as
  * fixed-width 16-bit entities. The Unicode standard has since been
  * changed to allow for characters whose representation requires more
@@ -72,43 +72,43 @@
  * sometimes referred to as the <em>Basic Multilingual Plane (BMP)</em>.
  * <a name="supplementary">Characters</a> whose code points are greater
  * than U+FFFF are called <em>supplementary character</em>s.  The Java
- * platform uses the UTF-16 representation in <code>char</code> arrays and
- * in the <code>String</code> and <code>StringBuffer</code> classes. In
+ * platform uses the UTF-16 representation in {@code char} arrays and
+ * in the {@code String} and {@code StringBuffer} classes. In
  * this representation, supplementary characters are represented as a pair
- * of <code>char</code> values, the first from the <em>high-surrogates</em>
+ * of {@code char} values, the first from the <em>high-surrogates</em>
  * range, (&#92;uD800-&#92;uDBFF), the second from the
  * <em>low-surrogates</em> range (&#92;uDC00-&#92;uDFFF).
  *
- * <p>A <code>char</code> value, therefore, represents Basic
+ * <p>A {@code char} value, therefore, represents Basic
  * Multilingual Plane (BMP) code points, including the surrogate
  * code points, or code units of the UTF-16 encoding. An
- * <code>int</code> value represents all Unicode code points,
+ * {@code int} value represents all Unicode code points,
  * including supplementary code points. The lower (least significant)
- * 21 bits of <code>int</code> are used to represent Unicode code
+ * 21 bits of {@code int} are used to represent Unicode code
  * points and the upper (most significant) 11 bits must be zero.
  * Unless otherwise specified, the behavior with respect to
- * supplementary characters and surrogate <code>char</code> values is
+ * supplementary characters and surrogate {@code char} values is
  * as follows:
  *
  * <ul>
- * <li>The methods that only accept a <code>char</code> value cannot support
- * supplementary characters. They treat <code>char</code> values from the
+ * <li>The methods that only accept a {@code char} value cannot support
+ * supplementary characters. They treat {@code char} values from the
  * surrogate ranges as undefined characters. For example,
- * <code>Character.isLetter('&#92;uD840')</code> returns <code>false</code>, even though
+ * {@code Character.isLetter('\u005CuD840')} returns {@code false}, even though
  * this specific value if followed by any low-surrogate value in a string
  * would represent a letter.
  *
- * <li>The methods that accept an <code>int</code> value support all
+ * <li>The methods that accept an {@code int} value support all
  * Unicode characters, including supplementary characters. For
- * example, <code>Character.isLetter(0x2F81A)</code> returns
- * <code>true</code> because the code point value represents a letter
+ * example, {@code Character.isLetter(0x2F81A)} returns
+ * {@code true} because the code point value represents a letter
  * (a CJK ideograph).
  * </ul>
  *
  * <p>In the Java SE API documentation, <em>Unicode code point</em> is
  * used for character values in the range between U+0000 and U+10FFFF,
  * and <em>Unicode code unit</em> is used for 16-bit
- * <code>char</code> values that are code units of the <em>UTF-16</em>
+ * {@code char} values that are code units of the <em>UTF-16</em>
  * encoding. For more information on Unicode terminology, refer to the
  * <a href="http://www.unicode.org/glossary/">Unicode Glossary</a>.
  *
@@ -125,9 +125,8 @@
      * The minimum radix available for conversion to and from strings.
      * The constant value of this field is the smallest value permitted
      * for the radix argument in radix-conversion methods such as the
-     * <code>digit</code> method, the <code>forDigit</code>
-     * method, and the <code>toString</code> method of class
-     * <code>Integer</code>.
+     * {@code digit} method, the {@code forDigit} method, and the
+     * {@code toString} method of class {@code Integer}.
      *
      * @see     Character#digit(char, int)
      * @see     Character#forDigit(int, int)
@@ -140,9 +139,8 @@
      * The maximum radix available for conversion to and from strings.
      * The constant value of this field is the largest value permitted
      * for the radix argument in radix-conversion methods such as the
-     * <code>digit</code> method, the <code>forDigit</code>
-     * method, and the <code>toString</code> method of class
-     * <code>Integer</code>.
+     * {@code digit} method, the {@code forDigit} method, and the
+     * {@code toString} method of class {@code Integer}.
      *
      * @see     Character#digit(char, int)
      * @see     Character#forDigit(int, int)
@@ -153,7 +151,7 @@
 
     /**
      * The constant value of this field is the smallest value of type
-     * <code>char</code>, <code>'&#92;u0000'</code>.
+     * {@code char}, {@code '\u005Cu0000'}.
      *
      * @since   1.0.2
      */
@@ -161,15 +159,15 @@
 
     /**
      * The constant value of this field is the largest value of type
-     * <code>char</code>, <code>'&#92;uFFFF'</code>.
+     * {@code char}, {@code '\u005CuFFFF'}.
      *
      * @since   1.0.2
      */
     public static final char MAX_VALUE = '\uFFFF';
 
     /**
-     * The <code>Class</code> instance representing the primitive type
-     * <code>char</code>.
+     * The {@code Class} instance representing the primitive type
+     * {@code char}.
      *
      * @since   1.1
      */
@@ -371,7 +369,7 @@
 
 
     /**
-     * Undefined bidirectional character type. Undefined <code>char</code>
+     * Undefined bidirectional character type. Undefined {@code char}
      * values have undefined directionality in the Unicode specification.
      * @since 1.4
      */
@@ -495,7 +493,7 @@
      * The minimum value of a
      * <a href="http://www.unicode.org/glossary/#high_surrogate_code_unit">
      * Unicode high-surrogate code unit</a>
-     * in the UTF-16 encoding, constant <code>'&#92;uD800'</code>.
+     * in the UTF-16 encoding, constant {@code '\u005CuD800'}.
      * A high-surrogate is also known as a <i>leading-surrogate</i>.
      *
      * @since 1.5
@@ -506,7 +504,7 @@
      * The maximum value of a
      * <a href="http://www.unicode.org/glossary/#high_surrogate_code_unit">
      * Unicode high-surrogate code unit</a>
-     * in the UTF-16 encoding, constant <code>'&#92;uDBFF'</code>.
+     * in the UTF-16 encoding, constant {@code '\u005CuDBFF'}.
      * A high-surrogate is also known as a <i>leading-surrogate</i>.
      *
      * @since 1.5
@@ -517,7 +515,7 @@
      * The minimum value of a
      * <a href="http://www.unicode.org/glossary/#low_surrogate_code_unit">
      * Unicode low-surrogate code unit</a>
-     * in the UTF-16 encoding, constant <code>'&#92;uDC00'</code>.
+     * in the UTF-16 encoding, constant {@code '\u005CuDC00'}.
      * A low-surrogate is also known as a <i>trailing-surrogate</i>.
      *
      * @since 1.5
@@ -528,7 +526,7 @@
      * The maximum value of a
      * <a href="http://www.unicode.org/glossary/#low_surrogate_code_unit">
      * Unicode low-surrogate code unit</a>
-     * in the UTF-16 encoding, constant <code>'&#92;uDFFF'</code>.
+     * in the UTF-16 encoding, constant {@code '\u005CuDFFF'}.
      * A low-surrogate is also known as a <i>trailing-surrogate</i>.
      *
      * @since 1.5
@@ -537,7 +535,7 @@
 
     /**
      * The minimum value of a Unicode surrogate code unit in the
-     * UTF-16 encoding, constant <code>'&#92;uD800'</code>.
+     * UTF-16 encoding, constant {@code '\u005CuD800'}.
      *
      * @since 1.5
      */
@@ -545,7 +543,7 @@
 
     /**
      * The maximum value of a Unicode surrogate code unit in the
-     * UTF-16 encoding, constant <code>'&#92;uDFFF'</code>.
+     * UTF-16 encoding, constant {@code '\u005CuDFFF'}.
      *
      * @since 1.5
      */
@@ -582,7 +580,7 @@
     /**
      * Instances of this class represent particular subsets of the Unicode
      * character set.  The only family of subsets defined in the
-     * <code>Character</code> class is {@link Character.UnicodeBlock}.
+     * {@code Character} class is {@link Character.UnicodeBlock}.
      * Other portions of the Java API may define other subsets for their
      * own purposes.
      *
@@ -593,10 +591,10 @@
         private String name;
 
         /**
-         * Constructs a new <code>Subset</code> instance.
+         * Constructs a new {@code Subset} instance.
          *
          * @param  name  The name of this subset
-         * @exception NullPointerException if name is <code>null</code>
+         * @exception NullPointerException if name is {@code null}
          */
         protected Subset(String name) {
             if (name == null) {
@@ -606,10 +604,10 @@
         }
 
         /**
-         * Compares two <code>Subset</code> objects for equality.
-         * This method returns <code>true</code> if and only if
-         * <code>this</code> and the argument refer to the same
-         * object; since this method is <code>final</code>, this
+         * Compares two {@code Subset} objects for equality.
+         * This method returns {@code true} if and only if
+         * {@code this} and the argument refer to the same
+         * object; since this method is {@code final}, this
          * guarantee holds for all subclasses.
          */
         public final boolean equals(Object obj) {
@@ -618,9 +616,9 @@
 
         /**
          * Returns the standard hash code as defined by the
-         * <code>{@link Object#hashCode}</code> method.  This method
-         * is <code>final</code> in order to ensure that the
-         * <code>equals</code> and <code>hashCode</code> methods will
+         * {@link Object#hashCode} method.  This method
+         * is {@code final} in order to ensure that the
+         * {@code equals} and {@code hashCode} methods will
          * be consistent in all subclasses.
          */
         public final int hashCode() {
@@ -2960,7 +2958,7 @@
 
         /**
          * Returns the object representing the Unicode block containing the
-         * given character, or <code>null</code> if the character is not a
+         * given character, or {@code null} if the character is not a
          * member of a defined block.
          *
          * <p><b>Note:</b> This method cannot handle
@@ -2969,9 +2967,9 @@
          * supplementary characters, use the {@link #of(int)} method.
          *
          * @param   c  The character in question
-         * @return  The <code>UnicodeBlock</code> instance representing the
+         * @return  The {@code UnicodeBlock} instance representing the
          *          Unicode block of which this character is a member, or
-         *          <code>null</code> if the character is not a member of any
+         *          {@code null} if the character is not a member of any
          *          Unicode block
          */
         public static UnicodeBlock of(char c) {
@@ -2981,16 +2979,16 @@
         /**
          * Returns the object representing the Unicode block
          * containing the given character (Unicode code point), or
-         * <code>null</code> if the character is not a member of a
+         * {@code null} if the character is not a member of a
          * defined block.
          *
          * @param   codePoint the character (Unicode code point) in question.
-         * @return  The <code>UnicodeBlock</code> instance representing the
+         * @return  The {@code UnicodeBlock} instance representing the
          *          Unicode block of which this character is a member, or
-         *          <code>null</code> if the character is not a member of any
+         *          {@code null} if the character is not a member of any
          *          Unicode block
          * @exception IllegalArgumentException if the specified
-         * <code>codePoint</code> is an invalid Unicode code point.
+         * {@code codePoint} is an invalid Unicode code point.
          * @see Character#isValidCodePoint(int)
          * @since   1.5
          */
@@ -3044,12 +3042,12 @@
          * If the Unicode Standard changes block names, both the previous and
          * current names will be accepted.
          *
-         * @param blockName A <code>UnicodeBlock</code> name.
-         * @return The <code>UnicodeBlock</code> instance identified
-         *         by <code>blockName</code>
-         * @throws IllegalArgumentException if <code>blockName</code> is an
+         * @param blockName A {@code UnicodeBlock} name.
+         * @return The {@code UnicodeBlock} instance identified
+         *         by {@code blockName}
+         * @throws IllegalArgumentException if {@code blockName} is an
          *         invalid name
-         * @throws NullPointerException if <code>blockName</code> is null
+         * @throws NullPointerException if {@code blockName} is null
          * @since 1.5
          */
         public static final UnicodeBlock forName(String blockName) {
@@ -4280,11 +4278,11 @@
          * the given character (Unicode code point) is assigned to.
          *
          * @param   codePoint the character (Unicode code point) in question.
-         * @return  The <code>UnicodeScript</code> constant representing the
+         * @return  The {@code UnicodeScript} constant representing the
          *          Unicode script of which this character is assigned to.
          *
          * @exception IllegalArgumentException if the specified
-         * <code>codePoint</code> is an invalid Unicode code point.
+         * {@code codePoint} is an invalid Unicode code point.
          * @see Character#isValidCodePoint(int)
          *
          */
@@ -4315,12 +4313,12 @@
          * case-insensitive string comparisons for script name validation.
          * <p>
          *
-         * @param scriptName A <code>UnicodeScript</code> name.
-         * @return The <code>UnicodeScript</code> constant identified
-         *         by <code>scriptName</code>
-         * @throws IllegalArgumentException if <code>scriptName</code> is an
+         * @param scriptName A {@code UnicodeScript} name.
+         * @return The {@code UnicodeScript} constant identified
+         *         by {@code scriptName}
+         * @throws IllegalArgumentException if {@code scriptName} is an
          *         invalid name
-         * @throws NullPointerException if <code>scriptName</code> is null
+         * @throws NullPointerException if {@code scriptName} is null
          */
         public static final UnicodeScript forName(String scriptName) {
             scriptName = scriptName.toUpperCase(Locale.ENGLISH);
@@ -4333,7 +4331,7 @@
     }
 
     /**
-     * The value of the <code>Character</code>.
+     * The value of the {@code Character}.
      *
      * @serial
      */
@@ -4343,11 +4341,11 @@
     private static final long serialVersionUID = 3786198910865385080L;
 
     /**
-     * Constructs a newly allocated <code>Character</code> object that
-     * represents the specified <code>char</code> value.
+     * Constructs a newly allocated {@code Character} object that
+     * represents the specified {@code char} value.
      *
      * @param  value   the value to be represented by the
-     *                  <code>Character</code> object.
+     *                  {@code Character} object.
      */
     public Character(char value) {
         this.value = value;
@@ -4374,7 +4372,7 @@
      * frequently requested values.
      *
      * This method will always cache values in the range {@code
-     * '\u005Cu0000'} to {@code '\u005Cu007f'}, inclusive, and may
+     * '\u005Cu0000'} to {@code '\u005Cu007F'}, inclusive, and may
      * cache other values outside of this range.
      *
      * @param  c a char value.
@@ -4389,8 +4387,8 @@
     }
 
     /**
-     * Returns the value of this <code>Character</code> object.
-     * @return  the primitive <code>char</code> value represented by
+     * Returns the value of this {@code Character} object.
+     * @return  the primitive {@code char} value represented by
      *          this object.
      */
     public char charValue() {
@@ -4409,13 +4407,13 @@
 
     /**
      * Compares this object against the specified object.
-     * The result is <code>true</code> if and only if the argument is not
-     * <code>null</code> and is a <code>Character</code> object that
-     * represents the same <code>char</code> value as this object.
+     * The result is {@code true} if and only if the argument is not
+     * {@code null} and is a {@code Character} object that
+     * represents the same {@code char} value as this object.
      *
      * @param   obj   the object to compare with.
-     * @return  <code>true</code> if the objects are the same;
-     *          <code>false</code> otherwise.
+     * @return  {@code true} if the objects are the same;
+     *          {@code false} otherwise.
      */
     public boolean equals(Object obj) {
         if (obj instanceof Character) {
@@ -4425,11 +4423,11 @@
     }
 
     /**
-     * Returns a <code>String</code> object representing this
-     * <code>Character</code>'s value.  The result is a string of
+     * Returns a {@code String} object representing this
+     * {@code Character}'s value.  The result is a string of
      * length 1 whose sole component is the primitive
-     * <code>char</code> value represented by this
-     * <code>Character</code> object.
+     * {@code char} value represented by this
+     * {@code Character} object.
      *
      * @return  a string representation of this object.
      */
@@ -4439,12 +4437,12 @@
     }
 
     /**
-     * Returns a <code>String</code> object representing the
-     * specified <code>char</code>.  The result is a string of length
-     * 1 consisting solely of the specified <code>char</code>.
-     *
-     * @param c the <code>char</code> to be converted
-     * @return the string representation of the specified <code>char</code>
+     * Returns a {@code String} object representing the
+     * specified {@code char}.  The result is a string of length
+     * 1 consisting solely of the specified {@code char}.
+     *
+     * @param c the {@code char} to be converted
+     * @return the string representation of the specified {@code char}
      * @since 1.4
      */
     public static String toString(char c) {
@@ -4578,7 +4576,7 @@
     }
 
     /**
-     * Determines whether the specified pair of <code>char</code>
+     * Determines whether the specified pair of {@code char}
      * values is a valid
      * <a href="http://www.unicode.org/glossary/#surrogate_pair">
      * Unicode surrogate pair</a>.
@@ -4590,9 +4588,9 @@
      *
      * @param  high the high-surrogate code value to be tested
      * @param  low the low-surrogate code value to be tested
-     * @return <code>true</code> if the specified high and
+     * @return {@code true} if the specified high and
      * low-surrogate code values represent a valid surrogate pair;
-     * <code>false</code> otherwise.
+     * {@code false} otherwise.
      * @since  1.5
      */
     public static boolean isSurrogatePair(char high, char low) {
@@ -4600,7 +4598,7 @@
     }
 
     /**
-     * Determines the number of <code>char</code> values needed to
+     * Determines the number of {@code char} values needed to
      * represent the specified character (Unicode code point). If the
      * specified character is equal to or greater than 0x10000, then
      * the method returns 2. Otherwise, the method returns 1.
@@ -4643,23 +4641,23 @@
 
     /**
      * Returns the code point at the given index of the
-     * <code>CharSequence</code>. If the <code>char</code> value at
-     * the given index in the <code>CharSequence</code> is in the
+     * {@code CharSequence}. If the {@code char} value at
+     * the given index in the {@code CharSequence} is in the
      * high-surrogate range, the following index is less than the
-     * length of the <code>CharSequence</code>, and the
-     * <code>char</code> value at the following index is in the
+     * length of the {@code CharSequence}, and the
+     * {@code char} value at the following index is in the
      * low-surrogate range, then the supplementary code point
      * corresponding to this surrogate pair is returned. Otherwise,
-     * the <code>char</code> value at the given index is returned.
-     *
-     * @param seq a sequence of <code>char</code> values (Unicode code
+     * the {@code char} value at the given index is returned.
+     *
+     * @param seq a sequence of {@code char} values (Unicode code
      * units)
-     * @param index the index to the <code>char</code> values (Unicode
-     * code units) in <code>seq</code> to be converted
+     * @param index the index to the {@code char} values (Unicode
+     * code units) in {@code seq} to be converted
      * @return the Unicode code point at the given index
-     * @exception NullPointerException if <code>seq</code> is null.
+     * @exception NullPointerException if {@code seq} is null.
      * @exception IndexOutOfBoundsException if the value
-     * <code>index</code> is negative or not less than
+     * {@code index} is negative or not less than
      * {@link CharSequence#length() seq.length()}.
      * @since  1.5
      */
@@ -4678,23 +4676,23 @@
 
     /**
      * Returns the code point at the given index of the
-     * <code>char</code> array. If the <code>char</code> value at
-     * the given index in the <code>char</code> array is in the
+     * {@code char} array. If the {@code char} value at
+     * the given index in the {@code char} array is in the
      * high-surrogate range, the following index is less than the
-     * length of the <code>char</code> array, and the
-     * <code>char</code> value at the following index is in the
+     * length of the {@code char} array, and the
+     * {@code char} value at the following index is in the
      * low-surrogate range, then the supplementary code point
      * corresponding to this surrogate pair is returned. Otherwise,
-     * the <code>char</code> value at the given index is returned.
-     *
-     * @param a the <code>char</code> array
-     * @param index the index to the <code>char</code> values (Unicode
-     * code units) in the <code>char</code> array to be converted
+     * the {@code char} value at the given index is returned.
+     *
+     * @param a the {@code char} array
+     * @param index the index to the {@code char} values (Unicode
+     * code units) in the {@code char} array to be converted
      * @return the Unicode code point at the given index
-     * @exception NullPointerException if <code>a</code> is null.
+     * @exception NullPointerException if {@code a} is null.
      * @exception IndexOutOfBoundsException if the value
-     * <code>index</code> is negative or not less than
-     * the length of the <code>char</code> array.
+     * {@code index} is negative or not less than
+     * the length of the {@code char} array.
      * @since  1.5
      */
     public static int codePointAt(char[] a, int index) {
@@ -4703,27 +4701,27 @@
 
     /**
      * Returns the code point at the given index of the
-     * <code>char</code> array, where only array elements with
-     * <code>index</code> less than <code>limit</code> can be used. If
-     * the <code>char</code> value at the given index in the
-     * <code>char</code> array is in the high-surrogate range, the
-     * following index is less than the <code>limit</code>, and the
-     * <code>char</code> value at the following index is in the
+     * {@code char} array, where only array elements with
+     * {@code index} less than {@code limit} can be used. If
+     * the {@code char} value at the given index in the
+     * {@code char} array is in the high-surrogate range, the
+     * following index is less than the {@code limit}, and the
+     * {@code char} value at the following index is in the
      * low-surrogate range, then the supplementary code point
      * corresponding to this surrogate pair is returned. Otherwise,
-     * the <code>char</code> value at the given index is returned.
-     *
-     * @param a the <code>char</code> array
-     * @param index the index to the <code>char</code> values (Unicode
-     * code units) in the <code>char</code> array to be converted
-     * @param limit the index after the last array element that can be used in the
-     * <code>char</code> array
+     * the {@code char} value at the given index is returned.
+     *
+     * @param a the {@code char} array
+     * @param index the index to the {@code char} values (Unicode
+     * code units) in the {@code char} array to be converted
+     * @param limit the index after the last array element that
+     * can be used in the {@code char} array
      * @return the Unicode code point at the given index
-     * @exception NullPointerException if <code>a</code> is null.
-     * @exception IndexOutOfBoundsException if the <code>index</code>
-     * argument is negative or not less than the <code>limit</code>
-     * argument, or if the <code>limit</code> argument is negative or
-     * greater than the length of the <code>char</code> array.
+     * @exception NullPointerException if {@code a} is null.
+     * @exception IndexOutOfBoundsException if the {@code index}
+     * argument is negative or not less than the {@code limit}
+     * argument, or if the {@code limit} argument is negative or
+     * greater than the length of the {@code char} array.
      * @since  1.5
      */
     public static int codePointAt(char[] a, int index, int limit) {
@@ -4749,21 +4747,21 @@
 
     /**
      * Returns the code point preceding the given index of the
-     * <code>CharSequence</code>. If the <code>char</code> value at
-     * <code>(index - 1)</code> in the <code>CharSequence</code> is in
-     * the low-surrogate range, <code>(index - 2)</code> is not
-     * negative, and the <code>char</code> value at <code>(index -
-     * 2)</code> in the <code>CharSequence</code> is in the
+     * {@code CharSequence}. If the {@code char} value at
+     * {@code (index - 1)} in the {@code CharSequence} is in
+     * the low-surrogate range, {@code (index - 2)} is not
+     * negative, and the {@code char} value at {@code (index - 2)}
+     * in the {@code CharSequence} is in the
      * high-surrogate range, then the supplementary code point
      * corresponding to this surrogate pair is returned. Otherwise,
-     * the <code>char</code> value at <code>(index - 1)</code> is
+     * the {@code char} value at {@code (index - 1)} is
      * returned.
      *
-     * @param seq the <code>CharSequence</code> instance
+     * @param seq the {@code CharSequence} instance
      * @param index the index following the code point that should be returned
      * @return the Unicode code point value before the given index.
-     * @exception NullPointerException if <code>seq</code> is null.
-     * @exception IndexOutOfBoundsException if the <code>index</code>
+     * @exception NullPointerException if {@code seq} is null.
+     * @exception IndexOutOfBoundsException if the {@code index}
      * argument is less than 1 or greater than {@link
      * CharSequence#length() seq.length()}.
      * @since  1.5
@@ -4783,23 +4781,23 @@
 
     /**
      * Returns the code point preceding the given index of the
-     * <code>char</code> array. If the <code>char</code> value at
-     * <code>(index - 1)</code> in the <code>char</code> array is in
-     * the low-surrogate range, <code>(index - 2)</code> is not
-     * negative, and the <code>char</code> value at <code>(index -
-     * 2)</code> in the <code>char</code> array is in the
+     * {@code char} array. If the {@code char} value at
+     * {@code (index - 1)} in the {@code char} array is in
+     * the low-surrogate range, {@code (index - 2)} is not
+     * negative, and the {@code char} value at {@code (index - 2)}
+     * in the {@code char} array is in the
      * high-surrogate range, then the supplementary code point
      * corresponding to this surrogate pair is returned. Otherwise,
-     * the <code>char</code> value at <code>(index - 1)</code> is
+     * the {@code char} value at {@code (index - 1)} is
      * returned.
      *
-     * @param a the <code>char</code> array
+     * @param a the {@code char} array
      * @param index the index following the code point that should be returned
      * @return the Unicode code point value before the given index.
-     * @exception NullPointerException if <code>a</code> is null.
-     * @exception IndexOutOfBoundsException if the <code>index</code>
+     * @exception NullPointerException if {@code a} is null.
+     * @exception IndexOutOfBoundsException if the {@code index}
      * argument is less than 1 or greater than the length of the
-     * <code>char</code> array
+     * {@code char} array
      * @since  1.5
      */
     public static int codePointBefore(char[] a, int index) {
@@ -4808,29 +4806,29 @@
 
     /**
      * Returns the code point preceding the given index of the
-     * <code>char</code> array, where only array elements with
-     * <code>index</code> greater than or equal to <code>start</code>
-     * can be used. If the <code>char</code> value at <code>(index -
-     * 1)</code> in the <code>char</code> array is in the
-     * low-surrogate range, <code>(index - 2)</code> is not less than
-     * <code>start</code>, and the <code>char</code> value at
-     * <code>(index - 2)</code> in the <code>char</code> array is in
+     * {@code char} array, where only array elements with
+     * {@code index} greater than or equal to {@code start}
+     * can be used. If the {@code char} value at {@code (index - 1)}
+     * in the {@code char} array is in the
+     * low-surrogate range, {@code (index - 2)} is not less than
+     * {@code start}, and the {@code char} value at
+     * {@code (index - 2)} in the {@code char} array is in
      * the high-surrogate range, then the supplementary code point
      * corresponding to this surrogate pair is returned. Otherwise,
-     * the <code>char</code> value at <code>(index - 1)</code> is
+     * the {@code char} value at {@code (index - 1)} is
      * returned.
      *
-     * @param a the <code>char</code> array
+     * @param a the {@code char} array
      * @param index the index following the code point that should be returned
      * @param start the index of the first array element in the
-     * <code>char</code> array
+     * {@code char} array
      * @return the Unicode code point value before the given index.
-     * @exception NullPointerException if <code>a</code> is null.
-     * @exception IndexOutOfBoundsException if the <code>index</code>
-     * argument is not greater than the <code>start</code> argument or
-     * is greater than the length of the <code>char</code> array, or
-     * if the <code>start</code> argument is negative or not less than
-     * the length of the <code>char</code> array.
+     * @exception NullPointerException if {@code a} is null.
+     * @exception IndexOutOfBoundsException if the {@code index}
+     * argument is not greater than the {@code start} argument or
+     * is greater than the length of the {@code char} array, or
+     * if the {@code start} argument is negative or not less than
+     * the length of the {@code char} array.
      * @since  1.5
      */
     public static int codePointBefore(char[] a, int index, int start) {
@@ -4915,31 +4913,31 @@
      * Converts the specified character (Unicode code point) to its
      * UTF-16 representation. If the specified code point is a BMP
      * (Basic Multilingual Plane or Plane 0) value, the same value is
-     * stored in <code>dst[dstIndex]</code>, and 1 is returned. If the
+     * stored in {@code dst[dstIndex]}, and 1 is returned. If the
      * specified code point is a supplementary character, its
-     * surrogate values are stored in <code>dst[dstIndex]</code>
-     * (high-surrogate) and <code>dst[dstIndex+1]</code>
+     * surrogate values are stored in {@code dst[dstIndex]}
+     * (high-surrogate) and {@code dst[dstIndex+1]}
      * (low-surrogate), and 2 is returned.
      *
      * @param  codePoint the character (Unicode code point) to be converted.
-     * @param  dst an array of <code>char</code> in which the
-     * <code>codePoint</code>'s UTF-16 value is stored.
-     * @param dstIndex the start index into the <code>dst</code>
+     * @param  dst an array of {@code char} in which the
+     * {@code codePoint}'s UTF-16 value is stored.
+     * @param dstIndex the start index into the {@code dst}
      * array where the converted value is stored.
      * @return 1 if the code point is a BMP code point, 2 if the
      * code point is a supplementary code point.
      * @exception IllegalArgumentException if the specified
-     * <code>codePoint</code> is not a valid Unicode code point.
-     * @exception NullPointerException if the specified <code>dst</code> is null.
-     * @exception IndexOutOfBoundsException if <code>dstIndex</code>
-     * is negative or not less than <code>dst.length</code>, or if
-     * <code>dst</code> at <code>dstIndex</code> doesn't have enough
-     * array element(s) to store the resulting <code>char</code>
-     * value(s). (If <code>dstIndex</code> is equal to
-     * <code>dst.length-1</code> and the specified
-     * <code>codePoint</code> is a supplementary character, the
+     * {@code codePoint} is not a valid Unicode code point.
+     * @exception NullPointerException if the specified {@code dst} is null.
+     * @exception IndexOutOfBoundsException if {@code dstIndex}
+     * is negative or not less than {@code dst.length}, or if
+     * {@code dst} at {@code dstIndex} doesn't have enough
+     * array element(s) to store the resulting {@code char}
+     * value(s). (If {@code dstIndex} is equal to
+     * {@code dst.length-1} and the specified
+     * {@code codePoint} is a supplementary character, the
      * high-surrogate value is not stored in
-     * <code>dst[dstIndex]</code>.)
+     * {@code dst[dstIndex]}.)
      * @since  1.5
      */
     public static int toChars(int codePoint, char[] dst, int dstIndex) {
@@ -4956,18 +4954,18 @@
 
     /**
      * Converts the specified character (Unicode code point) to its
-     * UTF-16 representation stored in a <code>char</code> array. If
+     * UTF-16 representation stored in a {@code char} array. If
      * the specified code point is a BMP (Basic Multilingual Plane or
-     * Plane 0) value, the resulting <code>char</code> array has
-     * the same value as <code>codePoint</code>. If the specified code
+     * Plane 0) value, the resulting {@code char} array has
+     * the same value as {@code codePoint}. If the specified code
      * point is a supplementary code point, the resulting
-     * <code>char</code> array has the corresponding surrogate pair.
+     * {@code char} array has the corresponding surrogate pair.
      *
      * @param  codePoint a Unicode code point
-     * @return a <code>char</code> array having
-     *         <code>codePoint</code>'s UTF-16 representation.
+     * @return a {@code char} array having
+     *         {@code codePoint}'s UTF-16 representation.
      * @exception IllegalArgumentException if the specified
-     * <code>codePoint</code> is not a valid Unicode code point.
+     * {@code codePoint} is not a valid Unicode code point.
      * @since  1.5
      */
     public static char[] toChars(int codePoint) {
@@ -4991,24 +4989,24 @@
     /**
      * Returns the number of Unicode code points in the text range of
      * the specified char sequence. The text range begins at the
-     * specified <code>beginIndex</code> and extends to the
-     * <code>char</code> at index <code>endIndex - 1</code>. Thus the
-     * length (in <code>char</code>s) of the text range is
-     * <code>endIndex-beginIndex</code>. Unpaired surrogates within
+     * specified {@code beginIndex} and extends to the
+     * {@code char} at index {@code endIndex - 1}. Thus the
+     * length (in {@code char}s) of the text range is
+     * {@code endIndex-beginIndex}. Unpaired surrogates within
      * the text range count as one code point each.
      *
      * @param seq the char sequence
-     * @param beginIndex the index to the first <code>char</code> of
+     * @param beginIndex the index to the first {@code char} of
      * the text range.
-     * @param endIndex the index after the last <code>char</code> of
+     * @param endIndex the index after the last {@code char} of
      * the text range.
      * @return the number of Unicode code points in the specified text
      * range
-     * @exception NullPointerException if <code>seq</code> is null.
+     * @exception NullPointerException if {@code seq} is null.
      * @exception IndexOutOfBoundsException if the
-     * <code>beginIndex</code> is negative, or <code>endIndex</code>
+     * {@code beginIndex} is negative, or {@code endIndex}
      * is larger than the length of the given sequence, or
-     * <code>beginIndex</code> is larger than <code>endIndex</code>.
+     * {@code beginIndex} is larger than {@code endIndex}.
      * @since  1.5
      */
     public static int codePointCount(CharSequence seq, int beginIndex, int endIndex) {
@@ -5029,21 +5027,21 @@
 
     /**
      * Returns the number of Unicode code points in a subarray of the
-     * <code>char</code> array argument. The <code>offset</code>
-     * argument is the index of the first <code>char</code> of the
-     * subarray and the <code>count</code> argument specifies the
-     * length of the subarray in <code>char</code>s. Unpaired
+     * {@code char} array argument. The {@code offset}
+     * argument is the index of the first {@code char} of the
+     * subarray and the {@code count} argument specifies the
+     * length of the subarray in {@code char}s. Unpaired
      * surrogates within the subarray count as one code point each.
      *
-     * @param a the <code>char</code> array
-     * @param offset the index of the first <code>char</code> in the
-     * given <code>char</code> array
-     * @param count the length of the subarray in <code>char</code>s
+     * @param a the {@code char} array
+     * @param offset the index of the first {@code char} in the
+     * given {@code char} array
+     * @param count the length of the subarray in {@code char}s
      * @return the number of Unicode code points in the specified subarray
-     * @exception NullPointerException if <code>a</code> is null.
-     * @exception IndexOutOfBoundsException if <code>offset</code> or
-     * <code>count</code> is negative, or if <code>offset +
-     * count</code> is larger than the length of the given array.
+     * @exception NullPointerException if {@code a} is null.
+     * @exception IndexOutOfBoundsException if {@code offset} or
+     * {@code count} is negative, or if {@code offset +
+     * count} is larger than the length of the given array.
      * @since  1.5
      */
     public static int codePointCount(char[] a, int offset, int count) {
@@ -5068,24 +5066,24 @@
 
     /**
      * Returns the index within the given char sequence that is offset
-     * from the given <code>index</code> by <code>codePointOffset</code>
+     * from the given {@code index} by {@code codePointOffset}
      * code points. Unpaired surrogates within the text range given by
-     * <code>index</code> and <code>codePointOffset</code> count as
+     * {@code index} and {@code codePointOffset} count as
      * one code point each.
      *
      * @param seq the char sequence
      * @param index the index to be offset
      * @param codePointOffset the offset in code points
      * @return the index within the char sequence
-     * @exception NullPointerException if <code>seq</code> is null.
-     * @exception IndexOutOfBoundsException if <code>index</code>
+     * @exception NullPointerException if {@code seq} is null.
+     * @exception IndexOutOfBoundsException if {@code index}
      *   is negative or larger then the length of the char sequence,
-     *   or if <code>codePointOffset</code> is positive and the
-     *   subsequence starting with <code>index</code> has fewer than
-     *   <code>codePointOffset</code> code points, or if
-     *   <code>codePointOffset</code> is negative and the subsequence
-     *   before <code>index</code> has fewer than the absolute value
-     *   of <code>codePointOffset</code> code points.
+     *   or if {@code codePointOffset} is positive and the
+     *   subsequence starting with {@code index} has fewer than
+     *   {@code codePointOffset} code points, or if
+     *   {@code codePointOffset} is negative and the subsequence
+     *   before {@code index} has fewer than the absolute value
+     *   of {@code codePointOffset} code points.
      * @since 1.5
      */
     public static int offsetByCodePoints(CharSequence seq, int index,
@@ -5123,36 +5121,36 @@
     }
 
     /**
-     * Returns the index within the given <code>char</code> subarray
-     * that is offset from the given <code>index</code> by
-     * <code>codePointOffset</code> code points. The
-     * <code>start</code> and <code>count</code> arguments specify a
-     * subarray of the <code>char</code> array. Unpaired surrogates
-     * within the text range given by <code>index</code> and
-     * <code>codePointOffset</code> count as one code point each.
-     *
-     * @param a the <code>char</code> array
-     * @param start the index of the first <code>char</code> of the
+     * Returns the index within the given {@code char} subarray
+     * that is offset from the given {@code index} by
+     * {@code codePointOffset} code points. The
+     * {@code start} and {@code count} arguments specify a
+     * subarray of the {@code char} array. Unpaired surrogates
+     * within the text range given by {@code index} and
+     * {@code codePointOffset} count as one code point each.
+     *
+     * @param a the {@code char} array
+     * @param start the index of the first {@code char} of the
      * subarray
-     * @param count the length of the subarray in <code>char</code>s
+     * @param count the length of the subarray in {@code char}s
      * @param index the index to be offset
      * @param codePointOffset the offset in code points
      * @return the index within the subarray
-     * @exception NullPointerException if <code>a</code> is null.
+     * @exception NullPointerException if {@code a} is null.
      * @exception IndexOutOfBoundsException
-     *   if <code>start</code> or <code>count</code> is negative,
-     *   or if <code>start + count</code> is larger than the length of
+     *   if {@code start} or {@code count} is negative,
+     *   or if {@code start + count} is larger than the length of
      *   the given array,
-     *   or if <code>index</code> is less than <code>start</code> or
-     *   larger then <code>start + count</code>,
-     *   or if <code>codePointOffset</code> is positive and the text range
-     *   starting with <code>index</code> and ending with <code>start
-     *   + count - 1</code> has fewer than <code>codePointOffset</code> code
+     *   or if {@code index} is less than {@code start} or
+     *   larger then {@code start + count},
+     *   or if {@code codePointOffset} is positive and the text range
+     *   starting with {@code index} and ending with {@code start + count - 1}
+     *   has fewer than {@code codePointOffset} code
      *   points,
-     *   or if <code>codePointOffset</code> is negative and the text range
-     *   starting with <code>start</code> and ending with <code>index
-     *   - 1</code> has fewer than the absolute value of
-     *   <code>codePointOffset</code> code points.
+     *   or if {@code codePointOffset} is negative and the text range
+     *   starting with {@code start} and ending with {@code index - 1}
+     *   has fewer than the absolute value of
+     *   {@code codePointOffset} code points.
      * @since 1.5
      */
     public static int offsetByCodePoints(char[] a, int start, int count,
@@ -5198,8 +5196,8 @@
      * Determines if the specified character is a lowercase character.
      * <p>
      * A character is lowercase if its general category type, provided
-     * by <code>Character.getType(ch)</code>, is
-     * <code>LOWERCASE_LETTER</code>.
+     * by {@code Character.getType(ch)}, is
+     * {@code LOWERCASE_LETTER}.
      * <p>
      * The following are examples of lowercase characters:
      * <p><blockquote><pre>
@@ -5217,8 +5215,8 @@
      * the {@link #isLowerCase(int)} method.
      *
      * @param   ch   the character to be tested.
-     * @return  <code>true</code> if the character is lowercase;
-     *          <code>false</code> otherwise.
+     * @return  {@code true} if the character is lowercase;
+     *          {@code false} otherwise.
      * @see     Character#isLowerCase(char)
      * @see     Character#isTitleCase(char)
      * @see     Character#toLowerCase(char)
@@ -5234,7 +5232,7 @@
      * <p>
      * A character is lowercase if its general category type, provided
      * by {@link Character#getType getType(codePoint)}, is
-     * <code>LOWERCASE_LETTER</code>.
+     * {@code LOWERCASE_LETTER}.
      * <p>
      * The following are examples of lowercase characters:
      * <p><blockquote><pre>
@@ -5247,8 +5245,8 @@
      * <p> Many other Unicode characters are lowercase too.
      *
      * @param   codePoint the character (Unicode code point) to be tested.
-     * @return  <code>true</code> if the character is lowercase;
-     *          <code>false</code> otherwise.
+     * @return  {@code true} if the character is lowercase;
+     *          {@code false} otherwise.
      * @see     Character#isLowerCase(int)
      * @see     Character#isTitleCase(int)
      * @see     Character#toLowerCase(int)
@@ -5263,7 +5261,7 @@
      * Determines if the specified character is an uppercase character.
      * <p>
      * A character is uppercase if its general category type, provided by
-     * <code>Character.getType(ch)</code>, is <code>UPPERCASE_LETTER</code>.
+     * {@code Character.getType(ch)}, is {@code UPPERCASE_LETTER}.
      * <p>
      * The following are examples of uppercase characters:
      * <p><blockquote><pre>
@@ -5281,8 +5279,8 @@
      * the {@link #isUpperCase(int)} method.
      *
      * @param   ch   the character to be tested.
-     * @return  <code>true</code> if the character is uppercase;
-     *          <code>false</code> otherwise.
+     * @return  {@code true} if the character is uppercase;
+     *          {@code false} otherwise.
      * @see     Character#isLowerCase(char)
      * @see     Character#isTitleCase(char)
      * @see     Character#toUpperCase(char)
@@ -5297,7 +5295,7 @@
      * Determines if the specified character (Unicode code point) is an uppercase character.
      * <p>
      * A character is uppercase if its general category type, provided by
-     * {@link Character#getType(int) getType(codePoint)}, is <code>UPPERCASE_LETTER</code>.
+     * {@link Character#getType(int) getType(codePoint)}, is {@code UPPERCASE_LETTER}.
      * <p>
      * The following are examples of uppercase characters:
      * <p><blockquote><pre>
@@ -5310,8 +5308,8 @@
      * <p> Many other Unicode characters are uppercase too.<p>
      *
      * @param   codePoint the character (Unicode code point) to be tested.
-     * @return  <code>true</code> if the character is uppercase;
-     *          <code>false</code> otherwise.
+     * @return  {@code true} if the character is uppercase;
+     *          {@code false} otherwise.
      * @see     Character#isLowerCase(int)
      * @see     Character#isTitleCase(int)
      * @see     Character#toUpperCase(int)
@@ -5326,8 +5324,8 @@
      * Determines if the specified character is a titlecase character.
      * <p>
      * A character is a titlecase character if its general
-     * category type, provided by <code>Character.getType(ch)</code>,
-     * is <code>TITLECASE_LETTER</code>.
+     * category type, provided by {@code Character.getType(ch)},
+     * is {@code TITLECASE_LETTER}.
      * <p>
      * Some characters look like pairs of Latin letters. For example, there
      * is an uppercase letter that looks like "LJ" and has a corresponding
@@ -5336,12 +5334,12 @@
      * with initial capitals, as for a book title.
      * <p>
      * These are some of the Unicode characters for which this method returns
-     * <code>true</code>:
+     * {@code true}:
      * <ul>
-     * <li><code>LATIN CAPITAL LETTER D WITH SMALL LETTER Z WITH CARON</code>
-     * <li><code>LATIN CAPITAL LETTER L WITH SMALL LETTER J</code>
-     * <li><code>LATIN CAPITAL LETTER N WITH SMALL LETTER J</code>
-     * <li><code>LATIN CAPITAL LETTER D WITH SMALL LETTER Z</code>
+     * <li>{@code LATIN CAPITAL LETTER D WITH SMALL LETTER Z WITH CARON}
+     * <li>{@code LATIN CAPITAL LETTER L WITH SMALL LETTER J}
+     * <li>{@code LATIN CAPITAL LETTER N WITH SMALL LETTER J}
+     * <li>{@code LATIN CAPITAL LETTER D WITH SMALL LETTER Z}
      * </ul>
      * <p> Many other Unicode characters are titlecase too.<p>
      *
@@ -5351,8 +5349,8 @@
      * the {@link #isTitleCase(int)} method.
      *
      * @param   ch   the character to be tested.
-     * @return  <code>true</code> if the character is titlecase;
-     *          <code>false</code> otherwise.
+     * @return  {@code true} if the character is titlecase;
+     *          {@code false} otherwise.
      * @see     Character#isLowerCase(char)
      * @see     Character#isUpperCase(char)
      * @see     Character#toTitleCase(char)
@@ -5368,7 +5366,7 @@
      * <p>
      * A character is a titlecase character if its general
      * category type, provided by {@link Character#getType(int) getType(codePoint)},
-     * is <code>TITLECASE_LETTER</code>.
+     * is {@code TITLECASE_LETTER}.
      * <p>
      * Some characters look like pairs of Latin letters. For example, there
      * is an uppercase letter that looks like "LJ" and has a corresponding
@@ -5377,18 +5375,18 @@
      * with initial capitals, as for a book title.
      * <p>
      * These are some of the Unicode characters for which this method returns
-     * <code>true</code>:
+     * {@code true}:
      * <ul>
-     * <li><code>LATIN CAPITAL LETTER D WITH SMALL LETTER Z WITH CARON</code>
-     * <li><code>LATIN CAPITAL LETTER L WITH SMALL LETTER J</code>
-     * <li><code>LATIN CAPITAL LETTER N WITH SMALL LETTER J</code>
-     * <li><code>LATIN CAPITAL LETTER D WITH SMALL LETTER Z</code>
+     * <li>{@code LATIN CAPITAL LETTER D WITH SMALL LETTER Z WITH CARON}
+     * <li>{@code LATIN CAPITAL LETTER L WITH SMALL LETTER J}
+     * <li>{@code LATIN CAPITAL LETTER N WITH SMALL LETTER J}
+     * <li>{@code LATIN CAPITAL LETTER D WITH SMALL LETTER Z}
      * </ul>
      * <p> Many other Unicode characters are titlecase too.<p>
      *
      * @param   codePoint the character (Unicode code point) to be tested.
-     * @return  <code>true</code> if the character is titlecase;
-     *          <code>false</code> otherwise.
+     * @return  {@code true} if the character is titlecase;
+     *          {@code false} otherwise.
      * @see     Character#isLowerCase(int)
      * @see     Character#isUpperCase(int)
      * @see     Character#toTitleCase(int)
@@ -5403,20 +5401,20 @@
      * Determines if the specified character is a digit.
      * <p>
      * A character is a digit if its general category type, provided
-     * by <code>Character.getType(ch)</code>, is
-     * <code>DECIMAL_DIGIT_NUMBER</code>.
+     * by {@code Character.getType(ch)}, is
+     * {@code DECIMAL_DIGIT_NUMBER}.
      * <p>
      * Some Unicode character ranges that contain digits:
      * <ul>
-     * <li><code>'&#92;u0030'</code> through <code>'&#92;u0039'</code>,
-     *     ISO-LATIN-1 digits (<code>'0'</code> through <code>'9'</code>)
-     * <li><code>'&#92;u0660'</code> through <code>'&#92;u0669'</code>,
+     * <li>{@code '\u005Cu0030'} through {@code '\u005Cu0039'},
+     *     ISO-LATIN-1 digits ({@code '0'} through {@code '9'})
+     * <li>{@code '\u005Cu0660'} through {@code '\u005Cu0669'},
      *     Arabic-Indic digits
-     * <li><code>'&#92;u06F0'</code> through <code>'&#92;u06F9'</code>,
+     * <li>{@code '\u005Cu06F0'} through {@code '\u005Cu06F9'},
      *     Extended Arabic-Indic digits
-     * <li><code>'&#92;u0966'</code> through <code>'&#92;u096F'</code>,
+     * <li>{@code '\u005Cu0966'} through {@code '\u005Cu096F'},
      *     Devanagari digits
-     * <li><code>'&#92;uFF10'</code> through <code>'&#92;uFF19'</code>,
+     * <li>{@code '\u005CuFF10'} through {@code '\u005CuFF19'},
      *     Fullwidth digits
      * </ul>
      *
@@ -5428,8 +5426,8 @@
      * the {@link #isDigit(int)} method.
      *
      * @param   ch   the character to be tested.
-     * @return  <code>true</code> if the character is a digit;
-     *          <code>false</code> otherwise.
+     * @return  {@code true} if the character is a digit;
+     *          {@code false} otherwise.
      * @see     Character#digit(char, int)
      * @see     Character#forDigit(int, int)
      * @see     Character#getType(char)
@@ -5443,27 +5441,27 @@
      * <p>
      * A character is a digit if its general category type, provided
      * by {@link Character#getType(int) getType(codePoint)}, is
-     * <code>DECIMAL_DIGIT_NUMBER</code>.
+     * {@code DECIMAL_DIGIT_NUMBER}.
      * <p>
      * Some Unicode character ranges that contain digits:
      * <ul>
-     * <li><code>'&#92;u0030'</code> through <code>'&#92;u0039'</code>,
-     *     ISO-LATIN-1 digits (<code>'0'</code> through <code>'9'</code>)
-     * <li><code>'&#92;u0660'</code> through <code>'&#92;u0669'</code>,
+     * <li>{@code '\u005Cu0030'} through {@code '\u005Cu0039'},
+     *     ISO-LATIN-1 digits ({@code '0'} through {@code '9'})
+     * <li>{@code '\u005Cu0660'} through {@code '\u005Cu0669'},
      *     Arabic-Indic digits
-     * <li><code>'&#92;u06F0'</code> through <code>'&#92;u06F9'</code>,
+     * <li>{@code '\u005Cu06F0'} through {@code '\u005Cu06F9'},
      *     Extended Arabic-Indic digits
-     * <li><code>'&#92;u0966'</code> through <code>'&#92;u096F'</code>,
+     * <li>{@code '\u005Cu0966'} through {@code '\u005Cu096F'},
      *     Devanagari digits
-     * <li><code>'&#92;uFF10'</code> through <code>'&#92;uFF19'</code>,
+     * <li>{@code '\u005CuFF10'} through {@code '\u005CuFF19'},
      *     Fullwidth digits
      * </ul>
      *
      * Many other character ranges contain digits as well.
      *
      * @param   codePoint the character (Unicode code point) to be tested.
-     * @return  <code>true</code> if the character is a digit;
-     *          <code>false</code> otherwise.
+     * @return  {@code true} if the character is a digit;
+     *          {@code false} otherwise.
      * @see     Character#forDigit(int, int)
      * @see     Character#getType(int)
      * @since   1.5
@@ -5487,8 +5485,8 @@
      * the {@link #isDefined(int)} method.
      *
      * @param   ch   the character to be tested
-     * @return  <code>true</code> if the character has a defined meaning
-     *          in Unicode; <code>false</code> otherwise.
+     * @return  {@code true} if the character has a defined meaning
+     *          in Unicode; {@code false} otherwise.
      * @see     Character#isDigit(char)
      * @see     Character#isLetter(char)
      * @see     Character#isLetterOrDigit(char)
@@ -5511,8 +5509,8 @@
      * </ul>
      *
      * @param   codePoint the character (Unicode code point) to be tested.
-     * @return  <code>true</code> if the character has a defined meaning
-     *          in Unicode; <code>false</code> otherwise.
+     * @return  {@code true} if the character has a defined meaning
+     *          in Unicode; {@code false} otherwise.
      * @see     Character#isDigit(int)
      * @see     Character#isLetter(int)
      * @see     Character#isLetterOrDigit(int)
@@ -5529,14 +5527,14 @@
      * Determines if the specified character is a letter.
      * <p>
      * A character is considered to be a letter if its general
-     * category type, provided by <code>Character.getType(ch)</code>,
+     * category type, provided by {@code Character.getType(ch)},
      * is any of the following:
      * <ul>
-     * <li> <code>UPPERCASE_LETTER</code>
-     * <li> <code>LOWERCASE_LETTER</code>
-     * <li> <code>TITLECASE_LETTER</code>
-     * <li> <code>MODIFIER_LETTER</code>
-     * <li> <code>OTHER_LETTER</code>
+     * <li> {@code UPPERCASE_LETTER}
+     * <li> {@code LOWERCASE_LETTER}
+     * <li> {@code TITLECASE_LETTER}
+     * <li> {@code MODIFIER_LETTER}
+     * <li> {@code OTHER_LETTER}
      * </ul>
      *
      * Not all letters have case. Many characters are
@@ -5548,8 +5546,8 @@
      * the {@link #isLetter(int)} method.
      *
      * @param   ch   the character to be tested.
-     * @return  <code>true</code> if the character is a letter;
-     *          <code>false</code> otherwise.
+     * @return  {@code true} if the character is a letter;
+     *          {@code false} otherwise.
      * @see     Character#isDigit(char)
      * @see     Character#isJavaIdentifierStart(char)
      * @see     Character#isJavaLetter(char)
@@ -5571,19 +5569,19 @@
      * category type, provided by {@link Character#getType(int) getType(codePoint)},
      * is any of the following:
      * <ul>
-     * <li> <code>UPPERCASE_LETTER</code>
-     * <li> <code>LOWERCASE_LETTER</code>
-     * <li> <code>TITLECASE_LETTER</code>
-     * <li> <code>MODIFIER_LETTER</code>
-     * <li> <code>OTHER_LETTER</code>
+     * <li> {@code UPPERCASE_LETTER}
+     * <li> {@code LOWERCASE_LETTER}
+     * <li> {@code TITLECASE_LETTER}
+     * <li> {@code MODIFIER_LETTER}
+     * <li> {@code OTHER_LETTER}
      * </ul>
      *
      * Not all letters have case. Many characters are
      * letters but are neither uppercase nor lowercase nor titlecase.
      *
      * @param   codePoint the character (Unicode code point) to be tested.
-     * @return  <code>true</code> if the character is a letter;
-     *          <code>false</code> otherwise.
+     * @return  {@code true} if the character is a letter;
+     *          {@code false} otherwise.
      * @see     Character#isDigit(int)
      * @see     Character#isJavaIdentifierStart(int)
      * @see     Character#isLetterOrDigit(int)
@@ -5606,9 +5604,9 @@
      * Determines if the specified character is a letter or digit.
      * <p>
      * A character is considered to be a letter or digit if either
-     * <code>Character.isLetter(char ch)</code> or
-     * <code>Character.isDigit(char ch)</code> returns
-     * <code>true</code> for the character.
+     * {@code Character.isLetter(char ch)} or
+     * {@code Character.isDigit(char ch)} returns
+     * {@code true} for the character.
      *
      * <p><b>Note:</b> This method cannot handle <a
      * href="#supplementary"> supplementary characters</a>. To support
@@ -5616,8 +5614,8 @@
      * the {@link #isLetterOrDigit(int)} method.
      *
      * @param   ch   the character to be tested.
-     * @return  <code>true</code> if the character is a letter or digit;
-     *          <code>false</code> otherwise.
+     * @return  {@code true} if the character is a letter or digit;
+     *          {@code false} otherwise.
      * @see     Character#isDigit(char)
      * @see     Character#isJavaIdentifierPart(char)
      * @see     Character#isJavaLetter(char)
@@ -5636,11 +5634,11 @@
      * A character is considered to be a letter or digit if either
      * {@link #isLetter(int) isLetter(codePoint)} or
      * {@link #isDigit(int) isDigit(codePoint)} returns
-     * <code>true</code> for the character.
+     * {@code true} for the character.
      *
      * @param   codePoint the character (Unicode code point) to be tested.
-     * @return  <code>true</code> if the character is a letter or digit;
-     *          <code>false</code> otherwise.
+     * @return  {@code true} if the character is a letter or digit;
+     *          {@code false} otherwise.
      * @see     Character#isDigit(int)
      * @see     Character#isJavaIdentifierPart(int)
      * @see     Character#isLetter(int)
@@ -5664,15 +5662,15 @@
      * A character may start a Java identifier if and only if
      * one of the following is true:
      * <ul>
-     * <li> {@link #isLetter(char) isLetter(ch)} returns <code>true</code>
-     * <li> {@link #getType(char) getType(ch)} returns <code>LETTER_NUMBER</code>
-     * <li> ch is a currency symbol (such as "$")
-     * <li> ch is a connecting punctuation character (such as "_").
+     * <li> {@link #isLetter(char) isLetter(ch)} returns {@code true}
+     * <li> {@link #getType(char) getType(ch)} returns {@code LETTER_NUMBER}
+     * <li> {@code ch} is a currency symbol (such as {@code '$'})
+     * <li> {@code ch} is a connecting punctuation character (such as {@code '_'}).
      * </ul>
      *
      * @param   ch the character to be tested.
-     * @return  <code>true</code> if the character may start a Java
-     *          identifier; <code>false</code> otherwise.
+     * @return  {@code true} if the character may start a Java
+     *          identifier; {@code false} otherwise.
      * @see     Character#isJavaLetterOrDigit(char)
      * @see     Character#isJavaIdentifierStart(char)
      * @see     Character#isJavaIdentifierPart(char)
@@ -5695,19 +5693,19 @@
      * of the following are true:
      * <ul>
      * <li>  it is a letter
-     * <li>  it is a currency symbol (such as <code>'$'</code>)
-     * <li>  it is a connecting punctuation character (such as <code>'_'</code>)
+     * <li>  it is a currency symbol (such as {@code '$'})
+     * <li>  it is a connecting punctuation character (such as {@code '_'})
      * <li>  it is a digit
      * <li>  it is a numeric letter (such as a Roman numeral character)
      * <li>  it is a combining mark
      * <li>  it is a non-spacing mark
-     * <li> <code>isIdentifierIgnorable</code> returns
-     * <code>true</code> for the character.
+     * <li> {@code isIdentifierIgnorable} returns
+     * {@code true} for the character.
      * </ul>
      *
      * @param   ch the character to be tested.
-     * @return  <code>true</code> if the character may be part of a
-     *          Java identifier; <code>false</code> otherwise.
+     * @return  {@code true} if the character may be part of a
+     *          Java identifier; {@code false} otherwise.
      * @see     Character#isJavaLetter(char)
      * @see     Character#isJavaIdentifierStart(char)
      * @see     Character#isJavaIdentifierPart(char)
@@ -5730,10 +5728,10 @@
      * A character may start a Java identifier if and only if
      * one of the following conditions is true:
      * <ul>
-     * <li> {@link #isLetter(char) isLetter(ch)} returns <code>true</code>
-     * <li> {@link #getType(char) getType(ch)} returns <code>LETTER_NUMBER</code>
-     * <li> ch is a currency symbol (such as "$")
-     * <li> ch is a connecting punctuation character (such as "_").
+     * <li> {@link #isLetter(char) isLetter(ch)} returns {@code true}
+     * <li> {@link #getType(char) getType(ch)} returns {@code LETTER_NUMBER}
+     * <li> {@code ch} is a currency symbol (such as {@code '$'})
+     * <li> {@code ch} is a connecting punctuation character (such as {@code '_'}).
      * </ul>
      *
      * <p><b>Note:</b> This method cannot handle <a
@@ -5742,8 +5740,8 @@
      * the {@link #isJavaIdentifierStart(int)} method.
      *
      * @param   ch the character to be tested.
-     * @return  <code>true</code> if the character may start a Java identifier;
-     *          <code>false</code> otherwise.
+     * @return  {@code true} if the character may start a Java identifier;
+     *          {@code false} otherwise.
      * @see     Character#isJavaIdentifierPart(char)
      * @see     Character#isLetter(char)
      * @see     Character#isUnicodeIdentifierStart(char)
@@ -5762,17 +5760,17 @@
      * one of the following conditions is true:
      * <ul>
      * <li> {@link #isLetter(int) isLetter(codePoint)}
-     *      returns <code>true</code>
+     *      returns {@code true}
      * <li> {@link #getType(int) getType(codePoint)}
-     *      returns <code>LETTER_NUMBER</code>
-     * <li> the referenced character is a currency symbol (such as "$")
+     *      returns {@code LETTER_NUMBER}
+     * <li> the referenced character is a currency symbol (such as {@code '$'})
      * <li> the referenced character is a connecting punctuation character
-     *      (such as "_").
+     *      (such as {@code '_'}).
      * </ul>
      *
      * @param   codePoint the character (Unicode code point) to be tested.
-     * @return  <code>true</code> if the character may start a Java identifier;
-     *          <code>false</code> otherwise.
+     * @return  {@code true} if the character may start a Java identifier;
+     *          {@code false} otherwise.
      * @see     Character#isJavaIdentifierPart(int)
      * @see     Character#isLetter(int)
      * @see     Character#isUnicodeIdentifierStart(int)
@@ -5791,14 +5789,14 @@
      * are true:
      * <ul>
      * <li>  it is a letter
-     * <li>  it is a currency symbol (such as <code>'$'</code>)
-     * <li>  it is a connecting punctuation character (such as <code>'_'</code>)
+     * <li>  it is a currency symbol (such as {@code '$'})
+     * <li>  it is a connecting punctuation character (such as {@code '_'})
      * <li>  it is a digit
      * <li>  it is a numeric letter (such as a Roman numeral character)
      * <li>  it is a combining mark
      * <li>  it is a non-spacing mark
-     * <li> <code>isIdentifierIgnorable</code> returns
-     * <code>true</code> for the character
+     * <li> {@code isIdentifierIgnorable} returns
+     * {@code true} for the character
      * </ul>
      *
      * <p><b>Note:</b> This method cannot handle <a
@@ -5807,8 +5805,8 @@
      * the {@link #isJavaIdentifierPart(int)} method.
      *
      * @param   ch      the character to be tested.
-     * @return <code>true</code> if the character may be part of a
-     *          Java identifier; <code>false</code> otherwise.
+     * @return {@code true} if the character may be part of a
+     *          Java identifier; {@code false} otherwise.
      * @see     Character#isIdentifierIgnorable(char)
      * @see     Character#isJavaIdentifierStart(char)
      * @see     Character#isLetterOrDigit(char)
@@ -5828,20 +5826,20 @@
      * are true:
      * <ul>
      * <li>  it is a letter
-     * <li>  it is a currency symbol (such as <code>'$'</code>)
-     * <li>  it is a connecting punctuation character (such as <code>'_'</code>)
+     * <li>  it is a currency symbol (such as {@code '$'})
+     * <li>  it is a connecting punctuation character (such as {@code '_'})
      * <li>  it is a digit
      * <li>  it is a numeric letter (such as a Roman numeral character)
      * <li>  it is a combining mark
      * <li>  it is a non-spacing mark
      * <li> {@link #isIdentifierIgnorable(int)
-     * isIdentifierIgnorable(codePoint)} returns <code>true</code> for
+     * isIdentifierIgnorable(codePoint)} returns {@code true} for
      * the character
      * </ul>
      *
      * @param   codePoint the character (Unicode code point) to be tested.
-     * @return <code>true</code> if the character may be part of a
-     *          Java identifier; <code>false</code> otherwise.
+     * @return {@code true} if the character may be part of a
+     *          Java identifier; {@code false} otherwise.
      * @see     Character#isIdentifierIgnorable(int)
      * @see     Character#isJavaIdentifierStart(int)
      * @see     Character#isLetterOrDigit(int)
@@ -5860,9 +5858,9 @@
      * A character may start a Unicode identifier if and only if
      * one of the following conditions is true:
      * <ul>
-     * <li> {@link #isLetter(char) isLetter(ch)} returns <code>true</code>
+     * <li> {@link #isLetter(char) isLetter(ch)} returns {@code true}
      * <li> {@link #getType(char) getType(ch)} returns
-     *      <code>LETTER_NUMBER</code>.
+     *      {@code LETTER_NUMBER}.
      * </ul>
      *
      * <p><b>Note:</b> This method cannot handle <a
@@ -5871,8 +5869,8 @@
      * the {@link #isUnicodeIdentifierStart(int)} method.
      *
      * @param   ch      the character to be tested.
-     * @return  <code>true</code> if the character may start a Unicode
-     *          identifier; <code>false</code> otherwise.
+     * @return  {@code true} if the character may start a Unicode
+     *          identifier; {@code false} otherwise.
      * @see     Character#isJavaIdentifierStart(char)
      * @see     Character#isLetter(char)
      * @see     Character#isUnicodeIdentifierPart(char)
@@ -5890,13 +5888,13 @@
      * one of the following conditions is true:
      * <ul>
      * <li> {@link #isLetter(int) isLetter(codePoint)}
-     *      returns <code>true</code>
+     *      returns {@code true}
      * <li> {@link #getType(int) getType(codePoint)}
-     *      returns <code>LETTER_NUMBER</code>.
+     *      returns {@code LETTER_NUMBER}.
      * </ul>
      * @param   codePoint the character (Unicode code point) to be tested.
-     * @return  <code>true</code> if the character may start a Unicode
-     *          identifier; <code>false</code> otherwise.
+     * @return  {@code true} if the character may start a Unicode
+     *          identifier; {@code false} otherwise.
      * @see     Character#isJavaIdentifierStart(int)
      * @see     Character#isLetter(int)
      * @see     Character#isUnicodeIdentifierPart(int)
@@ -5914,13 +5912,13 @@
      * one of the following statements is true:
      * <ul>
      * <li>  it is a letter
-     * <li>  it is a connecting punctuation character (such as <code>'_'</code>)
+     * <li>  it is a connecting punctuation character (such as {@code '_'})
      * <li>  it is a digit
      * <li>  it is a numeric letter (such as a Roman numeral character)
      * <li>  it is a combining mark
      * <li>  it is a non-spacing mark
-     * <li> <code>isIdentifierIgnorable</code> returns
-     * <code>true</code> for this character.
+     * <li> {@code isIdentifierIgnorable} returns
+     * {@code true} for this character.
      * </ul>
      *
      * <p><b>Note:</b> This method cannot handle <a
@@ -5929,8 +5927,8 @@
      * the {@link #isUnicodeIdentifierPart(int)} method.
      *
      * @param   ch      the character to be tested.
-     * @return  <code>true</code> if the character may be part of a
-     *          Unicode identifier; <code>false</code> otherwise.
+     * @return  {@code true} if the character may be part of a
+     *          Unicode identifier; {@code false} otherwise.
      * @see     Character#isIdentifierIgnorable(char)
      * @see     Character#isJavaIdentifierPart(char)
      * @see     Character#isLetterOrDigit(char)
@@ -5949,17 +5947,17 @@
      * one of the following statements is true:
      * <ul>
      * <li>  it is a letter
-     * <li>  it is a connecting punctuation character (such as <code>'_'</code>)
+     * <li>  it is a connecting punctuation character (such as {@code '_'})
      * <li>  it is a digit
      * <li>  it is a numeric letter (such as a Roman numeral character)
      * <li>  it is a combining mark
      * <li>  it is a non-spacing mark
-     * <li> <code>isIdentifierIgnorable</code> returns
-     * <code>true</code> for this character.
+     * <li> {@code isIdentifierIgnorable} returns
+     * {@code true} for this character.
      * </ul>
      * @param   codePoint the character (Unicode code point) to be tested.
-     * @return  <code>true</code> if the character may be part of a
-     *          Unicode identifier; <code>false</code> otherwise.
+     * @return  {@code true} if the character may be part of a
+     *          Unicode identifier; {@code false} otherwise.
      * @see     Character#isIdentifierIgnorable(int)
      * @see     Character#isJavaIdentifierPart(int)
      * @see     Character#isLetterOrDigit(int)
@@ -5979,12 +5977,12 @@
      * <ul>
      * <li>ISO control characters that are not whitespace
      * <ul>
-     * <li><code>'&#92;u0000'</code> through <code>'&#92;u0008'</code>
-     * <li><code>'&#92;u000E'</code> through <code>'&#92;u001B'</code>
-     * <li><code>'&#92;u007F'</code> through <code>'&#92;u009F'</code>
+     * <li>{@code '\u005Cu0000'} through {@code '\u005Cu0008'}
+     * <li>{@code '\u005Cu000E'} through {@code '\u005Cu001B'}
+     * <li>{@code '\u005Cu007F'} through {@code '\u005Cu009F'}
      * </ul>
      *
-     * <li>all characters that have the <code>FORMAT</code> general
+     * <li>all characters that have the {@code FORMAT} general
      * category value
      * </ul>
      *
@@ -5994,9 +5992,9 @@
      * the {@link #isIdentifierIgnorable(int)} method.
      *
      * @param   ch      the character to be tested.
-     * @return  <code>true</code> if the character is an ignorable control
+     * @return  {@code true} if the character is an ignorable control
      *          character that may be part of a Java or Unicode identifier;
-     *           <code>false</code> otherwise.
+     *           {@code false} otherwise.
      * @see     Character#isJavaIdentifierPart(char)
      * @see     Character#isUnicodeIdentifierPart(char)
      * @since   1.1
@@ -6014,19 +6012,19 @@
      * <ul>
      * <li>ISO control characters that are not whitespace
      * <ul>
-     * <li><code>'&#92;u0000'</code> through <code>'&#92;u0008'</code>
-     * <li><code>'&#92;u000E'</code> through <code>'&#92;u001B'</code>
-     * <li><code>'&#92;u007F'</code> through <code>'&#92;u009F'</code>
+     * <li>{@code '\u005Cu0000'} through {@code '\u005Cu0008'}
+     * <li>{@code '\u005Cu000E'} through {@code '\u005Cu001B'}
+     * <li>{@code '\u005Cu007F'} through {@code '\u005Cu009F'}
      * </ul>
      *
-     * <li>all characters that have the <code>FORMAT</code> general
+     * <li>all characters that have the {@code FORMAT} general
      * category value
      * </ul>
      *
      * @param   codePoint the character (Unicode code point) to be tested.
-     * @return  <code>true</code> if the character is an ignorable control
+     * @return  {@code true} if the character is an ignorable control
      *          character that may be part of a Java or Unicode identifier;
-     *          <code>false</code> otherwise.
+     *          {@code false} otherwise.
      * @see     Character#isJavaIdentifierPart(int)
      * @see     Character#isUnicodeIdentifierPart(int)
      * @since   1.5
@@ -6040,16 +6038,16 @@
      * mapping information from the UnicodeData file.
      * <p>
      * Note that
-     * <code>Character.isLowerCase(Character.toLowerCase(ch))</code>
-     * does not always return <code>true</code> for some ranges of
+     * {@code Character.isLowerCase(Character.toLowerCase(ch))}
+     * does not always return {@code true} for some ranges of
      * characters, particularly those that are symbols or ideographs.
      *
      * <p>In general, {@link String#toLowerCase()} should be used to map
-     * characters to lowercase. <code>String</code> case mapping methods
-     * have several benefits over <code>Character</code> case mapping methods.
-     * <code>String</code> case mapping methods can perform locale-sensitive
+     * characters to lowercase. {@code String} case mapping methods
+     * have several benefits over {@code Character} case mapping methods.
+     * {@code String} case mapping methods can perform locale-sensitive
      * mappings, context-sensitive mappings, and 1:M character mappings, whereas
-     * the <code>Character</code> case mapping methods cannot.
+     * the {@code Character} case mapping methods cannot.
      *
      * <p><b>Note:</b> This method cannot handle <a
      * href="#supplementary"> supplementary characters</a>. To support
@@ -6072,16 +6070,16 @@
      * file.
      *
      * <p> Note that
-     * <code>Character.isLowerCase(Character.toLowerCase(codePoint))</code>
-     * does not always return <code>true</code> for some ranges of
+     * {@code Character.isLowerCase(Character.toLowerCase(codePoint))}
+     * does not always return {@code true} for some ranges of
      * characters, particularly those that are symbols or ideographs.
      *
      * <p>In general, {@link String#toLowerCase()} should be used to map
-     * characters to lowercase. <code>String</code> case mapping methods
-     * have several benefits over <code>Character</code> case mapping methods.
-     * <code>String</code> case mapping methods can perform locale-sensitive
+     * characters to lowercase. {@code String} case mapping methods
+     * have several benefits over {@code Character} case mapping methods.
+     * {@code String} case mapping methods can perform locale-sensitive
      * mappings, context-sensitive mappings, and 1:M character mappings, whereas
-     * the <code>Character</code> case mapping methods cannot.
+     * the {@code Character} case mapping methods cannot.
      *
      * @param   codePoint   the character (Unicode code point) to be converted.
      * @return  the lowercase equivalent of the character (Unicode code
@@ -6100,16 +6098,16 @@
      * information from the UnicodeData file.
      * <p>
      * Note that
-     * <code>Character.isUpperCase(Character.toUpperCase(ch))</code>
-     * does not always return <code>true</code> for some ranges of
+     * {@code Character.isUpperCase(Character.toUpperCase(ch))}
+     * does not always return {@code true} for some ranges of
      * characters, particularly those that are symbols or ideographs.
      *
      * <p>In general, {@link String#toUpperCase()} should be used to map
-     * characters to uppercase. <code>String</code> case mapping methods
-     * have several benefits over <code>Character</code> case mapping methods.
-     * <code>String</code> case mapping methods can perform locale-sensitive
+     * characters to uppercase. {@code String} case mapping methods
+     * have several benefits over {@code Character} case mapping methods.
+     * {@code String} case mapping methods can perform locale-sensitive
      * mappings, context-sensitive mappings, and 1:M character mappings, whereas
-     * the <code>Character</code> case mapping methods cannot.
+     * the {@code Character} case mapping methods cannot.
      *
      * <p><b>Note:</b> This method cannot handle <a
      * href="#supplementary"> supplementary characters</a>. To support
@@ -6132,16 +6130,16 @@
      * file.
      *
      * <p>Note that
-     * <code>Character.isUpperCase(Character.toUpperCase(codePoint))</code>
-     * does not always return <code>true</code> for some ranges of
+     * {@code Character.isUpperCase(Character.toUpperCase(codePoint))}
+     * does not always return {@code true} for some ranges of
      * characters, particularly those that are symbols or ideographs.
      *
      * <p>In general, {@link String#toUpperCase()} should be used to map
-     * characters to uppercase. <code>String</code> case mapping methods
-     * have several benefits over <code>Character</code> case mapping methods.
-     * <code>String</code> case mapping methods can perform locale-sensitive
+     * characters to uppercase. {@code String} case mapping methods
+     * have several benefits over {@code Character} case mapping methods.
+     * {@code String} case mapping methods can perform locale-sensitive
      * mappings, context-sensitive mappings, and 1:M character mappings, whereas
-     * the <code>Character</code> case mapping methods cannot.
+     * the {@code Character} case mapping methods cannot.
      *
      * @param   codePoint   the character (Unicode code point) to be converted.
      * @return  the uppercase equivalent of the character, if any;
@@ -6161,13 +6159,13 @@
      * explicit titlecase mapping and is not itself a titlecase char
      * according to UnicodeData, then the uppercase mapping is
      * returned as an equivalent titlecase mapping. If the
-     * <code>char</code> argument is already a titlecase
-     * <code>char</code>, the same <code>char</code> value will be
+     * {@code char} argument is already a titlecase
+     * {@code char}, the same {@code char} value will be
      * returned.
      * <p>
      * Note that
-     * <code>Character.isTitleCase(Character.toTitleCase(ch))</code>
-     * does not always return <code>true</code> for some ranges of
+     * {@code Character.isTitleCase(Character.toTitleCase(ch))}
+     * does not always return {@code true} for some ranges of
      * characters.
      *
      * <p><b>Note:</b> This method cannot handle <a
@@ -6198,8 +6196,8 @@
      * returned.
      *
      * <p>Note that
-     * <code>Character.isTitleCase(Character.toTitleCase(codePoint))</code>
-     * does not always return <code>true</code> for some ranges of
+     * {@code Character.isTitleCase(Character.toTitleCase(codePoint))}
+     * does not always return {@code true} for some ranges of
      * characters.
      *
      * @param   codePoint   the character (Unicode code point) to be converted.
@@ -6215,28 +6213,40 @@
     }
 
     /**
-     * Returns the numeric value of the character <code>ch</code> in the
+     * Returns the numeric value of the character {@code ch} in the
      * specified radix.
      * <p>
-     * If the radix is not in the range <code>MIN_RADIX</code>&nbsp;&lt;=
-     * <code>radix</code>&nbsp;&lt;= <code>MAX_RADIX</code> or if the
-     * value of <code>ch</code> is not a valid digit in the specified
-     * radix, <code>-1</code> is returned. A character is a valid digit
+     * If the radix is not in the range {@code MIN_RADIX} &le;
+     * {@code radix} &le; {@code MAX_RADIX} or if the
+     * value of {@code ch} is not a valid digit in the specified
+     * radix, {@code -1} is returned. A character is a valid digit
      * if at least one of the following is true:
      * <ul>
-     * <li>The method <code>isDigit</code> is <code>true</code> of the character
+     * <li>The method {@code isDigit} is {@code true} of the character
      *     and the Unicode decimal digit value of the character (or its
      *     single-character decomposition) is less than the specified radix.
      *     In this case the decimal digit value is returned.
      * <li>The character is one of the uppercase Latin letters
-     *     <code>'A'</code> through <code>'Z'</code> and its code is less than
-     *     <code>radix&nbsp;+ 'A'&nbsp;-&nbsp;10</code>.
-     *     In this case, <code>ch&nbsp;- 'A'&nbsp;+&nbsp;10</code>
+     *     {@code 'A'} through {@code 'Z'} and its code is less than
+     *     {@code radix + 'A' - 10}.
+     *     In this case, {@code ch - 'A' + 10}
      *     is returned.
      * <li>The character is one of the lowercase Latin letters
-     *     <code>'a'</code> through <code>'z'</code> and its code is less than
-     *     <code>radix&nbsp;+ 'a'&nbsp;-&nbsp;10</code>.
-     *     In this case, <code>ch&nbsp;- 'a'&nbsp;+&nbsp;10</code>
+     *     {@code 'a'} through {@code 'z'} and its code is less than
+     *     {@code radix + 'a' - 10}.
+     *     In this case, {@code ch - 'a' + 10}
+     *     is returned.
+     * <li>The character is one of the fullwidth uppercase Latin letters A
+     *     ({@code '\u005CuFF21'}) through Z ({@code '\u005CuFF3A'})
+     *     and its code is less than
+     *     {@code radix + '\u005CuFF21' - 10}.
+     *     In this case, {@code ch - '\u005CuFF21' + 10}
+     *     is returned.
+     * <li>The character is one of the fullwidth lowercase Latin letters a
+     *     ({@code '\u005CuFF41'}) through z ({@code '\u005CuFF5A'})
+     *     and its code is less than
+     *     {@code radix + '\u005CuFF41' - 10}.
+     *     In this case, {@code ch - '\u005CuFF41' + 10}
      *     is returned.
      * </ul>
      *
@@ -6260,25 +6270,39 @@
      * Returns the numeric value of the specified character (Unicode
      * code point) in the specified radix.
      *
-     * <p>If the radix is not in the range <code>MIN_RADIX</code>&nbsp;&lt;=
-     * <code>radix</code>&nbsp;&lt;= <code>MAX_RADIX</code> or if the
+     * <p>If the radix is not in the range {@code MIN_RADIX} &le;
+     * {@code radix} &le; {@code MAX_RADIX} or if the
      * character is not a valid digit in the specified
-     * radix, <code>-1</code> is returned. A character is a valid digit
+     * radix, {@code -1} is returned. A character is a valid digit
      * if at least one of the following is true:
      * <ul>
-     * <li>The method {@link #isDigit(int) isDigit(codePoint)} is <code>true</code> of the character
+     * <li>The method {@link #isDigit(int) isDigit(codePoint)} is {@code true} of the character
      *     and the Unicode decimal digit value of the character (or its
      *     single-character decomposition) is less than the specified radix.
      *     In this case the decimal digit value is returned.
      * <li>The character is one of the uppercase Latin letters
-     *     <code>'A'</code> through <code>'Z'</code> and its code is less than
-     *     <code>radix&nbsp;+ 'A'&nbsp;-&nbsp;10</code>.
-     *     In this case, <code>ch&nbsp;- 'A'&nbsp;+&nbsp;10</code>
+     *     {@code 'A'} through {@code 'Z'} and its code is less than
+     *     {@code radix + 'A' - 10}.
+     *     In this case, {@code codePoint - 'A' + 10}
      *     is returned.
      * <li>The character is one of the lowercase Latin letters
-     *     <code>'a'</code> through <code>'z'</code> and its code is less than
-     *     <code>radix&nbsp;+ 'a'&nbsp;-&nbsp;10</code>.
-     *     In this case, <code>ch&nbsp;- 'a'&nbsp;+&nbsp;10</code>
+     *     {@code 'a'} through {@code 'z'} and its code is less than
+     *     {@code radix + 'a' - 10}.
+     *     In this case, {@code codePoint - 'a' + 10}
+     *     is returned.
+     * <li>The character is one of the fullwidth uppercase Latin letters A
+     *     ({@code '\u005CuFF21'}) through Z ({@code '\u005CuFF3A'})
+     *     and its code is less than
+     *     {@code radix + '\u005CuFF21' - 10}.
+     *     In this case,
+     *     {@code codePoint - '\u005CuFF21' + 10}
+     *     is returned.
+     * <li>The character is one of the fullwidth lowercase Latin letters a
+     *     ({@code '\u005CuFF41'}) through z ({@code '\u005CuFF5A'})
+     *     and its code is less than
+     *     {@code radix + '\u005CuFF41'- 10}.
+     *     In this case,
+     *     {@code codePoint - '\u005CuFF41' + 10}
      *     is returned.
      * </ul>
      *
@@ -6295,19 +6319,19 @@
     }
 
     /**
-     * Returns the <code>int</code> value that the specified Unicode
+     * Returns the {@code int} value that the specified Unicode
      * character represents. For example, the character
-     * <code>'&#92;u216C'</code> (the roman numeral fifty) will return
+     * {@code '\u005Cu216C'} (the roman numeral fifty) will return
      * an int with a value of 50.
      * <p>
-     * The letters A-Z in their uppercase (<code>'&#92;u0041'</code> through
-     * <code>'&#92;u005A'</code>), lowercase
-     * (<code>'&#92;u0061'</code> through <code>'&#92;u007A'</code>), and
-     * full width variant (<code>'&#92;uFF21'</code> through
-     * <code>'&#92;uFF3A'</code> and <code>'&#92;uFF41'</code> through
-     * <code>'&#92;uFF5A'</code>) forms have numeric values from 10
+     * The letters A-Z in their uppercase ({@code '\u005Cu0041'} through
+     * {@code '\u005Cu005A'}), lowercase
+     * ({@code '\u005Cu0061'} through {@code '\u005Cu007A'}), and
+     * full width variant ({@code '\u005CuFF21'} through
+     * {@code '\u005CuFF3A'} and {@code '\u005CuFF41'} through
+     * {@code '\u005CuFF5A'}) forms have numeric values from 10
      * through 35. This is independent of the Unicode specification,
-     * which does not assign numeric values to these <code>char</code>
+     * which does not assign numeric values to these {@code char}
      * values.
      * <p>
      * If the character does not have a numeric value, then -1 is returned.
@@ -6321,7 +6345,7 @@
      * the {@link #getNumericValue(int)} method.
      *
      * @param   ch      the character to be converted.
-     * @return  the numeric value of the character, as a nonnegative <code>int</code>
+     * @return  the numeric value of the character, as a nonnegative {@code int}
      *           value; -2 if the character has a numeric value that is not a
      *          nonnegative integer; -1 if the character has no numeric value.
      * @see     Character#forDigit(int, int)
@@ -6333,19 +6357,19 @@
     }
 
     /**
-     * Returns the <code>int</code> value that the specified
+     * Returns the {@code int} value that the specified
      * character (Unicode code point) represents. For example, the character
-     * <code>'&#92;u216C'</code> (the Roman numeral fifty) will return
-     * an <code>int</code> with a value of 50.
+     * {@code '\u005Cu216C'} (the Roman numeral fifty) will return
+     * an {@code int} with a value of 50.
      * <p>
-     * The letters A-Z in their uppercase (<code>'&#92;u0041'</code> through
-     * <code>'&#92;u005A'</code>), lowercase
-     * (<code>'&#92;u0061'</code> through <code>'&#92;u007A'</code>), and
-     * full width variant (<code>'&#92;uFF21'</code> through
-     * <code>'&#92;uFF3A'</code> and <code>'&#92;uFF41'</code> through
-     * <code>'&#92;uFF5A'</code>) forms have numeric values from 10
+     * The letters A-Z in their uppercase ({@code '\u005Cu0041'} through
+     * {@code '\u005Cu005A'}), lowercase
+     * ({@code '\u005Cu0061'} through {@code '\u005Cu007A'}), and
+     * full width variant ({@code '\u005CuFF21'} through
+     * {@code '\u005CuFF3A'} and {@code '\u005CuFF41'} through
+     * {@code '\u005CuFF5A'}) forms have numeric values from 10
      * through 35. This is independent of the Unicode specification,
-     * which does not assign numeric values to these <code>char</code>
+     * which does not assign numeric values to these {@code char}
      * values.
      * <p>
      * If the character does not have a numeric value, then -1 is returned.
@@ -6354,7 +6378,7 @@
      * is returned.
      *
      * @param   codePoint the character (Unicode code point) to be converted.
-     * @return  the numeric value of the character, as a nonnegative <code>int</code>
+     * @return  the numeric value of the character, as a nonnegative {@code int}
      *          value; -2 if the character has a numeric value that is not a
      *          nonnegative integer; -1 if the character has no numeric value.
      * @see     Character#forDigit(int, int)
@@ -6367,24 +6391,24 @@
 
     /**
      * Determines if the specified character is ISO-LATIN-1 white space.
-     * This method returns <code>true</code> for the following five
+     * This method returns {@code true} for the following five
      * characters only:
      * <table>
-     * <tr><td><code>'\t'</code></td>            <td><code>U+0009</code></td>
-     *     <td><code>HORIZONTAL TABULATION</code></td></tr>
-     * <tr><td><code>'\n'</code></td>            <td><code>U+000A</code></td>
-     *     <td><code>NEW LINE</code></td></tr>
-     * <tr><td><code>'\f'</code></td>            <td><code>U+000C</code></td>
-     *     <td><code>FORM FEED</code></td></tr>
-     * <tr><td><code>'\r'</code></td>            <td><code>U+000D</code></td>
-     *     <td><code>CARRIAGE RETURN</code></td></tr>
-     * <tr><td><code>'&nbsp;'</code></td>  <td><code>U+0020</code></td>
-     *     <td><code>SPACE</code></td></tr>
+     * <tr><td>{@code '\t'}</td>            <td>{@code U+0009}</td>
+     *     <td>{@code HORIZONTAL TABULATION}</td></tr>
+     * <tr><td>{@code '\n'}</td>            <td>{@code U+000A}</td>
+     *     <td>{@code NEW LINE}</td></tr>
+     * <tr><td>{@code '\f'}</td>            <td>{@code U+000C}</td>
+     *     <td>{@code FORM FEED}</td></tr>
+     * <tr><td>{@code '\r'}</td>            <td>{@code U+000D}</td>
+     *     <td>{@code CARRIAGE RETURN}</td></tr>
+     * <tr><td>{@code '&nbsp;'}</td>  <td>{@code U+0020}</td>
+     *     <td>{@code SPACE}</td></tr>
      * </table>
      *
      * @param      ch   the character to be tested.
-     * @return     <code>true</code> if the character is ISO-LATIN-1 white
-     *             space; <code>false</code> otherwise.
+     * @return     {@code true} if the character is ISO-LATIN-1 white
+     *             space; {@code false} otherwise.
      * @see        Character#isSpaceChar(char)
      * @see        Character#isWhitespace(char)
      * @deprecated Replaced by isWhitespace(char).
@@ -6407,9 +6431,9 @@
      * method returns true if the character's general category type is any of
      * the following:
      * <ul>
-     * <li> <code>SPACE_SEPARATOR</code>
-     * <li> <code>LINE_SEPARATOR</code>
-     * <li> <code>PARAGRAPH_SEPARATOR</code>
+     * <li> {@code SPACE_SEPARATOR}
+     * <li> {@code LINE_SEPARATOR}
+     * <li> {@code PARAGRAPH_SEPARATOR}
      * </ul>
      *
      * <p><b>Note:</b> This method cannot handle <a
@@ -6418,8 +6442,8 @@
      * the {@link #isSpaceChar(int)} method.
      *
      * @param   ch      the character to be tested.
-     * @return  <code>true</code> if the character is a space character;
-     *          <code>false</code> otherwise.
+     * @return  {@code true} if the character is a space character;
+     *          {@code false} otherwise.
      * @see     Character#isWhitespace(char)
      * @since   1.1
      */
@@ -6441,8 +6465,8 @@
      * </ul>
      *
      * @param   codePoint the character (Unicode code point) to be tested.
-     * @return  <code>true</code> if the character is a space character;
-     *          <code>false</code> otherwise.
+     * @return  {@code true} if the character is a space character;
+     *          {@code false} otherwise.
      * @see     Character#isWhitespace(int)
      * @since   1.5
      */
@@ -6458,19 +6482,19 @@
      * A character is a Java whitespace character if and only if it satisfies
      * one of the following criteria:
      * <ul>
-     * <li> It is a Unicode space character (<code>SPACE_SEPARATOR</code>,
-     *      <code>LINE_SEPARATOR</code>, or <code>PARAGRAPH_SEPARATOR</code>)
-     *      but is not also a non-breaking space (<code>'&#92;u00A0'</code>,
-     *      <code>'&#92;u2007'</code>, <code>'&#92;u202F'</code>).
-     * <li> It is <code>'&#92;t'</code>, U+0009 HORIZONTAL TABULATION.
-     * <li> It is <code>'&#92;n'</code>, U+000A LINE FEED.
-     * <li> It is <code>'&#92;u000B'</code>, U+000B VERTICAL TABULATION.
-     * <li> It is <code>'&#92;f'</code>, U+000C FORM FEED.
-     * <li> It is <code>'&#92;r'</code>, U+000D CARRIAGE RETURN.
-     * <li> It is <code>'&#92;u001C'</code>, U+001C FILE SEPARATOR.
-     * <li> It is <code>'&#92;u001D'</code>, U+001D GROUP SEPARATOR.
-     * <li> It is <code>'&#92;u001E'</code>, U+001E RECORD SEPARATOR.
-     * <li> It is <code>'&#92;u001F'</code>, U+001F UNIT SEPARATOR.
+     * <li> It is a Unicode space character ({@code SPACE_SEPARATOR},
+     *      {@code LINE_SEPARATOR}, or {@code PARAGRAPH_SEPARATOR})
+     *      but is not also a non-breaking space ({@code '\u005Cu00A0'},
+     *      {@code '\u005Cu2007'}, {@code '\u005Cu202F'}).
+     * <li> It is {@code '\u005Ct'}, U+0009 HORIZONTAL TABULATION.
+     * <li> It is {@code '\u005Cn'}, U+000A LINE FEED.
+     * <li> It is {@code '\u005Cu000B'}, U+000B VERTICAL TABULATION.
+     * <li> It is {@code '\u005Cf'}, U+000C FORM FEED.
+     * <li> It is {@code '\u005Cr'}, U+000D CARRIAGE RETURN.
+     * <li> It is {@code '\u005Cu001C'}, U+001C FILE SEPARATOR.
+     * <li> It is {@code '\u005Cu001D'}, U+001D GROUP SEPARATOR.
+     * <li> It is {@code '\u005Cu001E'}, U+001E RECORD SEPARATOR.
+     * <li> It is {@code '\u005Cu001F'}, U+001F UNIT SEPARATOR.
      * </ul>
      *
      * <p><b>Note:</b> This method cannot handle <a
@@ -6479,8 +6503,8 @@
      * the {@link #isWhitespace(int)} method.
      *
      * @param   ch the character to be tested.
-     * @return  <code>true</code> if the character is a Java whitespace
-     *          character; <code>false</code> otherwise.
+     * @return  {@code true} if the character is a Java whitespace
+     *          character; {@code false} otherwise.
      * @see     Character#isSpaceChar(char)
      * @since   1.1
      */
@@ -6496,23 +6520,23 @@
      * <ul>
      * <li> It is a Unicode space character ({@link #SPACE_SEPARATOR},
      *      {@link #LINE_SEPARATOR}, or {@link #PARAGRAPH_SEPARATOR})
-     *      but is not also a non-breaking space (<code>'&#92;u00A0'</code>,
-     *      <code>'&#92;u2007'</code>, <code>'&#92;u202F'</code>).
-     * <li> It is <code>'&#92;t'</code>, U+0009 HORIZONTAL TABULATION.
-     * <li> It is <code>'&#92;n'</code>, U+000A LINE FEED.
-     * <li> It is <code>'&#92;u000B'</code>, U+000B VERTICAL TABULATION.
-     * <li> It is <code>'&#92;f'</code>, U+000C FORM FEED.
-     * <li> It is <code>'&#92;r'</code>, U+000D CARRIAGE RETURN.
-     * <li> It is <code>'&#92;u001C'</code>, U+001C FILE SEPARATOR.
-     * <li> It is <code>'&#92;u001D'</code>, U+001D GROUP SEPARATOR.
-     * <li> It is <code>'&#92;u001E'</code>, U+001E RECORD SEPARATOR.
-     * <li> It is <code>'&#92;u001F'</code>, U+001F UNIT SEPARATOR.
+     *      but is not also a non-breaking space ({@code '\u005Cu00A0'},
+     *      {@code '\u005Cu2007'}, {@code '\u005Cu202F'}).
+     * <li> It is {@code '\u005Ct'}, U+0009 HORIZONTAL TABULATION.
+     * <li> It is {@code '\u005Cn'}, U+000A LINE FEED.
+     * <li> It is {@code '\u005Cu000B'}, U+000B VERTICAL TABULATION.
+     * <li> It is {@code '\u005Cf'}, U+000C FORM FEED.
+     * <li> It is {@code '\u005Cr'}, U+000D CARRIAGE RETURN.
+     * <li> It is {@code '\u005Cu001C'}, U+001C FILE SEPARATOR.
+     * <li> It is {@code '\u005Cu001D'}, U+001D GROUP SEPARATOR.
+     * <li> It is {@code '\u005Cu001E'}, U+001E RECORD SEPARATOR.
+     * <li> It is {@code '\u005Cu001F'}, U+001F UNIT SEPARATOR.
      * </ul>
      * <p>
      *
      * @param   codePoint the character (Unicode code point) to be tested.
-     * @return  <code>true</code> if the character is a Java whitespace
-     *          character; <code>false</code> otherwise.
+     * @return  {@code true} if the character is a Java whitespace
+     *          character; {@code false} otherwise.
      * @see     Character#isSpaceChar(int)
      * @since   1.5
      */
@@ -6523,9 +6547,9 @@
     /**
      * Determines if the specified character is an ISO control
      * character.  A character is considered to be an ISO control
-     * character if its code is in the range <code>'&#92;u0000'</code>
-     * through <code>'&#92;u001F'</code> or in the range
-     * <code>'&#92;u007F'</code> through <code>'&#92;u009F'</code>.
+     * character if its code is in the range {@code '\u005Cu0000'}
+     * through {@code '\u005Cu001F'} or in the range
+     * {@code '\u005Cu007F'} through {@code '\u005Cu009F'}.
      *
      * <p><b>Note:</b> This method cannot handle <a
      * href="#supplementary"> supplementary characters</a>. To support
@@ -6533,8 +6557,8 @@
      * the {@link #isISOControl(int)} method.
      *
      * @param   ch      the character to be tested.
-     * @return  <code>true</code> if the character is an ISO control character;
-     *          <code>false</code> otherwise.
+     * @return  {@code true} if the character is an ISO control character;
+     *          {@code false} otherwise.
      *
      * @see     Character#isSpaceChar(char)
      * @see     Character#isWhitespace(char)
@@ -6547,13 +6571,13 @@
     /**
      * Determines if the referenced character (Unicode code point) is an ISO control
      * character.  A character is considered to be an ISO control
-     * character if its code is in the range <code>'&#92;u0000'</code>
-     * through <code>'&#92;u001F'</code> or in the range
-     * <code>'&#92;u007F'</code> through <code>'&#92;u009F'</code>.
+     * character if its code is in the range {@code '\u005Cu0000'}
+     * through {@code '\u005Cu001F'} or in the range
+     * {@code '\u005Cu007F'} through {@code '\u005Cu009F'}.
      *
      * @param   codePoint the character (Unicode code point) to be tested.
-     * @return  <code>true</code> if the character is an ISO control character;
-     *          <code>false</code> otherwise.
+     * @return  {@code true} if the character is an ISO control character;
+     *          {@code false} otherwise.
      * @see     Character#isSpaceChar(int)
      * @see     Character#isWhitespace(int)
      * @since   1.5
@@ -6575,7 +6599,7 @@
      * the {@link #getType(int)} method.
      *
      * @param   ch      the character to be tested.
-     * @return  a value of type <code>int</code> representing the
+     * @return  a value of type {@code int} representing the
      *          character's general category.
      * @see     Character#COMBINING_SPACING_MARK
      * @see     Character#CONNECTOR_PUNCTUATION
@@ -6617,7 +6641,7 @@
      * Returns a value indicating a character's general category.
      *
      * @param   codePoint the character (Unicode code point) to be tested.
-     * @return  a value of type <code>int</code> representing the
+     * @return  a value of type {@code int} representing the
      *          character's general category.
      * @see     Character#COMBINING_SPACING_MARK COMBINING_SPACING_MARK
      * @see     Character#CONNECTOR_PUNCTUATION CONNECTOR_PUNCTUATION
@@ -6657,23 +6681,23 @@
 
     /**
      * Determines the character representation for a specific digit in
-     * the specified radix. If the value of <code>radix</code> is not a
-     * valid radix, or the value of <code>digit</code> is not a valid
+     * the specified radix. If the value of {@code radix} is not a
+     * valid radix, or the value of {@code digit} is not a valid
      * digit in the specified radix, the null character
-     * (<code>'&#92;u0000'</code>) is returned.
+     * ({@code '\u005Cu0000'}) is returned.
      * <p>
-     * The <code>radix</code> argument is valid if it is greater than or
-     * equal to <code>MIN_RADIX</code> and less than or equal to
-     * <code>MAX_RADIX</code>. The <code>digit</code> argument is valid if
-     * <code>0&nbsp;&lt;=digit&nbsp;&lt;&nbsp;radix</code>.
+     * The {@code radix} argument is valid if it is greater than or
+     * equal to {@code MIN_RADIX} and less than or equal to
+     * {@code MAX_RADIX}. The {@code digit} argument is valid if
+     * {@code 0 <= digit < radix}.
      * <p>
      * If the digit is less than 10, then
-     * <code>'0'&nbsp;+ digit</code> is returned. Otherwise, the value
-     * <code>'a'&nbsp;+ digit&nbsp;-&nbsp;10</code> is returned.
+     * {@code '0' + digit} is returned. Otherwise, the value
+     * {@code 'a' + digit - 10} is returned.
      *
      * @param   digit   the number to convert to a character.
      * @param   radix   the radix.
-     * @return  the <code>char</code> representation of the specified digit
+     * @return  the {@code char} representation of the specified digit
      *          in the specified radix.
      * @see     Character#MIN_RADIX
      * @see     Character#MAX_RADIX
@@ -6696,16 +6720,16 @@
      * Returns the Unicode directionality property for the given
      * character.  Character directionality is used to calculate the
      * visual ordering of text. The directionality value of undefined
-     * <code>char</code> values is <code>DIRECTIONALITY_UNDEFINED</code>.
+     * {@code char} values is {@code DIRECTIONALITY_UNDEFINED}.
      *
      * <p><b>Note:</b> This method cannot handle <a
      * href="#supplementary"> supplementary characters</a>. To support
      * all Unicode characters, including supplementary characters, use
      * the {@link #getDirectionality(int)} method.
      *
-     * @param  ch <code>char</code> for which the directionality property
+     * @param  ch {@code char} for which the directionality property
      *            is requested.
-     * @return the directionality property of the <code>char</code> value.
+     * @return the directionality property of the {@code char} value.
      *
      * @see Character#DIRECTIONALITY_UNDEFINED
      * @see Character#DIRECTIONALITY_LEFT_TO_RIGHT
@@ -6774,7 +6798,7 @@
      * Determines whether the character is mirrored according to the
      * Unicode specification.  Mirrored characters should have their
      * glyphs horizontally mirrored when displayed in text that is
-     * right-to-left.  For example, <code>'&#92;u0028'</code> LEFT
+     * right-to-left.  For example, {@code '\u005Cu0028'} LEFT
      * PARENTHESIS is semantically defined to be an <i>opening
      * parenthesis</i>.  This will appear as a "(" in text that is
      * left-to-right but as a ")" in text that is right-to-left.
@@ -6784,9 +6808,9 @@
      * all Unicode characters, including supplementary characters, use
      * the {@link #isMirrored(int)} method.
      *
-     * @param  ch <code>char</code> for which the mirrored property is requested
-     * @return <code>true</code> if the char is mirrored, <code>false</code>
-     *         if the <code>char</code> is not mirrored or is not defined.
+     * @param  ch {@code char} for which the mirrored property is requested
+     * @return {@code true} if the char is mirrored, {@code false}
+     *         if the {@code char} is not mirrored or is not defined.
      * @since 1.4
      */
     public static boolean isMirrored(char ch) {
@@ -6798,13 +6822,13 @@
      * is mirrored according to the Unicode specification.  Mirrored
      * characters should have their glyphs horizontally mirrored when
      * displayed in text that is right-to-left.  For example,
-     * <code>'&#92;u0028'</code> LEFT PARENTHESIS is semantically
+     * {@code '\u005Cu0028'} LEFT PARENTHESIS is semantically
      * defined to be an <i>opening parenthesis</i>.  This will appear
      * as a "(" in text that is left-to-right but as a ")" in text
      * that is right-to-left.
      *
      * @param   codePoint the character (Unicode code point) to be tested.
-     * @return  <code>true</code> if the character is mirrored, <code>false</code>
+     * @return  {@code true} if the character is mirrored, {@code false}
      *          if the character is not mirrored or is not defined.
      * @since   1.5
      */
@@ -6813,16 +6837,16 @@
     }
 
     /**
-     * Compares two <code>Character</code> objects numerically.
-     *
-     * @param   anotherCharacter   the <code>Character</code> to be compared.
-
-     * @return  the value <code>0</code> if the argument <code>Character</code>
-     *          is equal to this <code>Character</code>; a value less than
-     *          <code>0</code> if this <code>Character</code> is numerically less
-     *          than the <code>Character</code> argument; and a value greater than
-     *          <code>0</code> if this <code>Character</code> is numerically greater
-     *          than the <code>Character</code> argument (unsigned comparison).
+     * Compares two {@code Character} objects numerically.
+     *
+     * @param   anotherCharacter   the {@code Character} to be compared.
+
+     * @return  the value {@code 0} if the argument {@code Character}
+     *          is equal to this {@code Character}; a value less than
+     *          {@code 0} if this {@code Character} is numerically less
+     *          than the {@code Character} argument; and a value greater than
+     *          {@code 0} if this {@code Character} is numerically greater
+     *          than the {@code Character} argument (unsigned comparison).
      *          Note that this is strictly a numerical comparison; it is not
      *          locale-dependent.
      * @since   1.2
@@ -6856,8 +6880,8 @@
      *
      * @param   codePoint   the character (Unicode code point) to be converted.
      * @return  either the uppercase equivalent of the character, if
-     *          any, or an error flag (<code>Character.ERROR</code>)
-     *          that indicates that a 1:M <code>char</code> mapping exists.
+     *          any, or an error flag ({@code Character.ERROR})
+     *          that indicates that a 1:M {@code char} mapping exists.
      * @see     Character#isLowerCase(char)
      * @see     Character#isUpperCase(char)
      * @see     Character#toLowerCase(char)
@@ -6873,11 +6897,11 @@
      * Converts the character (Unicode code point) argument to uppercase using case
      * mapping information from the SpecialCasing file in the Unicode
      * specification. If a character has no explicit uppercase
-     * mapping, then the <code>char</code> itself is returned in the
-     * <code>char[]</code>.
+     * mapping, then the {@code char} itself is returned in the
+     * {@code char[]}.
      *
      * @param   codePoint   the character (Unicode code point) to be converted.
-     * @return a <code>char[]</code> with the uppercased character.
+     * @return a {@code char[]} with the uppercased character.
      * @since 1.4
      */
     static char[] toUpperCaseCharArray(int codePoint) {
@@ -6908,7 +6932,7 @@
 
     /**
      * Returns the Unicode name of the specified character
-     * <code>codePoint</code>, or null if the code point is
+     * {@code codePoint}, or null if the code point is
      * {@link #UNASSIGNED unassigned}.
      * <p>
      * Note: if the specified character is not assigned a name by
@@ -6916,14 +6940,12 @@
      * Database maintained by the Unicode Consortium), the returned
      * name is the same as the result of expression
      *
-     * <blockquote><code>
-     *     Character.UnicodeBlock.of(codePoint)
-     *                           .toString()
-     *                           .replace('_', ' ')
+     * <blockquote>{@code
+     *     Character.UnicodeBlock.of(codePoint).toString().replace('_', ' ')
      *     + " "
      *     + Integer.toHexString(codePoint).toUpperCase(Locale.ENGLISH);
      *
-     * </code></blockquote>
+     * }</blockquote>
      *
      * @param  codePoint the character (Unicode code point)
      *
@@ -6931,7 +6953,7 @@
      *         the code point is unassigned.
      *
      * @exception IllegalArgumentException if the specified
-     *            <code>codePoint</code> is not a valid Unicode
+     *            {@code codePoint} is not a valid Unicode
      *            code point.
      *
      * @since 1.7
--- a/src/share/classes/javax/swing/JLayer.java	Mon Apr 04 17:18:35 2011 -0700
+++ b/src/share/classes/javax/swing/JLayer.java	Mon Apr 04 17:20:24 2011 -0700
@@ -476,7 +476,7 @@
      * for this {@code JLayer} and the {@code JLayer}
      * is displayable.
      * <p/>
-     * The following example shows how to correclty use this method
+     * The following example shows how to correctly use this method
      * in the {@code LayerUI} implementations:
      * <pre>
      *    public void installUI(JComponent c) {
@@ -834,7 +834,7 @@
         }
 
         /**
-         * First, implementatation of this method iterates through
+         * First, implementation of this method iterates through
          * glassPane's child components and returns {@code true}
          * if any of them is visible and contains passed x,y point.
          * After that it checks if no mouseListeners is attached to this component
--- a/src/share/classes/javax/swing/PopupFactory.java	Mon Apr 04 17:18:35 2011 -0700
+++ b/src/share/classes/javax/swing/PopupFactory.java	Mon Apr 04 17:20:24 2011 -0700
@@ -203,6 +203,12 @@
                     popupType = HEAVY_WEIGHT_POPUP;
                     break;
                 }
+            } else if (c instanceof Window) {
+                Window w = (Window) c;
+                if (!w.isOpaque() || w.getOpacity() < 1 || w.getShape() != null) {
+                    popupType = HEAVY_WEIGHT_POPUP;
+                    break;
+                }
             }
             c = c.getParent();
         }
--- a/src/share/classes/javax/swing/SpringLayout.java	Mon Apr 04 17:18:35 2011 -0700
+++ b/src/share/classes/javax/swing/SpringLayout.java	Mon Apr 04 17:20:24 2011 -0700
@@ -727,6 +727,9 @@
         * For any other <code>String</code> value passed as the edge,
         * no action is taken. For a <code>null</code> edge, a
         * <code>NullPointerException</code> is thrown.
+        * <p/>
+        * <b>Note:</b> This method can affect {@code x} and {@code y} values
+        * previously set for this {@code Constraints}.
         *
         * @param edgeName the edge to be set
         * @param s the spring controlling the specified edge
--- a/src/share/classes/javax/swing/plaf/LayerUI.java	Mon Apr 04 17:18:35 2011 -0700
+++ b/src/share/classes/javax/swing/plaf/LayerUI.java	Mon Apr 04 17:20:24 2011 -0700
@@ -25,9 +25,7 @@
 
 package javax.swing.plaf;
 
-import javax.accessibility.Accessible;
 import javax.swing.*;
-import javax.swing.plaf.ComponentUI;
 import java.awt.*;
 import java.awt.event.*;
 import java.beans.PropertyChangeEvent;
@@ -38,7 +36,7 @@
 /**
  * The base class for all {@link javax.swing.JLayer}'s UI delegates.
  * <p/>
- * {@link #paint(java.awt.Graphics, javax.swing.JComponent)} method performes the
+ * {@link #paint(java.awt.Graphics, javax.swing.JComponent)} method performs the
  * painting of the {@code JLayer}
  * and {@link #eventDispatched(AWTEvent, JLayer)} method is notified
  * about any {@code AWTEvent}s which have been generated by a {@code JLayer}
@@ -165,7 +163,7 @@
      *    l.setLayerEventMask(AWTEvent.COMPONENT_EVENT_MASK);
      * }
      *
-     * public void unistallUI(JComponent c) {
+     * public void uninstallUI(JComponent c) {
      *     super.uninstallUI(c);
      *     JLayer l = (JLayer) c;
      *     l.setLayerEventMask(0);
@@ -197,7 +195,7 @@
      *    l.setLayerEventMask(AWTEvent.FOCUS_EVENT_MASK);
      * }
      *
-     * public void unistallUI(JComponent c) {
+     * public void uninstallUI(JComponent c) {
      *     super.uninstallUI(c);
      *     JLayer l = (JLayer) c;
      *     l.setLayerEventMask(0);
@@ -229,7 +227,7 @@
      *    l.setLayerEventMask(AWTEvent.KEY_EVENT_MASK);
      * }
      *
-     * public void unistallUI(JComponent c) {
+     * public void uninstallUI(JComponent c) {
      *     super.uninstallUI(c);
      *     JLayer l = (JLayer) c;
      *     l.setLayerEventMask(0);
@@ -261,7 +259,7 @@
      *    l.setLayerEventMask(AWTEvent.MOUSE_EVENT_MASK);
      * }
      *
-     * public void unistallUI(JComponent c) {
+     * public void uninstallUI(JComponent c) {
      *     super.uninstallUI(c);
      *     JLayer l = (JLayer) c;
      *     l.setLayerEventMask(0);
@@ -293,7 +291,7 @@
      *    l.setLayerEventMask(AWTEvent.MOUSE_MOTION_EVENT_MASK);
      * }
      *
-     * public void unistallUI(JComponent c) {
+     * public void uninstallUI(JComponent c) {
      *     super.uninstallUI(c);
      *     JLayer l = (JLayer) c;
      *     l.setLayerEventMask(0);
@@ -325,7 +323,7 @@
      *    l.setLayerEventMask(AWTEvent.MOUSE_WHEEL_EVENT_MASK);
      * }
      *
-     * public void unistallUI(JComponent c) {
+     * public void uninstallUI(JComponent c) {
      *     super.uninstallUI(c);
      *     JLayer l = (JLayer) c;
      *     l.setLayerEventMask(0);
@@ -357,7 +355,7 @@
      *    l.setLayerEventMask(AWTEvent.INPUT_METHOD_EVENT_MASK);
      * }
      *
-     * public void unistallUI(JComponent c) {
+     * public void uninstallUI(JComponent c) {
      *     super.uninstallUI(c);
      *     JLayer l = (JLayer) c;
      *     l.setLayerEventMask(0);
@@ -389,7 +387,7 @@
      *    l.setLayerEventMask(AWTEvent.HIERARCHY_EVENT_MASK);
      * }
      *
-     * public void unistallUI(JComponent c) {
+     * public void uninstallUI(JComponent c) {
      *     super.uninstallUI(c);
      *     JLayer l = (JLayer) c;
      *     l.setLayerEventMask(0);
@@ -421,7 +419,7 @@
      *    l.setLayerEventMask(AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK);
      * }
      *
-     * public void unistallUI(JComponent c) {
+     * public void uninstallUI(JComponent c) {
      *     super.uninstallUI(c);
      *     JLayer l = (JLayer) c;
      *     l.setLayerEventMask(0);
@@ -691,7 +689,7 @@
      * Otherwise, the default implementation is used.
      *
      * @param c {@code JLayer} to return preferred size for
-     * @return maximun size for the passed {@code JLayer}
+     * @return maximum size for the passed {@code JLayer}
      */
     public Dimension getMaximumSize(JComponent c) {
         JLayer l = (JLayer) c;
--- a/src/share/classes/javax/swing/plaf/nimbus/LoweredBorder.java	Mon Apr 04 17:18:35 2011 -0700
+++ b/src/share/classes/javax/swing/plaf/nimbus/LoweredBorder.java	Mon Apr 04 17:20:24 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2011, 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
@@ -26,13 +26,11 @@
 
 import javax.swing.border.Border;
 import javax.swing.JComponent;
-import javax.swing.plaf.UIResource;
 import java.awt.Insets;
 import java.awt.Component;
 import java.awt.Graphics;
 import java.awt.Graphics2D;
 import java.awt.Color;
-import java.awt.Transparency;
 import java.awt.RenderingHints;
 import java.awt.Dimension;
 import java.awt.image.BufferedImage;
@@ -58,7 +56,9 @@
 
     @Override
     protected Object[] getExtendedCacheKeys(JComponent c) {
-        return new Object[] {c.getBackground()};
+        return (c != null)
+                ? new Object[] { c.getBackground() }
+                : null;
     }
 
     /**
@@ -85,6 +85,7 @@
      */
     protected void doPaint(Graphics2D g, JComponent c, int width, int height,
             Object[] extendedCacheKeys) {
+        Color color = (c == null) ? Color.BLACK : c.getBackground();
         BufferedImage img1 = new BufferedImage(IMG_SIZE,IMG_SIZE,
                     BufferedImage.TYPE_INT_ARGB);
         BufferedImage img2 = new BufferedImage(IMG_SIZE,IMG_SIZE,
@@ -93,14 +94,14 @@
         Graphics2D g2 = (Graphics2D)img1.getGraphics();
         g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                 RenderingHints.VALUE_ANTIALIAS_ON);
-        g2.setColor(c.getBackground());
+        g2.setColor(color);
         g2.fillRoundRect(2,0,26,26,RADIUS,RADIUS);
         g2.dispose();
         // draw shadow
         InnerShadowEffect effect = new InnerShadowEffect();
         effect.setDistance(1);
         effect.setSize(3);
-        effect.setColor(getLighter(c.getBackground(),2.1f));
+        effect.setColor(getLighter(color, 2.1f));
         effect.setAngle(90);
         effect.applyEffect(img1,img2,IMG_SIZE,IMG_SIZE);
         // draw outline to img2
@@ -108,7 +109,7 @@
         g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                 RenderingHints.VALUE_ANTIALIAS_ON);
         g2.setClip(0,28,IMG_SIZE,1);
-        g2.setColor(getLighter(c.getBackground(),0.90f));
+        g2.setColor(getLighter(color, 0.90f));
         g2.drawRoundRect(2,1,25,25,RADIUS,RADIUS);
         g2.dispose();
         // draw final image
@@ -150,7 +151,7 @@
      * @param c the component for which this border insets value applies
      */
     public Insets getBorderInsets(Component c) {
-        return INSETS;
+        return (Insets) INSETS.clone();
     }
 
     /**
--- a/src/share/classes/javax/swing/plaf/synth/SynthTableUI.java	Mon Apr 04 17:18:35 2011 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthTableUI.java	Mon Apr 04 17:20:24 2011 -0700
@@ -786,9 +786,9 @@
                                                 hasFocus, row, column);
 
             setIcon(null);
-            Class columnClass = table.getColumnClass(column);
-            configureValue(value, columnClass);
-
+            if (table != null) {
+                configureValue(value, table.getColumnClass(column));
+            }
             return this;
         }
 
--- a/src/share/demo/applets/ArcTest/ArcTest.java	Mon Apr 04 17:18:35 2011 -0700
+++ b/src/share/demo/applets/ArcTest/ArcTest.java	Mon Apr 04 17:20:24 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,22 +29,24 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/*
- */
 
 import java.awt.*;
 import java.awt.event.*;
 import java.applet.*;
 
+
 /**
  * An interactive test of the Graphics.drawArc and Graphics.fillArc
  * routines. Can be run either as a standalone application by
  * typing "java ArcTest" or as an applet in the AppletViewer.
  */
+@SuppressWarnings("serial")
 public class ArcTest extends Applet {
+
     ArcControls controls;   // The controls for marking and filling arcs
     ArcCanvas canvas;       // The drawing area to display arcs
 
+    @Override
     public void init() {
         setLayout(new BorderLayout());
         canvas = new ArcCanvas();
@@ -52,19 +54,23 @@
         add("South", controls = new ArcControls(canvas));
     }
 
+    @Override
     public void destroy() {
         remove(controls);
         remove(canvas);
     }
 
+    @Override
     public void start() {
         controls.setEnabled(true);
     }
 
+    @Override
     public void stop() {
         controls.setEnabled(false);
     }
 
+    @Override
     public void processEvent(AWTEvent e) {
         if (e.getID() == Event.WINDOW_DESTROY) {
             System.exit(0);
@@ -80,20 +86,28 @@
 
         f.add("Center", arcTest);
         f.setSize(300, 300);
-        f.show();
+        f.setVisible(true);
     }
 
+    @Override
     public String getAppletInfo() {
-        return "An interactive test of the Graphics.drawArc and \nGraphics.fillArc routines. Can be run \neither as a standalone application by typing 'java ArcTest' \nor as an applet in the AppletViewer.";
+        return "An interactive test of the Graphics.drawArc and \nGraphics."
+                + "fillArc routines. Can be run \neither as a standalone "
+                + "application by typing 'java ArcTest' \nor as an applet in "
+                + "the AppletViewer.";
     }
 }
 
+
+@SuppressWarnings("serial")
 class ArcCanvas extends Canvas {
-    int         startAngle = 0;
-    int         extent = 45;
-    boolean     filled = false;
-    Font        font = new java.awt.Font("SansSerif", Font.PLAIN, 12);
 
+    int startAngle = 0;
+    int extent = 45;
+    boolean filled = false;
+    Font font = new java.awt.Font("SansSerif", Font.PLAIN, 12);
+
+    @Override
     public void paint(Graphics g) {
         Rectangle r = getBounds();
         int hlines = r.height / 10;
@@ -134,12 +148,16 @@
     }
 }
 
+
+@SuppressWarnings("serial")
 class ArcControls extends Panel
-                  implements ActionListener {
+        implements ActionListener {
+
     TextField startTF;
     TextField extentTF;
     ArcCanvas canvas;
 
+    @SuppressWarnings("LeakingThisInConstructor")
     public ArcControls(ArcCanvas canvas) {
         Button b = null;
 
@@ -154,18 +172,19 @@
         add(b);
     }
 
+    @Override
     public void actionPerformed(ActionEvent ev) {
         String label = ev.getActionCommand();
 
         int start, extent;
         try {
             start = Integer.parseInt(startTF.getText().trim());
-        } catch (NumberFormatException nfe) {
+        } catch (NumberFormatException ignored) {
             start = 0;
         }
         try {
             extent = Integer.parseInt(extentTF.getText().trim());
-        } catch (NumberFormatException nfe) {
+        } catch (NumberFormatException ignored) {
             extent = 0;
         }
 
@@ -173,6 +192,8 @@
     }
 }
 
+
+@SuppressWarnings("serial")
 class IntegerTextField extends TextField {
 
     String oldText = null;
@@ -188,6 +209,7 @@
     // function, but this is neater, since ideally, it would prevent
     // the text from appearing at all.  Sigh.  See bugid 4100317/4114565.
     //
+    @Override
     protected void processEvent(AWTEvent evt) {
         int id = evt.getID();
         if (id != KeyEvent.KEY_TYPED) {
@@ -200,8 +222,8 @@
 
         // Digits, backspace, and delete are okay
         // Note that the minus sign is allowed, but not the decimal
-        if (Character.isDigit(c) || (c == '\b') || (c == '\u007f') ||
-            (c == '\u002d')) {
+        if (Character.isDigit(c) || (c == '\b') || (c == '\u007f') || (c
+                == '\u002d')) {
             super.processEvent(evt);
             return;
         }
@@ -215,6 +237,7 @@
     // so we can revert to it on a TextEvent (paste, or
     // legal key in the wrong location) with bad text
     //
+    @Override
     protected void processTextEvent(TextEvent te) {
         // The empty string is okay, too
         String newText = getText();
@@ -233,12 +256,11 @@
     // Note that the empty string is not allowed.
     //
     private boolean textIsInteger(String textToCheck) {
-        int value = -1;
 
         try {
-            value = Integer.parseInt(textToCheck, 10);
+            Integer.parseInt(textToCheck, 10);
             return true;
-        } catch (NumberFormatException nfe) {
+        } catch (NumberFormatException ignored) {
             return false;
         }
     }
--- a/src/share/demo/applets/BarChart/BarChart.java	Mon Apr 04 17:18:35 2011 -0700
+++ b/src/share/demo/applets/BarChart/BarChart.java	Mon Apr 04 17:20:24 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,28 +29,26 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/*
- */
 
 import java.awt.*;
 
+
 /**
  * A simple bar chart demo
  * @author Sami Shaio
  * @modified 06/21/00 Daniel Peek : refactored, comments
  */
+@SuppressWarnings("serial")
 public class BarChart extends java.applet.Applet {
+
     private static final int VERTICAL = 0;
     private static final int HORIZONTAL = 1;
-
     private static final int SOLID = 0;
     private static final int STRIPED = 1;
-
     private int orientation;
     private String title;
     private Font font;
     private FontMetrics metrics;
-    private int fontHeight = 15;
     private int columns;
     private int values[];
     private Color colors[];
@@ -61,6 +59,7 @@
     private int barSpacing = 10;
     private int maxValue = 0;
 
+    @Override
     public void init() {
 
         getSettings();
@@ -70,7 +69,7 @@
         styles = new int[columns];
         colors = new Color[columns];
 
-        for (int i=0; i < columns; i++) {
+        for (int i = 0; i < columns; i++) {
             parseValue(i);
             parseLabel(i);
             parseStyle(i);
@@ -112,7 +111,7 @@
     }
 
     private void parseValue(int i) {
-        String temp = getParameter("C" + (i+1));
+        String temp = getParameter("C" + (i + 1));
         try {
             values[i] = Integer.parseInt(temp);
         } catch (NumberFormatException e) {
@@ -124,18 +123,17 @@
     }
 
     private void parseLabel(int i) {
-        String temp = getParameter("C" + (i+1) + "_label");
-        if (temp==null) {
+        String temp = getParameter("C" + (i + 1) + "_label");
+        if (temp == null) {
             labels[i] = "";
         } else {
             labels[i] = temp;
         }
-        maxLabelWidth = Math.max(metrics.stringWidth
-                                 ((String) (labels[i])), maxLabelWidth);
+        maxLabelWidth = Math.max(metrics.stringWidth(labels[i]), maxLabelWidth);
     }
 
     private void parseStyle(int i) {
-        String temp = getParameter("C" + (i+1) + "_style");
+        String temp = getParameter("C" + (i + 1) + "_style");
         if (temp == null || temp.equalsIgnoreCase("solid")) {
             styles[i] = SOLID;
         } else if (temp.equalsIgnoreCase("striped")) {
@@ -146,7 +144,7 @@
     }
 
     private void parseColor(int i) {
-        String temp = getParameter("C" + (i+1) + "_color");
+        String temp = getParameter("C" + (i + 1) + "_color");
         if (temp != null) {
             temp = temp.toLowerCase();
             if (temp.equals("red")) {
@@ -179,6 +177,7 @@
         }
     }
 
+    @Override
     public void paint(Graphics g) {
         // draw the title centered at the bottom of the bar graph
         g.setColor(Color.black);
@@ -192,7 +191,7 @@
         g.drawString(title, cx, cy);
 
         // draw the bars and their titles
-        if(orientation == HORIZONTAL) {
+        if (orientation == HORIZONTAL) {
             paintHorizontal(g);
         } else {  // VERTICAL
             paintVertical(g);
@@ -208,12 +207,13 @@
 
             // set the X coordinate for this bar and label and center it
             int widthOfItems = maxLabelWidth + 3 + (maxValue * scale) + 5
-                + metrics.stringWidth(Integer.toString(maxValue));
+                    + metrics.stringWidth(Integer.toString(maxValue));
             cx = Math.max((getSize().width - widthOfItems) / 2, 0);
 
             // set the Y coordinate for this bar and label
             cy = getSize().height - metrics.getDescent() - metrics.getHeight()
-                - barSpacing - ((columns - i - 1) * (barSpacing + barHeight));
+                    - barSpacing
+                    - ((columns - i - 1) * (barSpacing + barHeight));
 
             // draw the label
             g.setColor(Color.black);
@@ -223,7 +223,7 @@
 
             // draw the shadow
             g.fillRect(cx + 4, cy - barHeight + 4,
-                       (values[i] * scale), barHeight);
+                    (values[i] * scale), barHeight);
 
             // draw the bar
             g.setColor(colors[i]);
@@ -233,7 +233,7 @@
                 }
             } else {      // SOLID
                 g.fillRect(cx, cy - barHeight,
-                           (values[i] * scale) + 1, barHeight + 1);
+                        (values[i] * scale) + 1, barHeight + 1);
             }
             cx += (values[i] * scale) + 4;
 
@@ -255,7 +255,7 @@
 
             // Y coordinate for this label and bar
             int cy = getSize().height - metrics.getHeight()
-                - metrics.getDescent() - 4;
+                    - metrics.getDescent() - 4;
 
             // draw the label
             g.setColor(Color.black);
@@ -264,18 +264,18 @@
 
             // draw the shadow
             g.fillRect(cx + 4, cy - (values[i] * scale) - 4,
-                       barWidth, (values[i] * scale));
+                    barWidth, (values[i] * scale));
 
             // draw the bar
             g.setColor(colors[i]);
             if (styles[i] == STRIPED) {
-                for (int k=0; k <= values[i] * scale; k+=2) {
+                for (int k = 0; k <= values[i] * scale; k += 2) {
                     g.drawLine(cx, cy - k,
-                               cx + barWidth, cy - k);
+                            cx + barWidth, cy - k);
                 }
             } else {
                 g.fillRect(cx, cy - (values[i] * scale),
-                           barWidth + 1, (values[i] * scale) + 1);
+                        barWidth + 1, (values[i] * scale) + 1);
             }
             cy -= (values[i] * scale) + 5;
 
@@ -285,28 +285,30 @@
         }
     }
 
+    @Override
     public String getAppletInfo() {
         return "Title: Bar Chart \n"
-            + "Author: Sami Shaio \n"
-            + "A simple bar chart demo.";
+                + "Author: Sami Shaio \n"
+                + "A simple bar chart demo.";
     }
 
+    @Override
     public String[][] getParameterInfo() {
         String[][] info = {
-            {"title", "string", "The title of bar graph.  Default is 'Chart'"},
-            {"scale", "int", "The scale of the bar graph.  Default is 10."},
-            {"columns", "int", "The number of columns/rows.  Default is 5."},
-            {"orientation", "{VERTICAL, HORIZONTAL}",
-             "The orienation of the bar graph.  Default is VERTICAL."},
-            {"c#", "int", "Subsitute a number for #.  "
-             + "The value/size of bar #.  Default is 0."},
-            {"c#_label", "string", "The label for bar #.  "
-             + "Default is an empty label."},
-            {"c#_style", "{SOLID, STRIPED}", "The style of bar #.  "
-             + "Default is SOLID."},
-            {"c#_color", "{RED, GREEN, BLUE, PINK, ORANGE, MAGENTA, CYAN, "
-             + "WHITE, YELLOW, GRAY, DARKGRAY}",
-             "The color of bar #.  Default is GRAY."}
+            { "title", "string", "The title of bar graph.  Default is 'Chart'" },
+            { "scale", "int", "The scale of the bar graph.  Default is 10." },
+            { "columns", "int", "The number of columns/rows.  Default is 5." },
+            { "orientation", "{VERTICAL, HORIZONTAL}",
+                "The orienation of the bar graph.  Default is VERTICAL." },
+            { "c#", "int", "Subsitute a number for #.  "
+                + "The value/size of bar #.  Default is 0." },
+            { "c#_label", "string", "The label for bar #.  "
+                + "Default is an empty label." },
+            { "c#_style", "{SOLID, STRIPED}", "The style of bar #.  "
+                + "Default is SOLID." },
+            { "c#_color", "{RED, GREEN, BLUE, PINK, ORANGE, MAGENTA, CYAN, "
+                + "WHITE, YELLOW, GRAY, DARKGRAY}",
+                "The color of bar #.  Default is GRAY." }
         };
         return info;
     }
--- a/src/share/demo/applets/Blink/Blink.java	Mon Apr 04 17:18:35 2011 -0700
+++ b/src/share/demo/applets/Blink/Blink.java	Mon Apr 04 17:20:24 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,92 +29,106 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/*
- */
 
 /**
  * I love blinking things.
  *
  * @author Arthur van Hoff
- * @modified 04/24/96 Jim Hagen use getBackground
- * @modified 02/05/98 Mike McCloskey removed use of deprecated methods
- * @modified 04/23/99 Josh Bloch, use timer instead of explicit multithreading.
- * @modified 07/10/00 Daniel Peek brought to code conventions, minor changes
+ * @author 04/24/96 Jim Hagen use getBackground
+ * @author 02/05/98 Mike McCloskey removed use of deprecated methods
+ * @author 04/23/99 Josh Bloch, use timer instead of explicit multithreading.
+ * @author 07/10/00 Daniel Peek brought to code conventions, minor changes
  */
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.FontMetrics;
+import java.awt.Graphics;
+import java.util.StringTokenizer;
+import java.util.Timer;
+import java.util.TimerTask;
 
-import java.awt.*;
-import java.util.*;
 
 public class Blink extends java.applet.Applet {
+
+    private static final long serialVersionUID = -775844794477507646L;
     private Timer timer;              // Schedules the blinking
     private String labelString;       // The label for the window
     private int delay;                // the delay time between blinks
 
+    @Override
     public void init() {
         String blinkFrequency = getParameter("speed");
-        delay = (blinkFrequency == null) ? 400 :
-            (1000 / Integer.parseInt(blinkFrequency));
+        delay = (blinkFrequency == null) ? 400
+                : (1000 / Integer.parseInt(blinkFrequency));
         labelString = getParameter("lbl");
-        if (labelString == null)
+        if (labelString == null) {
             labelString = "Blink";
+        }
         Font font = new java.awt.Font("Serif", Font.PLAIN, 24);
         setFont(font);
     }
 
+    @Override
     public void start() {
         timer = new Timer();     //creates a new timer to schedule the blinking
         timer.schedule(new TimerTask() {      //creates a timertask to schedule
+
             // overrides the run method to provide functionality
+            @Override
             public void run() {
                 repaint();
             }
-        }
-            , delay, delay);
+        }, delay, delay);
     }
 
+    @Override
     public void paint(Graphics g) {
         int fontSize = g.getFont().getSize();
         int x = 0, y = fontSize, space;
-        int red =   (int) ( 50 * Math.random());
-        int green = (int) ( 50 * Math.random());
-        int blue =  (int) (256 * Math.random());
+        int red = (int) (50 * Math.random());
+        int green = (int) (50 * Math.random());
+        int blue = (int) (256 * Math.random());
         Dimension d = getSize();
         g.setColor(Color.black);
         FontMetrics fm = g.getFontMetrics();
         space = fm.stringWidth(" ");
         for (StringTokenizer t = new StringTokenizer(labelString);
-             t.hasMoreTokens();) {
+                t.hasMoreTokens();) {
             String word = t.nextToken();
             int w = fm.stringWidth(word) + space;
             if (x + w > d.width) {
                 x = 0;
                 y += fontSize;  //move word to next line if it doesn't fit
             }
-            if (Math.random() < 0.5)
-                g.setColor(new java.awt.Color((red + y*30) % 256,
-                                              (green + x/3) % 256, blue));
-            else
+            if (Math.random() < 0.5) {
+                g.setColor(new java.awt.Color((red + y * 30) % 256,
+                        (green + x / 3) % 256, blue));
+            } else {
                 g.setColor(getBackground());
+            }
             g.drawString(word, x, y);
             x += w;  //shift to the right to draw the next word
         }
     }
 
+    @Override
     public void stop() {
         timer.cancel();  //stops the timer
     }
 
+    @Override
     public String getAppletInfo() {
         return "Title: Blinker\n"
-            + "Author: Arthur van Hoff\n"
-            + "Displays multicolored blinking text.";
+                + "Author: Arthur van Hoff\n"
+                + "Displays multicolored blinking text.";
     }
 
+    @Override
     public String[][] getParameterInfo() {
         String pinfo[][] = {
-            {"speed", "string", "The blink frequency"},
-            {"lbl", "string", "The text to blink."},
-        };
+            { "speed", "string", "The blink frequency" },
+            { "lbl", "string", "The text to blink." }, };
         return pinfo;
     }
 }
--- a/src/share/demo/applets/CardTest/CardTest.java	Mon Apr 04 17:18:35 2011 -0700
+++ b/src/share/demo/applets/CardTest/CardTest.java	Mon Apr 04 17:20:24 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,14 +29,27 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/*
- */
 
-import java.awt.*;
-import java.awt.event.*;
 import java.applet.Applet;
+import java.awt.BorderLayout;
+import java.awt.Button;
+import java.awt.CardLayout;
+import java.awt.Choice;
+import java.awt.Dimension;
+import java.awt.FlowLayout;
+import java.awt.Frame;
+import java.awt.GridLayout;
+import java.awt.LayoutManager;
+import java.awt.Panel;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
 
-class CardPanel extends Panel {
+
+@SuppressWarnings("serial")
+final class CardPanel extends Panel {
+
     ActionListener listener;
 
     Panel create(LayoutManager layout) {
@@ -83,16 +96,21 @@
         add("six", create(new GridLayout(2, 2, 10, 10)));
     }
 
+    @Override
     public Dimension getPreferredSize() {
         return new Dimension(200, 100);
     }
 }
 
+
+@SuppressWarnings("serial")
 public class CardTest extends Applet
-                      implements ActionListener,
-                                 ItemListener {
+        implements ActionListener,
+        ItemListener {
+
     CardPanel cards;
 
+    @SuppressWarnings("LeakingThisInConstructor")
     public CardTest() {
         setLayout(new BorderLayout());
         add("Center", cards = new CardPanel(this));
@@ -127,24 +145,26 @@
         p.add(c);
     }
 
+    @Override
     public void itemStateChanged(ItemEvent e) {
-        ((CardLayout)cards.getLayout()).show(cards,
-                                             (String)(e.getItem()));
+        ((CardLayout) cards.getLayout()).show(cards,
+                (String) (e.getItem()));
     }
 
+    @Override
     public void actionPerformed(ActionEvent e) {
         String arg = e.getActionCommand();
 
         if ("first".equals(arg)) {
-            ((CardLayout)cards.getLayout()).first(cards);
+            ((CardLayout) cards.getLayout()).first(cards);
         } else if ("next".equals(arg)) {
-            ((CardLayout)cards.getLayout()).next(cards);
+            ((CardLayout) cards.getLayout()).next(cards);
         } else if ("previous".equals(arg)) {
-            ((CardLayout)cards.getLayout()).previous(cards);
+            ((CardLayout) cards.getLayout()).previous(cards);
         } else if ("last".equals(arg)) {
-            ((CardLayout)cards.getLayout()).last(cards);
+            ((CardLayout) cards.getLayout()).last(cards);
         } else {
-            ((CardLayout)cards.getLayout()).show(cards,(String)arg);
+            ((CardLayout) cards.getLayout()).show(cards, arg);
         }
     }
 
@@ -156,9 +176,10 @@
 
         f.add("Center", cardTest);
         f.setSize(300, 300);
-        f.show();
+        f.setVisible(true);
     }
 
+    @Override
     public String getAppletInfo() {
         return "Demonstrates the different types of layout managers.";
     }
--- a/src/share/demo/applets/Clock/Clock.java	Mon Apr 04 17:18:35 2011 -0700
+++ b/src/share/demo/applets/Clock/Clock.java	Mon Apr 04 17:20:24 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,24 +29,28 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/*
- */
 
-import java.util.*;
-import java.awt.*;
-import java.applet.*;
-import java.text.*;
+import java.applet.Applet;
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.Graphics;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Locale;
+
 
 /**
  * Time!
  *
  * @author Rachel Gollub
- * @modified Daniel Peek replaced circle drawing calculation, few more changes
+ * @author Daniel Peek replaced circle drawing calculation, few more changes
  */
+@SuppressWarnings("serial")
 public class Clock extends Applet implements Runnable {
+
     private volatile Thread timer;       // The thread that displays clock
     private int lastxs, lastys, lastxm,
-                lastym, lastxh, lastyh;  // Dimensions used to draw hands
+            lastym, lastxh, lastyh;  // Dimensions used to draw hands
     private SimpleDateFormat formatter;  // Formats the date displayed
     private String lastdate;             // String to hold date displayed
     private Font clockFaceFont;          // Font for number display on clock
@@ -55,11 +59,11 @@
     private Color numberColor;           // Color of second hand and numbers
     private int xcenter = 80, ycenter = 55; // Center position
 
+    @Override
     public void init() {
-        int x,y;
         lastxs = lastys = lastxm = lastym = lastxh = lastyh = 0;
-        formatter = new SimpleDateFormat ("EEE MMM dd hh:mm:ss yyyy",
-                                          Locale.getDefault());
+        formatter = new SimpleDateFormat("EEE MMM dd hh:mm:ss yyyy",
+                Locale.getDefault());
         currentDate = new Date();
         lastdate = formatter.format(currentDate);
         clockFaceFont = new Font("Serif", Font.PLAIN, 14);
@@ -68,26 +72,29 @@
 
         try {
             setBackground(new Color(Integer.parseInt(getParameter("bgcolor"),
-                                                     16)));
+                    16)));
         } catch (NullPointerException e) {
         } catch (NumberFormatException e) {
         }
         try {
             handColor = new Color(Integer.parseInt(getParameter("fgcolor1"),
-                                                   16));
+                    16));
         } catch (NullPointerException e) {
         } catch (NumberFormatException e) {
         }
         try {
             numberColor = new Color(Integer.parseInt(getParameter("fgcolor2"),
-                                                     16));
+                    16));
         } catch (NullPointerException e) {
         } catch (NumberFormatException e) {
         }
-        resize(300,300);              // Set clock window size
+        resize(300, 300);              // Set clock window size
     }
 
-    // Paint is the main part of the program
+    /**
+     * Paint is the main part of the program
+     */
+    @Override
     public void update(Graphics g) {
         int xh, yh, xm, ym, xs, ys;
         int s = 0, m = 10, h = 10;
@@ -119,10 +126,12 @@
         ys = (int) (Math.sin(s * Math.PI / 30 - Math.PI / 2) * 45 + ycenter);
         xm = (int) (Math.cos(m * Math.PI / 30 - Math.PI / 2) * 40 + xcenter);
         ym = (int) (Math.sin(m * Math.PI / 30 - Math.PI / 2) * 40 + ycenter);
-        xh = (int) (Math.cos((h*30 + m / 2) * Math.PI / 180 - Math.PI / 2) * 30
-                   + xcenter);
-        yh = (int) (Math.sin((h*30 + m / 2) * Math.PI / 180 - Math.PI / 2) * 30
-                   + ycenter);
+        xh = (int) (Math.cos((h * 30 + m / 2) * Math.PI / 180 - Math.PI / 2)
+                * 30
+                + xcenter);
+        yh = (int) (Math.sin((h * 30 + m / 2) * Math.PI / 180 - Math.PI / 2)
+                * 30
+                + ycenter);
 
         // Get the date to print at the bottom
         formatter.applyPattern("EEE MMM dd HH:mm:ss yyyy");
@@ -136,12 +145,12 @@
             g.drawString(lastdate, 5, 125);
         }
         if (xm != lastxm || ym != lastym) {
-            g.drawLine(xcenter, ycenter-1, lastxm, lastym);
-            g.drawLine(xcenter-1, ycenter, lastxm, lastym);
+            g.drawLine(xcenter, ycenter - 1, lastxm, lastym);
+            g.drawLine(xcenter - 1, ycenter, lastxm, lastym);
         }
         if (xh != lastxh || yh != lastyh) {
-            g.drawLine(xcenter, ycenter-1, lastxh, lastyh);
-            g.drawLine(xcenter-1, ycenter, lastxh, lastyh);
+            g.drawLine(xcenter, ycenter - 1, lastxh, lastyh);
+            g.drawLine(xcenter - 1, ycenter, lastxh, lastyh);
         }
 
         // Draw date and hands
@@ -149,73 +158,83 @@
         g.drawString(today, 5, 125);
         g.drawLine(xcenter, ycenter, xs, ys);
         g.setColor(handColor);
-        g.drawLine(xcenter, ycenter-1, xm, ym);
-        g.drawLine(xcenter-1, ycenter, xm, ym);
-        g.drawLine(xcenter, ycenter-1, xh, yh);
-        g.drawLine(xcenter-1, ycenter, xh, yh);
-        lastxs = xs; lastys = ys;
-        lastxm = xm; lastym = ym;
-        lastxh = xh; lastyh = yh;
+        g.drawLine(xcenter, ycenter - 1, xm, ym);
+        g.drawLine(xcenter - 1, ycenter, xm, ym);
+        g.drawLine(xcenter, ycenter - 1, xh, yh);
+        g.drawLine(xcenter - 1, ycenter, xh, yh);
+        lastxs = xs;
+        lastys = ys;
+        lastxm = xm;
+        lastym = ym;
+        lastxh = xh;
+        lastyh = yh;
         lastdate = today;
         currentDate = null;
     }
 
+    @Override
     public void paint(Graphics g) {
         g.setFont(clockFaceFont);
         // Draw the circle and numbers
         g.setColor(handColor);
-        g.drawArc(xcenter-50, ycenter-50, 100, 100, 0, 360);
+        g.drawArc(xcenter - 50, ycenter - 50, 100, 100, 0, 360);
         g.setColor(numberColor);
-        g.drawString("9", xcenter-45, ycenter+3);
-        g.drawString("3", xcenter+40, ycenter+3);
-        g.drawString("12", xcenter-5, ycenter-37);
-        g.drawString("6", xcenter-3, ycenter+45);
+        g.drawString("9", xcenter - 45, ycenter + 3);
+        g.drawString("3", xcenter + 40, ycenter + 3);
+        g.drawString("12", xcenter - 5, ycenter - 37);
+        g.drawString("6", xcenter - 3, ycenter + 45);
 
         // Draw date and hands
         g.setColor(numberColor);
         g.drawString(lastdate, 5, 125);
         g.drawLine(xcenter, ycenter, lastxs, lastys);
         g.setColor(handColor);
-        g.drawLine(xcenter, ycenter-1, lastxm, lastym);
-        g.drawLine(xcenter-1, ycenter, lastxm, lastym);
-        g.drawLine(xcenter, ycenter-1, lastxh, lastyh);
-        g.drawLine(xcenter-1, ycenter, lastxh, lastyh);
+        g.drawLine(xcenter, ycenter - 1, lastxm, lastym);
+        g.drawLine(xcenter - 1, ycenter, lastxm, lastym);
+        g.drawLine(xcenter, ycenter - 1, lastxh, lastyh);
+        g.drawLine(xcenter - 1, ycenter, lastxh, lastyh);
     }
 
+    @Override
     public void start() {
         timer = new Thread(this);
         timer.start();
     }
 
+    @Override
     public void stop() {
         timer = null;
     }
 
+    @Override
+    @SuppressWarnings("SleepWhileHoldingLock")
     public void run() {
         Thread me = Thread.currentThread();
         while (timer == me) {
             try {
-                Thread.currentThread().sleep(100);
+                Thread.sleep(100);
             } catch (InterruptedException e) {
             }
             repaint();
         }
     }
 
+    @Override
     public String getAppletInfo() {
         return "Title: A Clock \n"
-            + "Author: Rachel Gollub, 1995 \n"
-            + "An analog clock.";
+                + "Author: Rachel Gollub, 1995 \n"
+                + "An analog clock.";
     }
 
+    @Override
     public String[][] getParameterInfo() {
         String[][] info = {
-            {"bgcolor", "hexadecimal RGB number",
-             "The background color. Default is the color of your browser."},
-            {"fgcolor1", "hexadecimal RGB number",
-             "The color of the hands and dial. Default is blue."},
-            {"fgcolor2", "hexadecimal RGB number",
-             "The color of the second hand and numbers. Default is dark gray."}
+            { "bgcolor", "hexadecimal RGB number",
+                "The background color. Default is the color of your browser." },
+            { "fgcolor1", "hexadecimal RGB number",
+                "The color of the hands and dial. Default is blue." },
+            { "fgcolor2", "hexadecimal RGB number",
+                "The color of the second hand and numbers. Default is dark gray." }
         };
         return info;
     }
--- a/src/share/demo/applets/DitherTest/DitherTest.java	Mon Apr 04 17:18:35 2011 -0700
+++ b/src/share/demo/applets/DitherTest/DitherTest.java	Mon Apr 04 17:20:24 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,25 +29,43 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/*
- */
 
 import java.applet.Applet;
-import java.awt.event.*;
-import java.awt.*;
+import java.awt.AWTEvent;
+import java.awt.BorderLayout;
+import java.awt.Button;
+import java.awt.Canvas;
+import java.awt.Choice;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.FlowLayout;
+import java.awt.FontMetrics;
+import java.awt.Frame;
+import java.awt.Graphics;
+import java.awt.Image;
+import java.awt.Label;
+import java.awt.LayoutManager;
+import java.awt.Panel;
+import java.awt.TextField;
+import java.awt.Toolkit;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.KeyEvent;
+import java.awt.event.TextEvent;
 import java.awt.image.ColorModel;
 import java.awt.image.MemoryImageSource;
 
+
+enum DitherMethod {
+
+    NOOP, RED, GREEN, BLUE, ALPHA, SATURATION
+};
+
+
+@SuppressWarnings("serial")
 public class DitherTest extends Applet implements Runnable {
-    final private static int NOOP = 0;
-    final private static int RED = 1;
-    final private static int GREEN = 2;
-    final private static int BLUE = 3;
-    final private static int ALPHA = 4;
-    final private static int SATURATION = 5;
 
     private Thread runner;
-
     private DitherControls XControls;
     private DitherControls YControls;
     private DitherCanvas canvas;
@@ -62,6 +80,7 @@
         ditherTest.start();
     }
 
+    @Override
     public void init() {
         String xspec = null, yspec = null;
         int xvals[] = new int[2];
@@ -70,7 +89,7 @@
         try {
             xspec = getParameter("xaxis");
             yspec = getParameter("yaxis");
-        } catch (NullPointerException npe) {
+        } catch (NullPointerException ignored) {
             //only occurs if run as application
         }
 
@@ -80,44 +99,34 @@
         if (yspec == null) {
             yspec = "blue";
         }
-        int xmethod = colormethod(xspec, xvals);
-        int ymethod = colormethod(yspec, yvals);
+        DitherMethod xmethod = colorMethod(xspec, xvals);
+        DitherMethod ymethod = colorMethod(yspec, yvals);
 
         setLayout(new BorderLayout());
         XControls = new DitherControls(this, xvals[0], xvals[1],
-                                       xmethod, false);
+                xmethod, false);
         YControls = new DitherControls(this, yvals[0], yvals[1],
-                                       ymethod, true);
+                ymethod, true);
         YControls.addRenderButton();
         add("North", XControls);
         add("South", YControls);
         add("Center", canvas = new DitherCanvas());
     }
 
-    private int colormethod(String s, int vals[]) {
-        int method = NOOP;
+    private DitherMethod colorMethod(String s, int vals[]) {
+        DitherMethod method = DitherMethod.NOOP;
         if (s == null) {
             s = "";
         }
         String lower = s.toLowerCase();
-        int len = 0;
-        if (lower.startsWith("red")) {
-            method = RED;
-            lower = lower.substring(3);
-        } else if (lower.startsWith("green")) {
-            method = GREEN;
-            lower = lower.substring(5);
-        } else if (lower.startsWith("blue")) {
-            method = BLUE;
-            lower = lower.substring(4);
-        } else if (lower.startsWith("alpha")) {
-            method = ALPHA;
-            lower = lower.substring(5);
-        } else if (lower.startsWith("saturation")) {
-            method = SATURATION;
-            lower = lower.substring(10);
+
+        for (DitherMethod m : DitherMethod.values()) {
+            if (lower.startsWith(m.toString().toLowerCase())) {
+                method = m;
+                lower = lower.substring(m.toString().length());
+            }
         }
-        if (method == NOOP) {
+        if (method == DitherMethod.NOOP) {
             vals[0] = 0;
             vals[1] = 0;
             return method;
@@ -132,7 +141,7 @@
                 begval = Integer.parseInt(lower.substring(0, dash));
                 endval = Integer.parseInt(lower.substring(dash + 1));
             }
-        } catch (NumberFormatException nfe) {
+        } catch (NumberFormatException ignored) {
         }
 
         if (begval < 0) {
@@ -173,16 +182,14 @@
                 c[0] = c[1] = c[2] = 0;
                 c[3] = 255;
                 if (xmethod < ymethod) {
-                    applymethod(c, xmethod, i, width, xvals);
-                    applymethod(c, ymethod, j, height, yvals);
+                    applyMethod(c, xmethod, i, width, xvals);
+                    applyMethod(c, ymethod, j, height, yvals);
                 } else {
-                    applymethod(c, ymethod, j, height, yvals);
-                    applymethod(c, xmethod, i, width, xvals);
+                    applyMethod(c, ymethod, j, height, yvals);
+                    applyMethod(c, xmethod, i, width, xvals);
                 }
-                pixels[index++] = ((c[3] << 24) |
-                                   (c[0] << 16) |
-                                   (c[1] << 8) |
-                                   c[2]);
+                pixels[index++] = ((c[3] << 24) | (c[0] << 16) | (c[1] << 8)
+                        | c[2]);
             }
 
             // Poll once per row to see if we've been told to stop.
@@ -191,51 +198,54 @@
             }
         }
         return createImage(new MemoryImageSource(width, height,
-                            ColorModel.getRGBdefault(), pixels, 0, width));
+                ColorModel.getRGBdefault(), pixels, 0, width));
     }
 
-    private void applymethod(int c[], int method, int step,
-                             int total, int vals[]) {
-        if (method == NOOP) {
+    private void applyMethod(int c[], int methodIndex, int step,
+            int total, int vals[]) {
+        DitherMethod method = DitherMethod.values()[methodIndex];
+        if (method == DitherMethod.NOOP) {
             return;
         }
         int val = ((total < 2)
-                   ? vals[0]
-                   : vals[0] + ((vals[1] - vals[0]) * step / (total - 1)));
+                ? vals[0]
+                : vals[0] + ((vals[1] - vals[0]) * step / (total - 1)));
         switch (method) {
-        case RED:
-            c[0] = val;
-            break;
-        case GREEN:
-            c[1] = val;
-            break;
-        case BLUE:
-            c[2] = val;
-            break;
-        case ALPHA:
-            c[3] = val;
-            break;
-        case SATURATION:
-            int max = Math.max(Math.max(c[0], c[1]), c[2]);
-            int min = max * (255 - val) / 255;
-            if (c[0] == 0) {
-                c[0] = min;
-            }
-            if (c[1] == 0) {
-                c[1] = min;
-            }
-            if (c[2] == 0) {
-                c[2] = min;
-            }
-            break;
+            case RED:
+                c[0] = val;
+                break;
+            case GREEN:
+                c[1] = val;
+                break;
+            case BLUE:
+                c[2] = val;
+                break;
+            case ALPHA:
+                c[3] = val;
+                break;
+            case SATURATION:
+                int max = Math.max(Math.max(c[0], c[1]), c[2]);
+                int min = max * (255 - val) / 255;
+                if (c[0] == 0) {
+                    c[0] = min;
+                }
+                if (c[1] == 0) {
+                    c[1] = min;
+                }
+                if (c[2] == 0) {
+                    c[2] = min;
+                }
+                break;
         }
     }
 
+    @Override
     public void start() {
         runner = new Thread(this);
         runner.start();
     }
 
+    @Override
     public void run() {
         canvas.setImage(null);  // Wipe previous image
         Image img = calculateImage();
@@ -244,35 +254,43 @@
         }
     }
 
+    @Override
     public void stop() {
         runner = null;
     }
 
+    @Override
     public void destroy() {
         remove(XControls);
         remove(YControls);
         remove(canvas);
     }
 
+    @Override
     public String getAppletInfo() {
         return "An interactive demonstration of dithering.";
     }
 
+    @Override
     public String[][] getParameterInfo() {
         String[][] info = {
-            {"xaxis", "{RED, GREEN, BLUE, ALPHA, SATURATION}",
-             "The color of the Y axis.  Default is RED."},
-            {"yaxis", "{RED, GREEN, BLUE, ALPHA, SATURATION}",
-             "The color of the X axis.  Default is BLUE."}
+            { "xaxis", "{RED, GREEN, BLUE, ALPHA, SATURATION}",
+                "The color of the Y axis.  Default is RED." },
+            { "yaxis", "{RED, GREEN, BLUE, ALPHA, SATURATION}",
+                "The color of the X axis.  Default is BLUE." }
         };
         return info;
     }
 }
 
+
+@SuppressWarnings("serial")
 class DitherCanvas extends Canvas {
+
     private Image img;
     private static String calcString = "Calculating...";
 
+    @Override
     public void paint(Graphics g) {
         int w = getSize().width;
         int h = getSize().height;
@@ -288,14 +306,17 @@
         }
     }
 
+    @Override
     public void update(Graphics g) {
         paint(g);
     }
 
+    @Override
     public Dimension getMinimumSize() {
         return new Dimension(20, 20);
     }
 
+    @Override
     public Dimension getPreferredSize() {
         return new Dimension(200, 200);
     }
@@ -310,29 +331,29 @@
     }
 }
 
+
+@SuppressWarnings("serial")
 class DitherControls extends Panel implements ActionListener {
+
     private CardinalTextField start;
     private CardinalTextField end;
     private Button button;
     private Choice choice;
     private DitherTest applet;
+    private static LayoutManager dcLayout = new FlowLayout(FlowLayout.CENTER,
+            10, 5);
 
-    private static LayoutManager dcLayout = new FlowLayout(FlowLayout.CENTER,
-                                                           10, 5);
-
-    public DitherControls(DitherTest app, int s, int e, int type,
-                          boolean vertical) {
+    public DitherControls(DitherTest app, int s, int e, DitherMethod type,
+            boolean vertical) {
         applet = app;
         setLayout(dcLayout);
         add(new Label(vertical ? "Vertical" : "Horizontal"));
         add(choice = new Choice());
-        choice.addItem("Noop");
-        choice.addItem("Red");
-        choice.addItem("Green");
-        choice.addItem("Blue");
-        choice.addItem("Alpha");
-        choice.addItem("Saturation");
-        choice.select(type);
+        for (DitherMethod m : DitherMethod.values()) {
+            choice.addItem(m.toString().substring(0, 1)
+                    + m.toString().substring(1).toLowerCase());
+        }
+        choice.select(type.ordinal());
         add(start = new CardinalTextField(Integer.toString(s), 4));
         add(end = new CardinalTextField(Integer.toString(e), 4));
     }
@@ -369,6 +390,7 @@
     }
 
     /* called when user clicks the button */
+    @Override
     public void actionPerformed(ActionEvent e) {
         if (e.getSource() == button) {
             applet.start();
@@ -376,6 +398,8 @@
     }
 }
 
+
+@SuppressWarnings("serial")
 class CardinalTextField extends TextField {
 
     String oldText = null;
@@ -391,6 +415,7 @@
     // function, but this is neater, since ideally, it would prevent
     // the text from appearing at all.  Sigh.  See bugid 4100317/4114565.
     //
+    @Override
     protected void processEvent(AWTEvent evt) {
         int id = evt.getID();
         if (id != KeyEvent.KEY_TYPED) {
@@ -420,6 +445,7 @@
     // Note: it would be easy to extend this to an eight-bit
     // TextField (range 0-255), but I'll leave it as-is.
     //
+    @Override
     protected void processTextEvent(TextEvent te) {
         // The empty string is okay, too
         String newText = getText();
@@ -436,11 +462,8 @@
     // Returns true for Cardinal (non-negative) numbers
     // Note that the empty string is not allowed
     private boolean textIsCardinal(String textToCheck) {
-        int value = -1;
-
         try {
-            value = Integer.parseInt(textToCheck, 10);
-            return (value >= 0);
+            return Integer.parseInt(textToCheck, 10) >= 0;
         } catch (NumberFormatException nfe) {
             return false;
         }
--- a/src/share/demo/applets/DrawTest/DrawTest.java	Mon Apr 04 17:18:35 2011 -0700
+++ b/src/share/demo/applets/DrawTest/DrawTest.java	Mon Apr 04 17:20:24 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,27 +29,46 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/*
- */
 
-import java.awt.event.*;
-import java.awt.*;
-import java.applet.*;
+import java.applet.Applet;
+import java.awt.BorderLayout;
+import java.awt.Checkbox;
+import java.awt.CheckboxGroup;
+import java.awt.Choice;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.FlowLayout;
+import java.awt.Frame;
+import java.awt.Graphics;
+import java.awt.Panel;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.awt.event.MouseMotionListener;
+import java.util.ArrayList;
+import java.util.List;
 
-import java.util.Vector;
 
-public class DrawTest extends Applet{
+@SuppressWarnings("serial")
+public class DrawTest extends Applet {
+
     DrawPanel panel;
     DrawControls controls;
 
+    @Override
     public void init() {
         setLayout(new BorderLayout());
         panel = new DrawPanel();
         controls = new DrawControls(panel);
         add("Center", panel);
-        add("South",controls);
+        add("South", controls);
     }
 
+    @Override
     public void destroy() {
         remove(panel);
         remove(controls);
@@ -63,22 +82,28 @@
 
         f.add("Center", drawTest);
         f.setSize(300, 300);
-        f.show();
+        f.setVisible(true);
     }
+
+    @Override
     public String getAppletInfo() {
         return "A simple drawing program.";
     }
 }
 
+
+@SuppressWarnings("serial")
 class DrawPanel extends Panel implements MouseListener, MouseMotionListener {
+
     public static final int LINES = 0;
     public static final int POINTS = 1;
-    int    mode = LINES;
-    Vector lines = new Vector();
-    Vector colors = new Vector();
-    int x1,y1;
-    int x2,y2;
+    int mode = LINES;
+    List<Rectangle> lines = new ArrayList<Rectangle>();
+    List<Color> colors = new ArrayList<Color>();
+    int x1, y1;
+    int x2, y2;
 
+    @SuppressWarnings("LeakingThisInConstructor")
     public DrawPanel() {
         setBackground(Color.white);
         addMouseMotionListener(this);
@@ -87,16 +112,16 @@
 
     public void setDrawMode(int mode) {
         switch (mode) {
-          case LINES:
-          case POINTS:
-            this.mode = mode;
-            break;
-          default:
-            throw new IllegalArgumentException();
+            case LINES:
+            case POINTS:
+                this.mode = mode;
+                break;
+            default:
+                throw new IllegalArgumentException();
         }
     }
 
-
+    @Override
     public void mouseDragged(MouseEvent e) {
         e.consume();
         switch (mode) {
@@ -106,8 +131,8 @@
                 break;
             case POINTS:
             default:
-                colors.addElement(getForeground());
-                lines.addElement(new Rectangle(x1, y1, e.getX(), e.getY()));
+                colors.add(getForeground());
+                lines.add(new Rectangle(x1, y1, e.getX(), e.getY()));
                 x1 = e.getX();
                 y1 = e.getY();
                 break;
@@ -115,9 +140,11 @@
         repaint();
     }
 
+    @Override
     public void mouseMoved(MouseEvent e) {
     }
 
+    @Override
     public void mousePressed(MouseEvent e) {
         e.consume();
         switch (mode) {
@@ -128,8 +155,8 @@
                 break;
             case POINTS:
             default:
-                colors.addElement(getForeground());
-                lines.addElement(new Rectangle(e.getX(), e.getY(), -1, -1));
+                colors.add(getForeground());
+                lines.add(new Rectangle(e.getX(), e.getY(), -1, -1));
                 x1 = e.getX();
                 y1 = e.getY();
                 repaint();
@@ -137,12 +164,13 @@
         }
     }
 
+    @Override
     public void mouseReleased(MouseEvent e) {
         e.consume();
         switch (mode) {
             case LINES:
-                colors.addElement(getForeground());
-                lines.addElement(new Rectangle(x1, y1, e.getX(), e.getY()));
+                colors.add(getForeground());
+                lines.add(new Rectangle(x1, y1, e.getX(), e.getY()));
                 x2 = -1;
                 break;
             case POINTS:
@@ -152,23 +180,27 @@
         repaint();
     }
 
+    @Override
     public void mouseEntered(MouseEvent e) {
     }
 
+    @Override
     public void mouseExited(MouseEvent e) {
     }
 
+    @Override
     public void mouseClicked(MouseEvent e) {
     }
 
+    @Override
     public void paint(Graphics g) {
         int np = lines.size();
 
         /* draw the current lines */
         g.setColor(getForeground());
-        for (int i=0; i < np; i++) {
-            Rectangle p = (Rectangle)lines.elementAt(i);
-            g.setColor((Color)colors.elementAt(i));
+        for (int i = 0; i < np; i++) {
+            Rectangle p = lines.get(i);
+            g.setColor(colors.get(i));
             if (p.width != -1) {
                 g.drawLine(p.x, p.y, p.width, p.height);
             } else {
@@ -185,9 +217,12 @@
 }
 
 
+@SuppressWarnings("serial")
 class DrawControls extends Panel implements ItemListener {
+
     DrawPanel target;
 
+    @SuppressWarnings("LeakingThisInConstructor")
     public DrawControls(DrawPanel target) {
         this.target = target;
         setLayout(new FlowLayout());
@@ -222,33 +257,35 @@
         add(shapes);
     }
 
+    @Override
     public void paint(Graphics g) {
         Rectangle r = getBounds();
         g.setColor(Color.lightGray);
         g.draw3DRect(0, 0, r.width, r.height, false);
 
         int n = getComponentCount();
-        for(int i=0; i<n; i++) {
+        for (int i = 0; i < n; i++) {
             Component comp = getComponent(i);
             if (comp instanceof Checkbox) {
                 Point loc = comp.getLocation();
                 Dimension d = comp.getSize();
                 g.setColor(comp.getForeground());
-                g.drawRect(loc.x-1, loc.y-1, d.width+1, d.height+1);
+                g.drawRect(loc.x - 1, loc.y - 1, d.width + 1, d.height + 1);
             }
         }
     }
 
-  public void itemStateChanged(ItemEvent e) {
-    if (e.getSource() instanceof Checkbox) {
-      target.setForeground(((Component)e.getSource()).getForeground());
-    } else if (e.getSource() instanceof Choice) {
-      String choice = (String) e.getItem();
-      if (choice.equals("Lines")) {
-        target.setDrawMode(DrawPanel.LINES);
-      } else if (choice.equals("Points")) {
-        target.setDrawMode(DrawPanel.POINTS);
-      }
+    @Override
+    public void itemStateChanged(ItemEvent e) {
+        if (e.getSource() instanceof Checkbox) {
+            target.setForeground(((Component) e.getSource()).getForeground());
+        } else if (e.getSource() instanceof Choice) {
+            String choice = (String) e.getItem();
+            if (choice.equals("Lines")) {
+                target.setDrawMode(DrawPanel.LINES);
+            } else if (choice.equals("Points")) {
+                target.setDrawMode(DrawPanel.POINTS);
+            }
+        }
     }
-  }
 }
--- a/src/share/demo/applets/Fractal/CLSFractal.java	Mon Apr 04 17:18:35 2011 -0700
+++ b/src/share/demo/applets/Fractal/CLSFractal.java	Mon Apr 04 17:20:24 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,13 +29,13 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/*
- */
 
 import java.awt.Graphics;
 import java.util.Stack;
-import java.util.Vector;
 import java.awt.event.*;
+import java.util.ArrayList;
+import java.util.List;
+
 
 /**
  * A (not-yet) Context sensitive L-System Fractal applet class.
@@ -50,9 +50,11 @@
  *
  * @author      Jim Graham
  */
+@SuppressWarnings("serial")
 public class CLSFractal
-    extends java.applet.Applet
-    implements Runnable, MouseListener {
+        extends java.applet.Applet
+        implements Runnable, MouseListener {
+
     Thread kicker;
     ContextLSystem cls;
     int fractLevel = 1;
@@ -67,31 +69,48 @@
     int border;
     boolean normalizescaling;
 
+    @Override
     public void init() {
         String s;
         cls = new ContextLSystem(this);
         s = getParameter("level");
-        if (s != null) fractLevel = Integer.parseInt(s);
+        if (s != null) {
+            fractLevel = Integer.parseInt(s);
+        }
         s = getParameter("incremental");
-        if (s != null) incrementalUpdates = s.equalsIgnoreCase("true");
+        if (s != null) {
+            incrementalUpdates = s.equalsIgnoreCase("true");
+        }
         s = getParameter("delay");
-        if (s != null) repaintDelay = Integer.parseInt(s);
+        if (s != null) {
+            repaintDelay = Integer.parseInt(s);
+        }
         s = getParameter("startAngle");
-        if (s != null) startAngle = Float.valueOf(s).floatValue();
+        if (s != null) {
+            startAngle = Float.valueOf(s).floatValue();
+        }
         s = getParameter("rotAngle");
-        if (s != null) rotAngle = Float.valueOf(s).floatValue();
+        if (s != null) {
+            rotAngle = Float.valueOf(s).floatValue();
+        }
         rotAngle = rotAngle / 360 * 2 * 3.14159265358f;
         s = getParameter("border");
-        if (s != null) border = Integer.parseInt(s);
+        if (s != null) {
+            border = Integer.parseInt(s);
+        }
         s = getParameter("normalizescale");
-        if (s != null) normalizescaling = s.equalsIgnoreCase("true");
+        if (s != null) {
+            normalizescaling = s.equalsIgnoreCase("true");
+        }
         addMouseListener(this);
     }
 
+    @Override
     public void destroy() {
         removeMouseListener(this);
     }
 
+    @Override
     public void run() {
         Thread me = Thread.currentThread();
         boolean needsRepaint = false;
@@ -99,7 +118,10 @@
             cls.generate();
             if (kicker == me && incrementalUpdates) {
                 repaint();
-                try {Thread.sleep(repaintDelay);} catch (InterruptedException e){}
+                try {
+                    Thread.sleep(repaintDelay);
+                } catch (InterruptedException ignored) {
+                }
             } else {
                 needsRepaint = true;
             }
@@ -112,22 +134,27 @@
         }
     }
 
+    @Override
     public void start() {
         kicker = new Thread(this);
         kicker.start();
     }
 
+    @Override
     public void stop() {
         kicker = null;
     }
 
-      /*1.1 event handling */
+    /*1.1 event handling */
+    @Override
     public void mouseClicked(MouseEvent e) {
     }
 
+    @Override
     public void mousePressed(MouseEvent e) {
     }
 
+    @Override
     public void mouseReleased(MouseEvent e) {
         cls = new ContextLSystem(this);
         savedPath = null;
@@ -135,14 +162,16 @@
         e.consume();
     }
 
+    @Override
     public void mouseEntered(MouseEvent e) {
     }
 
+    @Override
     public void mouseExited(MouseEvent e) {
     }
-
     String savedPath;
 
+    @Override
     public void paint(Graphics g) {
         String fractalPath = cls.getPath();
         if (fractalPath == null) {
@@ -155,13 +184,14 @@
         }
 
         for (int i = 0; i < border; i++) {
-            g.draw3DRect(i, i, getSize().width - i * 2, getSize().height - i * 2,false);
+            g.draw3DRect(i, i, getSize().width - i * 2, getSize().height - i * 2,
+                    false);
         }
         render(g, fractalPath);
     }
 
     void render(Graphics g, String path) {
-        Stack turtleStack = new Stack();
+        Stack<CLSTurtle> turtleStack = new Stack<CLSTurtle>();
         CLSTurtle turtle;
 
         if (g == null) {
@@ -172,11 +202,13 @@
             turtle = new CLSTurtle(startAngle, 0, 0, 0, 0, 1, 1);
         } else {
             float frwidth = Xmax - Xmin;
-            if (frwidth == 0)
+            if (frwidth == 0) {
                 frwidth = 1;
+            }
             float frheight = Ymax - Ymin;
-            if (frheight == 0)
+            if (frheight == 0) {
                 frheight = 1;
+            }
             float xscale = (getSize().width - border * 2 - 1) / frwidth;
             float yscale = (getSize().height - border * 2 - 1) / frheight;
             int xoff = border;
@@ -184,84 +216,102 @@
             if (normalizescaling) {
                 if (xscale < yscale) {
                     yoff += ((getSize().height - border * 2)
-                             - ((Ymax - Ymin) * xscale)) / 2;
+                            - ((Ymax - Ymin) * xscale)) / 2;
                     yscale = xscale;
                 } else if (yscale < xscale) {
                     xoff += ((getSize().width - border * 2)
-                             - ((Xmax - Xmin) * yscale)) / 2;
+                            - ((Xmax - Xmin) * yscale)) / 2;
                     xscale = yscale;
                 }
             }
             turtle = new CLSTurtle(startAngle, 0 - Xmin, 0 - Ymin,
-                                   xoff, yoff, xscale, yscale);
+                    xoff, yoff, xscale, yscale);
         }
 
         for (int pos = 0; pos < path.length(); pos++) {
             switch (path.charAt(pos)) {
-            case '+':
-                turtle.rotate(rotAngle);
-                break;
-            case '-':
-                turtle.rotate(-rotAngle);
-                break;
-            case '[':
-                turtleStack.push(turtle);
-                turtle = new CLSTurtle(turtle);
-                break;
-            case ']':
-                turtle = (CLSTurtle) turtleStack.pop();
-                break;
-            case 'f':
-                turtle.jump();
-                break;
-            case 'F':
-                if (g == null) {
-                    includePt(turtle.X, turtle.Y);
+                case '+':
+                    turtle.rotate(rotAngle);
+                    break;
+                case '-':
+                    turtle.rotate(-rotAngle);
+                    break;
+                case '[':
+                    turtleStack.push(turtle);
+                    turtle = new CLSTurtle(turtle);
+                    break;
+                case ']':
+                    turtle = turtleStack.pop();
+                    break;
+                case 'f':
                     turtle.jump();
-                    includePt(turtle.X, turtle.Y);
-                } else {
-                    turtle.draw(g);
-                }
-                break;
-            default:
-                break;
+                    break;
+                case 'F':
+                    if (g == null) {
+                        includePt(turtle.X, turtle.Y);
+                        turtle.jump();
+                        includePt(turtle.X, turtle.Y);
+                    } else {
+                        turtle.draw(g);
+                    }
+                    break;
+                default:
+                    break;
             }
         }
     }
 
     void includePt(float x, float y) {
-        if (x < Xmin)
+        if (x < Xmin) {
             Xmin = x;
-        if (x > Xmax)
+        }
+        if (x > Xmax) {
             Xmax = x;
-        if (y < Ymin)
+        }
+        if (y < Ymin) {
             Ymin = y;
-        if (y > Ymax)
+        }
+        if (y > Ymax) {
             Ymax = y;
+        }
     }
 
-  public String getAppletInfo() {
-    return "Title: CLSFractal 1.1f, 27 Mar 1995 \nAuthor: Jim Graham \nA (not yet) Context Sensitive L-System production rule. \nThis class encapsulates a production rule for a Context Sensitive\n L-System \n(pred, succ, lContext, rContext).  The matches() method, however, does not \n(yet) verify the lContext and rContext parts of the rule.";
-  }
+    @Override
+    public String getAppletInfo() {
+        return "Title: CLSFractal 1.1f, 27 Mar 1995 \nAuthor: Jim Graham \nA "
+                + "(not yet) Context Sensitive L-System production rule. \n"
+                + "This class encapsulates a production rule for a Context "
+                + "Sensitive\n L-System \n(pred, succ, lContext, rContext)."
+                + "  The matches() method, however, does not \n(yet) verify "
+                + "the lContext and rContext parts of the rule.";
+    }
 
-  public String[][] getParameterInfo() {
-    String[][] info = {
-      {"level", "int", "Maximum number of recursions.  Default is 1."},
-      {"incremental","boolean","Whether or not to repaint between recursions.  Default is true."},
-      {"delay","integer","Sets delay between repaints.  Default is 50."},
-      {"startAngle","float","Sets the starting angle.  Default is 0."},
-      {"rotAngle","float","Sets the rotation angle.  Default is 45."},
-      {"border","integer","Width of border.  Default is 2."},
-      {"normalizeScale","boolean","Whether or not to normalize the scaling.  Default is true."},
-      {"pred","String","Initializes the rules for Context Sensitive L-Systems."},
-      {"succ","String","Initializes the rules for Context Sensitive L-Systems."},
-      {"lContext","String","Initializes the rules for Context Sensitive L-Systems."},
-      {"rContext","String","Initializes the rules for Context Sensitive L-Systems."}
-    };
-    return info;
-  }
+    @Override
+    public String[][] getParameterInfo() {
+        String[][] info = {
+            { "level", "int", "Maximum number of recursions.  Default is 1." },
+            { "incremental", "boolean", "Whether or not to repaint between "
+                + "recursions.  Default is true." },
+            { "delay", "integer", "Sets delay between repaints.  Default is 50." },
+            { "startAngle", "float", "Sets the starting angle.  Default is 0." },
+            { "rotAngle", "float", "Sets the rotation angle.  Default is 45." },
+            { "border", "integer", "Width of border.  Default is 2." },
+            { "normalizeScale", "boolean", "Whether or not to normalize "
+                + "the scaling.  Default is true." },
+            { "pred", "String",
+                "Initializes the rules for Context Sensitive L-Systems." },
+            { "succ", "String",
+                "Initializes the rules for Context Sensitive L-Systems." },
+            { "lContext", "String",
+                "Initializes the rules for Context Sensitive L-Systems." },
+            { "rContext", "String",
+                "Initializes the rules for Context Sensitive L-Systems." }
+        };
+        return info;
+    }
 }
 
+
 /**
  * A Logo turtle class designed to support Context sensitive L-Systems.
  *
@@ -271,6 +321,7 @@
  * @author      Jim Graham
  */
 class CLSTurtle {
+
     float angle;
     float X;
     float Y;
@@ -280,7 +331,7 @@
     int yoff;
 
     public CLSTurtle(float ang, float x, float y,
-                     int xorg, int yorg, float sx, float sy) {
+            int xorg, int yorg, float sx, float sy) {
         angle = ang;
         scaleX = sx;
         scaleY = sy;
@@ -313,12 +364,13 @@
         float x = X + (float) Math.cos(angle) * scaleX;
         float y = Y + (float) Math.sin(angle) * scaleY;
         g.drawLine((int) X + xoff, (int) Y + yoff,
-                   (int) x + xoff, (int) y + yoff);
+                (int) x + xoff, (int) y + yoff);
         X = x;
         Y = y;
     }
 }
 
+
 /**
  * A (non-)Context sensitive L-System class.
  *
@@ -330,22 +382,23 @@
  * @author      Jim Graham
  */
 class ContextLSystem {
+
     String axiom;
-    Vector rules = new Vector();
+    List<CLSRule> rules = new ArrayList<CLSRule>();
     int level;
 
     public ContextLSystem(java.applet.Applet app) {
         axiom = app.getParameter("axiom");
         int num = 1;
         while (true) {
-            String pred = app.getParameter("pred"+num);
-            String succ = app.getParameter("succ"+num);
+            String pred = app.getParameter("pred" + num);
+            String succ = app.getParameter("succ" + num);
             if (pred == null || succ == null) {
                 break;
             }
-            rules.addElement(new CLSRule(pred, succ,
-                                         app.getParameter("lContext"+num),
-                                         app.getParameter("rContext"+num)));
+            rules.add(new CLSRule(pred, succ,
+                    app.getParameter("lContext" + num),
+                    app.getParameter("rContext" + num)));
             num++;
         }
         currentPath = new StringBuffer(axiom);
@@ -355,7 +408,6 @@
     public int getLevel() {
         return level;
     }
-
     StringBuffer currentPath;
 
     public synchronized String getPath() {
@@ -385,7 +437,7 @@
 
     public CLSRule findRule(int pos) {
         for (int i = 0; i < rules.size(); i++) {
-            CLSRule rule = (CLSRule) rules.elementAt(i);
+            CLSRule rule = rules.get(i);
             if (rule.matches(currentPath, pos)) {
                 return rule;
             }
@@ -394,6 +446,7 @@
     }
 }
 
+
 /**
  * A Context sensitive L-System production rule.
  *
@@ -405,6 +458,7 @@
  * @author      Jim Graham
  */
 class CLSRule {
+
     String pred;
     String succ;
     String lContext;
--- a/src/share/demo/applets/Fractal/example1.html	Mon Apr 04 17:18:35 2011 -0700
+++ b/src/share/demo/applets/Fractal/example1.html	Mon Apr 04 17:20:24 2011 -0700
@@ -5,7 +5,7 @@
   <body> 
       <h1>Fractals 1.1</h1>
       <hr>
-      <applet applet code="CLSFractal.class" width=500 height=120>
+      <applet code="CLSFractal.class" width=500 height=120>
 	<param name=level value="5">
 	<param name=rotangle value="45">
 	<param name=succ1 value="F-F++F-F">
--- a/src/share/demo/applets/GraphicsTest/AppletFrame.java	Mon Apr 04 17:18:35 2011 -0700
+++ b/src/share/demo/applets/GraphicsTest/AppletFrame.java	Mon Apr 04 17:20:24 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,8 +29,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/*
- */
 
 import java.awt.Frame;
 import java.awt.Event;
@@ -38,66 +36,67 @@
 import java.applet.Applet;
 import java.awt.AWTEvent;
 
-// Applet to Application Frame window
-class AppletFrame extends Frame
-{
+
+/**
+ * Applet to Application Frame window
+ */
+@SuppressWarnings("serial")
+class AppletFrame extends Frame {
 
     public static void startApplet(String className,
-                                   String title,
-                                   String args[])
-    {
-       // local variables
-       Applet a;
-       Dimension appletSize;
+            String title,
+            String args[]) {
+        // local variables
+        Applet a;
+        Dimension appletSize;
 
-       try
-       {
-          // create an instance of your applet class
-          a = (Applet) Class.forName(className).newInstance();
-       }
-       catch (ClassNotFoundException e) { return; }
-       catch (InstantiationException e) { return; }
-       catch (IllegalAccessException e) { return; }
+        try {
+            // create an instance of your applet class
+            a = (Applet) Class.forName(className).newInstance();
+        } catch (ClassNotFoundException e) {
+            return;
+        } catch (InstantiationException e) {
+            return;
+        } catch (IllegalAccessException e) {
+            return;
+        }
 
-       // initialize the applet
-       a.init();
-       a.start();
+        // initialize the applet
+        a.init();
+        a.start();
 
-       // create new application frame window
-       AppletFrame f = new AppletFrame(title);
+        // create new application frame window
+        AppletFrame f = new AppletFrame(title);
 
-       // add applet to frame window
-       f.add("Center", a);
+        // add applet to frame window
+        f.add("Center", a);
 
-       // resize frame window to fit applet
-       // assumes that the applet sets its own size
-       // otherwise, you should set a specific size here.
-       appletSize =  a.getSize();
-       f.pack();
-       f.setSize(appletSize);
+        // resize frame window to fit applet
+        // assumes that the applet sets its own size
+        // otherwise, you should set a specific size here.
+        appletSize = a.getSize();
+        f.pack();
+        f.setSize(appletSize);
 
-       // show the window
-       f.show();
+        // show the window
+        f.setVisible(true);
 
     }  // end startApplet()
 
-
     // constructor needed to pass window title to class Frame
-    public AppletFrame(String name)
-    {
-       // call java.awt.Frame(String) constructor
-       super(name);
+    public AppletFrame(String name) {
+        // call java.awt.Frame(String) constructor
+        super(name);
     }
 
     // needed to allow window close
-    public void processEvent(AWTEvent e)
-    {
-       // Window Destroy event
-       if (e.getID() == Event.WINDOW_DESTROY)
-       {
-          // exit the program
-          System.exit(0);
-       }
-   }  // end handleEvent()
+    @Override
+    public void processEvent(AWTEvent e) {
+        // Window Destroy event
+        if (e.getID() == Event.WINDOW_DESTROY) {
+            // exit the program
+            System.exit(0);
+        }
+    }  // end handleEvent()
+}   // end class AppletFrame
 
-}   // end class AppletFrame
--- a/src/share/demo/applets/GraphicsTest/GraphicsTest.java	Mon Apr 04 17:18:35 2011 -0700
+++ b/src/share/demo/applets/GraphicsTest/GraphicsTest.java	Mon Apr 04 17:20:24 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,22 +29,23 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/*
- */
 
 import java.awt.*;
 import java.util.*;
 import java.awt.event.*;
 import java.applet.Applet;
 
+
+@SuppressWarnings("serial")
 class GraphicsPanel extends Panel {
+
     ActionListener al;
     ItemListener il;
     public GraphicsCards cards;
 
-     GraphicsPanel(EventListener listener) {
-         al = (ActionListener)listener;
-         il = (ItemListener)listener;
+    GraphicsPanel(EventListener listener) {
+        al = (ActionListener) listener;
+        il = (ItemListener) listener;
 
         setLayout(new BorderLayout());
 
@@ -78,62 +79,75 @@
         setSize(400, 400);
     }
 
+    @Override
     public Dimension getPreferredSize() {
         return new Dimension(200, 100);
     }
 }
 
+
+@SuppressWarnings("serial")
 public class GraphicsTest extends Applet
-implements ActionListener, ItemListener {
+        implements ActionListener, ItemListener {
+
     GraphicsPanel mainPanel;
 
+    @Override
     public void init() {
         setLayout(new BorderLayout());
         add("Center", mainPanel = new GraphicsPanel(this));
     }
 
+    @Override
     public void destroy() {
         remove(mainPanel);
     }
 
+    @Override
     public void actionPerformed(ActionEvent e) {
         String arg = e.getActionCommand();
 
         if ("next".equals(arg)) {
-            ((CardLayout)mainPanel.cards.getLayout()).next(mainPanel.cards);
-        }
-        else if ("previous".equals(arg)) {
-            ((CardLayout)mainPanel.cards.getLayout()).previous(mainPanel.cards);
+            ((CardLayout) mainPanel.cards.getLayout()).next(mainPanel.cards);
+        } else if ("previous".equals(arg)) {
+            ((CardLayout) mainPanel.cards.getLayout()).previous(mainPanel.cards);
         }
     }
 
+    @Override
     public void itemStateChanged(ItemEvent e) {
-        ((CardLayout)mainPanel.cards.getLayout()).show(mainPanel.cards,(String)e.getItem());
+        ((CardLayout) mainPanel.cards.getLayout()).show(mainPanel.cards,
+                (String) e.getItem());
     }
 
     public static void main(String args[]) {
         AppletFrame.startApplet("GraphicsTest", "Graphics Test", args);
     }
 
+    @Override
     public String getAppletInfo() {
         return "An interactive demonstration of some graphics.";
     }
 }   // end class GraphicsTest
 
 
+@SuppressWarnings("serial")
 class GraphicsCards extends Panel {
+
     public GraphicsCards() {
         setLayout(new CardLayout());
         add("Arc", new ArcCard());
-        add("Oval", new ShapeTest( new OvalShape() ) );
-        add("Polygon", new ShapeTest( new PolygonShape() ) );
-        add("Rect", new ShapeTest( new RectShape() ) );
-        add("RoundRect", new ShapeTest( new RoundRectShape() ) );
+        add("Oval", new ShapeTest(new OvalShape()));
+        add("Polygon", new ShapeTest(new PolygonShape()));
+        add("Rect", new ShapeTest(new RectShape()));
+        add("RoundRect", new ShapeTest(new RoundRectShape()));
     }
 }   // end class GraphicsCards
 
 
+@SuppressWarnings("serial")
 class ArcCard extends Panel {
+
     public ArcCard() {
         setLayout(new GridLayout(0, 2));
         add(new ArcPanel(true));
@@ -144,7 +158,9 @@
 }   // end class ArcCard
 
 
+@SuppressWarnings("serial")
 class ArcDegreePanel extends Panel {
+
     boolean filled;
 
     public ArcDegreePanel(boolean filled) {
@@ -152,290 +168,262 @@
     }
 
     void arcSteps(Graphics g,
-                  int step,
-                  int x,
-                  int y,
-                  int w,
-                  int h,
-                  Color c1,
-                  Color c2) {
-    int a1 = 0;
-    int a2 = step;
-    int progress = 0;
-    g.setColor(c1);
-    for (; (a1+a2) <= 360; a1 = a1+a2, a2 += 1) {
-        if (g.getColor() == c1) {
-            g.setColor(c2);
-        }
-        else {
-            g.setColor(c1);
-        }
+            int step,
+            int x,
+            int y,
+            int w,
+            int h,
+            Color c1,
+            Color c2) {
+        int a1 = 0;
+        int a2 = step;
+        int progress = 0;
+        g.setColor(c1);
+        for (; (a1 + a2) <= 360; a1 = a1 + a2, a2 += 1) {
+            if (g.getColor() == c1) {
+                g.setColor(c2);
+            } else {
+                g.setColor(c1);
+            }
 
-        if (filled) {
-            g.fillArc(x, y, w, h, a1, a2);
-        }
-        else {
-            g.drawArc(x, y, w, h, a1, a2);
-        }
+            if (filled) {
+                g.fillArc(x, y, w, h, a1, a2);
+            } else {
+                g.drawArc(x, y, w, h, a1, a2);
+            }
 
-        progress = a1+a2;
-      }  // end for
+            progress = a1 + a2;
+        }  // end for
 
-    if (progress != 360) {
-          if (filled) {
-            g.fillArc(x, y, w, h, a1, 360 - progress);
-          }
-        else {
-            g.drawArc(x, y, w, h, a1, 360 - progress);
-        }
-      }  // end if
-  }  // end arcSteps()
+        if (progress != 360) {
+            if (filled) {
+                g.fillArc(x, y, w, h, a1, 360 - progress);
+            } else {
+                g.drawArc(x, y, w, h, a1, 360 - progress);
+            }
+        }  // end if
+    }  // end arcSteps()
 
+    @Override
     public void paint(Graphics g) {
         Rectangle r = getBounds();
 
         arcSteps(g, 3, 0, 0, r.width, r.height, Color.orange, Color.blue);
 
         arcSteps(g,
-                 2,
-                 r.width / 4,
-                 r.height / 4,
-                 r.width / 2,
-                 r.height / 2,
-                 Color.yellow,
-                 Color.green);
+                2,
+                r.width / 4,
+                r.height / 4,
+                r.width / 2,
+                r.height / 2,
+                Color.yellow,
+                Color.green);
 
         arcSteps(g,
-                 1,
-                 (r.width  * 3) / 8,
-                 (r.height * 3) / 8,
-                 r.width / 4,
-                 r.height / 4,
-                 Color.magenta,
-                 Color.white);
+                1,
+                (r.width * 3) / 8,
+                (r.height * 3) / 8,
+                r.width / 4,
+                r.height / 4,
+                Color.magenta,
+                Color.white);
 
-  }  // end paint()
+    }  // end paint()
 }   // end class ArcDegreePanel
 
 
+@SuppressWarnings("serial")
 class ArcPanel extends Panel {
+
     boolean filled;
 
     public ArcPanel(boolean filled) {
-    this.filled = filled;
-  }
+        this.filled = filled;
+    }
 
-  public void paint(Graphics g)
-  {
-    Rectangle r = getBounds();
+    @Override
+    public void paint(Graphics g) {
+        Rectangle r = getBounds();
 
-    g.setColor(Color.yellow);
-    if (filled)
-      {
-        g.fillArc(0, 0, r.width, r.height, 0, 45);
-      }
-    else
-      {
-        g.drawArc(0, 0, r.width, r.height, 0, 45);
-      }
+        g.setColor(Color.yellow);
+        if (filled) {
+            g.fillArc(0, 0, r.width, r.height, 0, 45);
+        } else {
+            g.drawArc(0, 0, r.width, r.height, 0, 45);
+        }
 
-    g.setColor(Color.green);
-    if (filled)
-      {
-        g.fillArc(0, 0, r.width, r.height, 90, -45);
-      }
-    else
-      {
-        g.drawArc(0, 0, r.width, r.height, 90, -45);
-      }
+        g.setColor(Color.green);
+        if (filled) {
+            g.fillArc(0, 0, r.width, r.height, 90, -45);
+        } else {
+            g.drawArc(0, 0, r.width, r.height, 90, -45);
+        }
 
-    g.setColor(Color.orange);
-    if (filled)
-      {
-        g.fillArc(0, 0, r.width, r.height, 135, -45);
-      }
-    else
-      {
-        g.drawArc(0, 0, r.width, r.height, 135, -45);
-      }
+        g.setColor(Color.orange);
+        if (filled) {
+            g.fillArc(0, 0, r.width, r.height, 135, -45);
+        } else {
+            g.drawArc(0, 0, r.width, r.height, 135, -45);
+        }
 
-    g.setColor(Color.magenta);
+        g.setColor(Color.magenta);
 
-    if (filled)
-      {
-        g.fillArc(0, 0, r.width, r.height, -225, 45);
-      }
-    else
-      {
-        g.drawArc(0, 0, r.width, r.height, -225, 45);
-      }
+        if (filled) {
+            g.fillArc(0, 0, r.width, r.height, -225, 45);
+        } else {
+            g.drawArc(0, 0, r.width, r.height, -225, 45);
+        }
 
-    g.setColor(Color.yellow);
-    if (filled)
-      {
-        g.fillArc(0, 0, r.width, r.height, 225, -45);
-      }
-    else
-      {
-        g.drawArc(0, 0, r.width, r.height, 225, -45);
-      }
+        g.setColor(Color.yellow);
+        if (filled) {
+            g.fillArc(0, 0, r.width, r.height, 225, -45);
+        } else {
+            g.drawArc(0, 0, r.width, r.height, 225, -45);
+        }
 
-    g.setColor(Color.green);
-    if (filled)
-      {
-        g.fillArc(0, 0, r.width, r.height, -135, 45);
-      }
-    else
-      {
-        g.drawArc(0, 0, r.width, r.height, -135, 45);
-      }
+        g.setColor(Color.green);
+        if (filled) {
+            g.fillArc(0, 0, r.width, r.height, -135, 45);
+        } else {
+            g.drawArc(0, 0, r.width, r.height, -135, 45);
+        }
 
-    g.setColor(Color.orange);
-    if (filled)
-      {
-        g.fillArc(0, 0, r.width, r.height, -45, -45);
-      }
-    else
-      {
-        g.drawArc(0, 0, r.width, r.height, -45, -45);
-      }
+        g.setColor(Color.orange);
+        if (filled) {
+            g.fillArc(0, 0, r.width, r.height, -45, -45);
+        } else {
+            g.drawArc(0, 0, r.width, r.height, -45, -45);
+        }
 
-    g.setColor(Color.magenta);
-    if (filled)
-      {
-        g.fillArc(0, 0, r.width, r.height, 315, 45);
-      }
-    else
-      {
-        g.drawArc(0, 0, r.width, r.height, 315, 45);
-      }
+        g.setColor(Color.magenta);
+        if (filled) {
+            g.fillArc(0, 0, r.width, r.height, 315, 45);
+        } else {
+            g.drawArc(0, 0, r.width, r.height, 315, 45);
+        }
 
-  }  // end paint()
-
+    }  // end paint()
 }   // end class ArcPanel
 
 
-abstract class Shape
-{
-  abstract void draw(Graphics g, int x, int y, int w, int h);
-  abstract void fill(Graphics g, int x, int y, int w, int h);
+abstract class Shape {
+
+    abstract void draw(Graphics g, int x, int y, int w, int h);
+
+    abstract void fill(Graphics g, int x, int y, int w, int h);
 }
 
 
-class RectShape extends Shape
-{
-  void draw(Graphics g, int x, int y, int w, int h)
-  {
-    g.drawRect(x, y, w, h);
-  }
+class RectShape extends Shape {
 
-  void fill(Graphics g, int x, int y, int w, int h)
-  {
-    g.fillRect(x, y, w, h);
-  }
+    @Override
+    void draw(Graphics g, int x, int y, int w, int h) {
+        g.drawRect(x, y, w, h);
+    }
+
+    @Override
+    void fill(Graphics g, int x, int y, int w, int h) {
+        g.fillRect(x, y, w, h);
+    }
 }
 
 
-class OvalShape extends Shape
-{
-  void draw(Graphics g, int x, int y, int w, int h)
-  {
-    g.drawOval(x, y, w, h);
-  }
+class OvalShape extends Shape {
 
-  void fill(Graphics g, int x, int y, int w, int h)
-  {
-    g.fillOval(x, y, w, h);
-  }
+    @Override
+    void draw(Graphics g, int x, int y, int w, int h) {
+        g.drawOval(x, y, w, h);
+    }
+
+    @Override
+    void fill(Graphics g, int x, int y, int w, int h) {
+        g.fillOval(x, y, w, h);
+    }
 }
 
 
-class RoundRectShape extends Shape
-{
-  void draw(Graphics g, int x, int y, int w, int h)
-  {
-    g.drawRoundRect(x, y, w, h, 10, 10);
-  }
+class RoundRectShape extends Shape {
 
-  void fill(Graphics g, int x, int y, int w, int h)
-  {
-    g.fillRoundRect(x, y, w, h, 10, 10);
-  }
+    @Override
+    void draw(Graphics g, int x, int y, int w, int h) {
+        g.drawRoundRect(x, y, w, h, 10, 10);
+    }
+
+    @Override
+    void fill(Graphics g, int x, int y, int w, int h) {
+        g.fillRoundRect(x, y, w, h, 10, 10);
+    }
 }
 
-class PolygonShape extends Shape
-{
-  // class variables
-  Polygon p;
-  Polygon pBase;
 
-  public PolygonShape()
-  {
-    pBase = new Polygon();
-    pBase.addPoint(0, 0);
-    pBase.addPoint(10, 0);
-    pBase.addPoint(5, 15);
-    pBase.addPoint(10, 20);
-    pBase.addPoint(5, 20);
-    pBase.addPoint(0, 10);
-    pBase.addPoint(0, 0);
-  }
+class PolygonShape extends Shape {
+    // class variables
 
-  void scalePolygon(float w, float h)
-  {
-    p = new Polygon();
-    for (int i = 0; i < pBase.npoints; ++i)
-      {
-        p.addPoint( (int) (pBase.xpoints[i] * w),
-                    (int) (pBase.ypoints[i] * h) );
-      }
+    Polygon p;
+    Polygon pBase;
 
-  }
+    public PolygonShape() {
+        pBase = new Polygon();
+        pBase.addPoint(0, 0);
+        pBase.addPoint(10, 0);
+        pBase.addPoint(5, 15);
+        pBase.addPoint(10, 20);
+        pBase.addPoint(5, 20);
+        pBase.addPoint(0, 10);
+        pBase.addPoint(0, 0);
+    }
 
-  void draw(Graphics g, int x, int y, int w, int h)
-  {
-    Graphics ng = g.create();
-    try {
-        ng.translate(x, y);
-        scalePolygon( (float) ( (float) w / (float) 10 ),
-                      (float) ( (float) h / (float) 20 ) );
-        ng.drawPolygon(p);
-    } finally {
-        ng.dispose();
+    void scalePolygon(float w, float h) {
+        p = new Polygon();
+        for (int i = 0; i < pBase.npoints; ++i) {
+            p.addPoint((int) (pBase.xpoints[i] * w),
+                    (int) (pBase.ypoints[i] * h));
+        }
+
     }
-  }
 
-  void fill(Graphics g, int x, int y, int w, int h)
-  {
-    Graphics ng = g.create();
-    try {
-        ng.translate(x, y);
-        scalePolygon( (float) ( (float) w / (float) 10 ),
-                      (float) ( (float) h / (float) 20 ) );
-        ng.fillPolygon(p);
-    } finally {
-        ng.dispose();
+    @Override
+    void draw(Graphics g, int x, int y, int w, int h) {
+        Graphics ng = g.create();
+        try {
+            ng.translate(x, y);
+            scalePolygon(((float) w / 10f), ((float) h / 20f));
+            ng.drawPolygon(p);
+        } finally {
+            ng.dispose();
+        }
     }
-  }
+
+    @Override
+    void fill(Graphics g, int x, int y, int w, int h) {
+        Graphics ng = g.create();
+        try {
+            ng.translate(x, y);
+            scalePolygon(((float) w / 10f), ((float) h / 20f));
+            ng.fillPolygon(p);
+        } finally {
+            ng.dispose();
+        }
+    }
 }
 
 
-class ShapeTest extends Panel
-{
-  Shape   shape;
-  int       step;
+@SuppressWarnings("serial")
+class ShapeTest extends Panel {
 
-  public ShapeTest(Shape shape, int step)
-  {
-    this.shape = shape;
-    this.step = step;
-  }
+    Shape shape;
+    int step;
 
-  public ShapeTest(Shape shape)
-  {
-    this(shape, 10);
-  }
+    public ShapeTest(Shape shape, int step) {
+        this.shape = shape;
+        this.step = step;
+    }
 
+    public ShapeTest(Shape shape) {
+        this(shape, 10);
+    }
+
+    @Override
     public void paint(Graphics g) {
         Rectangle bounds = getBounds();
 
@@ -443,35 +431,22 @@
 
         Color color;
 
-        for (color=Color.red,
-                 cx=bounds.x,
-                 cy=bounds.y,
-                 cw=bounds.width / 2,
-                 ch=bounds.height;
-             cw > 0 && ch > 0;
-
-             cx+=step,
-                 cy += step,
-                 cw -= (step * 2),
-                 ch -= (step * 2),
-                 color=ColorUtils.darker(color, 0.9) ) {
+        for (color = Color.red, cx = bounds.x, cy = bounds.y,
+                cw = bounds.width / 2, ch = bounds.height;
+                cw > 0 && ch > 0;
+                cx += step, cy += step, cw -= (step * 2), ch -= (step * 2),
+                color = ColorUtils.darker(color, 0.9)) {
             g.setColor(color);
             shape.draw(g, cx, cy, cw, ch);
         }
 
-        for (cx=bounds.x + bounds.width / 2,
-                 cy=bounds.y,
-                 cw=bounds.width / 2, ch=bounds.height;
-             cw > 0 && ch > 0;
-
-             cx+=step,
-                 cy += step,
-                 cw -= (step * 2),
-                 ch -= (step * 2) ) {
+        for (cx = bounds.x + bounds.width / 2, cy = bounds.y,
+                cw = bounds.width / 2, ch = bounds.height;
+                cw > 0 && ch > 0;
+                cx += step, cy += step, cw -= (step * 2), ch -= (step * 2)) {
             if (g.getColor() == Color.red) {
                 g.setColor(Color.blue);
-            }
-            else {
+            } else {
                 g.setColor(Color.red);
             }
 
@@ -480,16 +455,18 @@
     }  // end paint()
 }   // end class ShapeTest
 
+
 class ColorUtils {
+
     static Color brighter(Color c, double factor) {
-        return new Color( Math.min((int)(c.getRed()  *(1/factor)), 255),
-                          Math.min((int)(c.getGreen()*(1/factor)), 255),
-                          Math.min((int)(c.getBlue() *(1/factor)), 255) );
+        return new Color(Math.min((int) (c.getRed() * (1 / factor)), 255),
+                Math.min((int) (c.getGreen() * (1 / factor)), 255),
+                Math.min((int) (c.getBlue() * (1 / factor)), 255));
     }
 
     static Color darker(Color c, double factor) {
-        return new Color( Math.max((int)(c.getRed()  *factor), 0),
-                          Math.max((int)(c.getGreen()*factor), 0),
-                          Math.max((int)(c.getBlue() *factor), 0) );
+        return new Color(Math.max((int) (c.getRed() * factor), 0),
+                Math.max((int) (c.getGreen() * factor), 0),
+                Math.max((int) (c.getBlue() * factor), 0));
     }
 }
--- a/src/share/demo/applets/MoleculeViewer/Matrix3D.java	Mon Apr 04 17:18:35 2011 -0700
+++ b/src/share/demo/applets/MoleculeViewer/Matrix3D.java	Mon Apr 04 17:20:24 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,22 +29,23 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/*
- */
 
 /** A fairly conventional 3D matrix object that can transform sets of
-    3D points and perform a variety of manipulations on the transform */
+3D points and perform a variety of manipulations on the transform */
 class Matrix3D {
+
     float xx, xy, xz, xo;
     float yx, yy, yz, yo;
     float zx, zy, zz, zo;
     static final double pi = 3.14159265;
+
     /** Create a new unit matrix */
-    Matrix3D () {
+    Matrix3D() {
         xx = 1.0f;
         yy = 1.0f;
         zz = 1.0f;
     }
+
     /** Scale by f in all dimensions */
     void scale(float f) {
         xx *= f;
@@ -60,6 +61,7 @@
         zz *= f;
         zo *= f;
     }
+
     /** Scale along each axis independently */
     void scale(float xf, float yf, float zf) {
         xx *= xf;
@@ -75,12 +77,14 @@
         zz *= zf;
         zo *= zf;
     }
+
     /** Translate the origin */
     void translate(float x, float y, float z) {
         xo += x;
         yo += y;
         zo += z;
     }
+
     /** rotate theta degrees about the y axis */
     void yrot(double theta) {
         theta *= (pi / 180);
@@ -106,6 +110,7 @@
         zy = Nzy;
         zz = Nzz;
     }
+
     /** rotate theta degrees about the x axis */
     void xrot(double theta) {
         theta *= (pi / 180);
@@ -131,6 +136,7 @@
         zy = Nzy;
         zz = Nzz;
     }
+
     /** rotate theta degrees about the z axis */
     void zrot(double theta) {
         theta *= (pi / 180);
@@ -156,6 +162,7 @@
         xy = Nxy;
         xz = Nxz;
     }
+
     /** Multiply this matrix by a second: M = M*R */
     void mult(Matrix3D rhs) {
         float lxx = xx * rhs.xx + yx * rhs.xy + zx * rhs.xz;
@@ -204,10 +211,11 @@
         zy = 0;
         zz = 1;
     }
+
     /** Transform nvert points from v into tv.  v contains the input
-        coordinates in floating point.  Three successive entries in
-        the array constitute a point.  tv ends up holding the transformed
-        points as integers; three successive entries per point */
+    coordinates in floating point.  Three successive entries in
+    the array constitute a point.  tv ends up holding the transformed
+    points as integers; three successive entries per point */
     void transform(float v[], int tv[], int nvert) {
         float lxx = xx, lxy = xy, lxz = xz, lxo = xo;
         float lyx = yx, lyy = yy, lyz = yz, lyo = yo;
@@ -216,11 +224,13 @@
             float x = v[i];
             float y = v[i + 1];
             float z = v[i + 2];
-            tv[i    ] = (int) (x * lxx + y * lxy + z * lxz + lxo);
+            tv[i] = (int) (x * lxx + y * lxy + z * lxz + lxo);
             tv[i + 1] = (int) (x * lyx + y * lyy + z * lyz + lyo);
             tv[i + 2] = (int) (x * lzx + y * lzy + z * lzz + lzo);
         }
     }
+
+    @Override
     public String toString() {
         return ("[" + xo + "," + xx + "," + xy + "," + xz + ";"
                 + yo + "," + yx + "," + yy + "," + yz + ";"
--- a/src/share/demo/applets/MoleculeViewer/XYZApp.java	Mon Apr 04 17:18:35 2011 -0700
+++ b/src/share/demo/applets/MoleculeViewer/XYZApp.java	Mon Apr 04 17:20:24 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,37 +29,43 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/*
- */
+
+import java.applet.Applet;
+import java.awt.Image;
+import java.awt.Graphics;
+import java.awt.Dimension;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.awt.event.MouseMotionListener;
+import java.net.URL;
+import java.awt.image.IndexColorModel;
+import java.awt.image.MemoryImageSource;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.StreamTokenizer;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
 
 /*
  * A set of classes to parse, represent and display Chemical compounds in
  * .xyz format (see http://chem.leeds.ac.uk/Project/MIME.html)
  */
+/** The representation of a Chemical .xyz model */
+final class XYZChemModel {
 
-import java.applet.Applet;
-import java.awt.Image;
-import java.awt.Event;
-import java.awt.Graphics;
-import java.awt.Dimension;
-import java.io.*;
-import java.net.URL;
-import java.util.Hashtable;
-import java.awt.image.IndexColorModel;
-import java.awt.image.ColorModel;
-import java.awt.image.MemoryImageSource;
-import java.awt.event.*;
-
-/** The representation of a Chemical .xyz model */
-class XYZChemModel {
     float vert[];
     Atom atoms[];
     int tvert[];
     int ZsortMap[];
     int nvert, maxvert;
+    static final Map<String, Atom> atomTable = new HashMap<String, Atom>();
+    static Atom defaultAtom;
 
-    static Hashtable atomTable = new Hashtable();
-    static Atom defaultAtom;
     static {
         atomTable.put("c", new Atom(0, 0, 0));
         atomTable.put("h", new Atom(210, 210, 210));
@@ -70,77 +76,72 @@
         atomTable.put("hn", new Atom(150, 255, 150)); /* !!*/
         defaultAtom = new Atom(255, 100, 200);
     }
-
     boolean transformed;
     Matrix3D mat;
-
     float xmin, xmax, ymin, ymax, zmin, zmax;
 
-
-    XYZChemModel () {
+    XYZChemModel() {
         mat = new Matrix3D();
         mat.xrot(20);
         mat.yrot(30);
     }
 
+    /** Create a Chemical model by parsing an input stream */
+    XYZChemModel(InputStream is) throws Exception {
+        this();
+        StreamTokenizer st = new StreamTokenizer(
+                new BufferedReader(new InputStreamReader(is, "UTF-8")));
+        st.eolIsSignificant(true);
+        st.commentChar('#');
 
-    /** Create a Cehmical model by parsing an input stream */
-    XYZChemModel (InputStream is) throws Exception
-    {
-       this();
-       StreamTokenizer st = new StreamTokenizer(
-               new BufferedReader(new InputStreamReader(is, "UTF-8")));
-       st.eolIsSignificant(true);
-       st.commentChar('#');
-       int slot = 0;
+        try {
+            scan:
+            while (true) {
+                switch (st.nextToken()) {
+                    case StreamTokenizer.TT_EOF:
+                        break scan;
+                    default:
+                        break;
+                    case StreamTokenizer.TT_WORD:
+                        String name = st.sval;
+                        double x = 0,
+                         y = 0,
+                         z = 0;
+                        if (st.nextToken() == StreamTokenizer.TT_NUMBER) {
+                            x = st.nval;
+                            if (st.nextToken() == StreamTokenizer.TT_NUMBER) {
+                                y = st.nval;
+                                if (st.nextToken() == StreamTokenizer.TT_NUMBER) {
+                                    z = st.nval;
+                                }
+                            }
+                        }
+                        addVert(name, (float) x, (float) y, (float) z);
+                        while (st.ttype != StreamTokenizer.TT_EOL
+                                && st.ttype != StreamTokenizer.TT_EOF) {
+                            st.nextToken();
+                        }
 
-       try
-       {
-scan:
-          while (true)
-          {
-             switch ( st.nextToken() )
-             {
-                case StreamTokenizer.TT_EOF:
-                   break scan;
-                default:
-                   break;
-                case StreamTokenizer.TT_WORD:
-                   String name = st.sval;
-                   double x = 0, y = 0, z = 0;
-                   if (st.nextToken() == StreamTokenizer.TT_NUMBER)
-                   {
-                      x = st.nval;
-                      if (st.nextToken() == StreamTokenizer.TT_NUMBER)
-                      {
-                         y = st.nval;
-                         if (st.nextToken() == StreamTokenizer.TT_NUMBER)
-                            z = st.nval;
-                      }
-                   }
-                   addVert(name, (float) x, (float) y, (float) z);
-                   while( st.ttype != StreamTokenizer.TT_EOL &&
-                          st.ttype != StreamTokenizer.TT_EOF )
-                      st.nextToken();
+                }   // end Switch
 
-             }   // end Switch
+            }  // end while
 
-          }  // end while
+            is.close();
 
-          is.close();
+        } // end Try
+        catch (IOException e) {
+        }
 
-       }  // end Try
-       catch( IOException e) {}
-
-       if (st.ttype != StreamTokenizer.TT_EOF)
-          throw new Exception(st.toString());
+        if (st.ttype != StreamTokenizer.TT_EOF) {
+            throw new Exception(st.toString());
+        }
 
     }  // end XYZChemModel()
 
     /** Add a vertex to this model */
     int addVert(String name, float x, float y, float z) {
         int i = nvert;
-        if (i >= maxvert)
+        if (i >= maxvert) {
             if (vert == null) {
                 maxvert = 100;
                 vert = new float[maxvert * 3];
@@ -154,8 +155,11 @@
                 System.arraycopy(atoms, 0, na, 0, atoms.length);
                 atoms = na;
             }
-        Atom a = (Atom) atomTable.get(name.toLowerCase());
-        if (a == null) a = defaultAtom;
+        }
+        Atom a = atomTable.get(name.toLowerCase());
+        if (a == null) {
+            a = defaultAtom;
+        }
         atoms[i] = a;
         i *= 3;
         vert[i] = x;
@@ -166,29 +170,32 @@
 
     /** Transform all the points in this model */
     void transform() {
-        if (transformed || nvert <= 0)
+        if (transformed || nvert <= 0) {
             return;
-        if (tvert == null || tvert.length < nvert * 3)
+        }
+        if (tvert == null || tvert.length < nvert * 3) {
             tvert = new int[nvert * 3];
+        }
         mat.transform(vert, tvert, nvert);
         transformed = true;
     }
 
-
     /** Paint this model to a graphics context.  It uses the matrix associated
-        with this model to map from model space to screen space.
-        The next version of the browser should have double buffering,
-        which will make this *much* nicer */
+    with this model to map from model space to screen space.
+    The next version of the browser should have double buffering,
+    which will make this *much* nicer */
     void paint(Graphics g) {
-        if (vert == null || nvert <= 0)
+        if (vert == null || nvert <= 0) {
             return;
+        }
         transform();
         int v[] = tvert;
         int zs[] = ZsortMap;
         if (zs == null) {
             ZsortMap = zs = new int[nvert];
-            for (int i = nvert; --i >= 0;)
+            for (int i = nvert; --i >= 0;) {
                 zs[i] = i * 3;
+            }
         }
 
         /*
@@ -209,24 +216,26 @@
                     flipped = true;
                 }
             }
-            if (!flipped)
+            if (!flipped) {
                 break;
+            }
         }
 
-        int lg = 0;
         int lim = nvert;
-        Atom ls[] = atoms;
-        if (lim <= 0 || nvert <= 0)
+        if (lim <= 0 || nvert <= 0) {
             return;
+        }
         for (int i = 0; i < lim; i++) {
             int j = zs[i];
             int grey = v[j + 2];
-            if (grey < 0)
+            if (grey < 0) {
                 grey = 0;
-            if (grey > 15)
+            }
+            if (grey > 15) {
                 grey = 15;
+            }
             // g.drawString(names[i], v[j], v[j+1]);
-            atoms[j/3].paint(g, v[j], v[j + 1], grey);
+            atoms[j / 3].paint(g, v[j], v[j + 1], grey);
             // g.drawImage(iBall, v[j] - (iBall.width >> 1), v[j + 1] -
             // (iBall.height >> 1));
         }
@@ -234,47 +243,55 @@
 
     /** Find the bounding box of this model */
     void findBB() {
-        if (nvert <= 0)
+        if (nvert <= 0) {
             return;
+        }
         float v[] = vert;
-        float xmin = v[0], xmax = xmin;
-        float ymin = v[1], ymax = ymin;
-        float zmin = v[2], zmax = zmin;
+        float _xmin = v[0], _xmax = _xmin;
+        float _ymin = v[1], _ymax = _ymin;
+        float _zmin = v[2], _zmax = _zmin;
         for (int i = nvert * 3; (i -= 3) > 0;) {
             float x = v[i];
-            if (x < xmin)
-                xmin = x;
-            if (x > xmax)
-                xmax = x;
+            if (x < _xmin) {
+                _xmin = x;
+            }
+            if (x > _xmax) {
+                _xmax = x;
+            }
             float y = v[i + 1];
-            if (y < ymin)
-                ymin = y;
-            if (y > ymax)
-                ymax = y;
+            if (y < _ymin) {
+                _ymin = y;
+            }
+            if (y > _ymax) {
+                _ymax = y;
+            }
             float z = v[i + 2];
-            if (z < zmin)
-                zmin = z;
-            if (z > zmax)
-                zmax = z;
+            if (z < _zmin) {
+                _zmin = z;
+            }
+            if (z > _zmax) {
+                _zmax = z;
+            }
         }
-        this.xmax = xmax;
-        this.xmin = xmin;
-        this.ymax = ymax;
-        this.ymin = ymin;
-        this.zmax = zmax;
-        this.zmin = zmin;
+        this.xmax = _xmax;
+        this.xmin = _xmin;
+        this.ymax = _ymax;
+        this.ymin = _ymin;
+        this.zmax = _zmax;
+        this.zmin = _zmin;
     }
 }
 
+
 /** An applet to put a Chemical model into a page */
-public class XYZApp
-    extends Applet
-    implements Runnable, MouseListener, MouseMotionListener {
+@SuppressWarnings("serial")
+public class XYZApp extends Applet implements Runnable, MouseListener,
+        MouseMotionListener {
+
     XYZChemModel md;
     boolean painted = true;
     float xfac;
     int prevx, prevy;
-    float xtheta, ytheta;
     float scalefudge = 1;
     Matrix3D amat = new Matrix3D(), tmat = new Matrix3D();
     String mdname = null;
@@ -283,7 +300,6 @@
     Graphics backGC;
     Dimension backSize;
 
-
     private synchronized void newBackBuffer() {
         backBuffer = createImage(getSize().width, getSize().height);
         if (backGC != null) {
@@ -293,164 +309,190 @@
         backSize = getSize();
     }
 
+    @Override
     public void init() {
         mdname = getParameter("model");
         try {
             scalefudge = Float.valueOf(getParameter("scale")).floatValue();
-        } catch(Exception e) {
-        };
+        } catch (Exception ignored) {
+        }
         amat.yrot(20);
         amat.xrot(20);
-        if (mdname == null)
+        if (mdname == null) {
             mdname = "model.obj";
+        }
         resize(getSize().width <= 20 ? 400 : getSize().width,
-               getSize().height <= 20 ? 400 : getSize().height);
+                getSize().height <= 20 ? 400 : getSize().height);
         newBackBuffer();
         addMouseListener(this);
         addMouseMotionListener(this);
     }
 
+    @Override
     public void destroy() {
         removeMouseListener(this);
         removeMouseMotionListener(this);
     }
 
+    @Override
     public void run() {
         InputStream is = null;
         try {
             Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
             is = new URL(getDocumentBase(), mdname).openStream();
-            XYZChemModel m = new XYZChemModel (is);
+            XYZChemModel m = new XYZChemModel(is);
             Atom.setApplet(this);
             md = m;
             m.findBB();
             float xw = m.xmax - m.xmin;
             float yw = m.ymax - m.ymin;
             float zw = m.zmax - m.zmin;
-            if (yw > xw)
+            if (yw > xw) {
                 xw = yw;
-            if (zw > xw)
+            }
+            if (zw > xw) {
                 xw = zw;
+            }
             float f1 = getSize().width / xw;
             float f2 = getSize().height / xw;
             xfac = 0.7f * (f1 < f2 ? f1 : f2) * scalefudge;
-        } catch(Exception e) {
-            e.printStackTrace();
+        } catch (Exception e) {
+            Logger.getLogger(XYZApp.class.getName()).log(Level.SEVERE, null, e);
             md = null;
             message = e.toString();
         }
         try {
-            if (is != null)
+            if (is != null) {
                 is.close();
-        } catch(Exception e) {
+            }
+        } catch (Exception ignored) {
         }
         repaint();
     }
+
+    @Override
     public void start() {
-        if (md == null && message == null)
+        if (md == null && message == null) {
             new Thread(this).start();
+        }
     }
+
+    @Override
     public void stop() {
     }
-      /* event handling */
-  public void mouseClicked(MouseEvent e) {
-  }
-  public void mousePressed(MouseEvent e) {
-    prevx = e.getX();
-    prevy = e.getY();
-    e.consume();
-  }
-  public void mouseReleased(MouseEvent e) {
-  }
-  public void mouseEntered(MouseEvent e) {
-  }
-  public void mouseExited(MouseEvent e) {
-  }
-  public void mouseDragged(MouseEvent e) {
-    int x = e.getX();
-    int y = e.getY();
-    tmat.unit();
-    float xtheta = (prevy - y) * (360.0f / getSize().width);
-    float ytheta = (x - prevx) * (360.0f / getSize().height);
-    tmat.xrot(xtheta);
-    tmat.yrot(ytheta);
-    amat.mult(tmat);
-    if (painted) {
-      painted = false;
-      repaint();
+    /* event handling */
+
+    @Override
+    public void mouseClicked(MouseEvent e) {
     }
-    prevx = x;
-    prevy = y;
-    e.consume();
-  }
-  public void mouseMoved(MouseEvent e) {
-  }
 
+    @Override
+    public void mousePressed(MouseEvent e) {
+        prevx = e.getX();
+        prevy = e.getY();
+        e.consume();
+    }
+
+    @Override
+    public void mouseReleased(MouseEvent e) {
+    }
+
+    @Override
+    public void mouseEntered(MouseEvent e) {
+    }
+
+    @Override
+    public void mouseExited(MouseEvent e) {
+    }
+
+    @Override
+    public void mouseDragged(MouseEvent e) {
+        int x = e.getX();
+        int y = e.getY();
+        tmat.unit();
+        float xtheta = (prevy - y) * (360.0f / getSize().width);
+        float ytheta = (x - prevx) * (360.0f / getSize().height);
+        tmat.xrot(xtheta);
+        tmat.yrot(ytheta);
+        amat.mult(tmat);
+        if (painted) {
+            painted = false;
+            repaint();
+        }
+        prevx = x;
+        prevy = y;
+        e.consume();
+    }
+
+    @Override
+    public void mouseMoved(MouseEvent e) {
+    }
+
+    @Override
     public void update(Graphics g) {
-        if (backBuffer == null)
+        if (backBuffer == null) {
             g.clearRect(0, 0, getSize().width, getSize().height);
+        }
         paint(g);
     }
 
+    @Override
     public void paint(Graphics g) {
         if (md != null) {
             md.mat.unit();
             md.mat.translate(-(md.xmin + md.xmax) / 2,
-                             -(md.ymin + md.ymax) / 2,
-                             -(md.zmin + md.zmax) / 2);
+                    -(md.ymin + md.ymax) / 2,
+                    -(md.zmin + md.zmax) / 2);
             md.mat.mult(amat);
             // md.mat.scale(xfac, -xfac, 8 * xfac / getSize().width);
             md.mat.scale(xfac, -xfac, 16 * xfac / getSize().width);
             md.mat.translate(getSize().width / 2, getSize().height / 2, 8);
             md.transformed = false;
             if (backBuffer != null) {
-                if (!backSize.equals(getSize()))
+                if (!backSize.equals(getSize())) {
                     newBackBuffer();
+                }
                 backGC.setColor(getBackground());
-                backGC.fillRect(0,0,getSize().width,getSize().height);
+                backGC.fillRect(0, 0, getSize().width, getSize().height);
                 md.paint(backGC);
                 g.drawImage(backBuffer, 0, 0, this);
+            } else {
+                md.paint(g);
             }
-            else
-                md.paint(g);
             setPainted();
         } else if (message != null) {
             g.drawString("Error in model:", 3, 20);
             g.drawString(message, 10, 40);
         }
     }
+
     private synchronized void setPainted() {
         painted = true;
         notifyAll();
     }
 
-    private synchronized void waitPainted()
-    {
-       while (!painted)
-       {
-          try
-          {
-             wait();
-          }
-          catch (InterruptedException e) {}
-       }
-       painted = false;
+    @Override
+    public String getAppletInfo() {
+        return "Title: XYZApp \nAuthor: James Gosling \nAn applet to put"
+                + " a Chemical model into a page.";
     }
 
-  public String getAppletInfo() {
-    return "Title: XYZApp \nAuthor: James Gosling \nAn applet to put a Chemical model into a page.";
-  }
-
-  public String[][] getParameterInfo() {
-    String[][] info = {
-      {"model", "path string", "The path to the model to be displayed in .xyz format (see http://chem.leeds.ac.uk/Project/MIME.html).  Default is model.obj."},
-      {"scale", "float", "Scale factor.  Default is 1 (i.e. no scale)."}
-    };
-    return info;
-  }
+    @Override
+    public String[][] getParameterInfo() {
+        String[][] info = {
+            { "model", "path string", "The path to the model to be displayed"
+                + " in .xyz format "
+                + "(see http://chem.leeds.ac.uk/Project/MIME.html)."
+                + "  Default is model.obj." },
+            { "scale", "float", "Scale factor.  Default is 1 (i.e. no scale)." }
+        };
+        return info;
+    }
 }   // end class XYZApp
 
+
 class Atom {
+
     private static Applet applet;
     private static byte[] data;
     private final static int R = 40;
@@ -459,7 +501,6 @@
     private final static int bgGrey = 192;
     private final static int nBalls = 16;
     private static int maxr;
-
     private int Rl;
     private int Gl;
     private int Bl;
@@ -475,24 +516,29 @@
                 int x = X + hx;
                 int y = Y - R + hy;
                 int r = (int) (Math.sqrt(x * x + y * y) + 0.5);
-                if (r > mr)
+                if (r > mr) {
                     mr = r;
+                }
                 data[p++] = r <= 0 ? 1 : (byte) r;
             }
         }
         maxr = mr;
     }
+
     static void setApplet(Applet app) {
         applet = app;
     }
+
     Atom(int Rl, int Gl, int Bl) {
         this.Rl = Rl;
         this.Gl = Gl;
         this.Bl = Bl;
     }
-    private final int blend(int fg, int bg, float fgfactor) {
+
+    private int blend(int fg, int bg, float fgfactor) {
         return (int) (bg + (fg - bg) * fgfactor);
     }
+
     private void Setup() {
         balls = new Image[nBalls];
         byte red[] = new byte[256];
@@ -502,7 +548,7 @@
         byte blue[] = new byte[256];
         blue[0] = (byte) bgGrey;
         for (int r = 0; r < nBalls; r++) {
-            float b = (float) (r+1) / nBalls;
+            float b = (float) (r + 1) / nBalls;
             for (int i = maxr; i >= 1; --i) {
                 float d = (float) i / maxr;
                 red[i] = (byte) blend(blend(Rl, 255, d), bgGrey, b);
@@ -510,11 +556,12 @@
                 blue[i] = (byte) blend(blend(Bl, 255, d), bgGrey, b);
             }
             IndexColorModel model = new IndexColorModel(8, maxr + 1,
-                                                        red, green, blue, 0);
+                    red, green, blue, 0);
             balls[r] = applet.createImage(
-                new MemoryImageSource(R*2, R*2, model, data, 0, R*2));
+                    new MemoryImageSource(R * 2, R * 2, model, data, 0, R * 2));
         }
     }
+
     void paint(Graphics gc, int x, int y, int r) {
         Image ba[] = balls;
         if (ba == null) {
--- a/src/share/demo/applets/MoleculeViewer/example1.html	Mon Apr 04 17:18:35 2011 -0700
+++ b/src/share/demo/applets/MoleculeViewer/example1.html	Mon Apr 04 17:20:24 2011 -0700
@@ -6,7 +6,7 @@
       <h1>MoleculeViewer (example 1)</h1>
       <hr>
       <applet code=XYZApp.class width=300 height=300>
-	<param name=model value=models/HyaluronicAcid.xyz>
+	<param name=model value="models/HyaluronicAcid.xyz">
 	alt="Your browser understands the &lt;APPLET&gt; tag but isn't running the applet, for some reason."
 	Your browser is completely ignoring the &lt;APPLET&gt; tag!
       </applet>
--- a/src/share/demo/applets/MoleculeViewer/example2.html	Mon Apr 04 17:18:35 2011 -0700
+++ b/src/share/demo/applets/MoleculeViewer/example2.html	Mon Apr 04 17:20:24 2011 -0700
@@ -6,7 +6,7 @@
       <h1>MoleculeViewer (example 2)</h1>
       <hr>
       <applet code=XYZApp.class width=300 height=300>
-	<param name=model value=models/buckminsterfullerine.xyz>
+	<param name=model value="models/buckminsterfullerine.xyz">
 	  alt="Your browser understands the &lt;APPLET&gt; tag but isn't running the applet, for some reason."
 	  Your browser is completely ignoring the &lt;APPLET&gt; tag!
       </applet>
--- a/src/share/demo/applets/MoleculeViewer/example3.html	Mon Apr 04 17:18:35 2011 -0700
+++ b/src/share/demo/applets/MoleculeViewer/example3.html	Mon Apr 04 17:20:24 2011 -0700
@@ -6,25 +6,25 @@
       <h1>MoleculeViewer (example 3)</h1>
       <hr>
       <applet code=XYZApp.class width=100 height=100>
-	<param name=model value=models/water.xyz>
+	<param name=model value="models/water.xyz">
 	alt="Your browser understands the &lt;APPLET&gt; tag but isn't running the applet, for some reason."
 	Your browser is completely ignoring the &lt;APPLET&gt; tag!
       </applet>
       <p>
 	<applet code=XYZApp.class width=100 height=100>
-	  <param name=model value=models/benzene.xyz>
+          <param name=model value="models/benzene.xyz">
 	  alt="Your browser understands the &lt;APPLET&gt; tag but isn't running the applet, for some reason."
 	  Your browser is completely ignoring the &lt;APPLET&gt; tag!
 	</applet>
       <p>
 	<applet code=XYZApp.class width=100 height=100>
-	  <param name=model value=models/ethane.xyz>
+	  <param name=model value="models/ethane.xyz">
 	  alt="Your browser understands the &lt;APPLET&gt; tag but isn't running the applet, for some reason."
 	  Your browser is completely ignoring the &lt;APPLET&gt; tag!
 	</applet>
       <p>
 	<applet code=XYZApp.class width=100 height=100>
-	  <param name=model value=models/cyclohexane.xyz>
+	  <param name=model value="models/cyclohexane.xyz">
 	  alt="Your browser understands the &lt;APPLET&gt; tag but isn't running the applet, for some reason."
 	  Your browser is completely ignoring the &lt;APPLET&gt; tag!
 	</applet>
--- a/src/share/demo/applets/NervousText/NervousText.java	Mon Apr 04 17:18:35 2011 -0700
+++ b/src/share/demo/applets/NervousText/NervousText.java	Mon Apr 04 17:20:24 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,37 +29,37 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/*
- */
 
-import java.awt.event.*;
 import java.awt.Graphics;
 import java.awt.Font;
 import java.applet.Applet;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+
 
 /**
  * An applet that displays jittering text on the screen.
  *
  * @author Daniel Wyszynski 04/12/95
- * @modified 05/09/95 kwalrath Changed string; added thread suspension
- * @modified 02/06/98 madbot removed use of suspend and resume and cleaned up
+ * @author 05/09/95 kwalrath Changed string; added thread suspension
+ * @author 02/06/98 madbot removed use of suspend and resume and cleaned up
  */
+@SuppressWarnings("serial")
+public class NervousText extends Applet implements Runnable, MouseListener {
 
-public class NervousText extends Applet implements Runnable, MouseListener {
     String banner;              // The text to be displayed
     char bannerChars[];         // The same text as an array of characters
     char attributes[];          // Character attributes ('^' for superscript)
     Thread runner = null;       // The thread that is displaying the text
     boolean threadSuspended;    // True when thread suspended (via mouse click)
-
     static final int REGULAR_WD = 15;
     static final int REGULAR_HT = 36;
     static final int SMALL_WD = 12;
     static final int SMALL_HT = 24;
-
     Font regularFont = new Font("Serif", Font.BOLD, REGULAR_HT);
     Font smallFont = new Font("Serif", Font.BOLD, SMALL_HT);
 
+    @Override
     public void init() {
         banner = getParameter("text");
         if (banner == null) {
@@ -67,8 +67,8 @@
         }
 
         int bannerLength = banner.length();
-        StringBuffer bc = new StringBuffer(bannerLength);
-        StringBuffer attrs = new StringBuffer(bannerLength);
+        StringBuilder bc = new StringBuilder(bannerLength);
+        StringBuilder attrs = new StringBuilder(bannerLength);
         int wd = 0;
         for (int i = 0; i < bannerLength; i++) {
             char c = banner.charAt(i);
@@ -89,7 +89,7 @@
         }
 
         bannerLength = bc.length();
-        bannerChars =  new char[bannerLength];
+        bannerChars = new char[bannerLength];
         attributes = new char[bannerLength];
         bc.getChars(0, bannerLength, bannerChars, 0);
         attrs.getChars(0, bannerLength, attributes, 0);
@@ -99,15 +99,18 @@
         addMouseListener(this);
     }
 
+    @Override
     public void destroy() {
         removeMouseListener(this);
     }
 
+    @Override
     public void start() {
         runner = new Thread(this);
         runner.start();
     }
 
+    @Override
     public synchronized void stop() {
         runner = null;
         if (threadSuspended) {
@@ -116,22 +119,24 @@
         }
     }
 
+    @Override
     public void run() {
         Thread me = Thread.currentThread();
         while (runner == me) {
             try {
                 Thread.sleep(100);
-                synchronized(this) {
+                synchronized (this) {
                     while (threadSuspended) {
                         wait();
                     }
                 }
-            } catch (InterruptedException e){
+            } catch (InterruptedException e) {
             }
             repaint();
         }
     }
 
+    @Override
     public void paint(Graphics g) {
         int length = bannerChars.length;
         for (int i = 0, x = 0; i < length; i++) {
@@ -152,33 +157,41 @@
         }
     }
 
+    @Override
     public synchronized void mousePressed(MouseEvent e) {
         e.consume();
         threadSuspended = !threadSuspended;
-        if (!threadSuspended)
+        if (!threadSuspended) {
             notify();
+        }
     }
 
+    @Override
     public void mouseReleased(MouseEvent e) {
     }
 
+    @Override
     public void mouseEntered(MouseEvent e) {
     }
 
+    @Override
     public void mouseExited(MouseEvent e) {
     }
 
+    @Override
     public void mouseClicked(MouseEvent e) {
     }
 
+    @Override
     public String getAppletInfo() {
-        return "Title: NervousText\nAuthor: Daniel Wyszynski\nDisplays a text banner that jitters.";
+        return "Title: NervousText\nAuthor: Daniel Wyszynski\n"
+                + "Displays a text banner that jitters.";
     }
 
+    @Override
     public String[][] getParameterInfo() {
         String pinfo[][] = {
-            {"text", "string", "Text to display"},
-        };
+            { "text", "string", "Text to display" }, };
         return pinfo;
     }
 }
--- a/src/share/demo/applets/SimpleGraph/GraphApplet.java	Mon Apr 04 17:18:35 2011 -0700
+++ b/src/share/demo/applets/SimpleGraph/GraphApplet.java	Mon Apr 04 17:20:24 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,22 +29,26 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/*
- */
 
 import java.awt.Graphics;
 
+
+@SuppressWarnings("serial")
 public class GraphApplet extends java.applet.Applet {
+
     double f(double x) {
-        return (Math.cos(x/5) + Math.sin(x/7) + 2) * getSize().height / 4;
+        return (Math.cos(x / 5) + Math.sin(x / 7) + 2) * getSize().height / 4;
     }
 
+    @Override
     public void paint(Graphics g) {
-        for (int x = 0 ; x < getSize().width ; x++) {
-            g.drawLine(x, (int)f(x), x + 1, (int)f(x + 1));
+        for (int x = 0; x < getSize().width; x++) {
+            g.drawLine(x, (int) f(x), x + 1, (int) f(x + 1));
         }
     }
-  public String getAppletInfo() {
-    return "Draws a sin graph.";
-  }
+
+    @Override
+    public String getAppletInfo() {
+        return "Draws a sin graph.";
+    }
 }
--- a/src/share/demo/applets/SortDemo/BidirBubbleSortAlgorithm.java	Mon Apr 04 17:18:35 2011 -0700
+++ b/src/share/demo/applets/SortDemo/BidirBubbleSortAlgorithm.java	Mon Apr 04 17:20:24 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,8 +29,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/*
- */
 
 /**
  * A bi-directional bubble sort demonstration algorithm
@@ -39,6 +37,8 @@
  * @author James Gosling
  */
 class BidirBubbleSortAlgorithm extends SortAlgorithm {
+
+    @Override
     void sort(int a[]) throws Exception {
         int j;
         int limit = a.length;
@@ -61,9 +61,9 @@
             }
             if (!swapped) {
                 return;
+            } else {
+                swapped = false;
             }
-            else
-                swapped = false;
             for (j = limit; --j >= st;) {
                 if (stopRequested) {
                     return;
--- a/src/share/demo/applets/SortDemo/BubbleSortAlgorithm.java	Mon Apr 04 17:18:35 2011 -0700
+++ b/src/share/demo/applets/SortDemo/BubbleSortAlgorithm.java	Mon Apr 04 17:20:24 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,8 +29,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/*
- */
 
 /**
  * A bubble sort demonstration algorithm
@@ -39,23 +37,26 @@
  * @author James Gosling
  */
 class BubbleSortAlgorithm extends SortAlgorithm {
+
+    @Override
     void sort(int a[]) throws Exception {
-        for (int i = a.length; --i>=0; ) {
+        for (int i = a.length; --i >= 0;) {
             boolean swapped = false;
-            for (int j = 0; j<i; j++) {
+            for (int j = 0; j < i; j++) {
                 if (stopRequested) {
                     return;
                 }
-                if (a[j] > a[j+1]) {
+                if (a[j] > a[j + 1]) {
                     int T = a[j];
-                    a[j] = a[j+1];
-                    a[j+1] = T;
+                    a[j] = a[j + 1];
+                    a[j + 1] = T;
                     swapped = true;
                 }
-                pause(i,j);
+                pause(i, j);
             }
-            if (!swapped)
+            if (!swapped) {
                 return;
+            }
         }
     }
 }
--- a/src/share/demo/applets/SortDemo/QSortAlgorithm.java	Mon Apr 04 17:18:35 2011 -0700
+++ b/src/share/demo/applets/SortDemo/QSortAlgorithm.java	Mon Apr 04 17:20:24 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,8 +29,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/*
- */
 
 /**
  * A quick sort demonstration algorithm
@@ -39,8 +37,7 @@
  * @author James Gosling
  * @author Kevin A. Smith
  */
-public class QSortAlgorithm extends SortAlgorithm
-{
+public class QSortAlgorithm extends SortAlgorithm {
 
     /**
      * A version of pause() that makes it easier to ensure that we pause
@@ -51,84 +48,83 @@
         return true;
     }
 
-   /** This is a generic version of C.A.R Hoare's Quick Sort
-    * algorithm.  This will handle arrays that are already
-    * sorted, and arrays with duplicate keys.<BR>
-    *
-    * If you think of a one dimensional array as going from
-    * the lowest index on the left to the highest index on the right
-    * then the parameters to this function are lowest index or
-    * left and highest index or right.  The first time you call
-    * this function it will be with the parameters 0, a.length - 1.
-    *
-    * @param a       an integer array
-    * @param lo0     left boundary of array partition
-    * @param hi0     right boundary of array partition
-    */
-   void QuickSort(int a[], int lo0, int hi0) throws Exception
-   {
-      int lo = lo0;
-      int hi = hi0;
-      int mid;
+    /** This is a generic version of C.A.R Hoare's Quick Sort
+     * algorithm.  This will handle arrays that are already
+     * sorted, and arrays with duplicate keys.<BR>
+     *
+     * If you think of a one dimensional array as going from
+     * the lowest index on the left to the highest index on the right
+     * then the parameters to this function are lowest index or
+     * left and highest index or right.  The first time you call
+     * this function it will be with the parameters 0, a.length - 1.
+     *
+     * @param a       an integer array
+     * @param lo0     left boundary of array partition
+     * @param hi0     right boundary of array partition
+     */
+    void QuickSort(int a[], int lo0, int hi0) throws Exception {
+        int lo = lo0;
+        int hi = hi0;
+        int mid;
 
-      if ( hi0 > lo0)
-      {
+        if (hi0 > lo0) {
 
-         /* Arbitrarily establishing partition element as the midpoint of
-          * the array.
-          */
-         mid = a[ ( lo0 + hi0 ) / 2 ];
+            /* Arbitrarily establishing partition element as the midpoint of
+             * the array.
+             */
+            mid = a[(lo0 + hi0) / 2];
 
-         // loop through the array until indices cross
-         while( lo <= hi )
-         {
-            /* find the first element that is greater than or equal to
-             * the partition element starting from the left Index.
+            // loop through the array until indices cross
+            while (lo <= hi) {
+                /* find the first element that is greater than or equal to
+                 * the partition element starting from the left Index.
+                 */
+                while ((lo < hi0) && pauseTrue(lo0, hi0) && (a[lo] < mid)) {
+                    ++lo;
+                }
+
+                /* find an element that is smaller than or equal to
+                 * the partition element starting from the right Index.
+                 */
+                while ((hi > lo0) && pauseTrue(lo0, hi0) && (a[hi] > mid)) {
+                    --hi;
+                }
+
+                // if the indexes have not crossed, swap
+                if (lo <= hi) {
+                    swap(a, lo, hi);
+                    ++lo;
+                    --hi;
+                }
+            }
+
+            /* If the right index has not reached the left side of array
+             * must now sort the left partition.
              */
-             while( ( lo < hi0 ) && pauseTrue(lo0, hi0) && ( a[lo] < mid ))
-                 ++lo;
+            if (lo0 < hi) {
+                QuickSort(a, lo0, hi);
+            }
 
-            /* find an element that is smaller than or equal to
-             * the partition element starting from the right Index.
+            /* If the left index has not reached the right side of array
+             * must now sort the right partition.
              */
-             while( ( hi > lo0 ) && pauseTrue(lo0, hi0) && ( a[hi] > mid ))
-                 --hi;
+            if (lo < hi0) {
+                QuickSort(a, lo, hi0);
+            }
 
-            // if the indexes have not crossed, swap
-            if( lo <= hi )
-            {
-               swap(a, lo, hi);
-               ++lo;
-               --hi;
-            }
-         }
+        }
+    }
 
-         /* If the right index has not reached the left side of array
-          * must now sort the left partition.
-          */
-         if( lo0 < hi )
-            QuickSort( a, lo0, hi );
+    private void swap(int a[], int i, int j) {
+        int T;
+        T = a[i];
+        a[i] = a[j];
+        a[j] = T;
 
-         /* If the left index has not reached the right side of array
-          * must now sort the right partition.
-          */
-         if( lo < hi0 )
-            QuickSort( a, lo, hi0 );
+    }
 
-      }
-   }
-
-   private void swap(int a[], int i, int j)
-   {
-      int T;
-      T = a[i];
-      a[i] = a[j];
-      a[j] = T;
-
-   }
-
-   public void sort(int a[]) throws Exception
-   {
-      QuickSort(a, 0, a.length - 1);
-   }
+    @Override
+    public void sort(int a[]) throws Exception {
+        QuickSort(a, 0, a.length - 1);
+    }
 }
--- a/src/share/demo/applets/SortDemo/SortAlgorithm.java	Mon Apr 04 17:18:35 2011 -0700
+++ b/src/share/demo/applets/SortDemo/SortAlgorithm.java	Mon Apr 04 17:20:24 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,8 +29,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/*
- */
 
 /**
  * A generic sort demonstration algorithm
@@ -38,13 +36,12 @@
  *
  * @author James Gosling
  */
+class SortAlgorithm {
 
-class SortAlgorithm {
     /**
      * The sort item.
      */
     private SortItem parent;
-
     /**
      * When true stop sorting.
      */
--- a/src/share/demo/applets/SortDemo/SortItem.java	Mon Apr 04 17:18:35 2011 -0700
+++ b/src/share/demo/applets/SortDemo/SortItem.java	Mon Apr 04 17:20:24 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,57 +29,50 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/*
- */
 
-import java.awt.*;
-import java.awt.event.*;
-import java.io.InputStream;
-import java.util.Hashtable;
-import java.net.*;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+
 
 /**
  * A simple applet class to demonstrate a sort algorithm.
  * You can specify a sorting algorithm using the "alg"
- * attribyte. When you click on the applet, a thread is
+ * attribute. When you click on the applet, a thread is
  * forked which animates the sorting algorithm.
  *
  * @author James Gosling
  */
-public class SortItem
-    extends java.applet.Applet
-    implements Runnable, MouseListener {
+@SuppressWarnings("serial")
+public class SortItem extends java.applet.Applet implements Runnable,
+        MouseListener {
 
     /**
      * The thread that is sorting (or null).
      */
     private Thread kicker;
-
     /**
      * The array that is being sorted.
      */
     int arr[];
-
     /**
      * The high water mark.
      */
     int h1 = -1;
-
     /**
      * The low water mark.
      */
     int h2 = -1;
-
     /**
      * The name of the algorithm.
      */
     String algName;
-
     /**
      * The sorting algorithm (or null).
      */
     SortAlgorithm algorithm;
-
     Dimension initialSize = null;
 
     /**
@@ -91,10 +84,10 @@
         double f = initialSize.width / (double) a.length;
 
         for (int i = a.length; --i >= 0;) {
-            a[i] = (int)(i * f);
+            a[i] = (int) (i * f);
         }
         for (int i = a.length; --i >= 0;) {
-            int j = (int)(i * Math.random());
+            int j = (int) (i * Math.random());
             int t = a[i];
             a[i] = a[j];
             a[j] = t;
@@ -128,12 +121,16 @@
         if (kicker != null) {
             repaint();
         }
-        try {Thread.sleep(20);} catch (InterruptedException e){}
+        try {
+            Thread.sleep(20);
+        } catch (InterruptedException e) {
+        }
     }
 
     /**
      * Initialize the applet.
      */
+    @Override
     public void init() {
         String at = getParameter("alg");
         if (at == null) {
@@ -147,6 +144,7 @@
         addMouseListener(this);
     }
 
+    @Override
     public void start() {
         h1 = h2 = -1;
         scramble();
@@ -157,6 +155,7 @@
     /**
      * Deallocate resources of applet.
      */
+    @Override
     public void destroy() {
         removeMouseListener(this);
     }
@@ -165,10 +164,11 @@
      * Paint the array of numbers as a list
      * of horizontal lines of varying lengths.
      */
+    @Override
     public void paint(Graphics g) {
         int a[] = arr;
         int y = 0;
-        int deltaY = 0, deltaX = 0, evenY = 0, evenX = 0;
+        int deltaY = 0, deltaX = 0, evenY = 0;
 
         Dimension currentSize = getSize();
         int currentHeight = currentSize.height;
@@ -184,7 +184,6 @@
         // even size.
         if (!currentSize.equals(initialSize)) {
             evenY = (currentHeight - initialSize.height) % 2;
-            evenX = (currentWidth - initialSize.width) % 2;
             deltaY = (currentHeight - initialSize.height) / 2;
             deltaX = (currentWidth - initialSize.width) / 2;
 
@@ -194,7 +193,6 @@
             }
             if (deltaX < 0) {
                 deltaX = 0;
-                evenX = 0;
             }
         }
 
@@ -227,6 +225,7 @@
     /**
      * Update without erasing the background.
      */
+    @Override
     public void update(Graphics g) {
         paint(g);
     }
@@ -238,15 +237,16 @@
      * @see java.lang.Thread#run
      * @see SortItem#mouseUp
      */
+    @Override
     public void run() {
         try {
             if (algorithm == null) {
-                algorithm = (SortAlgorithm)Class.forName(algName).newInstance();
+                algorithm = (SortAlgorithm) Class.forName(algName).newInstance();
                 algorithm.setParent(this);
             }
             algorithm.init();
             algorithm.sort(arr);
-        } catch(Exception e) {
+        } catch (Exception e) {
         }
     }
 
@@ -254,8 +254,9 @@
      * Stop the applet. Kill any sorting algorithm that
      * is still sorting.
      */
+    @Override
     public synchronized void stop() {
-        if (algorithm != null){
+        if (algorithm != null) {
             try {
                 algorithm.stop();
             } catch (IllegalThreadStateException e) {
@@ -279,35 +280,42 @@
         }
     }
 
-
+    @Override
     public void mouseClicked(MouseEvent e) {
         showStatus(getParameter("alg"));
     }
 
+    @Override
     public void mousePressed(MouseEvent e) {
     }
 
     /**
      * The user clicked in the applet. Start the clock!
      */
+    @Override
     public void mouseReleased(MouseEvent e) {
         startSort();
         e.consume();
     }
 
+    @Override
     public void mouseEntered(MouseEvent e) {
     }
 
+    @Override
     public void mouseExited(MouseEvent e) {
     }
 
+    @Override
     public String getAppletInfo() {
         return "Title: SortDemo \nAuthor: James Gosling 1.17f, 10 Apr 1995 \nA simple applet class to demonstrate a sort algorithm.  \nYou can specify a sorting algorithm using the 'alg' attribute.  \nWhen you click on the applet, a thread is forked which animates \nthe sorting algorithm.";
     }
 
+    @Override
     public String[][] getParameterInfo() {
         String[][] info = {
-          {"alg", "string", "The name of the algorithm to run.  You can choose from the provided algorithms or suppply your own, as long as the classes are runnable as threads and their names end in 'Algorithm.'  BubbleSort is the default.  Example:  Use 'QSort' to run the QSortAlgorithm class."}
+            { "alg", "string",
+                "The name of the algorithm to run.  You can choose from the provided algorithms or suppply your own, as long as the classes are runnable as threads and their names end in 'Algorithm.'  BubbleSort is the default.  Example:  Use 'QSort' to run the QSortAlgorithm class." }
         };
         return info;
     }
--- a/src/share/demo/applets/SortDemo/example1.html	Mon Apr 04 17:18:35 2011 -0700
+++ b/src/share/demo/applets/SortDemo/example1.html	Mon Apr 04 17:20:24 2011 -0700
@@ -6,7 +6,7 @@
       <h1>The Sorting Algorithm Demo (1.1)</h1>
       <hr>
 
-      <table cols=3 width="340">
+      <table width="340">
       <tr>
       <th><strong>Bubble Sort</strong></th>
       <th><strong>Bidirectional Bubble Sort</strong></th>
--- a/src/share/demo/applets/SpreadSheet/SpreadSheet.java	Mon Apr 04 17:18:35 2011 -0700
+++ b/src/share/demo/applets/SpreadSheet/SpreadSheet.java	Mon Apr 04 17:20:24 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,39 +29,38 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/*
- */
 
 import java.applet.Applet;
 import java.awt.*;
 import java.awt.event.*;
 import java.io.*;
-import java.lang.*;
 import java.net.*;
 
-public class SpreadSheet
-    extends Applet
-    implements MouseListener, KeyListener {
-    String              title;
-    Font                titleFont;
-    Color               cellColor;
-    Color               inputColor;
-    int                 cellWidth = 100;
-    int                 cellHeight = 15;
-    int                 titleHeight = 15;
-    int                 rowLabelWidth = 15;
-    Font                inputFont;
-    boolean             isStopped = false;
-    boolean             fullUpdate = true;
-    int                 rows;
-    int                 columns;
-    int                 currentKey = -1;
-    int                 selectedRow = -1;
-    int                 selectedColumn = -1;
-    SpreadSheetInput    inputArea;
-    Cell                cells[][];
-    Cell                current = null;
 
+@SuppressWarnings("serial")
+public class SpreadSheet extends Applet implements MouseListener, KeyListener {
+
+    String title;
+    Font titleFont;
+    Color cellColor;
+    Color inputColor;
+    int cellWidth = 100;
+    int cellHeight = 15;
+    int titleHeight = 15;
+    int rowLabelWidth = 15;
+    Font inputFont;
+    boolean isStopped = false;
+    boolean fullUpdate = true;
+    int rows;
+    int columns;
+    int currentKey = -1;
+    int selectedRow = -1;
+    int selectedColumn = -1;
+    SpreadSheetInput inputArea;
+    Cell cells[][];
+    Cell current = null;
+
+    @Override
     public synchronized void init() {
         String rs;
 
@@ -87,17 +86,17 @@
         }
         cells = new Cell[rows][columns];
         char l[] = new char[1];
-        for (int i=0; i < rows; i++) {
-            for (int j=0; j < columns; j++) {
+        for (int i = 0; i < rows; i++) {
+            for (int j = 0; j < columns; j++) {
 
                 cells[i][j] = new Cell(this,
-                                       Color.lightGray,
-                                       Color.black,
-                                       cellColor,
-                                       cellWidth - 2,
-                                       cellHeight - 2);
-                l[0] = (char)((int)'a' + j);
-                rs = getParameter("" + new String(l) + (i+1));
+                        Color.lightGray,
+                        Color.black,
+                        cellColor,
+                        cellWidth - 2,
+                        cellHeight - 2);
+                l[0] = (char) ((int) 'a' + j);
+                rs = getParameter("" + new String(l) + (i + 1));
                 if (rs != null) {
                     cells[i][j].setUnparsedValue(rs);
                 }
@@ -106,9 +105,9 @@
 
         Dimension d = getSize();
         inputArea = new SpreadSheetInput(null, this, d.width - 2, cellHeight - 1,
-                                         inputColor, Color.white);
+                inputColor, Color.white);
         resize(columns * cellWidth + rowLabelWidth,
-               (rows + 3) * cellHeight + titleHeight);
+                (rows + 3) * cellHeight + titleHeight);
         addMouseListener(this);
         addKeyListener(this);
     }
@@ -121,19 +120,22 @@
         repaint();
     }
 
+    @Override
     public void stop() {
         isStopped = true;
     }
 
+    @Override
     public void start() {
         isStopped = false;
     }
 
+    @Override
     public void destroy() {
-        for (int i=0; i < rows; i++) {
-            for (int j=0; j < columns; j++) {
+        for (int i = 0; i < rows; i++) {
+            for (int j = 0; j < columns; j++) {
                 if (cells[i][j].type == Cell.URL) {
-                    cells[i][j].updaterThread.stop();
+                    cells[i][j].updaterThread.run = false;
                 }
             }
         }
@@ -147,16 +149,17 @@
         repaint();
     }
 
+    @Override
     public void update(Graphics g) {
-        if (! fullUpdate) {
+        if (!fullUpdate) {
             int cx, cy;
 
             g.setFont(titleFont);
-            for (int i=0; i < rows; i++) {
-                for (int j=0; j < columns; j++) {
+            for (int i = 0; i < rows; i++) {
+                for (int j = 0; j < columns; j++) {
                     if (cells[i][j].needRedisplay) {
                         cx = (j * cellWidth) + 2 + rowLabelWidth;
-                        cy = ((i+1) * cellHeight) + 2 + titleHeight;
+                        cy = ((i + 1) * cellHeight) + 2 + titleHeight;
                         cells[i][j].paint(g, cx, cy);
                     }
                 }
@@ -168,13 +171,14 @@
     }
 
     public void recalculate() {
-        int     i,j;
+        int i, j;
 
         //System.out.println("SpreadSheet.recalculate");
-        for (i=0; i < rows; i++) {
-            for (j=0; j < columns; j++) {
+        for (i = 0; i < rows; i++) {
+            for (j = 0; j < columns; j++) {
                 if (cells[i][j] != null && cells[i][j].type == Cell.FORMULA) {
-                    cells[i][j].setRawValue(evaluateFormula(cells[i][j].parseRoot));
+                    cells[i][j].setRawValue(evaluateFormula(
+                            cells[i][j].parseRoot));
                     cells[i][j].needRedisplay = true;
                 }
             }
@@ -182,8 +186,8 @@
         repaint();
     }
 
-    public float evaluateFormula(Node n) {
-        float   val = 0.0f;
+    float evaluateFormula(Node n) {
+        float val = 0.0f;
 
         //System.out.println("evaluateFormula:");
         //n.print(3);
@@ -192,43 +196,40 @@
             return val;
         }
         switch (n.type) {
-          case Node.OP:
-            val = evaluateFormula(n.left);
-            switch (n.op) {
-              case '+':
-                val += evaluateFormula(n.right);
+            case Node.OP:
+                val = evaluateFormula(n.left);
+                switch (n.op) {
+                    case '+':
+                        val += evaluateFormula(n.right);
+                        break;
+                    case '*':
+                        val *= evaluateFormula(n.right);
+                        break;
+                    case '-':
+                        val -= evaluateFormula(n.right);
+                        break;
+                    case '/':
+                        val /= evaluateFormula(n.right);
+                        break;
+                }
                 break;
-              case '*':
-                val *= evaluateFormula(n.right);
-                break;
-              case '-':
-                val -= evaluateFormula(n.right);
-                break;
-              case '/':
-                val /= evaluateFormula(n.right);
-                break;
-            }
-            break;
-          case Node.VALUE:
-            //System.out.println("=>" + n.value);
-            return n.value;
-          case Node.CELL:
-            if (n == null) {
-                //System.out.println("NULL at 192");
-            } else {
+            case Node.VALUE:
+                //System.out.println("=>" + n.value);
+                return n.value;
+            case Node.CELL:
                 if (cells[n.row][n.column] == null) {
                     //System.out.println("NULL at 193");
                 } else {
                     //System.out.println("=>" + cells[n.row][n.column].value);
                     return cells[n.row][n.column].value;
                 }
-            }
         }
 
         //System.out.println("=>" + val);
         return val;
     }
 
+    @Override
     public synchronized void paint(Graphics g) {
         int i, j;
         int cx, cy;
@@ -240,40 +241,40 @@
         g.setFont(titleFont);
         i = g.getFontMetrics().stringWidth(title);
         g.drawString((title == null) ? "Spreadsheet" : title,
-                     (d.width - i) / 2, 12);
+                (d.width - i) / 2, 12);
         g.setColor(inputColor);
         g.fillRect(0, cellHeight, d.width, cellHeight);
         g.setFont(titleFont);
-        for (i=0; i < rows+1; i++) {
-            cy = (i+2) * cellHeight;
+        for (i = 0; i < rows + 1; i++) {
+            cy = (i + 2) * cellHeight;
             g.setColor(getBackground());
             g.draw3DRect(0, cy, d.width, 2, true);
             if (i < rows) {
                 g.setColor(Color.red);
-                g.drawString("" + (i+1), 2, cy + 12);
+                g.drawString("" + (i + 1), 2, cy + 12);
             }
         }
 
         g.setColor(Color.red);
-        cy = (rows+3) * cellHeight + (cellHeight / 2);
-        for (i=0; i < columns; i++) {
+        cy = (rows + 3) * cellHeight + (cellHeight / 2);
+        for (i = 0; i < columns; i++) {
             cx = i * cellWidth;
             g.setColor(getBackground());
             g.draw3DRect(cx + rowLabelWidth,
-                          2 * cellHeight, 1, d.height, true);
+                    2 * cellHeight, 1, d.height, true);
             if (i < columns) {
                 g.setColor(Color.red);
-                l[0] = (char)((int)'A' + i);
+                l[0] = (char) ((int) 'A' + i);
                 g.drawString(new String(l),
-                             cx + rowLabelWidth + (cellWidth / 2),
-                             cy);
+                        cx + rowLabelWidth + (cellWidth / 2),
+                        cy);
             }
         }
 
-        for (i=0; i < rows; i++) {
-            for (j=0; j < columns; j++) {
+        for (i = 0; i < rows; i++) {
+            for (j = 0; j < columns; j++) {
                 cx = (j * cellWidth) + 2 + rowLabelWidth;
-                cy = ((i+1) * cellHeight) + 2 + titleHeight;
+                cy = ((i + 1) * cellHeight) + 2 + titleHeight;
                 if (cells[i][j] != null) {
                     cells[i][j].paint(g, cx, cy);
                 }
@@ -282,141 +283,152 @@
 
         g.setColor(getBackground());
         g.draw3DRect(0, titleHeight,
-                      d.width,
-                      d.height - titleHeight,
-                      false);
+                d.width,
+                d.height - titleHeight,
+                false);
         inputArea.paint(g, 1, titleHeight + 1);
     }
 
-      //1.1 event handling
+    //1.1 event handling
+    @Override
+    public void mouseClicked(MouseEvent e) {
+    }
 
-  public void mouseClicked(MouseEvent e)
-  {}
+    @Override
+    public void mousePressed(MouseEvent e) {
+        int x = e.getX();
+        int y = e.getY();
+        Cell cell;
+        if (y < (titleHeight + cellHeight)) {
+            selectedRow = -1;
+            if (y <= titleHeight && current != null) {
+                current.deselect();
+                current = null;
+            }
+            e.consume();
+        }
+        if (x < rowLabelWidth) {
+            selectedRow = -1;
+            if (current != null) {
+                current.deselect();
+                current = null;
+            }
+            e.consume();
 
-  public void mousePressed(MouseEvent e)
-  {
-    int x = e.getX();
-    int y = e.getY();
-    Cell cell;
-    if (y < (titleHeight + cellHeight)) {
-      selectedRow = -1;
-      if (y <= titleHeight && current != null) {
-        current.deselect();
-        current = null;
-      }
-      e.consume();
+        }
+        selectedRow = ((y - cellHeight - titleHeight) / cellHeight);
+        selectedColumn = (x - rowLabelWidth) / cellWidth;
+        if (selectedRow > rows
+                || selectedColumn >= columns) {
+            selectedRow = -1;
+            if (current != null) {
+                current.deselect();
+                current = null;
+            }
+        } else {
+            if (selectedRow >= rows) {
+                selectedRow = -1;
+                if (current != null) {
+                    current.deselect();
+                    current = null;
+                }
+                e.consume();
+            }
+            if (selectedRow != -1) {
+                cell = cells[selectedRow][selectedColumn];
+                inputArea.setText(cell.getPrintString());
+                if (current != null) {
+                    current.deselect();
+                }
+                current = cell;
+                current.select();
+                requestFocus();
+                fullUpdate = true;
+                repaint();
+            }
+            e.consume();
+        }
     }
-    if (x < rowLabelWidth) {
-      selectedRow = -1;
-      if (current != null) {
-        current.deselect();
-                current = null;
-      }
-      e.consume();
 
+    @Override
+    public void mouseReleased(MouseEvent e) {
     }
-    selectedRow = ((y - cellHeight - titleHeight) / cellHeight);
-    selectedColumn = (x - rowLabelWidth) / cellWidth;
-    if (selectedRow > rows ||
-        selectedColumn >= columns) {
-      selectedRow = -1;
-      if (current != null) {
-        current.deselect();
-        current = null;
-      }
-    } else {
-      if (selectedRow >= rows) {
-        selectedRow = -1;
-        if (current != null) {
-          current.deselect();
-          current = null;
-        }
+
+    @Override
+    public void mouseEntered(MouseEvent e) {
+    }
+
+    @Override
+    public void mouseExited(MouseEvent e) {
+    }
+
+    @Override
+    public void keyPressed(KeyEvent e) {
+    }
+
+    @Override
+    public void keyTyped(KeyEvent e) {
+        fullUpdate = true;
+        inputArea.processKey(e);
         e.consume();
-      }
-      if (selectedRow != -1) {
-        cell = cells[selectedRow][selectedColumn];
-        inputArea.setText(new String(cell.getPrintString()));
-        if (current != null) {
-          current.deselect();
-        }
-        current = cell;
-        current.select();
-        requestFocus();
-        fullUpdate = true;
-        repaint();
-      }
-      e.consume();
     }
-  }
 
-  public void mouseReleased(MouseEvent e)
-  {}
+    @Override
+    public void keyReleased(KeyEvent e) {
+    }
 
-  public void mouseEntered(MouseEvent e)
-  {}
+    @Override
+    public String getAppletInfo() {
+        return "Title: SpreadSheet \nAuthor: Sami Shaio \nA simple spread sheet.";
+    }
 
-  public void mouseExited(MouseEvent e)
-  {}
-
-  public void keyPressed(KeyEvent e)
-  {
-  }
-
-  public void keyTyped(KeyEvent e) {
-    fullUpdate=true;
-    inputArea.processKey(e);
-    e.consume();
-  }
-
-  public void keyReleased(KeyEvent e)
-  {}
-
-  public String getAppletInfo() {
-    return "Title: SpreadSheet \nAuthor: Sami Shaio \nA simple spread sheet.";
-  }
-
-  public String[][] getParameterInfo() {
-    String[][] info = {
-      {"title", "string", "The title of the spread sheet.  Default is 'Spreadsheet'"},
-      {"rows", "int", "The number of rows.  Default is 9."},
-      {"columns", "int", "The number of columns.  Default is 5."}
-    };
-    return info;
-  }
-
-
+    @Override
+    public String[][] getParameterInfo() {
+        String[][] info = {
+            { "title", "string",
+                "The title of the spread sheet.  Default is 'Spreadsheet'" },
+            { "rows", "int", "The number of rows.  Default is 9." },
+            { "columns", "int", "The number of columns.  Default is 5." }
+        };
+        return info;
+    }
 }
 
+
 class CellUpdater extends Thread {
-    Cell        target;
+
+    Cell target;
     InputStream dataStream = null;
     StreamTokenizer tokenStream;
+    public volatile boolean run = true;
 
     public CellUpdater(Cell c) {
         super("cell updater");
         target = c;
     }
 
+    @Override
     public void run() {
         try {
             dataStream = new URL(target.app.getDocumentBase(),
-                                 target.getValueString()).openStream();
-            tokenStream = new StreamTokenizer(new BufferedReader(new InputStreamReader(dataStream)));
+                    target.getValueString()).openStream();
+            tokenStream = new StreamTokenizer(new BufferedReader(
+                    new InputStreamReader(dataStream)));
             tokenStream.eolIsSignificant(false);
 
-            while (true) {
+            while (run) {
                 switch (tokenStream.nextToken()) {
-                case StreamTokenizer.TT_EOF:
-                    dataStream.close();
-                    return;
-                default:
-                    break;
-                case StreamTokenizer.TT_NUMBER:
-                    target.setTransientValue((float)tokenStream.nval);
-                    if (! target.app.isStopped && ! target.paused) {
-                        target.app.repaint();
-                    }
-                    break;
+                    case StreamTokenizer.TT_EOF:
+                        dataStream.close();
+                        return;
+                    default:
+                        break;
+                    case StreamTokenizer.TT_NUMBER:
+                        target.setTransientValue((float) tokenStream.nval);
+                        if (!target.app.isStopped && !target.paused) {
+                            target.app.repaint();
+                        }
+                        break;
                 }
                 try {
                     Thread.sleep(2000);
@@ -430,35 +442,36 @@
     }
 }
 
+
 class Cell {
+
     public static final int VALUE = 0;
     public static final int LABEL = 1;
-    public static final int URL   = 2;
+    public static final int URL = 2;
     public static final int FORMULA = 3;
-
-    Node        parseRoot;
-    boolean     needRedisplay;
+    Node parseRoot;
+    boolean needRedisplay;
     boolean selected = false;
     boolean transientValue = false;
-    public int  type = Cell.VALUE;
-    String      valueString = "";
-    String      printString = "v";
-    float       value;
-    Color       bgColor;
-    Color       fgColor;
-    Color       highlightColor;
-    int         width;
-    int         height;
+    public int type = Cell.VALUE;
+    String valueString = "";
+    String printString = "v";
+    float value;
+    Color bgColor;
+    Color fgColor;
+    Color highlightColor;
+    int width;
+    int height;
     SpreadSheet app;
     CellUpdater updaterThread;
-    boolean     paused = false;
+    boolean paused = false;
 
     public Cell(SpreadSheet app,
-                Color bgColor,
-                Color fgColor,
-                Color highlightColor,
-                int width,
-                int height) {
+            Color bgColor,
+            Color fgColor,
+            Color highlightColor,
+            int width,
+            int height) {
         this.app = app;
         this.bgColor = bgColor;
         this.fgColor = fgColor;
@@ -472,6 +485,7 @@
         valueString = Float.toString(f);
         value = f;
     }
+
     public void setValue(float f) {
         setRawValue(f);
         printString = "v" + valueString;
@@ -490,18 +504,18 @@
 
     public void setUnparsedValue(String s) {
         switch (s.charAt(0)) {
-          case 'v':
-            setValue(Cell.VALUE, s.substring(1));
-            break;
-          case 'f':
-            setValue(Cell.FORMULA, s.substring(1));
-            break;
-          case 'l':
-            setValue(Cell.LABEL, s.substring(1));
-            break;
-          case 'u':
-            setValue(Cell.URL, s.substring(1));
-            break;
+            case 'v':
+                setValue(Cell.VALUE, s.substring(1));
+                break;
+            case 'f':
+                setValue(Cell.FORMULA, s.substring(1));
+                break;
+            case 'l':
+                setValue(Cell.LABEL, s.substring(1));
+                break;
+            case 'u':
+                setValue(Cell.URL, s.substring(1));
+                break;
         }
     }
 
@@ -519,8 +533,6 @@
     public String parseFormula(String formula, Node node) {
         String subformula;
         String restFormula;
-        float value;
-        int length = formula.length();
         Node left;
         Node right;
         char op;
@@ -534,52 +546,53 @@
             //System.out.println("Parse succeeded");
             return null;
         }
-        if (subformula == formula) {
+        if (subformula.equals(formula)) {
             //System.out.println("Parse failed");
             return formula;
         }
 
         // parse an operator and then another value
         switch (op = subformula.charAt(0)) {
-          case 0:
-            //System.out.println("Parse succeeded");
-            return null;
-          case ')':
-            //System.out.println("Returning subformula=" + subformula);
-            return subformula;
-          case '+':
-          case '*':
-          case '-':
-          case '/':
-            restFormula = subformula.substring(1);
-            subformula = parseValue(restFormula, right=new Node());
-            //System.out.println("subformula(2) = " + subformula);
-            if (subformula != restFormula) {
+            case 0:
                 //System.out.println("Parse succeeded");
-                left = new Node(node);
-                node.left = left;
-                node.right = right;
-                node.op = op;
-                node.type = Node.OP;
-                //node.print(3);
+                return null;
+            case ')':
+                //System.out.println("Returning subformula=" + subformula);
                 return subformula;
-            } else {
-                //System.out.println("Parse failed");
+            case '+':
+            case '*':
+            case '-':
+            case '/':
+                restFormula = subformula.substring(1);
+                subformula = parseValue(restFormula, right = new Node());
+                //System.out.println("subformula(2) = " + subformula);
+                if (subformula == null ? restFormula != null : !subformula.
+                        equals(restFormula)) {
+                    //System.out.println("Parse succeeded");
+                    left = new Node(node);
+                    node.left = left;
+                    node.right = right;
+                    node.op = op;
+                    node.type = Node.OP;
+                    //node.print(3);
+                    return subformula;
+                } else {
+                    //System.out.println("Parse failed");
+                    return formula;
+                }
+            default:
+                //System.out.println("Parse failed (bad operator): " + subformula);
                 return formula;
-            }
-          default:
-            //System.out.println("Parse failed (bad operator): " + subformula);
-            return formula;
         }
     }
 
     public String parseValue(String formula, Node node) {
-        char    c = formula.charAt(0);
-        String  subformula;
-        String  restFormula;
-        float   value;
-        int     row;
-        int     column;
+        char c = formula.charAt(0);
+        String subformula;
+        String restFormula;
+        float _value;
+        int row;
+        int column;
 
         //System.out.println("parseValue: " + formula);
         restFormula = formula;
@@ -588,11 +601,11 @@
             restFormula = formula.substring(1);
             subformula = parseFormula(restFormula, node);
             //System.out.println("rest=(" + subformula + ")");
-            if (subformula == null ||
-                subformula.length() == restFormula.length()) {
+            if (subformula == null
+                    || subformula.length() == restFormula.length()) {
                 //System.out.println("Failed");
                 return formula;
-            } else if (! (subformula.charAt(0) == ')')) {
+            } else if (!(subformula.charAt(0) == ')')) {
                 //System.out.println("Failed (missing parentheses)");
                 return formula;
             }
@@ -601,31 +614,31 @@
             int i;
 
             //System.out.println("formula=" + formula);
-            for (i=0; i < formula.length(); i++) {
+            for (i = 0; i < formula.length(); i++) {
                 c = formula.charAt(i);
                 if ((c < '0' || c > '9') && c != '.') {
                     break;
                 }
             }
             try {
-                value = Float.valueOf(formula.substring(0, i)).floatValue();
+                _value = Float.valueOf(formula.substring(0, i)).floatValue();
             } catch (NumberFormatException e) {
                 //System.out.println("Failed (number format error)");
                 return formula;
             }
             node.type = Node.VALUE;
-            node.value = value;
+            node.value = _value;
             //node.print(3);
             restFormula = formula.substring(i);
             //System.out.println("value= " + value + " i=" + i +
-                //                     " rest = " + restFormula);
+            //                     " rest = " + restFormula);
             return restFormula;
         } else if (c >= 'A' && c <= 'Z') {
             int i;
 
             column = c - 'A';
             restFormula = formula.substring(1);
-            for (i=0; i < restFormula.length(); i++) {
+            for (i = 0; i < restFormula.length(); i++) {
                 c = restFormula.charAt(i);
                 if (c < '0' || c > '9') {
                     break;
@@ -650,33 +663,32 @@
         return restFormula;
     }
 
-
     public void setValue(int type, String s) {
         paused = false;
         if (this.type == Cell.URL) {
-            updaterThread.stop();
+            updaterThread.run = false;
             updaterThread = null;
         }
 
-        valueString = new String(s);
+        valueString = s;
         this.type = type;
         needRedisplay = true;
         switch (type) {
-          case Cell.VALUE:
-            setValue(Float.valueOf(s).floatValue());
-            break;
-          case Cell.LABEL:
-            printString = "l" + valueString;
-            break;
-          case Cell.URL:
-            printString = "u" + valueString;
-            updaterThread = new CellUpdater(this);
-            updaterThread.start();
-            break;
-          case Cell.FORMULA:
-            parseFormula(valueString, parseRoot = new Node());
-            printString = "f" + valueString;
-            break;
+            case Cell.VALUE:
+                setValue(Float.valueOf(s).floatValue());
+                break;
+            case Cell.LABEL:
+                printString = "l" + valueString;
+                break;
+            case Cell.URL:
+                printString = "u" + valueString;
+                updaterThread = new CellUpdater(this);
+                updaterThread.start();
+                break;
+            case Cell.FORMULA:
+                parseFormula(valueString, parseRoot = new Node());
+                printString = "f" + valueString;
+                break;
         }
         app.recalculate();
     }
@@ -693,12 +705,14 @@
         selected = true;
         paused = true;
     }
+
     public void deselect() {
         selected = false;
         paused = false;
         needRedisplay = true;
         app.repaint();
     }
+
     public void paint(Graphics g, int x, int y) {
         if (selected) {
             g.setColor(highlightColor);
@@ -708,23 +722,23 @@
         g.fillRect(x, y, width - 1, height);
         if (valueString != null) {
             switch (type) {
-              case Cell.VALUE:
-              case Cell.LABEL:
-                g.setColor(fgColor);
-                break;
-              case Cell.FORMULA:
-                g.setColor(Color.red);
-                break;
-              case Cell.URL:
-                g.setColor(Color.blue);
-                break;
+                case Cell.VALUE:
+                case Cell.LABEL:
+                    g.setColor(fgColor);
+                    break;
+                case Cell.FORMULA:
+                    g.setColor(Color.red);
+                    break;
+                case Cell.URL:
+                    g.setColor(Color.blue);
+                    break;
             }
-            if (transientValue){
+            if (transientValue) {
                 g.drawString("" + value, x, y + (height / 2) + 5);
             } else {
                 if (valueString.length() > 14) {
                     g.drawString(valueString.substring(0, 14),
-                                 x, y + (height / 2) + 5);
+                            x, y + (height / 2) + 5);
                 } else {
                     g.drawString(valueString, x, y + (height / 2) + 5);
                 }
@@ -734,18 +748,19 @@
     }
 }
 
+
 class Node {
+
     public static final int OP = 0;
     public static final int VALUE = 1;
     public static final int CELL = 2;
-
-    int         type;
-    Node        left;
-    Node        right;
-    int         row;
-    int         column;
-    float       value;
-    char        op;
+    int type;
+    Node left;
+    Node right;
+    int row;
+    int column;
+    float value;
+    char op;
 
     public Node() {
         left = null;
@@ -756,6 +771,7 @@
         op = 0;
         type = Node.VALUE;
     }
+
     public Node(Node n) {
         left = n.left;
         right = n.right;
@@ -765,47 +781,51 @@
         op = n.op;
         type = n.type;
     }
+
     public void indent(int ind) {
         for (int i = 0; i < ind; i++) {
             System.out.print(" ");
         }
     }
+
     public void print(int indentLevel) {
         char l[] = new char[1];
         indent(indentLevel);
         System.out.println("NODE type=" + type);
         indent(indentLevel);
         switch (type) {
-          case Node.VALUE:
-            System.out.println(" value=" + value);
-            break;
-          case Node.CELL:
-            l[0] = (char)((int)'A' + column);
-            System.out.println(" cell=" + new String(l) + (row+1));
-            break;
-          case Node.OP:
-            System.out.println(" op=" + op);
-            left.print(indentLevel + 3);
-            right.print(indentLevel + 3);
-            break;
+            case Node.VALUE:
+                System.out.println(" value=" + value);
+                break;
+            case Node.CELL:
+                l[0] = (char) ((int) 'A' + column);
+                System.out.println(" cell=" + new String(l) + (row + 1));
+                break;
+            case Node.OP:
+                System.out.println(" op=" + op);
+                left.print(indentLevel + 3);
+                right.print(indentLevel + 3);
+                break;
         }
     }
 }
 
+
 class InputField {
-    int         maxchars = 50;
-    int         cursorPos = 0;
-    Applet      app;
-    String      sval;
-    char        buffer[];
-    int         nChars;
-    int         width;
-    int         height;
-    Color       bgColor;
-    Color       fgColor;
+
+    int maxchars = 50;
+    int cursorPos = 0;
+    Applet app;
+    String sval;
+    char buffer[];
+    int nChars;
+    int width;
+    int height;
+    Color bgColor;
+    Color fgColor;
 
     public InputField(String initValue, Applet app, int width, int height,
-                      Color bgColor, Color fgColor) {
+            Color bgColor, Color fgColor) {
         this.width = width;
         this.height = height;
         this.bgColor = bgColor;
@@ -823,7 +843,7 @@
     public void setText(String val) {
         int i;
 
-        for (i=0; i < maxchars; i++) {
+        for (i = 0; i < maxchars; i++) {
             buffer[i] = 0;
         }
         if (val == null) {
@@ -876,47 +896,52 @@
     }
 }
 
+
 class SpreadSheetInput
-    extends InputField {
+        extends InputField {
 
-  public SpreadSheetInput(String initValue,
-                          SpreadSheet app,
-                          int width,
-                          int height,
-                          Color bgColor,
-                          Color fgColor) {
-    super(initValue, app, width, height, bgColor, fgColor);
-  }
+    public SpreadSheetInput(String initValue,
+            SpreadSheet app,
+            int width,
+            int height,
+            Color bgColor,
+            Color fgColor) {
+        super(initValue, app, width, height, bgColor, fgColor);
+    }
 
+    @Override
     public void selected() {
         float f;
-        sval = ("".equals(sval)) ? "v":sval;
+        sval = ("".equals(sval)) ? "v" : sval;
         switch (sval.charAt(0)) {
-          case 'v':
-              String s= sval.substring(1);
-            try {
-                int i;
-                for (i = 0; i < s.length(); i++) {
-                    char c = s.charAt(i);
-                    if (c < '0' || c > '9')
-                        break;
+            case 'v':
+                String s = sval.substring(1);
+                try {
+                    int i;
+                    for (i = 0; i < s.length(); i++) {
+                        char c = s.charAt(i);
+                        if (c < '0' || c > '9') {
+                            break;
+                        }
+                    }
+                    s = s.substring(0, i);
+                    f = Float.valueOf(s).floatValue();
+                    ((SpreadSheet) app).setCurrentValue(f);
+                } catch (NumberFormatException e) {
+                    System.out.println("Not a float: '" + s + "'");
                 }
-                s = s.substring(0, i);
-                f = Float.valueOf(s).floatValue();
-                ((SpreadSheet)app).setCurrentValue(f);
-            } catch (NumberFormatException e) {
-                System.out.println("Not a float: '" + s + "'");
-            }
-            break;
-          case 'l':
-            ((SpreadSheet)app).setCurrentValue(Cell.LABEL, sval.substring(1));
-            break;
-          case 'u':
-            ((SpreadSheet)app).setCurrentValue(Cell.URL, sval.substring(1));
-            break;
-          case 'f':
-            ((SpreadSheet)app).setCurrentValue(Cell.FORMULA, sval.substring(1));
-            break;
+                break;
+            case 'l':
+                ((SpreadSheet) app).setCurrentValue(Cell.LABEL,
+                        sval.substring(1));
+                break;
+            case 'u':
+                ((SpreadSheet) app).setCurrentValue(Cell.URL, sval.substring(1));
+                break;
+            case 'f':
+                ((SpreadSheet) app).setCurrentValue(Cell.FORMULA,
+                        sval.substring(1));
+                break;
         }
     }
 }
--- a/src/share/demo/applets/WireFrame/Matrix3D.java	Mon Apr 04 17:18:35 2011 -0700
+++ b/src/share/demo/applets/WireFrame/Matrix3D.java	Mon Apr 04 17:20:24 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,22 +29,23 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/*
- */
 
 /** A fairly conventional 3D matrix object that can transform sets of
-    3D points and perform a variety of manipulations on the transform */
+3D points and perform a variety of manipulations on the transform */
 class Matrix3D {
+
     float xx, xy, xz, xo;
     float yx, yy, yz, yo;
     float zx, zy, zz, zo;
     static final double pi = 3.14159265;
+
     /** Create a new unit matrix */
-    Matrix3D () {
+    Matrix3D() {
         xx = 1.0f;
         yy = 1.0f;
         zz = 1.0f;
     }
+
     /** Scale by f in all dimensions */
     void scale(float f) {
         xx *= f;
@@ -60,6 +61,7 @@
         zz *= f;
         zo *= f;
     }
+
     /** Scale along each axis independently */
     void scale(float xf, float yf, float zf) {
         xx *= xf;
@@ -75,12 +77,14 @@
         zz *= zf;
         zo *= zf;
     }
+
     /** Translate the origin */
     void translate(float x, float y, float z) {
         xo += x;
         yo += y;
         zo += z;
     }
+
     /** rotate theta degrees about the y axis */
     void yrot(double theta) {
         theta *= (pi / 180);
@@ -106,6 +110,7 @@
         zy = Nzy;
         zz = Nzz;
     }
+
     /** rotate theta degrees about the x axis */
     void xrot(double theta) {
         theta *= (pi / 180);
@@ -131,6 +136,7 @@
         zy = Nzy;
         zz = Nzz;
     }
+
     /** rotate theta degrees about the z axis */
     void zrot(double theta) {
         theta *= (pi / 180);
@@ -156,6 +162,7 @@
         xy = Nxy;
         xz = Nxz;
     }
+
     /** Multiply this matrix by a second: M = M*R */
     void mult(Matrix3D rhs) {
         float lxx = xx * rhs.xx + yx * rhs.xy + zx * rhs.xz;
@@ -204,10 +211,11 @@
         zy = 0;
         zz = 1;
     }
+
     /** Transform nvert points from v into tv.  v contains the input
-        coordinates in floating point.  Three successive entries in
-        the array constitute a point.  tv ends up holding the transformed
-        points as integers; three successive entries per point */
+    coordinates in floating point.  Three successive entries in
+    the array constitute a point.  tv ends up holding the transformed
+    points as integers; three successive entries per point */
     void transform(float v[], int tv[], int nvert) {
         float lxx = xx, lxy = xy, lxz = xz, lxo = xo;
         float lyx = yx, lyy = yy, lyz = yz, lyo = yo;
@@ -216,11 +224,13 @@
             float x = v[i];
             float y = v[i + 1];
             float z = v[i + 2];
-            tv[i    ] = (int) (x * lxx + y * lxy + z * lxz + lxo);
+            tv[i] = (int) (x * lxx + y * lxy + z * lxz + lxo);
             tv[i + 1] = (int) (x * lyx + y * lyy + z * lyz + lyo);
             tv[i + 2] = (int) (x * lzx + y * lzy + z * lzz + lzo);
         }
     }
+
+    @Override
     public String toString() {
         return ("[" + xo + "," + xx + "," + xy + "," + xz + ";"
                 + yo + "," + yx + "," + yy + "," + yz + ";"
--- a/src/share/demo/applets/WireFrame/ThreeD.java	Mon Apr 04 17:18:35 2011 -0700
+++ b/src/share/demo/applets/WireFrame/ThreeD.java	Mon Apr 04 17:20:24 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,28 +29,29 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/*
- */
-
-/* A set of classes to parse, represent and display 3D wireframe models
-   represented in Wavefront .obj format. */
 
 import java.applet.Applet;
 import java.awt.Graphics;
 import java.awt.Color;
-import java.awt.Event;
 import java.awt.event.*;
 import java.io.*;
 import java.net.URL;
 
+
+/* A set of classes to parse, represent and display 3D wireframe models
+represented in Wavefront .obj format. */
+@SuppressWarnings("serial")
 class FileFormatException extends Exception {
+
     public FileFormatException(String s) {
         super(s);
     }
 }
 
+
 /** The representation of a 3D model */
-class Model3D {
+final class Model3D {
+
     float vert[];
     int tvert[];
     int nvert, maxvert;
@@ -58,78 +59,90 @@
     int ncon, maxcon;
     boolean transformed;
     Matrix3D mat;
-
     float xmin, xmax, ymin, ymax, zmin, zmax;
 
-    Model3D () {
-        mat = new Matrix3D ();
+    Model3D() {
+        mat = new Matrix3D();
         mat.xrot(20);
         mat.yrot(30);
     }
+
     /** Create a 3D model by parsing an input stream */
-    Model3D (InputStream is) throws IOException, FileFormatException {
-      this();
-      StreamTokenizer st = new StreamTokenizer(
-              new BufferedReader(new InputStreamReader(is, "UTF-8")));
-      st.eolIsSignificant(true);
-      st.commentChar('#');
-    scan:
+    Model3D(InputStream is) throws IOException, FileFormatException {
+        this();
+        StreamTokenizer st = new StreamTokenizer(
+                new BufferedReader(new InputStreamReader(is, "UTF-8")));
+        st.eolIsSignificant(true);
+        st.commentChar('#');
+        scan:
         while (true) {
             switch (st.nextToken()) {
-              default:
-                break scan;
-              case StreamTokenizer.TT_EOL:
-                break;
-              case StreamTokenizer.TT_WORD:
-                if ("v".equals(st.sval)) {
-                    double x = 0, y = 0, z = 0;
-                    if (st.nextToken() == StreamTokenizer.TT_NUMBER) {
-                        x = st.nval;
+                default:
+                    break scan;
+                case StreamTokenizer.TT_EOL:
+                    break;
+                case StreamTokenizer.TT_WORD:
+                    if ("v".equals(st.sval)) {
+                        double x = 0, y = 0, z = 0;
                         if (st.nextToken() == StreamTokenizer.TT_NUMBER) {
-                            y = st.nval;
-                            if (st.nextToken() == StreamTokenizer.TT_NUMBER)
-                                z = st.nval;
+                            x = st.nval;
+                            if (st.nextToken() == StreamTokenizer.TT_NUMBER) {
+                                y = st.nval;
+                                if (st.nextToken() == StreamTokenizer.TT_NUMBER) {
+                                    z = st.nval;
+                                }
+                            }
+                        }
+                        addVert((float) x, (float) y, (float) z);
+                        while (st.ttype != StreamTokenizer.TT_EOL && st.ttype
+                                != StreamTokenizer.TT_EOF) {
+                            st.nextToken();
+                        }
+                    } else if ("f".equals(st.sval) || "fo".equals(st.sval) || "l".
+                            equals(st.sval)) {
+                        int start = -1;
+                        int prev = -1;
+                        int n = -1;
+                        while (true) {
+                            if (st.nextToken() == StreamTokenizer.TT_NUMBER) {
+                                n = (int) st.nval;
+                                if (prev >= 0) {
+                                    add(prev - 1, n - 1);
+                                }
+                                if (start < 0) {
+                                    start = n;
+                                }
+                                prev = n;
+                            } else if (st.ttype == '/') {
+                                st.nextToken();
+                            } else {
+                                break;
+                            }
+                        }
+                        if (start >= 0) {
+                            add(start - 1, prev - 1);
+                        }
+                        if (st.ttype != StreamTokenizer.TT_EOL) {
+                            break scan;
+                        }
+                    } else {
+                        while (st.nextToken() != StreamTokenizer.TT_EOL
+                                && st.ttype != StreamTokenizer.TT_EOF) {
+                            // no-op
                         }
                     }
-                    addVert((float) x, (float) y, (float) z);
-                    while (st.ttype != StreamTokenizer.TT_EOL &&
-                            st.ttype != StreamTokenizer.TT_EOF)
-                        st.nextToken();
-                } else if ("f".equals(st.sval) || "fo".equals(st.sval) || "l".equals(st.sval)) {
-                    int start = -1;
-                    int prev = -1;
-                    int n = -1;
-                    while (true)
-                        if (st.nextToken() == StreamTokenizer.TT_NUMBER) {
-                            n = (int) st.nval;
-                            if (prev >= 0)
-                                add(prev - 1, n - 1);
-                            if (start < 0)
-                                start = n;
-                            prev = n;
-                        } else if (st.ttype == '/')
-                            st.nextToken();
-                        else
-                            break;
-                    if (start >= 0)
-                        add(start - 1, prev - 1);
-                    if (st.ttype != StreamTokenizer.TT_EOL)
-                        break scan;
-                } else {
-                    while (st.nextToken() != StreamTokenizer.TT_EOL
-                            && st.ttype != StreamTokenizer.TT_EOF);
-                }
             }
         }
         is.close();
-        if (st.ttype != StreamTokenizer.TT_EOF)
+        if (st.ttype != StreamTokenizer.TT_EOF) {
             throw new FileFormatException(st.toString());
+        }
     }
 
     /** Add a vertex to this model */
     int addVert(float x, float y, float z) {
         int i = nvert;
-        if (i >= maxvert)
+        if (i >= maxvert) {
             if (vert == null) {
                 maxvert = 100;
                 vert = new float[maxvert * 3];
@@ -139,18 +152,21 @@
                 System.arraycopy(vert, 0, nv, 0, vert.length);
                 vert = nv;
             }
+        }
         i *= 3;
         vert[i] = x;
         vert[i + 1] = y;
         vert[i + 2] = z;
         return nvert++;
     }
+
     /** Add a line from vertex p1 to vertex p2 */
     void add(int p1, int p2) {
         int i = ncon;
-        if (p1 >= nvert || p2 >= nvert)
+        if (p1 >= nvert || p2 >= nvert) {
             return;
-        if (i >= maxcon)
+        }
+        if (i >= maxcon) {
             if (con == null) {
                 maxcon = 100;
                 con = new int[maxcon];
@@ -160,6 +176,7 @@
                 System.arraycopy(con, 0, nv, 0, con.length);
                 con = nv;
             }
+        }
         if (p1 > p2) {
             int t = p1;
             p1 = p2;
@@ -168,79 +185,79 @@
         con[i] = (p1 << 16) | p2;
         ncon = i + 1;
     }
+
     /** Transform all the points in this model */
     void transform() {
-        if (transformed || nvert <= 0)
+        if (transformed || nvert <= 0) {
             return;
-        if (tvert == null || tvert.length < nvert * 3)
-            tvert = new int[nvert*3];
+        }
+        if (tvert == null || tvert.length < nvert * 3) {
+            tvert = new int[nvert * 3];
+        }
         mat.transform(vert, tvert, nvert);
         transformed = true;
     }
 
-   /* Quick Sort implementation
-    */
-   private void quickSort(int a[], int left, int right)
-   {
-      int leftIndex = left;
-      int rightIndex = right;
-      int partionElement;
-      if ( right > left)
-      {
+    /* Quick Sort implementation
+     */
+    private void quickSort(int a[], int left, int right) {
+        int leftIndex = left;
+        int rightIndex = right;
+        int partionElement;
+        if (right > left) {
 
-         /* Arbitrarily establishing partition element as the midpoint of
-          * the array.
-          */
-         partionElement = a[ ( left + right ) / 2 ];
+            /* Arbitrarily establishing partition element as the midpoint of
+             * the array.
+             */
+            partionElement = a[(left + right) / 2];
 
-         // loop through the array until indices cross
-         while( leftIndex <= rightIndex )
-         {
-            /* find the first element that is greater than or equal to
-             * the partionElement starting from the leftIndex.
+            // loop through the array until indices cross
+            while (leftIndex <= rightIndex) {
+                /* find the first element that is greater than or equal to
+                 * the partionElement starting from the leftIndex.
+                 */
+                while ((leftIndex < right) && (a[leftIndex] < partionElement)) {
+                    ++leftIndex;
+                }
+
+                /* find an element that is smaller than or equal to
+                 * the partionElement starting from the rightIndex.
+                 */
+                while ((rightIndex > left) && (a[rightIndex] > partionElement)) {
+                    --rightIndex;
+                }
+
+                // if the indexes have not crossed, swap
+                if (leftIndex <= rightIndex) {
+                    swap(a, leftIndex, rightIndex);
+                    ++leftIndex;
+                    --rightIndex;
+                }
+            }
+
+            /* If the right index has not reached the left side of array
+             * must now sort the left partition.
              */
-            while( ( leftIndex < right ) && ( a[leftIndex] < partionElement ) )
-               ++leftIndex;
+            if (left < rightIndex) {
+                quickSort(a, left, rightIndex);
+            }
 
-            /* find an element that is smaller than or equal to
-             * the partionElement starting from the rightIndex.
+            /* If the left index has not reached the right side of array
+             * must now sort the right partition.
              */
-            while( ( rightIndex > left ) &&
-                   ( a[rightIndex] > partionElement ) )
-               --rightIndex;
+            if (leftIndex < right) {
+                quickSort(a, leftIndex, right);
+            }
 
-            // if the indexes have not crossed, swap
-            if( leftIndex <= rightIndex )
-            {
-               swap(a, leftIndex, rightIndex);
-               ++leftIndex;
-               --rightIndex;
-            }
-         }
+        }
+    }
 
-         /* If the right index has not reached the left side of array
-          * must now sort the left partition.
-          */
-         if( left < rightIndex )
-            quickSort( a, left, rightIndex );
-
-         /* If the left index has not reached the right side of array
-          * must now sort the right partition.
-          */
-         if( leftIndex < right )
-            quickSort( a, leftIndex, right );
-
-      }
-   }
-
-   private void swap(int a[], int i, int j)
-   {
-      int T;
-      T = a[i];
-      a[i] = a[j];
-      a[j] = T;
-   }
-
+    private void swap(int a[], int i, int j) {
+        int T;
+        T = a[i];
+        a[i] = a[j];
+        a[j] = T;
+    }
 
     /** eliminate duplicate lines */
     void compress() {
@@ -259,21 +276,21 @@
         }
         ncon = d;
     }
-
     static Color gr[];
 
     /** Paint this model to a graphics context.  It uses the matrix associated
-        with this model to map from model space to screen space.
-        The next version of the browser should have double buffering,
-        which will make this *much* nicer */
+    with this model to map from model space to screen space.
+    The next version of the browser should have double buffering,
+    which will make this *much* nicer */
     void paint(Graphics g) {
-        if (vert == null || nvert <= 0)
+        if (vert == null || nvert <= 0) {
             return;
+        }
         transform();
         if (gr == null) {
             gr = new Color[16];
             for (int i = 0; i < 16; i++) {
-                int grey = (int) (170*(1-Math.pow(i/15.0, 2.3)));
+                int grey = (int) (170 * (1 - Math.pow(i / 15.0, 2.3)));
                 gr[i] = new Color(grey, grey, grey);
             }
         }
@@ -281,151 +298,181 @@
         int lim = ncon;
         int c[] = con;
         int v[] = tvert;
-        if (lim <= 0 || nvert <= 0)
+        if (lim <= 0 || nvert <= 0) {
             return;
+        }
         for (int i = 0; i < lim; i++) {
             int T = c[i];
             int p1 = ((T >> 16) & 0xFFFF) * 3;
             int p2 = (T & 0xFFFF) * 3;
             int grey = v[p1 + 2] + v[p2 + 2];
-            if (grey < 0)
+            if (grey < 0) {
                 grey = 0;
-            if (grey > 15)
+            }
+            if (grey > 15) {
                 grey = 15;
+            }
             if (grey != lg) {
                 lg = grey;
                 g.setColor(gr[grey]);
             }
             g.drawLine(v[p1], v[p1 + 1],
-                       v[p2], v[p2 + 1]);
+                    v[p2], v[p2 + 1]);
         }
     }
 
     /** Find the bounding box of this model */
     void findBB() {
-        if (nvert <= 0)
+        if (nvert <= 0) {
             return;
+        }
         float v[] = vert;
-        float xmin = v[0], xmax = xmin;
-        float ymin = v[1], ymax = ymin;
-        float zmin = v[2], zmax = zmin;
+        float _xmin = v[0], _xmax = _xmin;
+        float _ymin = v[1], _ymax = _ymin;
+        float _zmin = v[2], _zmax = _zmin;
         for (int i = nvert * 3; (i -= 3) > 0;) {
             float x = v[i];
-            if (x < xmin)
-                xmin = x;
-            if (x > xmax)
-                xmax = x;
+            if (x < _xmin) {
+                _xmin = x;
+            }
+            if (x > _xmax) {
+                _xmax = x;
+            }
             float y = v[i + 1];
-            if (y < ymin)
-                ymin = y;
-            if (y > ymax)
-                ymax = y;
+            if (y < _ymin) {
+                _ymin = y;
+            }
+            if (y > _ymax) {
+                _ymax = y;
+            }
             float z = v[i + 2];
-            if (z < zmin)
-                zmin = z;
-            if (z > zmax)
-                zmax = z;
+            if (z < _zmin) {
+                _zmin = z;
+            }
+            if (z > _zmax) {
+                _zmax = z;
+            }
         }
-        this.xmax = xmax;
-        this.xmin = xmin;
-        this.ymax = ymax;
-        this.ymin = ymin;
-        this.zmax = zmax;
-        this.zmin = zmin;
+        this.xmax = _xmax;
+        this.xmin = _xmin;
+        this.ymax = _ymax;
+        this.ymin = _ymin;
+        this.zmax = _zmax;
+        this.zmin = _zmin;
     }
 }
 
+
 /** An applet to put a 3D model into a page */
+@SuppressWarnings("serial")
 public class ThreeD extends Applet
-  implements Runnable, MouseListener, MouseMotionListener {
+        implements Runnable, MouseListener, MouseMotionListener {
+
     Model3D md;
     boolean painted = true;
     float xfac;
     int prevx, prevy;
-    float xtheta, ytheta;
     float scalefudge = 1;
     Matrix3D amat = new Matrix3D(), tmat = new Matrix3D();
     String mdname = null;
     String message = null;
 
+    @Override
     public void init() {
         mdname = getParameter("model");
         try {
             scalefudge = Float.valueOf(getParameter("scale")).floatValue();
-        }catch(Exception e){};
+        } catch (Exception ignored) {
+            // fall back to default scalefudge = 1
+        }
         amat.yrot(20);
         amat.xrot(20);
-        if (mdname == null)
+        if (mdname == null) {
             mdname = "model.obj";
+        }
         resize(getSize().width <= 20 ? 400 : getSize().width,
-               getSize().height <= 20 ? 400 : getSize().height);
+                getSize().height <= 20 ? 400 : getSize().height);
         addMouseListener(this);
         addMouseMotionListener(this);
     }
 
+    @Override
     public void destroy() {
         removeMouseListener(this);
         removeMouseMotionListener(this);
     }
 
+    @Override
     public void run() {
         InputStream is = null;
         try {
             Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
             is = new URL(getDocumentBase(), mdname).openStream();
-            Model3D m = new Model3D (is);
+            Model3D m = new Model3D(is);
             md = m;
             m.findBB();
             m.compress();
             float xw = m.xmax - m.xmin;
             float yw = m.ymax - m.ymin;
             float zw = m.zmax - m.zmin;
-            if (yw > xw)
+            if (yw > xw) {
                 xw = yw;
-            if (zw > xw)
+            }
+            if (zw > xw) {
                 xw = zw;
+            }
             float f1 = getSize().width / xw;
             float f2 = getSize().height / xw;
             xfac = 0.7f * (f1 < f2 ? f1 : f2) * scalefudge;
-        } catch(Exception e) {
+        } catch (Exception e) {
             md = null;
             message = e.toString();
         }
         try {
-            if (is != null)
+            if (is != null) {
                 is.close();
-        } catch(Exception e) {
+            }
+        } catch (Exception e) {
         }
         repaint();
     }
 
+    @Override
     public void start() {
-        if (md == null && message == null)
+        if (md == null && message == null) {
             new Thread(this).start();
+        }
     }
 
+    @Override
     public void stop() {
     }
 
-    public  void mouseClicked(MouseEvent e) {
+    @Override
+    public void mouseClicked(MouseEvent e) {
     }
 
-    public  void mousePressed(MouseEvent e) {
+    @Override
+    public void mousePressed(MouseEvent e) {
         prevx = e.getX();
         prevy = e.getY();
         e.consume();
     }
 
-    public  void mouseReleased(MouseEvent e) {
+    @Override
+    public void mouseReleased(MouseEvent e) {
     }
 
-    public  void mouseEntered(MouseEvent e) {
+    @Override
+    public void mouseEntered(MouseEvent e) {
     }
 
-    public  void mouseExited(MouseEvent e) {
+    @Override
+    public void mouseExited(MouseEvent e) {
     }
 
-    public  void mouseDragged(MouseEvent e) {
+    @Override
+    public void mouseDragged(MouseEvent e) {
         int x = e.getX();
         int y = e.getY();
 
@@ -444,15 +491,17 @@
         e.consume();
     }
 
-    public  void mouseMoved(MouseEvent e) {
+    @Override
+    public void mouseMoved(MouseEvent e) {
     }
 
+    @Override
     public void paint(Graphics g) {
         if (md != null) {
             md.mat.unit();
             md.mat.translate(-(md.xmin + md.xmax) / 2,
-                             -(md.ymin + md.ymax) / 2,
-                             -(md.zmin + md.zmax) / 2);
+                    -(md.ymin + md.ymax) / 2,
+                    -(md.zmin + md.zmax) / 2);
             md.mat.mult(amat);
             md.mat.scale(xfac, -xfac, 16 * xfac / getSize().width);
             md.mat.translate(getSize().width / 2, getSize().height / 2, 8);
@@ -469,20 +518,18 @@
         painted = true;
         notifyAll();
     }
-//    private synchronized void waitPainted() {
-//      while (!painted)
-//          wait();
-//      painted = false;
-//    }
 
+    @Override
     public String getAppletInfo() {
-        return "Title: ThreeD \nAuthor: James Gosling? \nAn applet to put a 3D model into a page.";
+        return "Title: ThreeD \nAuthor: James Gosling? \n"
+                + "An applet to put a 3D model into a page.";
     }
 
+    @Override
     public String[][] getParameterInfo() {
         String[][] info = {
-            {"model", "path string", "The path to the model to be displayed."},
-            {"scale", "float", "The scale of the model.  Default is 1."}
+            { "model", "path string", "The path to the model to be displayed." },
+            { "scale", "float", "The scale of the model.  Default is 1." }
         };
         return info;
     }
--- a/src/share/demo/applets/WireFrame/example1.html	Mon Apr 04 17:18:35 2011 -0700
+++ b/src/share/demo/applets/WireFrame/example1.html	Mon Apr 04 17:20:24 2011 -0700
@@ -6,7 +6,7 @@
     <h1>3D Model: Cube</h1>
       <hr>
       <applet code=ThreeD.class width=100 height=100>
-	<param name=model value=models/cube.obj>
+	<param name=model value="models/cube.obj">
 	  alt="Your browser understands the &lt;APPLET&gt; tag but isn't running the applet, for some reason."
 	  Your browser is completely ignoring the &lt;APPLET&gt; tag!
       </applet>
--- a/src/share/demo/applets/WireFrame/example2.html	Mon Apr 04 17:18:35 2011 -0700
+++ b/src/share/demo/applets/WireFrame/example2.html	Mon Apr 04 17:20:24 2011 -0700
@@ -6,7 +6,7 @@
       <h1>3D Model: Dinosaur</h1>
       <hr>
       <applet code=ThreeD.class width=300 height=300>
-	<param name=model value=models/dinasaur.obj>
+	<param name=model value="models/dinasaur.obj">
 	  alt="Your browser understands the &lt;APPLET&gt; tag but isn't running the applet, for some reason."
 	  Your browser is completely ignoring the &lt;APPLET&gt; tag!
       </applet>
--- a/src/share/demo/applets/WireFrame/example3.html	Mon Apr 04 17:18:35 2011 -0700
+++ b/src/share/demo/applets/WireFrame/example3.html	Mon Apr 04 17:20:24 2011 -0700
@@ -6,7 +6,7 @@
       <h1>3D Model: Hughes</h1>
       <hr>
       <applet code=ThreeD.class width=300 height=300>
-	<param name=model value=models/hughes_500.obj>
+	<param name=model value="models/hughes_500.obj">
 	  alt="Your browser understands the &lt;APPLET&gt; tag but isn't running the applet, for some reason."
 	  Your browser is completely ignoring the &lt;APPLET&gt; tag!
       </applet>
--- a/src/share/demo/applets/WireFrame/example4.html	Mon Apr 04 17:18:35 2011 -0700
+++ b/src/share/demo/applets/WireFrame/example4.html	Mon Apr 04 17:20:24 2011 -0700
@@ -6,7 +6,7 @@
       <h1>3D Model: knoxS</h1>
       <hr>
       <applet code=ThreeD.class width=300 height=300>
-	<param name=model value=models/knoxS.obj>      
+	<param name=model value="models/knoxS.obj">
 	  alt="Your browser understands the &lt;APPLET&gt; tag but isn't running the applet, for some reason."
 	  Your browser is completely ignoring the &lt;APPLET&gt; tag!
       </applet>
--- a/src/share/demo/jfc/CodePointIM/CodePointIM.java	Mon Apr 04 17:18:35 2011 -0700
+++ b/src/share/demo/jfc/CodePointIM/CodePointIM.java	Mon Apr 04 17:20:24 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,12 +29,12 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/*
- */
+
 import java.util.Locale;
 import java.util.MissingResourceException;
 import java.util.ResourceBundle;
 
+
 public class CodePointIM {
 
     // Actually, the main method is not required for InputMethod.
@@ -42,11 +42,11 @@
     // not correct and encourage their reading README.txt.
     public static void main(String[] args) {
         try {
-            ResourceBundle resource = ResourceBundle.getBundle("resources.codepoint",
-                                                          Locale.getDefault());
+            ResourceBundle resource = ResourceBundle.getBundle(
+                    "resources.codepoint",
+                    Locale.getDefault());
             System.err.println(resource.getString("warning"));
-        }
-        catch (MissingResourceException e) {
+        } catch (MissingResourceException e) {
             System.err.println(e.toString());
         }
 
--- a/src/share/demo/jfc/CodePointIM/CodePointInputMethod.java	Mon Apr 04 17:18:35 2011 -0700
+++ b/src/share/demo/jfc/CodePointIM/CodePointInputMethod.java	Mon Apr 04 17:20:24 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -28,13 +28,8 @@
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+package com.sun.inputmethods.internal.codepointim;
 
-/*
- */
-
-package com.sun.inputmethods.internal.codepointim;
-import java.text.AttributedCharacterIterator;
-import java.util.Map;
 
 import java.awt.AWTEvent;
 import java.awt.Toolkit;
@@ -50,6 +45,7 @@
 import java.text.AttributedString;
 import java.util.Locale;
 
+
 /**
  * The Code Point Input Method is a simple input method that allows Unicode
  * characters to be entered using their code point or code unit values. See the
@@ -59,18 +55,16 @@
  */
 public class CodePointInputMethod implements InputMethod {
 
-    private static final int UNSET           = 0;
-    private static final int ESCAPE          = 1; // \u0000       - \uFFFF
-    private static final int SPECIAL_ESCAPE  = 2; // \U000000     - \U10FFFF
-    private static final int SURROGATE_PAIR  = 3; // \uD800\uDC00 - \uDBFF\uDFFF
-
+    private static final int UNSET = 0;
+    private static final int ESCAPE = 1; // \u0000       - \uFFFF
+    private static final int SPECIAL_ESCAPE = 2; // \U000000     - \U10FFFF
+    private static final int SURROGATE_PAIR = 3; // \uD800\uDC00 - \uDBFF\uDFFF
     private InputMethodContext context;
     private Locale locale;
     private StringBuffer buffer;
     private int insertionPoint;
     private int format = UNSET;
 
-
     public CodePointInputMethod() throws IOException {
     }
 
@@ -90,7 +84,7 @@
 
         if (eventID == KeyEvent.KEY_PRESSED) {
             // If we are not in composition mode, pass through
-            if (notInCompositionMode)  {
+            if (notInCompositionMode) {
                 return;
             }
 
@@ -106,7 +100,7 @@
             char c = e.getKeyChar();
 
             // If we are not in composition mode, wait a back slash
-            if (notInCompositionMode)  {
+            if (notInCompositionMode) {
                 // If the type character is not a back slash, pass through
                 if (c != '\\') {
                     return;
@@ -115,30 +109,30 @@
                 startComposition();     // Enter to composition mode
             } else {
                 switch (c) {
-                case ' ':       // Exit from composition mode
-                    finishComposition();
-                    break;
-                case '\u007f':  // Delete
-                    deleteCharacter();
-                    break;
-                case '\b':      // BackSpace
-                    deletePreviousCharacter();
-                    break;
-                case '\u001b':  // Escape
-                    cancelComposition();
-                    break;
-                case '\n':      // Return
-                case '\t':      // Tab
-                    sendCommittedText();
-                    break;
-                default:
-                    composeUnicodeEscape(c);
-                    break;
+                    case ' ':       // Exit from composition mode
+                        finishComposition();
+                        break;
+                    case '\u007f':  // Delete
+                        deleteCharacter();
+                        break;
+                    case '\b':      // BackSpace
+                        deletePreviousCharacter();
+                        break;
+                    case '\u001b':  // Escape
+                        cancelComposition();
+                        break;
+                    case '\n':      // Return
+                    case '\t':      // Tab
+                        sendCommittedText();
+                        break;
+                    default:
+                        composeUnicodeEscape(c);
+                        break;
                 }
             }
         } else {  // KeyEvent.KEY_RELEASED
             // If we are not in composition mode, pass through
-            if (notInCompositionMode)  {
+            if (notInCompositionMode) {
                 return;
             }
         }
@@ -148,7 +142,7 @@
 
     private void composeUnicodeEscape(char c) {
         switch (buffer.length()) {
-            case  1:  // \\
+            case 1:  // \\
                 waitEscapeCharacter(c);
                 break;
             case 2:  // \\u or \\U
@@ -221,7 +215,7 @@
     private void waitDigit2(char c) {
         if (Character.digit(c, 16) != -1) {
             buffer.insert(insertionPoint++, c);
-            char codePoint = (char)getCodePoint(buffer, 2, 5);
+            char codePoint = (char) getCodePoint(buffer, 2, 5);
             if (Character.isHighSurrogate(codePoint)) {
                 format = SURROGATE_PAIR;
                 buffer.append("\\u");
@@ -261,11 +255,11 @@
     private void sendComposedText() {
         AttributedString as = new AttributedString(buffer.toString());
         as.addAttribute(TextAttribute.INPUT_METHOD_HIGHLIGHT,
-                        InputMethodHighlight.SELECTED_RAW_TEXT_HIGHLIGHT);
+                InputMethodHighlight.SELECTED_RAW_TEXT_HIGHLIGHT);
         context.dispatchInputMethodEvent(
-                                  InputMethodEvent.INPUT_METHOD_TEXT_CHANGED,
-                                  as.getIterator(), 0,
-                                  TextHitInfo.leading(insertionPoint), null);
+                InputMethodEvent.INPUT_METHOD_TEXT_CHANGED,
+                as.getIterator(), 0,
+                TextHitInfo.leading(insertionPoint), null);
     }
 
     /**
@@ -274,9 +268,9 @@
     private void sendCommittedText() {
         AttributedString as = new AttributedString(buffer.toString());
         context.dispatchInputMethodEvent(
-                                  InputMethodEvent.INPUT_METHOD_TEXT_CHANGED,
-                                  as.getIterator(), buffer.length(),
-                                  TextHitInfo.leading(insertionPoint), null);
+                InputMethodEvent.INPUT_METHOD_TEXT_CHANGED,
+                as.getIterator(), buffer.length(),
+                TextHitInfo.leading(insertionPoint), null);
 
         buffer.setLength(0);
         insertionPoint = 0;
@@ -298,9 +292,9 @@
         }
 
         context.dispatchInputMethodEvent(
-                                  InputMethodEvent.CARET_POSITION_CHANGED,
-                                  null, 0,
-                                  TextHitInfo.leading(insertionPoint), null);
+                InputMethodEvent.CARET_POSITION_CHANGED,
+                null, 0,
+                TextHitInfo.leading(insertionPoint), null);
     }
 
     /**
@@ -314,9 +308,9 @@
         }
 
         context.dispatchInputMethodEvent(
-                                  InputMethodEvent.CARET_POSITION_CHANGED,
-                                  null, 0,
-                                  TextHitInfo.leading(insertionPoint), null);
+                InputMethodEvent.CARET_POSITION_CHANGED,
+                null, 0,
+                TextHitInfo.leading(insertionPoint), null);
     }
 
     /**
@@ -383,7 +377,7 @@
     private void finishComposition() {
         int len = buffer.length();
         if (len == 6 && format != SPECIAL_ESCAPE) {
-            char codePoint = (char)getCodePoint(buffer, 2, 5);
+            char codePoint = (char) getCodePoint(buffer, 2, 5);
             if (Character.isValidCodePoint(codePoint) && codePoint != 0xFFFF) {
                 buffer.setLength(0);
                 buffer.append(codePoint);
@@ -400,11 +394,11 @@
             }
         } else if (len == 12 && format == SURROGATE_PAIR) {
             char[] codePoint = {
-                (char)getCodePoint(buffer, 2, 5),
-                (char)getCodePoint(buffer, 8, 11)
+                (char) getCodePoint(buffer, 2, 5),
+                (char) getCodePoint(buffer, 8, 11)
             };
-            if (Character.isHighSurrogate(codePoint[0]) &&
-                Character.isLowSurrogate(codePoint[1])) {
+            if (Character.isHighSurrogate(codePoint[0]) && Character.
+                    isLowSurrogate(codePoint[1])) {
                 buffer.setLength(0);
                 buffer.append(codePoint);
                 sendCommittedText();
@@ -418,7 +412,7 @@
     private int getCodePoint(StringBuffer sb, int from, int to) {
         int value = 0;
         for (int i = from; i <= to; i++) {
-            value = (value<<4) + Character.digit(sb.charAt(i), 16);
+            value = (value << 4) + Character.digit(sb.charAt(i), 16);
         }
         return value;
     }
@@ -427,7 +421,6 @@
         Toolkit.getDefaultToolkit().beep();
     }
 
-
     public void activate() {
         if (buffer == null) {
             buffer = new StringBuffer(12);
--- a/src/share/demo/jfc/CodePointIM/CodePointInputMethodDescriptor.java	Mon Apr 04 17:18:35 2011 -0700
+++ b/src/share/demo/jfc/CodePointIM/CodePointInputMethodDescriptor.java	Mon Apr 04 17:20:24 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -28,17 +28,15 @@
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+package com.sun.inputmethods.internal.codepointim;
 
-/*
- */
-
-package com.sun.inputmethods.internal.codepointim;
 
 import java.awt.Image;
 import java.awt.im.spi.InputMethodDescriptor;
 import java.awt.im.spi.InputMethod;
 import java.util.Locale;
 
+
 /**
  * The CodePointInputMethod is a simple input method that allows Unicode
  * characters to be entered via their hexadecimal code point values.
@@ -68,12 +66,12 @@
      */
     public Locale[] getAvailableLocales() {
         Locale[] locales = {
-            new Locale("","",""),
-        };
+            new Locale("", "", ""), };
         return locales;
     }
 
-    public synchronized String getInputMethodDisplayName(Locale inputLocale, Locale displayLanguage) {
+    public synchronized String getInputMethodDisplayName(Locale inputLocale,
+            Locale displayLanguage) {
         return "CodePoint Input Method";
     }
 
--- a/src/share/demo/jfc/FileChooserDemo/ExampleFileSystemView.java	Mon Apr 04 17:18:35 2011 -0700
+++ b/src/share/demo/jfc/FileChooserDemo/ExampleFileSystemView.java	Mon Apr 04 17:20:24 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,13 +29,12 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/*
- */
 
 import java.io.File;
 import java.io.IOException;
 import javax.swing.filechooser.FileSystemView;
 
+
 /**
  * This is a simple example that uses the FileSystemView class.
  * You can provide a superclass of the FileSystemView class with your own functionality.
@@ -43,6 +42,7 @@
  * @author Pavel Porvatov
  */
 public class ExampleFileSystemView extends FileSystemView {
+
     /**
      * Creates a new folder with the default name "New folder". This method is invoked
      * when the user presses the "New folder" button.
@@ -65,8 +65,9 @@
      * Returns a list which appears in a drop-down list of the FileChooser component.
      * In this implementation only the home directory is returned.
      */
+    @Override
     public File[] getRoots() {
-        return new File[]{getHomeDirectory()};
+        return new File[] { getHomeDirectory() };
     }
 
     /**
@@ -74,9 +75,11 @@
      * A string with all upper case letters is returned for a directory.
      * A string with all lower case letters is returned for a file.
      */
+    @Override
     public String getSystemDisplayName(File f) {
         String displayName = super.getSystemDisplayName(f);
 
-        return f.isDirectory() ? displayName.toUpperCase() : displayName.toLowerCase();
+        return f.isDirectory() ? displayName.toUpperCase() : displayName.
+                toLowerCase();
     }
 }
--- a/src/share/demo/jfc/FileChooserDemo/ExampleFileView.java	Mon Apr 04 17:18:35 2011 -0700
+++ b/src/share/demo/jfc/FileChooserDemo/ExampleFileView.java	Mon Apr 04 17:20:24 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,14 +29,13 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/*
- */
 
 import javax.swing.*;
 import javax.swing.filechooser.*;
+import java.io.File;
+import java.util.HashMap;
+import java.util.Map;
 
-import java.io.File;
-import java.util.Hashtable;
 
 /**
  * A convenience implementation of the FileView interface that
@@ -61,15 +60,19 @@
  * @author Jeff Dinkins
  */
 public class ExampleFileView extends FileView {
-    private final Hashtable<String, Icon> icons = new Hashtable<String, Icon>();
-    private final Hashtable<File, String> fileDescriptions = new Hashtable<File, String>();
-    private final Hashtable<String, String> typeDescriptions = new Hashtable<String, String>();
+
+    private final Map<String, Icon> icons = new HashMap<String, Icon>();
+    private final Map<File, String> fileDescriptions =
+            new HashMap<File, String>();
+    private final Map<String, String> typeDescriptions =
+            new HashMap<String, String>();
 
     /**
      * The name of the file.  Do nothing special here. Let
      * the system file view handle this.
      * @see FileView#getName
      */
+    @Override
     public String getName(File f) {
         return null;
     }
@@ -86,6 +89,7 @@
      *
      * @see FileView#getDescription
      */
+    @Override
     public String getDescription(File f) {
         return fileDescriptions.get(f);
     }
@@ -112,6 +116,7 @@
      *
      * @see FileView#getTypeDescription
      */
+    @Override
     public String getTypeDescription(File f) {
         return typeDescriptions.get(getExtension(f));
     }
@@ -122,12 +127,12 @@
      */
     private String getExtension(File f) {
         String name = f.getName();
-        if(name != null) {
+        if (name != null) {
             int extensionIndex = name.lastIndexOf('.');
-            if(extensionIndex < 0) {
+            if (extensionIndex < 0) {
                 return null;
             }
-            return name.substring(extensionIndex+1).toLowerCase();
+            return name.substring(extensionIndex + 1).toLowerCase();
         }
         return null;
     }
@@ -147,10 +152,11 @@
      *
      * @see FileView#getIcon
      */
+    @Override
     public Icon getIcon(File f) {
         Icon icon = null;
         String extension = getExtension(f);
-        if(extension != null) {
+        if (extension != null) {
             icon = icons.get(extension);
         }
         return icon;
@@ -168,11 +174,11 @@
      *
      * @see FileView#isTraversable
      */
+    @Override
     public Boolean isTraversable(File f) {
         // if (some_reason) {
         //    return Boolean.FALSE;
         // }
         return null;    // Use default from FileSystemView
     }
-
 }
--- a/src/share/demo/jfc/FileChooserDemo/FileChooserDemo.java	Mon Apr 04 17:18:35 2011 -0700
+++ b/src/share/demo/jfc/FileChooserDemo/FileChooserDemo.java	Mon Apr 04 17:20:24 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,21 +29,56 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/*
- */
 
-import javax.swing.*;
-import javax.swing.filechooser.*;
+import java.lang.reflect.InvocationTargetException;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import javax.swing.UIManager.LookAndFeelInfo;
+import java.awt.BorderLayout;
+import java.awt.CardLayout;
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.Image;
+import java.awt.Insets;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.List;
+import javax.swing.BorderFactory;
+import javax.swing.Box;
+import javax.swing.BoxLayout;
+import javax.swing.ButtonGroup;
+import javax.swing.DefaultComboBoxModel;
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JComboBox;
+import javax.swing.JComponent;
+import javax.swing.JDialog;
+import javax.swing.JFileChooser;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+import javax.swing.JTextField;
+import javax.swing.JToggleButton;
+import javax.swing.LookAndFeel;
+import javax.swing.SwingUtilities;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+import javax.swing.WindowConstants;
+import javax.swing.filechooser.FileFilter;
+import javax.swing.filechooser.FileNameExtensionFilter;
+import javax.swing.filechooser.FileSystemView;
+import java.util.ArrayList;
 import javax.swing.plaf.FileChooserUI;
 import javax.swing.plaf.basic.BasicFileChooserUI;
+import java.io.File;
+import static javax.swing.JFileChooser.*;
 
-import java.awt.*;
-import java.io.File;
-import java.awt.event.*;
-import java.beans.*;
-import java.util.Vector;
-
-import static javax.swing.JFileChooser.*;
 
 /**
  *
@@ -51,12 +86,18 @@
  *
  * @author Jeff Dinkins
  */
+@SuppressWarnings("serial")
 public class FileChooserDemo extends JPanel implements ActionListener {
+
+    public static final String NIMBUS_LAF_NAME = "Nimbus";
     private static JFrame frame;
+    private final List<SupportedLaF> supportedLaFs =
+            new ArrayList<SupportedLaF>();
+    private static SupportedLaF nimbusLaF;
 
-    private final Vector<SupportedLaF> supportedLaFs = new Vector();
 
     private static class SupportedLaF {
+
         private final String name;
         private final LookAndFeel laf;
 
@@ -65,18 +106,15 @@
             this.laf = laf;
         }
 
+        @Override
         public String toString() {
             return name;
         }
     }
-
-
     private JButton showButton;
-
     private JCheckBox showAllFilesFilterCheckBox;
     private JCheckBox showImageFilesFilterCheckBox;
     private JCheckBox showFullDescriptionCheckBox;
-
     private JCheckBox useFileViewCheckBox;
     private JCheckBox useFileSystemViewCheckBox;
     private JCheckBox accessoryCheckBox;
@@ -84,46 +122,44 @@
     private JCheckBox useEmbedInWizardCheckBox;
     private JCheckBox useControlsCheckBox;
     private JCheckBox enableDragCheckBox;
-
     private JRadioButton singleSelectionRadioButton;
     private JRadioButton multiSelectionRadioButton;
-
     private JRadioButton openRadioButton;
     private JRadioButton saveRadioButton;
     private JRadioButton customButton;
-
     private JComboBox lafComboBox;
-
     private JRadioButton justFilesRadioButton;
     private JRadioButton justDirectoriesRadioButton;
     private JRadioButton bothFilesAndDirectoriesRadioButton;
-
     private JTextField customField;
-
     private final ExampleFileView fileView;
-
     private final ExampleFileSystemView fileSystemView;
-
-    private final static Dimension hpad10 = new Dimension(10,1);
-    private final static Dimension vpad20 = new Dimension(1,20);
+    private final static Dimension hpad10 = new Dimension(10, 1);
+    private final static Dimension vpad20 = new Dimension(1, 20);
     private final static Dimension vpad7 = new Dimension(1, 7);
     private final static Dimension vpad4 = new Dimension(1, 4);
     private final static Insets insets = new Insets(5, 10, 0, 10);
-
     private final FilePreviewer previewer;
     private final JFileChooser chooser;
 
+    @SuppressWarnings("LeakingThisInConstructor")
     public FileChooserDemo() {
-        UIManager.LookAndFeelInfo[] installedLafs = UIManager.getInstalledLookAndFeels();
+        UIManager.LookAndFeelInfo[] installedLafs = UIManager.
+                getInstalledLookAndFeels();
         for (UIManager.LookAndFeelInfo lafInfo : installedLafs) {
             try {
-                Class lnfClass = Class.forName(lafInfo.getClassName());
-                LookAndFeel laf = (LookAndFeel)(lnfClass.newInstance());
+                Class<?> lnfClass = Class.forName(lafInfo.getClassName());
+                LookAndFeel laf = (LookAndFeel) (lnfClass.newInstance());
                 if (laf.isSupportedLookAndFeel()) {
                     String name = lafInfo.getName();
-                    supportedLaFs.add(new SupportedLaF(name, laf));
+                    SupportedLaF supportedLaF = new SupportedLaF(name, laf);
+                    supportedLaFs.add(supportedLaF);
+                    if (NIMBUS_LAF_NAME.equals(name)) {
+                        nimbusLaF = supportedLaF;
+                    }
                 }
-            } catch (Exception e) { // If ANYTHING weird happens, don't add it
+            } catch (Exception ignored) {
+                // If ANYTHING weird happens, don't add this L&F
             }
         }
 
@@ -134,8 +170,10 @@
 
         // Create Custom FileView
         fileView = new ExampleFileView();
-        fileView.putIcon("jpg", new ImageIcon(getClass().getResource("/resources/images/jpgIcon.jpg")));
-        fileView.putIcon("gif", new ImageIcon(getClass().getResource("/resources/images/gifIcon.gif")));
+        fileView.putIcon("jpg", new ImageIcon(getClass().getResource(
+                "/resources/images/jpgIcon.jpg")));
+        fileView.putIcon("gif", new ImageIcon(getClass().getResource(
+                "/resources/images/gifIcon.gif")));
 
         // Create Custom FileSystemView
         fileSystemView = new ExampleFileSystemView();
@@ -155,8 +193,11 @@
         customButton.addActionListener(optionListener);
 
         customField = new JTextField(8) {
+
+            @Override
             public Dimension getMaximumSize() {
-                return new Dimension(getPreferredSize().width, getPreferredSize().height);
+                return new Dimension(getPreferredSize().width,
+                        getPreferredSize().height);
             }
         };
         customField.setText("Doit");
@@ -220,7 +261,8 @@
         group3.add(justDirectoriesRadioButton);
         justDirectoriesRadioButton.addActionListener(optionListener);
 
-        bothFilesAndDirectoriesRadioButton = new JRadioButton("Select Files or Directories");
+        bothFilesAndDirectoriesRadioButton = new JRadioButton(
+                "Select Files or Directories");
         group3.add(bothFilesAndDirectoriesRadioButton);
         bothFilesAndDirectoriesRadioButton.addActionListener(optionListener);
 
@@ -241,7 +283,8 @@
         showButton.setMnemonic('s');
 
         // Create laf combo box
-        lafComboBox = new JComboBox(supportedLaFs);
+        lafComboBox = new JComboBox(supportedLaFs.toArray());
+        lafComboBox.setSelectedItem(nimbusLaF);
         lafComboBox.setEditable(false);
         lafComboBox.addActionListener(optionListener);
 
@@ -317,7 +360,8 @@
         // ************* File & Directory Options *****************
         // ********************************************************
         JPanel control4 = new InsetPanel(insets);
-        control4.setBorder(BorderFactory.createTitledBorder("File and Directory Options"));
+        control4.setBorder(BorderFactory.createTitledBorder(
+                "File and Directory Options"));
         control4.setLayout(new BoxLayout(control4, BoxLayout.Y_AXIS));
         control4.add(Box.createRigidArea(vpad20));
         control4.add(justFilesRadioButton);
@@ -379,7 +423,7 @@
         // clear the preview from the previous display of the chooser
         JComponent accessory = chooser.getAccessory();
         if (accessory != null) {
-            ((FilePreviewer)accessory).loadImage(null);
+            ((FilePreviewer) accessory).loadImage(null);
         }
 
         if (useEmbedInWizardCheckBox.isSelected()) {
@@ -393,25 +437,28 @@
         if (retval == APPROVE_OPTION) {
             JOptionPane.showMessageDialog(frame, getResultString());
         } else if (retval == CANCEL_OPTION) {
-            JOptionPane.showMessageDialog(frame, "User cancelled operation. No file was chosen.");
+            JOptionPane.showMessageDialog(frame,
+                    "User cancelled operation. No file was chosen.");
         } else if (retval == ERROR_OPTION) {
-            JOptionPane.showMessageDialog(frame, "An error occured. No file was chosen.");
+            JOptionPane.showMessageDialog(frame,
+                    "An error occured. No file was chosen.");
         } else {
             JOptionPane.showMessageDialog(frame, "Unknown operation occured.");
         }
     }
 
     private void resetFileFilters(boolean enableFilters,
-                                  boolean showExtensionInDescription) {
+            boolean showExtensionInDescription) {
         chooser.resetChoosableFileFilters();
         if (enableFilters) {
-            FileFilter jpgFilter = createFileFilter("JPEG Compressed Image Files",
-                                         showExtensionInDescription, "jpg");
+            FileFilter jpgFilter = createFileFilter(
+                    "JPEG Compressed Image Files",
+                    showExtensionInDescription, "jpg");
             FileFilter gifFilter = createFileFilter("GIF Image Files",
-                                         showExtensionInDescription, "gif");
+                    showExtensionInDescription, "gif");
             FileFilter bothFilter = createFileFilter("JPEG and GIF Image Files",
-                                          showExtensionInDescription, "jpg",
-                                          "gif");
+                    showExtensionInDescription, "jpg",
+                    "gif");
             chooser.addChoosableFileFilter(bothFilter);
             chooser.addChoosableFileFilter(jpgFilter);
             chooser.addChoosableFileFilter(gifFilter);
@@ -419,7 +466,7 @@
     }
 
     private FileFilter createFileFilter(String description,
-            boolean showExtensionInDescription, String...extensions) {
+            boolean showExtensionInDescription, String... extensions) {
         if (showExtensionInDescription) {
             description = createFileNameFilterDescriptionFromExtensions(
                     description, extensions);
@@ -429,8 +476,8 @@
 
     private String createFileNameFilterDescriptionFromExtensions(
             String description, String[] extensions) {
-        String fullDescription = (description == null) ?
-                "(" : description + " (";
+        String fullDescription = (description == null) ? "(" : description
+                + " (";
         // build the description from the extension list
         fullDescription += "." + extensions[0];
         for (int i = 1; i < extensions.length; i++) {
@@ -441,12 +488,15 @@
         return fullDescription;
     }
 
+
     private class WizardDialog extends JDialog implements ActionListener {
+
         CardLayout cardLayout;
         JPanel cardPanel;
         JLabel messageLabel;
         JButton backButton, nextButton, closeButton;
 
+        @SuppressWarnings("LeakingThisInConstructor")
         WizardDialog(JFrame frame, boolean modal) {
             super(frame, "Embedded JFileChooser Demo", modal);
 
@@ -494,15 +544,16 @@
                     // Workaround for bug 4528663. This is necessary to
                     // pick up the contents of the file chooser text field.
                     // This will trigger an APPROVE_SELECTION action.
-                    ((BasicFileChooserUI)ui).getApproveSelectionAction().actionPerformed(null);
+                    ((BasicFileChooserUI) ui).getApproveSelectionAction().
+                            actionPerformed(null);
                 } else {
                     next();
                 }
             } else if (src == closeButton) {
                 close();
-            } else if (cmd == APPROVE_SELECTION) {
+            } else if (APPROVE_SELECTION.equals(cmd)) {
                 next();
-            } else if (cmd == CANCEL_SELECTION) {
+            } else if (CANCEL_SELECTION.equals(cmd)) {
                 close();
             }
         }
@@ -528,6 +579,7 @@
             setVisible(false);
         }
 
+        @Override
         public void dispose() {
             chooser.removeActionListener(this);
 
@@ -542,13 +594,18 @@
 
     private String getResultString() {
         String resultString;
-        String filter = chooser.getFileFilter().getDescription();
+        String filter;
+        if (chooser.getFileFilter() == null) {
+            filter = "";
+        } else {
+            filter = chooser.getFileFilter().getDescription();
+        }
         String path = null;
         boolean isDirMode = (chooser.getFileSelectionMode() == DIRECTORIES_ONLY);
         boolean isMulti = chooser.isMultiSelectionEnabled();
 
         if (isMulti) {
-            File [] files = chooser.getSelectedFiles();
+            File[] files = chooser.getSelectedFiles();
             if (files != null && files.length > 0) {
                 path = "";
                 for (File file : files) {
@@ -565,11 +622,10 @@
             path = path.replace(" ", "&nbsp;");
             filter = filter.replace(" ", "&nbsp;");
             resultString =
-                "<html>You chose " + (isMulti ? "these" : "this") + " " +
-                (isDirMode ? (isMulti ? "directories" : "directory")
-                           : (isMulti ? "files" : "file")) +
-                ": <code>" + path +
-                "</code><br><br>with filter: <br><code>" + filter;
+                    "<html>You chose " + (isMulti ? "these" : "this") + " " + (isDirMode ? (isMulti
+                    ? "directories" : "directory")
+                    : (isMulti ? "files" : "file")) + ": <code>" + path
+                    + "</code><br><br>with filter: <br><code>" + filter;
         } else {
             resultString = "Nothing was chosen";
         }
@@ -577,15 +633,14 @@
     }
 
 
-
-
     /** An ActionListener that listens to the radio buttons. */
     private class OptionListener implements ActionListener {
+
         public void actionPerformed(ActionEvent e) {
             JComponent c = (JComponent) e.getSource();
             boolean selected = false;
             if (c instanceof JToggleButton) {
-                selected = ((JToggleButton)c).isSelected();
+                selected = ((JToggleButton) c).isSelected();
             }
 
             if (c == openRadioButton) {
@@ -612,7 +667,7 @@
                 chooser.setAcceptAllFileFilterUsed(selected);
             } else if (c == showImageFilesFilterCheckBox) {
                 resetFileFilters(selected,
-                                 showFullDescriptionCheckBox.isSelected());
+                        showFullDescriptionCheckBox.isSelected());
                 showFullDescriptionCheckBox.setEnabled(selected);
             } else if (c == setHiddenCheckBox) {
                 chooser.setFileHidingEnabled(!selected);
@@ -637,7 +692,7 @@
                 }
             } else if (c == showFullDescriptionCheckBox) {
                 resetFileFilters(showImageFilesFilterCheckBox.isSelected(),
-                                 selected);
+                        selected);
             } else if (c == justFilesRadioButton) {
                 chooser.setFileSelectionMode(FILES_ONLY);
             } else if (c == justDirectoriesRadioButton) {
@@ -653,27 +708,33 @@
                     chooser.setMultiSelectionEnabled(true);
                 }
             } else if (c == lafComboBox) {
-                SupportedLaF supportedLaF = ((SupportedLaF)lafComboBox.getSelectedItem());
+                SupportedLaF supportedLaF = ((SupportedLaF) lafComboBox.
+                        getSelectedItem());
                 LookAndFeel laf = supportedLaF.laf;
                 try {
                     UIManager.setLookAndFeel(laf);
                     SwingUtilities.updateComponentTreeUI(frame);
-                    if(chooser != null) {
+                    if (chooser != null) {
                         SwingUtilities.updateComponentTreeUI(chooser);
                     }
                     frame.pack();
                 } catch (UnsupportedLookAndFeelException exc) {
                     // This should not happen because we already checked
-                    ((DefaultComboBoxModel)lafComboBox.getModel()).removeElement(supportedLaF);
+                    ((DefaultComboBoxModel) lafComboBox.getModel()).
+                            removeElement(supportedLaF);
                 }
             }
 
         }
     }
 
-    private class FilePreviewer extends JComponent implements PropertyChangeListener {
+
+    private class FilePreviewer extends JComponent implements
+            PropertyChangeListener {
+
         ImageIcon thumbnail = null;
 
+        @SuppressWarnings("LeakingThisInConstructor")
         public FilePreviewer(JFileChooser fc) {
             setPreferredSize(new Dimension(100, 50));
             fc.addPropertyChangeListener(this);
@@ -684,9 +745,10 @@
                 thumbnail = null;
             } else {
                 ImageIcon tmpIcon = new ImageIcon(f.getPath());
-                if(tmpIcon.getIconWidth() > 90) {
+                if (tmpIcon.getIconWidth() > 90) {
                     thumbnail = new ImageIcon(
-                        tmpIcon.getImage().getScaledInstance(90, -1, Image.SCALE_DEFAULT));
+                            tmpIcon.getImage().getScaledInstance(90, -1,
+                            Image.SCALE_DEFAULT));
                 } else {
                     thumbnail = tmpIcon;
                 }
@@ -695,23 +757,24 @@
 
         public void propertyChange(PropertyChangeEvent e) {
             String prop = e.getPropertyName();
-            if (prop == SELECTED_FILE_CHANGED_PROPERTY) {
-                if(isShowing()) {
+            if (SELECTED_FILE_CHANGED_PROPERTY.equals(prop)) {
+                if (isShowing()) {
                     loadImage((File) e.getNewValue());
                     repaint();
                 }
             }
         }
 
+        @Override
         public void paint(Graphics g) {
-            if(thumbnail != null) {
-                int x = getWidth()/2 - thumbnail.getIconWidth()/2;
-                int y = getHeight()/2 - thumbnail.getIconHeight()/2;
-                if(y < 0) {
+            if (thumbnail != null) {
+                int x = getWidth() / 2 - thumbnail.getIconWidth() / 2;
+                int y = getHeight() / 2 - thumbnail.getIconHeight() / 2;
+                if (y < 0) {
                     y = 0;
                 }
 
-                if(x < 5) {
+                if (x < 5) {
                     x = 5;
                 }
                 thumbnail.paintIcon(this, g, x, y);
@@ -720,46 +783,57 @@
     }
 
     public static void main(String s[]) {
-        /*
-           NOTE: By default, the look and feel will be set to the
-           Cross Platform Look and Feel (which is currently Metal).
-           The user may someday be able to override the default
-           via a system property. If you as the developer want to
-           be sure that a particular L&F is set, you can do so
-           by calling UIManager.setLookAndFeel(). For example, the
-           first code snippet below forcibly sets the UI to be the
-           System Look and Feel. The second code snippet forcibly
-           sets the look and feel to the Cross Platform L&F.
+        try {
+            SwingUtilities.invokeAndWait(new Runnable() {
 
-           Snippet 1:
-           try {
-              UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
-           } catch (Exception exc) {
-              System.err.println("Error loading L&F: " + exc);
-           }
+                public void run() {
+                    /*
+                     * NOTE: By default, the look and feel will be set to the
+                     * Cross Platform Look and Feel (which is currently Metal).
+                     * The following code tries to set the Look and Feel to Nimbus.
+                     * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/nimbus.html
+                     */
+                    try {
+                        for (LookAndFeelInfo info : UIManager.
+                                getInstalledLookAndFeels()) {
+                            if (NIMBUS_LAF_NAME.equals(info.getName())) {
+                                UIManager.setLookAndFeel(info.getClassName());
+                                break;
+                            }
+                        }
+                    } catch (Exception ignored) {
+                    }
 
-           Snippet 2:
-           try {
-              UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
-           } catch (Exception exc) {
-              System.err.println("Error loading L&F: " + exc);
-           }
-        */
+                    FileChooserDemo panel = new FileChooserDemo();
 
-        FileChooserDemo panel = new FileChooserDemo();
-
-        frame = new JFrame("FileChooserDemo");
-        frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
-        frame.getContentPane().add("Center", panel);
-        frame.pack();
-        frame.setVisible(true);
+                    frame = new JFrame("FileChooserDemo");
+                    frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
+                    frame.getContentPane().add("Center", panel);
+                    frame.pack();
+                    frame.setVisible(true);
+                }
+            });
+        } catch (InterruptedException ex) {
+            Logger.getLogger(FileChooserDemo.class.getName()).log(Level.SEVERE,
+                    null,
+                    ex);
+        } catch (InvocationTargetException ex) {
+            Logger.getLogger(FileChooserDemo.class.getName()).log(Level.SEVERE,
+                    null,
+                    ex);
+        }
     }
 
+
     private static class InsetPanel extends JPanel {
+
         Insets i;
+
         InsetPanel(Insets i) {
             this.i = i;
         }
+
+        @Override
         public Insets getInsets() {
             return i;
         }
--- a/src/share/demo/jfc/Metalworks/AquaMetalTheme.java	Mon Apr 04 17:18:35 2011 -0700
+++ b/src/share/demo/jfc/Metalworks/AquaMetalTheme.java	Mon Apr 04 17:20:24 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,31 +29,39 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/*
- */
 
+import javax.swing.plaf.ColorUIResource;
+import javax.swing.plaf.metal.DefaultMetalTheme;
 
-import javax.swing.plaf.*;
-import javax.swing.plaf.metal.*;
-import javax.swing.*;
-import javax.swing.border.*;
-import java.awt.*;
 
 /**
  * This class describes a theme using "blue-green" colors.
  *
  * @author Steve Wilson
+ * @author Alexander Kouznetsov
  */
 public class AquaMetalTheme extends DefaultMetalTheme {
 
-    public String getName() { return "Oxide"; }
-
+    @Override
+    public String getName() {
+        return "Oxide";
+    }
     private final ColorUIResource primary1 = new ColorUIResource(102, 153, 153);
     private final ColorUIResource primary2 = new ColorUIResource(128, 192, 192);
     private final ColorUIResource primary3 = new ColorUIResource(159, 235, 235);
 
-    protected ColorUIResource getPrimary1() { return primary1; }
-    protected ColorUIResource getPrimary2() { return primary2; }
-    protected ColorUIResource getPrimary3() { return primary3; }
+    @Override
+    protected ColorUIResource getPrimary1() {
+        return primary1;
+    }
 
+    @Override
+    protected ColorUIResource getPrimary2() {
+        return primary2;
+    }
+
+    @Override
+    protected ColorUIResource getPrimary3() {
+        return primary3;
+    }
 }
--- a/src/share/demo/jfc/Metalworks/BigContrastMetalTheme.java	Mon Apr 04 17:18:35 2011 -0700
+++ b/src/share/demo/jfc/Metalworks/BigContrastMetalTheme.java	Mon Apr 04 17:20:24 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,9 +29,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/*
- */
-
 
 import javax.swing.plaf.*;
 import javax.swing.plaf.metal.*;
@@ -39,54 +36,91 @@
 import javax.swing.border.*;
 import java.awt.*;
 
+
 /**
  * This class describes a theme using "green" colors.
  *
  * @author Steve Wilson
+ * @author Alexander Kouznetsov
  */
 public class BigContrastMetalTheme extends ContrastMetalTheme {
 
-    public String getName() { return "Low Vision"; }
+    @Override
+    public String getName() {
+        return "Low Vision";
+    }
+    private final FontUIResource controlFont = new FontUIResource("Dialog",
+            Font.BOLD, 24);
+    private final FontUIResource systemFont = new FontUIResource("Dialog",
+            Font.PLAIN, 24);
+    private final FontUIResource windowTitleFont = new FontUIResource("Dialog",
+            Font.BOLD, 24);
+    private final FontUIResource userFont = new FontUIResource("SansSerif",
+            Font.PLAIN, 24);
+    private final FontUIResource smallFont = new FontUIResource("Dialog",
+            Font.PLAIN, 20);
 
-    private final FontUIResource controlFont = new FontUIResource("Dialog", Font.BOLD, 24);
-    private final FontUIResource systemFont = new FontUIResource("Dialog", Font.PLAIN, 24);
-    private final FontUIResource windowTitleFont = new FontUIResource("Dialog", Font.BOLD, 24);
-    private final FontUIResource userFont = new FontUIResource("SansSerif", Font.PLAIN, 24);
-    private final FontUIResource smallFont = new FontUIResource("Dialog", Font.PLAIN, 20);
+    @Override
+    public FontUIResource getControlTextFont() {
+        return controlFont;
+    }
 
+    @Override
+    public FontUIResource getSystemTextFont() {
+        return systemFont;
+    }
 
-    public FontUIResource getControlTextFont() { return controlFont;}
-    public FontUIResource getSystemTextFont() { return systemFont;}
-    public FontUIResource getUserTextFont() { return userFont;}
-    public FontUIResource getMenuTextFont() { return controlFont;}
-    public FontUIResource getWindowTitleFont() { return windowTitleFont;}
-    public FontUIResource getSubTextFont() { return smallFont;}
+    @Override
+    public FontUIResource getUserTextFont() {
+        return userFont;
+    }
 
+    @Override
+    public FontUIResource getMenuTextFont() {
+        return controlFont;
+    }
+
+    @Override
+    public FontUIResource getWindowTitleFont() {
+        return windowTitleFont;
+    }
+
+    @Override
+    public FontUIResource getSubTextFont() {
+        return smallFont;
+    }
+
+    @Override
     public void addCustomEntriesToTable(UIDefaults table) {