Miscellaneous minor patches: javadoc typos, javac warnings, etc.
Kelly Ohair
kelly.ohair at oracle.com
Tue Oct 4 14:32:12 PDT 2011
try going to http://cr.openjdk.java.net for information on webrev.
the main reason i like webrev's is that it provides so many views on the change, which translates into faster reviews from people like me. :) the webrev also includes a patch file.
if a patch is very small i usually do not mind reviewing it by email, but that's just me.
Sent from my iPhone
On Oct 4, 2011, at 14:07, Dr Andrew John Hughes <ahughes at redhat.com> wrote:
> On 18:17 Tue 04 Oct , Martin Desruisseaux wrote:
>> Hello all
>>
>> I have a set of minor patches that I would like to submit for JDK8. I'm not yet
>> familiar with the contribution process. I presume that sending patches by email
>> is not the preferred way, but I'm not sure which process I should use.
>
> Personally I think patches by email works best; you can commit inline on them,
> everything can take place within the mail client and the patches are then archived
> along with the mails.
>
> However, the Oracle developers seem to prefer their own tool for this:
>
> http://blogs.oracle.com/jcc/resource/webrev-doc.html
>
> the results of which then need to be posted on some web space somewhere.
>
>>
>> * JavadocTypos.patch contains only minor typo fixes in javadoc comments. Note
>> that the fix inside the {@code} element is because javadoc renders >
>> verbatism - no HTML entity is expected inside {@code}.
>> * JavacWarnings.patch fixes a few javac warnings, most of them related to
>> generic types.
>> * ReuseExistingMethods.patch replaces calls to Math.sqrt(x*x + y*y) by
>> Math.hypot(x, y) - with the benefit of better protection against floating
>> point overflow - and reuse existing constructors instead than passing 0
>> values in argument.
>> * AvoidStringConcatenation.patch replaces calls to "" + x by String.valueOf(x)
>> in order to avoid useless objects creation caused by string concatenation
>> (unless javac was clever enough to detect that the string concatenation was
>> useless, which I don't know).
>> * UselessInstantiation.patch avoid a useless object creation, since the
>> BufferedImage constructor explicitely accepts (stated in the javadoc) null
>> Hashtable if there is no properties.
>> * InnerClasses.patch declares some private inner classes as static, which
>> avoid a useless reference to the enclosing class. If only one patch was to
>> be applied, I would like to be that one. Some complex image formats may have
>> thousands of IIOMetadataNode, and I'm afraid that the cost of thousands of
>> useless references to the enclosing IIOMetadataFormatImpl may be significant.
>
> These all look fine to me. The only change I have an issue with is the change
> from System.arraycopy to Arrays.copyOf, as this may have been done for performance
> reasons. The rest, I guess, are just due to dated code that needs updating.
> I'm quite surprised recent reviews haven't cleaned up some of the missing generics
> in ImageIO.
>
>>
>>
>> Regards,
>>
>> Martin
>>
>
>> diff -r ac9349be6821 src/share/classes/java/awt/image/BufferedImage.java
>> --- a/src/share/classes/java/awt/image/BufferedImage.java Thu Sep 29 18:53:53 2011 -0700
>> +++ b/src/share/classes/java/awt/image/BufferedImage.java Tue Oct 04 17:30:51 2011 +0200
>> @@ -211,7 +211,7 @@
>> public static final int TYPE_BYTE_GRAY = 10;
>>
>> /**
>> - * Represents an unsigned short grayscale image, non-indexed). This
>> + * Represents an unsigned short grayscale image, non-indexed. This
>> * image has a <code>ComponentColorModel</code> with a CS_GRAY
>> * <code>ColorSpace</code>.
>> * When data with non-opaque alpha is stored
>> diff -r ac9349be6821 src/share/classes/java/lang/Class.java
>> --- a/src/share/classes/java/lang/Class.java Thu Sep 29 18:53:53 2011 -0700
>> +++ b/src/share/classes/java/lang/Class.java Tue Oct 04 17:30:51 2011 +0200
>> @@ -3008,7 +3008,7 @@
>>
>> /**
>> * Casts this {@code Class} object to represent a subclass of the class
>> - * represented by the specified class object. Checks that that the cast
>> + * represented by the specified class object. Checks that the cast
>> * is valid, and throws a {@code ClassCastException} if it is not. If
>> * this method succeeds, it always returns a reference to this class object.
>> *
>> diff -r ac9349be6821 src/share/classes/java/sql/PreparedStatement.java
>> --- a/src/share/classes/java/sql/PreparedStatement.java Thu Sep 29 18:53:53 2011 -0700
>> +++ b/src/share/classes/java/sql/PreparedStatement.java Tue Oct 04 17:30:51 2011 +0200
>> @@ -767,7 +767,7 @@
>>
>>
>> /**
>> - * Sets the designated paramter to the given <code>String</code> object.
>> + * Sets the designated parameter to the given <code>String</code> object.
>> * The driver converts this to a SQL <code>NCHAR</code> or
>> * <code>NVARCHAR</code> or <code>LONGNVARCHAR</code> value
>> * (depending on the argument's
>> diff -r ac9349be6821 src/share/classes/java/sql/Statement.java
>> --- a/src/share/classes/java/sql/Statement.java Thu Sep 29 18:53:53 2011 -0700
>> +++ b/src/share/classes/java/sql/Statement.java Tue Oct 04 17:30:51 2011 +0200
>> @@ -991,7 +991,7 @@
>> /**
>> * Requests that a <code>Statement</code> be pooled or not pooled. The value
>> * specified is a hint to the statement pool implementation indicating
>> - * whether the applicaiton wants the statement to be pooled. It is up to
>> + * whether the application wants the statement to be pooled. It is up to
>> * the statement pool manager as to whether the hint is used.
>> * <p>
>> * The poolable value of a statement is applicable to both internal
>> diff -r ac9349be6821 src/share/classes/javax/imageio/ImageIO.java
>> --- a/src/share/classes/javax/imageio/ImageIO.java Thu Sep 29 18:53:53 2011 -0700
>> +++ b/src/share/classes/javax/imageio/ImageIO.java Tue Oct 04 17:30:51 2011 +0200
>> @@ -228,7 +228,7 @@
>> * be used when creating <code>ImageInputStream</code>s and
>> * <code>ImageOutputStream</code>s.
>> *
>> - * <p> When reading from a standard <code>InputStream</code>>, it
>> + * <p> When reading from a standard <code>InputStream</code>, it
>> * may be necessary to save previously read information in a cache
>> * since the underlying stream does not allow data to be re-read.
>> * Similarly, when writing to a standard
>> diff -r ac9349be6821 src/share/classes/javax/imageio/metadata/IIOMetadataFormat.java
>> --- a/src/share/classes/javax/imageio/metadata/IIOMetadataFormat.java Thu Sep 29 18:53:53 2011 -0700
>> +++ b/src/share/classes/javax/imageio/metadata/IIOMetadataFormat.java Tue Oct 04 17:30:51 2011 +0200
>> @@ -434,8 +434,8 @@
>> /**
>> * Returns one of the constants starting with
>> * <code>DATATYPE_</code>, indicating the format and
>> - * interpretation of the value of the given attribute within th
>> - * enamed element. If <code>getAttributeValueType</code> returns
>> + * interpretation of the value of the given attribute within the
>> + * named element. If <code>getAttributeValueType</code> returns
>> * <code>VALUE_LIST</code>, then the legal value is a
>> * whitespace-spearated list of values of the returned datatype.
>> *
>> diff -r ac9349be6821 src/share/classes/javax/swing/JFileChooser.java
>> --- a/src/share/classes/javax/swing/JFileChooser.java Thu Sep 29 18:53:53 2011 -0700
>> +++ b/src/share/classes/javax/swing/JFileChooser.java Tue Oct 04 17:30:51 2011 +0200
>> @@ -1206,7 +1206,7 @@
>> * If false, the <code>AcceptAll</code> file filter is removed from
>> * the list of available file filters.
>> * If true, the <code>AcceptAll</code> file filter will become the
>> - * the actively used file filter.
>> + * actively used file filter.
>> *
>> * @beaninfo
>> * preferred: true
>> diff -r ac9349be6821 src/share/classes/javax/swing/event/ListSelectionEvent.java
>> --- a/src/share/classes/javax/swing/event/ListSelectionEvent.java Thu Sep 29 18:53:53 2011 -0700
>> +++ b/src/share/classes/javax/swing/event/ListSelectionEvent.java Tue Oct 04 17:30:51 2011 +0200
>> @@ -78,7 +78,7 @@
>>
>> /**
>> * Returns the index of the first row whose selection may have changed.
>> - * {@code getFirstIndex() <= getLastIndex()}
>> + * {@code getFirstIndex() <= getLastIndex()}
>> *
>> * @return the first row whose selection value may have changed,
>> * where zero is the first row
>> @@ -87,7 +87,7 @@
>>
>> /**
>> * Returns the index of the last row whose selection may have changed.
>> - * {@code getLastIndex() >= getFirstIndex()}
>> + * {@code getLastIndex() >= getFirstIndex()}
>> *
>> * @return the last row whose selection value may have changed,
>> * where zero is the first row
>
>> diff -r ac9349be6821 src/share/classes/javax/imageio/ImageReader.java
>> --- a/src/share/classes/javax/imageio/ImageReader.java Thu Sep 29 18:53:53 2011 -0700
>> +++ b/src/share/classes/javax/imageio/ImageReader.java Tue Oct 04 17:39:20 2011 +0200
>> @@ -291,7 +291,7 @@
>> if (input != null) {
>> boolean found = false;
>> if (originatingProvider != null) {
>> - Class[] classes = originatingProvider.getInputTypes();
>> + Class<?>[] classes = originatingProvider.getInputTypes();
>> for (int i = 0; i < classes.length; i++) {
>> if (classes[i].isInstance(input)) {
>> found = true;
>> @@ -457,7 +457,7 @@
>> if (availableLocales == null) {
>> return null;
>> } else {
>> - return (Locale[])availableLocales.clone();
>> + return availableLocales.clone();
>> }
>> }
>>
>> @@ -679,7 +679,7 @@
>> */
>> public ImageTypeSpecifier getRawImageType(int imageIndex)
>> throws IOException {
>> - return (ImageTypeSpecifier)getImageTypes(imageIndex).next();
>> + return getImageTypes(imageIndex).next();
>> }
>>
>> /**
>> @@ -794,7 +794,7 @@
>> }
>>
>> private IIOMetadata getMetadata(String formatName,
>> - Set nodeNames,
>> + Set<String> nodeNames,
>> boolean wantStream,
>> int imageIndex) throws IOException {
>> if (formatName == null) {
>> @@ -1066,10 +1066,10 @@
>>
>> BufferedImage im = read(imageIndex, param);
>>
>> - ArrayList thumbnails = null;
>> + ArrayList<BufferedImage> thumbnails = null;
>> int numThumbnails = getNumThumbnails(imageIndex);
>> if (numThumbnails > 0) {
>> - thumbnails = new ArrayList();
>> + thumbnails = new ArrayList<BufferedImage>();
>> for (int j = 0; j < numThumbnails; j++) {
>> thumbnails.add(readThumbnail(imageIndex, j));
>> }
>> @@ -1157,7 +1157,7 @@
>> readAll(Iterator<? extends ImageReadParam> params)
>> throws IOException
>> {
>> - List output = new ArrayList();
>> + List<IIOImage> output = new ArrayList<IIOImage>();
>>
>> int imageIndex = getMinIndex();
>>
>> @@ -1188,10 +1188,10 @@
>> break;
>> }
>>
>> - ArrayList thumbnails = null;
>> + ArrayList<BufferedImage> thumbnails = null;
>> int numThumbnails = getNumThumbnails(imageIndex);
>> if (numThumbnails > 0) {
>> - thumbnails = new ArrayList();
>> + thumbnails = new ArrayList<BufferedImage>();
>> for (int j = 0; j < numThumbnails; j++) {
>> thumbnails.add(readThumbnail(imageIndex, j));
>> }
>> @@ -1800,9 +1800,9 @@
>>
>> // Add an element to a list, creating a new list if the
>> // existing list is null, and return the list.
>> - static List addToList(List l, Object elt) {
>> + static <E> List<E> addToList(List<E> l, E elt) {
>> if (l == null) {
>> - l = new ArrayList();
>> + l = new ArrayList<E>();
>> }
>> l.add(elt);
>> return l;
>> @@ -1811,7 +1811,7 @@
>>
>> // Remove an element from a list, discarding the list if the
>> // resulting list is empty, and return the list or null.
>> - static List removeFromList(List l, Object elt) {
>> + static <E> List<E> removeFromList(List<E> l, E elt) {
>> if (l == null) {
>> return l;
>> }
>> @@ -2014,8 +2014,7 @@
>> }
>> int numListeners = progressListeners.size();
>> for (int i = 0; i < numListeners; i++) {
>> - IIOReadProgressListener listener =
>> - (IIOReadProgressListener)progressListeners.get(i);
>> + IIOReadProgressListener listener = progressListeners.get(i);
>> listener.sequenceStarted(this, minIndex);
>> }
>> }
>> @@ -2032,8 +2031,7 @@
>> }
>> int numListeners = progressListeners.size();
>> for (int i = 0; i < numListeners; i++) {
>> - IIOReadProgressListener listener =
>> - (IIOReadProgressListener)progressListeners.get(i);
>> + IIOReadProgressListener listener = progressListeners.get(i);
>> listener.sequenceComplete(this);
>> }
>> }
>> @@ -2052,8 +2050,7 @@
>> }
>> int numListeners = progressListeners.size();
>> for (int i = 0; i < numListeners; i++) {
>> - IIOReadProgressListener listener =
>> - (IIOReadProgressListener)progressListeners.get(i);
>> + IIOReadProgressListener listener = progressListeners.get(i);
>> listener.imageStarted(this, imageIndex);
>> }
>> }
>> @@ -2073,8 +2070,7 @@
>> }
>> int numListeners = progressListeners.size();
>> for (int i = 0; i < numListeners; i++) {
>> - IIOReadProgressListener listener =
>> - (IIOReadProgressListener)progressListeners.get(i);
>> + IIOReadProgressListener listener = progressListeners.get(i);
>> listener.imageProgress(this, percentageDone);
>> }
>> }
>> @@ -2091,8 +2087,7 @@
>> }
>> int numListeners = progressListeners.size();
>> for (int i = 0; i < numListeners; i++) {
>> - IIOReadProgressListener listener =
>> - (IIOReadProgressListener)progressListeners.get(i);
>> + IIOReadProgressListener listener = progressListeners.get(i);
>> listener.imageComplete(this);
>> }
>> }
>> @@ -2114,8 +2109,7 @@
>> }
>> int numListeners = progressListeners.size();
>> for (int i = 0; i < numListeners; i++) {
>> - IIOReadProgressListener listener =
>> - (IIOReadProgressListener)progressListeners.get(i);
>> + IIOReadProgressListener listener = progressListeners.get(i);
>> listener.thumbnailStarted(this, imageIndex, thumbnailIndex);
>> }
>> }
>> @@ -2135,8 +2129,7 @@
>> }
>> int numListeners = progressListeners.size();
>> for (int i = 0; i < numListeners; i++) {
>> - IIOReadProgressListener listener =
>> - (IIOReadProgressListener)progressListeners.get(i);
>> + IIOReadProgressListener listener = progressListeners.get(i);
>> listener.thumbnailProgress(this, percentageDone);
>> }
>> }
>> @@ -2153,8 +2146,7 @@
>> }
>> int numListeners = progressListeners.size();
>> for (int i = 0; i < numListeners; i++) {
>> - IIOReadProgressListener listener =
>> - (IIOReadProgressListener)progressListeners.get(i);
>> + IIOReadProgressListener listener = progressListeners.get(i);
>> listener.thumbnailComplete(this);
>> }
>> }
>> @@ -2171,8 +2163,7 @@
>> }
>> int numListeners = progressListeners.size();
>> for (int i = 0; i < numListeners; i++) {
>> - IIOReadProgressListener listener =
>> - (IIOReadProgressListener)progressListeners.get(i);
>> + IIOReadProgressListener listener = progressListeners.get(i);
>> listener.readAborted(this);
>> }
>> }
>> @@ -2207,8 +2198,7 @@
>> }
>> int numListeners = updateListeners.size();
>> for (int i = 0; i < numListeners; i++) {
>> - IIOReadUpdateListener listener =
>> - (IIOReadUpdateListener)updateListeners.get(i);
>> + IIOReadUpdateListener listener = updateListeners.get(i);
>> listener.passStarted(this, theImage, pass,
>> minPass,
>> maxPass,
>> @@ -2248,8 +2238,7 @@
>> }
>> int numListeners = updateListeners.size();
>> for (int i = 0; i < numListeners; i++) {
>> - IIOReadUpdateListener listener =
>> - (IIOReadUpdateListener)updateListeners.get(i);
>> + IIOReadUpdateListener listener = updateListeners.get(i);
>> listener.imageUpdate(this,
>> theImage,
>> minX, minY,
>> @@ -2273,8 +2262,7 @@
>> }
>> int numListeners = updateListeners.size();
>> for (int i = 0; i < numListeners; i++) {
>> - IIOReadUpdateListener listener =
>> - (IIOReadUpdateListener)updateListeners.get(i);
>> + IIOReadUpdateListener listener = updateListeners.get(i);
>> listener.passComplete(this, theImage);
>> }
>> }
>> @@ -2310,8 +2298,7 @@
>> }
>> int numListeners = updateListeners.size();
>> for (int i = 0; i < numListeners; i++) {
>> - IIOReadUpdateListener listener =
>> - (IIOReadUpdateListener)updateListeners.get(i);
>> + IIOReadUpdateListener listener = updateListeners.get(i);
>> listener.thumbnailPassStarted(this, theThumbnail, pass,
>> minPass,
>> maxPass,
>> @@ -2352,8 +2339,7 @@
>> }
>> int numListeners = updateListeners.size();
>> for (int i = 0; i < numListeners; i++) {
>> - IIOReadUpdateListener listener =
>> - (IIOReadUpdateListener)updateListeners.get(i);
>> + IIOReadUpdateListener listener = updateListeners.get(i);
>> listener.thumbnailUpdate(this,
>> theThumbnail,
>> minX, minY,
>> @@ -2378,8 +2364,7 @@
>> }
>> int numListeners = updateListeners.size();
>> for (int i = 0; i < numListeners; i++) {
>> - IIOReadUpdateListener listener =
>> - (IIOReadUpdateListener)updateListeners.get(i);
>> + IIOReadUpdateListener listener = updateListeners.get(i);
>> listener.thumbnailPassComplete(this, theThumbnail);
>> }
>> }
>> @@ -2404,8 +2389,7 @@
>> }
>> int numListeners = warningListeners.size();
>> for (int i = 0; i < numListeners; i++) {
>> - IIOReadWarningListener listener =
>> - (IIOReadWarningListener)warningListeners.get(i);
>> + IIOReadWarningListener listener = warningListeners.get(i);
>>
>> listener.warningOccurred(this, warning);
>> }
>> @@ -2449,9 +2433,8 @@
>> }
>> int numListeners = warningListeners.size();
>> for (int i = 0; i < numListeners; i++) {
>> - IIOReadWarningListener listener =
>> - (IIOReadWarningListener)warningListeners.get(i);
>> - Locale locale = (Locale)warningLocales.get(i);
>> + IIOReadWarningListener listener = warningListeners.get(i);
>> + Locale locale = warningLocales.get(i);
>> if (locale == null) {
>> locale = Locale.getDefault();
>> }
>> @@ -2867,8 +2850,7 @@
>> } else {
>> boolean foundIt = false;
>> while (imageTypes.hasNext()) {
>> - ImageTypeSpecifier type =
>> - (ImageTypeSpecifier)imageTypes.next();
>> + ImageTypeSpecifier type = imageTypes.next();
>> if (type.equals(imageType)) {
>> foundIt = true;
>> break;
>> diff -r ac9349be6821 src/share/classes/javax/swing/event/EventListenerList.java
>> --- a/src/share/classes/javax/swing/event/EventListenerList.java Thu Sep 29 18:53:53 2011 -0700
>> +++ b/src/share/classes/javax/swing/event/EventListenerList.java Tue Oct 04 17:39:20 2011 +0200
>> @@ -97,6 +97,8 @@
>> * @author James Gosling
>> */
>> public class EventListenerList implements Serializable {
>> + static final long serialVersionUID = -5677132037850737084L;
>> +
>> /* A null array to be shared by all empty listener lists*/
>> private final static Object[] NULL_ARRAY = new Object[0];
>> /* The list of ListenerType - Listener pairs */
>> @@ -160,10 +162,10 @@
>> return getListenerCount(lList, t);
>> }
>>
>> - private int getListenerCount(Object[] list, Class t) {
>> + private static int getListenerCount(Object[] list, Class<?> t) {
>> int count = 0;
>> for (int i = 0; i < list.length; i+=2) {
>> - if (t == (Class)list[i])
>> + if (t == (Class<?>)list[i])
>> count++;
>> }
>> return count;
>> @@ -192,8 +194,7 @@
>> } else {
>> // Otherwise copy the array and add the new listener
>> int i = listenerList.length;
>> - Object[] tmp = new Object[i+2];
>> - System.arraycopy(listenerList, 0, tmp, 0, i);
>> + Object[] tmp = Arrays.copyOf(listenerList, i+2);
>>
>> tmp[i] = t;
>> tmp[i+1] = l;
>> @@ -250,7 +251,7 @@
>>
>> // Save the non-null event listeners:
>> for (int i = 0; i < lList.length; i+=2) {
>> - Class t = (Class)lList[i];
>> + Class<?> t = (Class<?>)lList[i];
>> EventListener l = (EventListener)lList[i+1];
>> if ((l!=null) && (l instanceof Serializable)) {
>> s.writeObject(t.getName());
>> @@ -282,7 +283,7 @@
>> String s = "EventListenerList: ";
>> s += lList.length/2 + " listeners: ";
>> for (int i = 0 ; i <= lList.length-2 ; i+=2) {
>> - s += " type " + ((Class)lList[i]).getName();
>> + s += " type " + ((Class<?>)lList[i]).getName();
>> s += " listener " + lList[i+1];
>> }
>> return s;
>
>> diff -r ac9349be6821 src/share/classes/java/awt/geom/Point2D.java
>> --- a/src/share/classes/java/awt/geom/Point2D.java Thu Sep 29 18:53:53 2011 -0700
>> +++ b/src/share/classes/java/awt/geom/Point2D.java Tue Oct 04 17:36:47 2011 +0200
>> @@ -361,7 +361,7 @@
>> public double distance(double px, double py) {
>> px -= getX();
>> py -= getY();
>> - return Math.sqrt(px * px + py * py);
>> + return Math.hypot(px, py);
>> }
>>
>> /**
>> @@ -377,7 +377,7 @@
>> public double distance(Point2D pt) {
>> double px = pt.getX() - this.getX();
>> double py = pt.getY() - this.getY();
>> - return Math.sqrt(px * px + py * py);
>> + return Math.hypot(px, py);
>> }
>>
>> /**
>> diff -r ac9349be6821 src/share/classes/javax/imageio/ImageReader.java
>> --- a/src/share/classes/javax/imageio/ImageReader.java Thu Sep 29 18:53:53 2011 -0700
>> +++ b/src/share/classes/javax/imageio/ImageReader.java Tue Oct 04 17:36:47 2011 +0200
>> @@ -2558,7 +2558,7 @@
>> protected static Rectangle getSourceRegion(ImageReadParam param,
>> int srcWidth,
>> int srcHeight) {
>> - Rectangle sourceRegion = new Rectangle(0, 0, srcWidth, srcHeight);
>> + Rectangle sourceRegion = new Rectangle(srcWidth, srcHeight);
>> if (param != null) {
>> Rectangle region = param.getSourceRegion();
>> if (region != null) {
>> @@ -2684,8 +2684,7 @@
>> // Now clip that to right and bottom of the destination image,
>> // if there is one, taking subsampling into account
>> if (image != null) {
>> - Rectangle destImageRect = new Rectangle(0, 0,
>> - image.getWidth(),
>> + Rectangle destImageRect = new Rectangle(image.getWidth(),
>> image.getHeight());
>> destRegion.setBounds(destRegion.intersection(destImageRect));
>> if (destRegion.isEmpty()) {
>> @@ -2881,8 +2880,8 @@
>> }
>> }
>>
>> - Rectangle srcRegion = new Rectangle(0,0,0,0);
>> - Rectangle destRegion = new Rectangle(0,0,0,0);
>> + Rectangle srcRegion = new Rectangle();
>> + Rectangle destRegion = new Rectangle();
>> computeRegions(param,
>> width,
>> height,
>
>> diff -r ac9349be6821 src/share/classes/java/lang/AssertionError.java
>> --- a/src/share/classes/java/lang/AssertionError.java Thu Sep 29 18:53:53 2011 -0700
>> +++ b/src/share/classes/java/lang/AssertionError.java Tue Oct 04 17:46:28 2011 +0200
>> @@ -71,7 +71,7 @@
>> * @see Throwable#getCause()
>> */
>> public AssertionError(Object detailMessage) {
>> - this("" + detailMessage);
>> + this(String.valueOf(detailMessage));
>> if (detailMessage instanceof Throwable)
>> initCause((Throwable) detailMessage);
>> }
>> @@ -85,7 +85,7 @@
>> * @param detailMessage value to be used in constructing detail message
>> */
>> public AssertionError(boolean detailMessage) {
>> - this("" + detailMessage);
>> + this(String.valueOf(detailMessage));
>> }
>>
>> /**
>> @@ -97,7 +97,7 @@
>> * @param detailMessage value to be used in constructing detail message
>> */
>> public AssertionError(char detailMessage) {
>> - this("" + detailMessage);
>> + this(String.valueOf(detailMessage));
>> }
>>
>> /**
>> @@ -109,7 +109,7 @@
>> * @param detailMessage value to be used in constructing detail message
>> */
>> public AssertionError(int detailMessage) {
>> - this("" + detailMessage);
>> + this(String.valueOf(detailMessage));
>> }
>>
>> /**
>> @@ -121,7 +121,7 @@
>> * @param detailMessage value to be used in constructing detail message
>> */
>> public AssertionError(long detailMessage) {
>> - this("" + detailMessage);
>> + this(String.valueOf(detailMessage));
>> }
>>
>> /**
>> @@ -133,7 +133,7 @@
>> * @param detailMessage value to be used in constructing detail message
>> */
>> public AssertionError(float detailMessage) {
>> - this("" + detailMessage);
>> + this(String.valueOf(detailMessage));
>> }
>>
>> /**
>> @@ -145,7 +145,7 @@
>> * @param detailMessage value to be used in constructing detail message
>> */
>> public AssertionError(double detailMessage) {
>> - this("" + detailMessage);
>> + this(String.valueOf(detailMessage));
>> }
>>
>> /**
>
>> diff -r ac9349be6821 src/share/classes/javax/imageio/ImageTypeSpecifier.java
>> --- a/src/share/classes/javax/imageio/ImageTypeSpecifier.java Thu Sep 29 18:53:53 2011 -0700
>> +++ b/src/share/classes/javax/imageio/ImageTypeSpecifier.java Tue Oct 04 17:41:10 2011 +0200
>> @@ -1075,7 +1075,7 @@
>> new Point(0, 0));
>> return new BufferedImage(colorModel, raster,
>> colorModel.isAlphaPremultiplied(),
>> - new Hashtable());
>> + null);
>> } catch (NegativeArraySizeException e) {
>> // Exception most likely thrown from a DataBuffer constructor
>> throw new IllegalArgumentException
>
>> diff -r ac9349be6821 src/share/classes/java/awt/CardLayout.java
>> --- a/src/share/classes/java/awt/CardLayout.java Thu Sep 29 18:53:53 2011 -0700
>> +++ b/src/share/classes/java/awt/CardLayout.java Tue Oct 04 17:43:02 2011 +0200
>> @@ -71,7 +71,7 @@
>> /*
>> * A pair of Component and String that represents its name.
>> */
>> - class Card implements Serializable {
>> + private static final class Card implements Serializable {
>> static final long serialVersionUID = 6640330810709497518L;
>> public String name;
>> public Component comp;
>> diff -r ac9349be6821 src/share/classes/javax/imageio/metadata/IIOMetadataFormatImpl.java
>> --- a/src/share/classes/javax/imageio/metadata/IIOMetadataFormatImpl.java Thu Sep 29 18:53:53 2011 -0700
>> +++ b/src/share/classes/javax/imageio/metadata/IIOMetadataFormatImpl.java Tue Oct 04 17:43:02 2011 +0200
>> @@ -92,7 +92,7 @@
>> // Element name (String) -> Element
>> private HashMap elementMap = new HashMap();
>>
>> - class Element {
>> + private static final class Element {
>> String elementName;
>>
>> int childPolicy;
>> @@ -113,7 +113,7 @@
>> ObjectValue objectValue;
>> }
>>
>> - class Attribute {
>> + private static final class Attribute {
>> String attrName;
>>
>> int valueType = VALUE_ARBITRARY;
>> @@ -133,7 +133,7 @@
>> int listMaxLength;
>> }
>>
>> - class ObjectValue {
>> + private static final class ObjectValue {
>> int valueType = VALUE_NONE;
>> Class classType = null;
>> Object defaultValue = null;
>
>
> --
> Andrew :)
>
> Free Java Software Engineer
> Red Hat, Inc. (http://www.redhat.com)
>
> Support Free Java!
> Contribute to GNU Classpath and IcedTea
> http://www.gnu.org/software/classpath
> http://icedtea.classpath.org
> PGP Key: F5862A37 (https://keys.indymedia.org/)
> Fingerprint = EA30 D855 D50F 90CD F54D 0698 0713 C3ED F586 2A37
More information about the jdk8-dev
mailing list