--- a/jdk/src/share/classes/java/net/URLConnection.java Thu Sep 15 14:10:30 2011 +0100
+++ b/jdk/src/share/classes/java/net/URLConnection.java Fri Sep 16 12:09:04 2011 -0700
@@ -595,7 +595,7 @@
* @since 1.4
*/
public Map<String,List<String>> getHeaderFields() {
- return Collections.EMPTY_MAP;
+ return Collections.emptyMap();
}
/**
@@ -659,6 +659,7 @@
* <code>Default</code> argument is returned if the field is
* missing or malformed.
*/
+ @SuppressWarnings("deprecation")
public long getHeaderFieldDate(String name, long Default) {
String value = getHeaderField(name);
try {
@@ -1153,7 +1154,7 @@
throw new IllegalStateException("Already connected");
if (requests == null)
- return Collections.EMPTY_MAP;
+ return Collections.emptyMap();
return requests.getHeaders(null);
}
@@ -1236,7 +1237,7 @@
factory = fac;
}
- private static Hashtable handlers = new Hashtable();
+ private static Hashtable<String, ContentHandler> handlers = new Hashtable<>();
/**
* Gets the Content Handler appropriate for this connection.
@@ -1250,7 +1251,7 @@
if (contentType == null)
throw new UnknownServiceException("no content-type");
try {
- handler = (ContentHandler) handlers.get(contentType);
+ handler = handlers.get(contentType);
if (handler != null)
return handler;
} catch(Exception e) {
@@ -1316,7 +1317,7 @@
try {
String clsName = packagePrefix + "." + contentHandlerClassName;
- Class cls = null;
+ Class<?> cls = null;
try {
cls = Class.forName(clsName);
} catch (ClassNotFoundException e) {