diff --git a/jdk/src/share/classes/com/sun/java/util/jar/pack/PackageWriter.java b/jdk/src/share/classes/com/sun/java/util/jar/pack/PackageWriter.java index a4a29826135..78754b5c72b 100644 --- a/jdk/src/share/classes/com/sun/java/util/jar/pack/PackageWriter.java +++ b/jdk/src/share/classes/com/sun/java/util/jar/pack/PackageWriter.java @@ -883,7 +883,7 @@ class PackageWriter extends BandStructure { avHiBits &= (1L< defMap = allLayouts.get(i); - @SuppressWarnings({ "unchecked", "rawtypes" }) + @SuppressWarnings({"unchecked", "rawtypes"}) Map.Entry[] layoutsAndCounts = new Map.Entry[defMap.size()]; defMap.entrySet().toArray(layoutsAndCounts); diff --git a/jdk/src/share/classes/java/io/FilePermission.java b/jdk/src/share/classes/java/io/FilePermission.java index a5781f3fb00..b2ba8bdf752 100644 --- a/jdk/src/share/classes/java/io/FilePermission.java +++ b/jdk/src/share/classes/java/io/FilePermission.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -31,10 +31,6 @@ import java.util.List; import java.util.ArrayList; import java.util.Vector; import java.util.Collections; -import java.io.ObjectStreamField; -import java.io.ObjectOutputStream; -import java.io.ObjectInputStream; -import java.io.IOException; import sun.security.util.SecurityConstants; /** @@ -424,7 +420,7 @@ public final class FilePermission extends Permission implements Serializable { /** * Converts an actions String to an actions mask. * - * @param action the action string. + * @param actions the action string. * @return the actions mask. */ private static int getMask(String actions) { @@ -435,7 +431,9 @@ public final class FilePermission extends Permission implements Serializable { if (actions == null) { return mask; } - // Check against use of constants (used heavily within the JDK) + + // Use object identity comparison against known-interned strings for + // performance benefit (these values are used heavily within the JDK). if (actions == SecurityConstants.FILE_READ_ACTION) { return READ; } else if (actions == SecurityConstants.FILE_WRITE_ACTION) { @@ -531,7 +529,7 @@ public final class FilePermission extends Permission implements Serializable { switch(a[i-matchlen]) { case ',': seencomma = true; - /*FALLTHROUGH*/ + break; case ' ': case '\r': case '\n': case '\f': case '\t': break; @@ -798,7 +796,7 @@ implements Serializable { * @return an enumeration of all the FilePermission objects. */ - public Enumeration elements() { + public Enumeration elements() { // Convert Iterator into Enumeration synchronized (this) { return Collections.enumeration(perms); @@ -843,7 +841,6 @@ implements Serializable { /* * Reads in a Vector of FilePermissions and saves them in the perms field. */ - @SuppressWarnings("unchecked") private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { // Don't call defaultReadObject() @@ -852,6 +849,7 @@ implements Serializable { ObjectInputStream.GetField gfields = in.readFields(); // Get the one we want + @SuppressWarnings("unchecked") Vector permissions = (Vector)gfields.get("permissions", null); perms = new ArrayList<>(permissions.size()); perms.addAll(permissions); diff --git a/jdk/src/share/classes/java/lang/reflect/Constructor.java b/jdk/src/share/classes/java/lang/reflect/Constructor.java index fbf300b7fac..d84e373a7b5 100644 --- a/jdk/src/share/classes/java/lang/reflect/Constructor.java +++ b/jdk/src/share/classes/java/lang/reflect/Constructor.java @@ -182,7 +182,7 @@ public final class Constructor extends Executable { * @since 1.5 */ @Override - @SuppressWarnings({ "rawtypes", "unchecked" }) + @SuppressWarnings({"rawtypes", "unchecked"}) public TypeVariable>[] getTypeParameters() { if (getSignature() != null) { return (TypeVariable>[])getGenericInfo().getTypeParameters(); diff --git a/jdk/src/share/classes/java/lang/reflect/Method.java b/jdk/src/share/classes/java/lang/reflect/Method.java index b940e23de42..068d864e96e 100644 --- a/jdk/src/share/classes/java/lang/reflect/Method.java +++ b/jdk/src/share/classes/java/lang/reflect/Method.java @@ -194,7 +194,7 @@ public final class Method extends Executable { * @since 1.5 */ @Override - @SuppressWarnings({ "rawtypes", "unchecked" }) + @SuppressWarnings({"rawtypes", "unchecked"}) public TypeVariable[] getTypeParameters() { if (getGenericSignature() != null) return (TypeVariable[])getGenericInfo().getTypeParameters(); diff --git a/jdk/src/share/classes/java/net/SocketPermission.java b/jdk/src/share/classes/java/net/SocketPermission.java index b20563bc9dc..da9abee01f6 100644 --- a/jdk/src/share/classes/java/net/SocketPermission.java +++ b/jdk/src/share/classes/java/net/SocketPermission.java @@ -467,7 +467,6 @@ implements java.io.Serializable * @param action the action string * @return the action mask */ - @SuppressWarnings("fallthrough") private static int getMask(String action) { if (action == null) { @@ -480,7 +479,8 @@ implements java.io.Serializable int mask = NONE; - // Check against use of constants (used heavily within the JDK) + // Use object identity comparison against known-interned strings for + // performance benefit (these values are used heavily within the JDK). if (action == SecurityConstants.SOCKET_RESOLVE_ACTION) { return RESOLVE; } else if (action == SecurityConstants.SOCKET_CONNECT_ACTION) { @@ -568,7 +568,7 @@ implements java.io.Serializable switch(a[i-matchlen]) { case ',': seencomma = true; - /*FALLTHROUGH*/ + break; case ' ': case '\r': case '\n': case '\f': case '\t': break; diff --git a/jdk/src/share/classes/java/nio/channels/AsynchronousFileChannel.java b/jdk/src/share/classes/java/nio/channels/AsynchronousFileChannel.java index c47ba4255a9..ba24eb113cf 100644 --- a/jdk/src/share/classes/java/nio/channels/AsynchronousFileChannel.java +++ b/jdk/src/share/classes/java/nio/channels/AsynchronousFileChannel.java @@ -248,7 +248,7 @@ public abstract class AsynchronousFileChannel return provider.newAsynchronousFileChannel(file, options, executor, attrs); } - @SuppressWarnings({ "unchecked", "rawtypes" }) // generic array construction + @SuppressWarnings({"unchecked", "rawtypes"}) // generic array construction private static final FileAttribute[] NO_ATTRIBUTES = new FileAttribute[0]; /** diff --git a/jdk/src/share/classes/java/nio/channels/FileChannel.java b/jdk/src/share/classes/java/nio/channels/FileChannel.java index 1a6dc5fec85..f18f03e39c9 100644 --- a/jdk/src/share/classes/java/nio/channels/FileChannel.java +++ b/jdk/src/share/classes/java/nio/channels/FileChannel.java @@ -287,7 +287,7 @@ public abstract class FileChannel return provider.newFileChannel(path, options, attrs); } - @SuppressWarnings({ "unchecked", "rawtypes" }) // generic array construction + @SuppressWarnings({"unchecked", "rawtypes"}) // generic array construction private static final FileAttribute[] NO_ATTRIBUTES = new FileAttribute[0]; /** diff --git a/jdk/src/share/classes/java/util/ArrayDeque.java b/jdk/src/share/classes/java/util/ArrayDeque.java index 8a9a0ee7b8b..476b2233298 100644 --- a/jdk/src/share/classes/java/util/ArrayDeque.java +++ b/jdk/src/share/classes/java/util/ArrayDeque.java @@ -121,6 +121,7 @@ public class ArrayDeque extends AbstractCollection * * @param numElements the number of elements to hold */ + @SuppressWarnings("unchecked") private void allocateElements(int numElements) { int initialCapacity = MIN_INITIAL_CAPACITY; // Find the best power of two to hold elements. @@ -152,10 +153,11 @@ public class ArrayDeque extends AbstractCollection int newCapacity = n << 1; if (newCapacity < 0) throw new IllegalStateException("Sorry, deque too big"); - Object[] a = new Object[newCapacity]; + @SuppressWarnings("unchecked") + E[] a = (E[]) new Object[newCapacity]; System.arraycopy(elements, p, a, 0, r); System.arraycopy(elements, 0, a, r, p); - elements = (E[])a; + elements = a; head = 0; tail = n; } @@ -182,6 +184,7 @@ public class ArrayDeque extends AbstractCollection * Constructs an empty array deque with an initial capacity * sufficient to hold 16 elements. */ + @SuppressWarnings("unchecked") public ArrayDeque() { elements = (E[]) new Object[16]; } @@ -793,6 +796,7 @@ public class ArrayDeque extends AbstractCollection * this deque * @throws NullPointerException if the specified array is null */ + @SuppressWarnings("unchecked") public T[] toArray(T[] a) { int size = size(); if (a.length < size) diff --git a/jdk/src/share/classes/java/util/Arrays.java b/jdk/src/share/classes/java/util/Arrays.java index d0c3a60a05a..c4dde9bbedf 100644 --- a/jdk/src/share/classes/java/util/Arrays.java +++ b/jdk/src/share/classes/java/util/Arrays.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -560,7 +560,7 @@ public class Arrays { * off is the offset to generate corresponding low, high in src * To be removed in a future release. */ - @SuppressWarnings({ "unchecked", "rawtypes" }) + @SuppressWarnings({"unchecked", "rawtypes"}) private static void mergeSort(Object[] src, Object[] dest, int low, @@ -747,7 +747,7 @@ public class Arrays { * off is the offset into src corresponding to low in dest * To be removed in a future release. */ - @SuppressWarnings({ "rawtypes", "unchecked" }) + @SuppressWarnings({"rawtypes", "unchecked"}) private static void mergeSort(Object[] src, Object[] dest, int low, int high, int off, @@ -2832,6 +2832,7 @@ public class Arrays { * @return a list view of the specified array */ @SafeVarargs + @SuppressWarnings("varargs") public static List asList(T... a) { return new ArrayList<>(a); } diff --git a/jdk/src/share/classes/java/util/Collections.java b/jdk/src/share/classes/java/util/Collections.java index 53326032680..58eae6f9509 100644 --- a/jdk/src/share/classes/java/util/Collections.java +++ b/jdk/src/share/classes/java/util/Collections.java @@ -213,7 +213,7 @@ public class Collections { * @throws IllegalArgumentException (optional) if the comparator is * found to violate the {@link Comparator} contract */ - @SuppressWarnings({ "unchecked", "rawtypes" }) + @SuppressWarnings({"unchecked", "rawtypes"}) public static void sort(List list, Comparator c) { Object[] a = list.toArray(); Arrays.sort(a, (Comparator)c); @@ -418,7 +418,7 @@ public class Collections { * @throws UnsupportedOperationException if the specified list or * its list-iterator does not support the set operation. */ - @SuppressWarnings({ "rawtypes", "unchecked" }) + @SuppressWarnings({"rawtypes", "unchecked"}) public static void reverse(List list) { int size = list.size(); if (size < REVERSE_THRESHOLD || list instanceof RandomAccess) { @@ -497,7 +497,7 @@ public class Collections { * @throws UnsupportedOperationException if the specified list or its * list-iterator does not support the set operation. */ - @SuppressWarnings({ "rawtypes", "unchecked" }) + @SuppressWarnings({"rawtypes", "unchecked"}) public static void shuffle(List list, Random rnd) { int size = list.size(); if (size < SHUFFLE_THRESHOLD || list instanceof RandomAccess) { @@ -535,7 +535,7 @@ public class Collections { * || j < 0 || j >= list.size()). * @since 1.4 */ - @SuppressWarnings({ "rawtypes", "unchecked" }) + @SuppressWarnings({"rawtypes", "unchecked"}) public static void swap(List list, int i, int j) { // instead of using a raw type here, it's possible to capture // the wildcard but it will require a call to a supplementary @@ -669,7 +669,7 @@ public class Collections { * @throws NoSuchElementException if the collection is empty. * @see Comparable */ - @SuppressWarnings({ "unchecked", "rawtypes" }) + @SuppressWarnings({"unchecked", "rawtypes"}) public static T min(Collection coll, Comparator comp) { if (comp==null) return (T)min((Collection) coll); @@ -740,7 +740,7 @@ public class Collections { * @throws NoSuchElementException if the collection is empty. * @see Comparable */ - @SuppressWarnings({ "unchecked", "rawtypes" }) + @SuppressWarnings({"unchecked", "rawtypes"}) public static T max(Collection coll, Comparator comp) { if (comp==null) return (T)max((Collection) coll); @@ -1403,7 +1403,7 @@ public class Collections { extends UnmodifiableSet> { private static final long serialVersionUID = 7854390611657943733L; - @SuppressWarnings({ "unchecked", "rawtypes" }) + @SuppressWarnings({"unchecked", "rawtypes"}) UnmodifiableEntrySet(Set> s) { // Need to cast to raw in order to work around a limitation in the type system super((Set)s); @@ -3172,7 +3172,7 @@ public class Collections { * * @see #emptySet() */ - @SuppressWarnings("unchecked") + @SuppressWarnings("rawtypes") public static final Set EMPTY_SET = new EmptySet<>(); /** @@ -3271,10 +3271,13 @@ public class Collections { return new EmptySortedSet<>(); } - public Comparator comparator() { + @Override + public Comparator comparator() { return null; } + @Override + @SuppressWarnings("unchecked") public SortedSet subSet(Object fromElement, Object toElement) { Objects.requireNonNull(fromElement); Objects.requireNonNull(toElement); @@ -3294,6 +3297,7 @@ public class Collections { return emptySortedSet(); } + @Override public SortedSet headSet(Object toElement) { Objects.requireNonNull(toElement); @@ -3304,6 +3308,7 @@ public class Collections { return emptySortedSet(); } + @Override public SortedSet tailSet(Object fromElement) { Objects.requireNonNull(fromElement); @@ -3314,10 +3319,12 @@ public class Collections { return emptySortedSet(); } + @Override public E first() { throw new NoSuchElementException(); } + @Override public E last() { throw new NoSuchElementException(); } @@ -3328,7 +3335,7 @@ public class Collections { * * @see #emptyList() */ - @SuppressWarnings("unchecked") + @SuppressWarnings("rawtypes") public static final List EMPTY_LIST = new EmptyList<>(); /** @@ -3402,7 +3409,7 @@ public class Collections { * @see #emptyMap() * @since 1.3 */ - @SuppressWarnings("unchecked") + @SuppressWarnings("rawtypes") public static final Map EMPTY_MAP = new EmptyMap<>(); /** @@ -3685,6 +3692,7 @@ public class Collections { return a; } + @SuppressWarnings("unchecked") public T[] toArray(T[] a) { final int n = this.n; if (a.length < n) { @@ -3731,6 +3739,7 @@ public class Collections { * the Comparable interface. * @see Comparable */ + @SuppressWarnings("unchecked") public static Comparator reverseOrder() { return (Comparator) ReverseComparator.REVERSE_ORDER; } diff --git a/jdk/src/share/classes/java/util/ComparableTimSort.java b/jdk/src/share/classes/java/util/ComparableTimSort.java index ae1ab6a1e81..dd7cb3a80ec 100644 --- a/jdk/src/share/classes/java/util/ComparableTimSort.java +++ b/jdk/src/share/classes/java/util/ComparableTimSort.java @@ -208,7 +208,7 @@ class ComparableTimSort { * @param start the index of the first element in the range that is * not already known to be sorted ({@code lo <= start <= hi}) */ - @SuppressWarnings({ "fallthrough", "rawtypes", "unchecked" }) + @SuppressWarnings({"fallthrough", "rawtypes", "unchecked"}) private static void binarySort(Object[] a, int lo, int hi, int start) { assert lo <= start && start <= hi; if (start == lo) @@ -277,7 +277,7 @@ class ComparableTimSort { * @return the length of the run beginning at the specified position in * the specified array */ - @SuppressWarnings({ "unchecked", "rawtypes" }) + @SuppressWarnings({"unchecked", "rawtypes"}) private static int countRunAndMakeAscending(Object[] a, int lo, int hi) { assert lo < hi; int runHi = lo + 1; @@ -612,7 +612,7 @@ class ComparableTimSort { * (must be aBase + aLen) * @param len2 length of second run to be merged (must be > 0) */ - @SuppressWarnings({ "unchecked", "rawtypes" }) + @SuppressWarnings({"unchecked", "rawtypes"}) private void mergeLo(int base1, int len1, int base2, int len2) { assert len1 > 0 && len2 > 0 && base1 + len1 == base2; @@ -729,7 +729,7 @@ class ComparableTimSort { * (must be aBase + aLen) * @param len2 length of second run to be merged (must be > 0) */ - @SuppressWarnings({ "unchecked", "rawtypes" }) + @SuppressWarnings({"unchecked", "rawtypes"}) private void mergeHi(int base1, int len1, int base2, int len2) { assert len1 > 0 && len2 > 0 && base1 + len1 == base2; diff --git a/jdk/src/share/classes/java/util/HashMap.java b/jdk/src/share/classes/java/util/HashMap.java index 4687905e428..9990a6ef68c 100644 --- a/jdk/src/share/classes/java/util/HashMap.java +++ b/jdk/src/share/classes/java/util/HashMap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -230,7 +230,7 @@ public class HashMap this.loadFactor = loadFactor; threshold = (int)Math.min(capacity * loadFactor, MAXIMUM_CAPACITY + 1); - table = new Entry[capacity]; + table = new Entry[capacity]; init(); } @@ -1078,7 +1078,7 @@ public class HashMap capacity <<= 1; } - table = new Entry[capacity]; + table = new Entry[capacity]; threshold = (int) Math.min(capacity * loadFactor, MAXIMUM_CAPACITY + 1); init(); // Give subclass a chance to do its thing. diff --git a/jdk/src/share/classes/java/util/JumboEnumSet.java b/jdk/src/share/classes/java/util/JumboEnumSet.java index 5db15bbdace..d2f3e83f7b1 100644 --- a/jdk/src/share/classes/java/util/JumboEnumSet.java +++ b/jdk/src/share/classes/java/util/JumboEnumSet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2012, 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 @@ -121,6 +121,7 @@ class JumboEnumSet> extends EnumSet { unseen = elements[0]; } + @Override public boolean hasNext() { while (unseen == 0 && unseenIndex < elements.length - 1) unseen = elements[++unseenIndex]; @@ -128,6 +129,7 @@ class JumboEnumSet> extends EnumSet { } @Override + @SuppressWarnings("unchecked") public E next() { if (!hasNext()) throw new NoSuchElementException(); @@ -138,6 +140,7 @@ class JumboEnumSet> extends EnumSet { + Long.numberOfTrailingZeros(lastReturned)]; } + @Override public void remove() { if (lastReturned == 0) throw new IllegalStateException(); diff --git a/jdk/src/share/classes/java/util/PriorityQueue.java b/jdk/src/share/classes/java/util/PriorityQueue.java index bb9c114dd68..dd67a0c5ba4 100644 --- a/jdk/src/share/classes/java/util/PriorityQueue.java +++ b/jdk/src/share/classes/java/util/PriorityQueue.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2012, 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 @@ -330,6 +330,7 @@ public class PriorityQueue extends AbstractQueue return true; } + @SuppressWarnings("unchecked") public E peek() { if (size == 0) return null; diff --git a/jdk/src/share/classes/java/util/PropertyPermission.java b/jdk/src/share/classes/java/util/PropertyPermission.java index c89b28bf4d2..aed6f5c48c7 100644 --- a/jdk/src/share/classes/java/util/PropertyPermission.java +++ b/jdk/src/share/classes/java/util/PropertyPermission.java @@ -246,7 +246,8 @@ public final class PropertyPermission extends BasicPermission { return mask; } - // Check against use of constants (used heavily within the JDK) + // Use object identity comparison against known-interned strings for + // performance benefit (these values are used heavily within the JDK). if (actions == SecurityConstants.PROPERTY_READ_ACTION) { return READ; } if (actions == SecurityConstants.PROPERTY_WRITE_ACTION) { diff --git a/jdk/src/share/classes/java/util/PropertyResourceBundle.java b/jdk/src/share/classes/java/util/PropertyResourceBundle.java index c7fe3b460a1..98ebd3b0f41 100644 --- a/jdk/src/share/classes/java/util/PropertyResourceBundle.java +++ b/jdk/src/share/classes/java/util/PropertyResourceBundle.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2012, 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 @@ -125,6 +125,7 @@ public class PropertyResourceBundle extends ResourceBundle { * @throws IOException if an I/O error occurs * @throws NullPointerException if stream is null */ + @SuppressWarnings({"unchecked", "rawtypes"}) public PropertyResourceBundle (InputStream stream) throws IOException { Properties properties = new Properties(); properties.load(stream); @@ -143,6 +144,7 @@ public class PropertyResourceBundle extends ResourceBundle { * @throws NullPointerException if reader is null * @since 1.6 */ + @SuppressWarnings({"unchecked", "rawtypes"}) public PropertyResourceBundle (Reader reader) throws IOException { Properties properties = new Properties(); properties.load(reader); diff --git a/jdk/src/share/classes/java/util/jar/JarVerifier.java b/jdk/src/share/classes/java/util/jar/JarVerifier.java index 5c80d5013db..a455fb1f2f7 100644 --- a/jdk/src/share/classes/java/util/jar/JarVerifier.java +++ b/jdk/src/share/classes/java/util/jar/JarVerifier.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -325,6 +325,7 @@ class JarVerifier { * the given file in the jar. * @deprecated */ + @Deprecated public java.security.cert.Certificate[] getCerts(String name) { return mapSignersToCertArray(getCodeSigners(name)); diff --git a/jdk/src/share/classes/java/util/jar/Pack200.java b/jdk/src/share/classes/java/util/jar/Pack200.java index bb7cc2b47fe..0f28a14b527 100644 --- a/jdk/src/share/classes/java/util/jar/Pack200.java +++ b/jdk/src/share/classes/java/util/jar/Pack200.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003,2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003,2012, 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 @@ -726,13 +726,13 @@ public abstract class Pack200 { private static final String PACK_PROVIDER = "java.util.jar.Pack200.Packer"; private static final String UNPACK_PROVIDER = "java.util.jar.Pack200.Unpacker"; - private static Class packerImpl; - private static Class unpackerImpl; + private static Class packerImpl; + private static Class unpackerImpl; private synchronized static Object newInstance(String prop) { String implName = "(unknown)"; try { - Class impl = (PACK_PROVIDER.equals(prop))? packerImpl: unpackerImpl; + Class impl = (PACK_PROVIDER.equals(prop))? packerImpl: unpackerImpl; if (impl == null) { // The first time, we must decide which class to use. implName = java.security.AccessController.doPrivileged( diff --git a/jdk/src/share/classes/sun/util/PreHashedMap.java b/jdk/src/share/classes/sun/util/PreHashedMap.java index 2a257751a6f..c09425ce6e4 100644 --- a/jdk/src/share/classes/sun/util/PreHashedMap.java +++ b/jdk/src/share/classes/sun/util/PreHashedMap.java @@ -126,7 +126,7 @@ public abstract class PreHashedMap */ protected abstract void init(Object[] ht); - // @SuppressWarnings("unchecked") + @SuppressWarnings("unchecked") private V toV(Object x) { return (V)x; } @@ -259,8 +259,7 @@ public abstract class PreHashedMap return true; if (!(ob instanceof Map.Entry)) return false; - Map.Entry that - = (Map.Entry)ob; + Map.Entry that = (Map.Entry)ob; return ((this.getKey() == null ? that.getKey() == null : this.getKey()