diff --git a/make/common/Defs-linux.gmk b/make/common/Defs-linux.gmk
index 9d403b115384dcd7e77a15350ccc4930be56b39f..a0bfc3cc8d3ffabe88bea430df78dbeb479893a8 100644
--- a/make/common/Defs-linux.gmk
+++ b/make/common/Defs-linux.gmk
@@ -157,9 +157,7 @@ ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
_JUNK_ := $(shell \
echo >&2 "INFO: STRIP_POLICY=$(STRIP_POLICY)")
- # HACK: disable ZIP_DEBUGINFO_FILES by default until install repo
- # changes are promoted
- ZIP_DEBUGINFO_FILES ?= 0
+ ZIP_DEBUGINFO_FILES ?= 1
_JUNK_ := $(shell \
echo >&2 "INFO: ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES)")
diff --git a/make/common/Defs-solaris.gmk b/make/common/Defs-solaris.gmk
index ad445e978483c8b65d42ddad0202aaac0ed26461..5c272be1c35842df452dc360a9f10258fbac1914 100644
--- a/make/common/Defs-solaris.gmk
+++ b/make/common/Defs-solaris.gmk
@@ -165,9 +165,7 @@ ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
_JUNK_ := $(shell \
echo >&2 "INFO: STRIP_POLICY=$(STRIP_POLICY)")
- # HACK: disable ZIP_DEBUGINFO_FILES by default until install repo
- # changes are promoted
- ZIP_DEBUGINFO_FILES ?= 0
+ ZIP_DEBUGINFO_FILES ?= 1
_JUNK_ := $(shell \
echo >&2 "INFO: ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES)")
diff --git a/make/common/Defs-windows.gmk b/make/common/Defs-windows.gmk
index 3d1ec781bf5a9d6185ca348d18316bd28dac00b6..7afe0b515e079f8b91a27e02d542bb709147645f 100644
--- a/make/common/Defs-windows.gmk
+++ b/make/common/Defs-windows.gmk
@@ -113,9 +113,7 @@ _JUNK_ := $(shell \
echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
- # HACK: disable ZIP_DEBUGINFO_FILES by default until install repo
- # changes are promoted
- ZIP_DEBUGINFO_FILES ?= 0
+ ZIP_DEBUGINFO_FILES ?= 1
else
ZIP_DEBUGINFO_FILES=0
endif
diff --git a/src/share/classes/java/net/HttpCookie.java b/src/share/classes/java/net/HttpCookie.java
index bb12564193d9c7ede6dafe2d40040331372d5b8d..1963e1fc9138fcd7d665831d8158edd00b81dd10 100644
--- a/src/share/classes/java/net/HttpCookie.java
+++ b/src/share/classes/java/net/HttpCookie.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -616,9 +616,6 @@ public final class HttpCookie implements Cloneable {
* would be accepted.
*
A Set-Cookie2 with Domain=.com or Domain=.com., will always be
* rejected, because there is no embedded dot.
- *
A Set-Cookie2 with Domain=ajax.com will be accepted, and the
- * value for Domain will be taken to be .ajax.com, because a dot
- * gets prepended to the value.
*
A Set-Cookie2 from request-host example for Domain=.local will
* be accepted, because the effective host name for the request-
* host is example.local, and example.local domain-matches .local.
diff --git a/src/share/classes/java/nio/file/Path.java b/src/share/classes/java/nio/file/Path.java
index 92cd1f9661ea0fd9878819e4bfd2149fb0d39237..afe07a387d6e37e84024fb3b7f47406688720bae 100644
--- a/src/share/classes/java/nio/file/Path.java
+++ b/src/share/classes/java/nio/file/Path.java
@@ -54,7 +54,7 @@ import java.util.Iterator;
* resolveSibling} methods to combine paths. The {@link #relativize relativize}
* method that can be used to construct a relative path between two paths.
* Paths can be {@link #compareTo compared}, and tested against each other using
- * the {@link #startsWith startsWith} and {@link #endsWith endWith} methods.
+ * the {@link #startsWith startsWith} and {@link #endsWith endsWith} methods.
*
*
This interface extends {@link Watchable} interface so that a directory
* located by a path can be {@link #register registered} with a {@link
diff --git a/src/share/classes/java/util/AbstractCollection.java b/src/share/classes/java/util/AbstractCollection.java
index a32d41156a3912b0b239546038b8b075db63bab2..3824f390463651804183ff181d368dab03f7ef04 100644
--- a/src/share/classes/java/util/AbstractCollection.java
+++ b/src/share/classes/java/util/AbstractCollection.java
@@ -170,6 +170,7 @@ public abstract class AbstractCollection implements Collection {
* @throws ArrayStoreException {@inheritDoc}
* @throws NullPointerException {@inheritDoc}
*/
+ @SuppressWarnings("unchecked")
public T[] toArray(T[] a) {
// Estimate size of array; be prepared to see more or fewer elements
int size = size();
@@ -216,6 +217,7 @@ public abstract class AbstractCollection implements Collection {
* @return array containing the elements in the given array, plus any
* further elements returned by the iterator, trimmed to size
*/
+ @SuppressWarnings("unchecked")
private static T[] finishToArray(T[] r, Iterator> it) {
int i = r.length;
while (it.hasNext()) {
diff --git a/src/share/classes/java/util/AbstractList.java b/src/share/classes/java/util/AbstractList.java
index 4492166111b008ac69143c3272f1ac2132c17476..0b605150679970755b57384ddacc9f8e7de4815a 100644
--- a/src/share/classes/java/util/AbstractList.java
+++ b/src/share/classes/java/util/AbstractList.java
@@ -516,7 +516,7 @@ public abstract class AbstractList extends AbstractCollection implements L
return false;
ListIterator e1 = listIterator();
- ListIterator e2 = ((List) o).listIterator();
+ ListIterator> e2 = ((List>) o).listIterator();
while (e1.hasNext() && e2.hasNext()) {
E o1 = e1.next();
Object o2 = e2.next();
diff --git a/src/share/classes/java/util/AbstractMap.java b/src/share/classes/java/util/AbstractMap.java
index a3ad3d3497a28b4e159ee67137b17830a06df258..aba5048becdac5767dadd1353b66391f95f7ef28 100644
--- a/src/share/classes/java/util/AbstractMap.java
+++ b/src/share/classes/java/util/AbstractMap.java
@@ -443,7 +443,7 @@ public abstract class AbstractMap implements Map {
if (!(o instanceof Map))
return false;
- Map m = (Map) o;
+ Map,?> m = (Map,?>) o;
if (m.size() != size())
return false;
@@ -534,7 +534,7 @@ public abstract class AbstractMap implements Map {
* @return a shallow copy of this map
*/
protected Object clone() throws CloneNotSupportedException {
- AbstractMap result = (AbstractMap)super.clone();
+ AbstractMap,?> result = (AbstractMap,?>)super.clone();
result.keySet = null;
result.values = null;
return result;
@@ -652,7 +652,7 @@ public abstract class AbstractMap implements Map {
public boolean equals(Object o) {
if (!(o instanceof Map.Entry))
return false;
- Map.Entry e = (Map.Entry)o;
+ Map.Entry,?> e = (Map.Entry,?>)o;
return eq(key, e.getKey()) && eq(value, e.getValue());
}
@@ -783,7 +783,7 @@ public abstract class AbstractMap implements Map {
public boolean equals(Object o) {
if (!(o instanceof Map.Entry))
return false;
- Map.Entry e = (Map.Entry)o;
+ Map.Entry,?> e = (Map.Entry,?>)o;
return eq(key, e.getKey()) && eq(value, e.getValue());
}
diff --git a/src/share/classes/java/util/AbstractSet.java b/src/share/classes/java/util/AbstractSet.java
index 1f1a49c250e4cdf058c12cdaaca3499c195baeb6..03e45ba38c0e412dd8988c759e0156b27a934224 100644
--- a/src/share/classes/java/util/AbstractSet.java
+++ b/src/share/classes/java/util/AbstractSet.java
@@ -88,7 +88,7 @@ public abstract class AbstractSet extends AbstractCollection implements Se
if (!(o instanceof Set))
return false;
- Collection c = (Collection) o;
+ Collection> c = (Collection>) o;
if (c.size() != size())
return false;
try {
diff --git a/src/share/classes/java/util/ArrayDeque.java b/src/share/classes/java/util/ArrayDeque.java
index eb70aaa59ccbb04371d8546c4016fc76bb64dee8..8a9a0ee7b8b16665353d25581d28ba17efbf412f 100644
--- a/src/share/classes/java/util/ArrayDeque.java
+++ b/src/share/classes/java/util/ArrayDeque.java
@@ -813,7 +813,8 @@ public class ArrayDeque extends AbstractCollection
*/
public ArrayDeque clone() {
try {
- ArrayDeque result = (ArrayDeque) super.clone();
+ @SuppressWarnings("unchecked")
+ ArrayDeque result = (ArrayDeque) super.clone();
result.elements = Arrays.copyOf(elements, elements.length);
return result;
@@ -849,6 +850,7 @@ public class ArrayDeque extends AbstractCollection
/**
* Deserialize this deque.
*/
+ @SuppressWarnings("unchecked")
private void readObject(ObjectInputStream s)
throws IOException, ClassNotFoundException {
s.defaultReadObject();
diff --git a/src/share/classes/java/util/ArrayList.java b/src/share/classes/java/util/ArrayList.java
index 3b029272753ed2e7d8c83f26f915698cd862f7b4..eb44bd959eea359e18b9457e6e9c99da522b76e7 100644
--- a/src/share/classes/java/util/ArrayList.java
+++ b/src/share/classes/java/util/ArrayList.java
@@ -300,8 +300,7 @@ public class ArrayList extends AbstractList
*/
public Object clone() {
try {
- @SuppressWarnings("unchecked")
- ArrayList v = (ArrayList) super.clone();
+ ArrayList> v = (ArrayList>) super.clone();
v.elementData = Arrays.copyOf(elementData, size);
v.modCount = 0;
return v;
diff --git a/src/share/classes/java/util/Arrays.java b/src/share/classes/java/util/Arrays.java
index fd408e27b60ccdb4abcb13c78557a187f00c9b08..d0c3a60a05a41f50982c1871112d27657cf0b196 100644
--- a/src/share/classes/java/util/Arrays.java
+++ b/src/share/classes/java/util/Arrays.java
@@ -560,6 +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" })
private static void mergeSort(Object[] src,
Object[] dest,
int low,
@@ -746,6 +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" })
private static void mergeSort(Object[] src,
Object[] dest,
int low, int high, int off,
@@ -1477,8 +1479,10 @@ public class Arrays {
while (low <= high) {
int mid = (low + high) >>> 1;
- Comparable midVal = (Comparable)a[mid];
- int cmp = midVal.compareTo(key);
+ @SuppressWarnings("rawtypes")
+ Comparable midVal = (Comparable)a[mid];
+ @SuppressWarnings("unchecked")
+ int cmp = midVal.compareTo(key);
if (cmp < 0)
low = mid + 1;
@@ -2215,6 +2219,7 @@ public class Arrays {
* @throws NullPointerException if original is null
* @since 1.6
*/
+ @SuppressWarnings("unchecked")
public static T[] copyOf(T[] original, int newLength) {
return (T[]) copyOf(original, newLength, original.getClass());
}
@@ -2242,6 +2247,7 @@ public class Arrays {
* @since 1.6
*/
public static T[] copyOf(U[] original, int newLength, Class extends T[]> newType) {
+ @SuppressWarnings("unchecked")
T[] copy = ((Object)newType == (Object)Object[].class)
? (T[]) new Object[newLength]
: (T[]) Array.newInstance(newType.getComponentType(), newLength);
@@ -2470,8 +2476,9 @@ public class Arrays {
* @throws NullPointerException if original is null
* @since 1.6
*/
+ @SuppressWarnings("unchecked")
public static T[] copyOfRange(T[] original, int from, int to) {
- return copyOfRange(original, from, to, (Class) original.getClass());
+ return copyOfRange(original, from, to, (Class extends T[]>) original.getClass());
}
/**
@@ -2509,6 +2516,7 @@ public class Arrays {
int newLength = to - from;
if (newLength < 0)
throw new IllegalArgumentException(from + " > " + to);
+ @SuppressWarnings("unchecked")
T[] copy = ((Object)newType == (Object)Object[].class)
? (T[]) new Object[newLength]
: (T[]) Array.newInstance(newType.getComponentType(), newLength);
@@ -2851,6 +2859,7 @@ public class Arrays {
return a.clone();
}
+ @SuppressWarnings("unchecked")
public T[] toArray(T[] a) {
int size = size();
if (a.length < size)
@@ -3634,7 +3643,7 @@ public class Arrays {
if (element == null) {
buf.append("null");
} else {
- Class eClass = element.getClass();
+ Class> eClass = element.getClass();
if (eClass.isArray()) {
if (eClass == byte[].class)
diff --git a/src/share/classes/java/util/Calendar.java b/src/share/classes/java/util/Calendar.java
index 21de73437a4d226cc6eaecf53055e6d7b7a02da4..0e04b22fab3c629d35dceeab4194e2d52978aad4 100644
--- a/src/share/classes/java/util/Calendar.java
+++ b/src/share/classes/java/util/Calendar.java
@@ -840,7 +840,7 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable cachedLocaleData
- = new ConcurrentHashMap(3);
+ = new ConcurrentHashMap<>(3);
// Special values of stamp[]
/**
@@ -1499,7 +1499,7 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable names = new HashMap();
+ Map names = new HashMap<>();
for (int i = 0; i < strings.length; i++) {
if (strings[i].length() == 0) {
continue;
diff --git a/src/share/classes/java/util/Collections.java b/src/share/classes/java/util/Collections.java
index d18d568233698ab9239fb4ead6034f1b1d1abc5b..533260326809ccf919f30c0c31eff90a20db657c 100644
--- a/src/share/classes/java/util/Collections.java
+++ b/src/share/classes/java/util/Collections.java
@@ -150,6 +150,7 @@ public class Collections {
* detects that the natural ordering of the list elements is
* found to violate the {@link Comparable} contract
*/
+ @SuppressWarnings("unchecked")
public static > void sort(List list) {
Object[] a = list.toArray();
Arrays.sort(a);
@@ -212,13 +213,14 @@ public class Collections {
* @throws IllegalArgumentException (optional) if the comparator is
* found to violate the {@link Comparator} contract
*/
+ @SuppressWarnings({ "unchecked", "rawtypes" })
public static void sort(List list, Comparator super T> c) {
Object[] a = list.toArray();
Arrays.sort(a, (Comparator)c);
- ListIterator i = list.listIterator();
+ ListIterator i = list.listIterator();
for (int j=0; j int binarySearch(List extends T> list, T key, Comparator super T> c) {
if (c==null)
- return binarySearch((List) list, key);
+ return binarySearch((List extends Comparable super T>>) list, key);
if (list instanceof RandomAccess || list.size() {}
-
-
/**
* Reverses the order of the elements in the specified list.
*
@@ -418,12 +418,16 @@ public class Collections {
* @throws UnsupportedOperationException if the specified list or
* its list-iterator does not support the set operation.
*/
+ @SuppressWarnings({ "rawtypes", "unchecked" })
public static void reverse(List> list) {
int size = list.size();
if (size < REVERSE_THRESHOLD || list instanceof RandomAccess) {
for (int i=0, mid=size>>1, j=size-1; i>1; iset operation.
*/
+ @SuppressWarnings({ "rawtypes", "unchecked" })
public static void shuffle(List> list, Random rnd) {
int size = list.size();
if (size < SHUFFLE_THRESHOLD || list instanceof RandomAccess) {
@@ -506,6 +511,9 @@ public class Collections {
swap(arr, i-1, rnd.nextInt(i));
// Dump array back into list
+ // instead of using a raw type here, it's possible to capture
+ // the wildcard but it will require a call to a supplementary
+ // private method
ListIterator it = list.listIterator();
for (int i=0; i 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
+ // private method
final List l = list;
l.set(i, l.set(j, l.get(i)));
}
@@ -657,9 +669,10 @@ public class Collections {
* @throws NoSuchElementException if the collection is empty.
* @see Comparable
*/
+ @SuppressWarnings({ "unchecked", "rawtypes" })
public static T min(Collection extends T> coll, Comparator super T> comp) {
if (comp==null)
- return (T)min((Collection) (Collection) coll);
+ return (T)min((Collection) coll);
Iterator extends T> i = coll.iterator();
T candidate = i.next();
@@ -727,9 +740,10 @@ public class Collections {
* @throws NoSuchElementException if the collection is empty.
* @see Comparable
*/
+ @SuppressWarnings({ "unchecked", "rawtypes" })
public static T max(Collection extends T> coll, Comparator super T> comp) {
if (comp==null)
- return (T)max((Collection) (Collection) coll);
+ return (T)max((Collection) coll);
Iterator extends T> i = coll.iterator();
T candidate = i.next();
@@ -1389,7 +1403,9 @@ public class Collections {
extends UnmodifiableSet> {
private static final long serialVersionUID = 7854390611657943733L;
+ @SuppressWarnings({ "unchecked", "rawtypes" })
UnmodifiableEntrySet(Set extends Map.Entry extends K, ? extends V>> s) {
+ // Need to cast to raw in order to work around a limitation in the type system
super((Set)s);
}
public Iterator> iterator() {
@@ -1408,13 +1424,15 @@ public class Collections {
};
}
+ @SuppressWarnings("unchecked")
public Object[] toArray() {
Object[] a = c.toArray();
for (int i=0; i((Map.Entry)a[i]);
+ a[i] = new UnmodifiableEntry<>((Map.Entry extends K, ? extends V>)a[i]);
return a;
}
+ @SuppressWarnings("unchecked")
public T[] toArray(T[] a) {
// We don't pass a to c.toArray, to avoid window of
// vulnerability wherein an unscrupulous multithreaded client
@@ -1422,7 +1440,7 @@ public class Collections {
Object[] arr = c.toArray(a.length==0 ? a : Arrays.copyOf(a, 0));
for (int i=0; i((Map.Entry)arr[i]);
+ arr[i] = new UnmodifiableEntry<>((Map.Entry extends K, ? extends V>)arr[i]);
if (arr.length > a.length)
return (T[])arr;
@@ -1464,7 +1482,7 @@ public class Collections {
if (!(o instanceof Set))
return false;
- Set s = (Set) o;
+ Set> s = (Set>) o;
if (s.size() != c.size())
return false;
return containsAll(s); // Invokes safe containsAll() above
@@ -1493,7 +1511,7 @@ public class Collections {
return true;
if (!(o instanceof Map.Entry))
return false;
- Map.Entry t = (Map.Entry)o;
+ Map.Entry,?> t = (Map.Entry,?>)o;
return eq(e.getKey(), t.getKey()) &&
eq(e.getValue(), t.getValue());
}
diff --git a/src/share/classes/java/util/ComparableTimSort.java b/src/share/classes/java/util/ComparableTimSort.java
index 22427a2d353cba980b6a23d36d3f4b895cdbccd1..ae1ab6a1e817b30e5b3c2d324160cb76076802d2 100644
--- a/src/share/classes/java/util/ComparableTimSort.java
+++ b/src/share/classes/java/util/ComparableTimSort.java
@@ -114,7 +114,6 @@ class ComparableTimSort {
// Allocate temp storage (which may be increased later if necessary)
int len = a.length;
- @SuppressWarnings({"unchecked", "UnnecessaryLocalVariable"})
Object[] newArray = new Object[len < 2 * INITIAL_TMP_STORAGE_LENGTH ?
len >>> 1 : INITIAL_TMP_STORAGE_LENGTH];
tmp = newArray;
@@ -209,14 +208,13 @@ 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")
+ @SuppressWarnings({ "fallthrough", "rawtypes", "unchecked" })
private static void binarySort(Object[] a, int lo, int hi, int start) {
assert lo <= start && start <= hi;
if (start == lo)
start++;
for ( ; start < hi; start++) {
- @SuppressWarnings("unchecked")
- Comparable