libjava/classpath/ChangeLog.gcj:
2007-05-31 Matthias Klose <doko@ubuntu.com> * javax/management/NotificationBroadcasterSupport.java (getNotificationInfo): Add cast. * native/jni/qt-peer/Makefile.am (AM_CXXFLAGS): Add libstdc++ include directories. * native/jni/qt-peer/Makefile.in: Regenerate. libjava/ChangeLog: 2007-06-03 Matthias Klose <doko@ubuntu.com> * java/io/natFileWin32.cc (setFilePermissions): New (stub only). _access: Handle EXEC query, stub only. 2007-06-03 Matthias Klose <doko@ubuntu.com> Merged from classpath: * gnu/java/nio/SelectorProviderImpl.java: Whitespace merge. * java/lang/System.java(inheritedChannel): New. * java/lang/Character.java: Remove stray`;'. * java/net/MulticastSocket.java: Merged. * java/text/DateFormatSymbols.java(getInstance): New, comment updates. * java/text/Collator.java(getInstance): Merged. * java/util/Calendar.java: New attributes ALL_STYLES, SHORT, LONG. getDisplayName, getDisplayNames: New. * java/util/logging/Logger.java: Merged. * Regenerate .class and .h files. 2007-06-03 Matthias Klose <doko@ubuntu.com> * java/io/File.java: Merge with classpath-0.95, new method setFilePermissions, new attribute EXEC. * java/io/natFilePosix.cc (setFilePermissions): New. _access: Handle EXEC query. * classpath/lib/java/io/File.class, java/io/File.h: Regenerate. 2007-06-03 Matthias Klose <doko@ubuntu.com> Imported GNU Classpath 0.95. * classpath/Makefile.in, classpath/native/jni/midi-dssi/Makefile.in, classpath/native/jni/classpath/Makefile.in, classpath/native/jni/Makefile.in, classpath/native/jni/gconf-peer/Makefile.in, classpath/native/jni/java-io/Makefile.in, classpath/native/jni/native-lib/Makefile.in, classpath/native/jni/java-util/Makefile.in, classpath/native/jni/midi-alsa/Makefile.in, classpath/native/jni/java-lang/Makefile.in, classpath/native/jni/java-nio/Makefile.in, classpath/native/jni/java-net/Makefile.in, classpath/native/jni/xmlj/Makefile.in, classpath/native/jni/qt-peer/Makefile.in, classpath/native/jni/gtk-peer/Makefile.in, classpath/native/Makefile.in, classpath/native/jawt/Makefile.in, classpath/native/fdlibm/Makefile.in, classpath/native/plugin/Makefile.in, classpath/resource/Makefile.in, classpath/scripts/Makefile.in, classpath/tools/Makefile.in, classpath/doc/Makefile.in, classpath/doc/api/Makefile.in, classpath/lib/Makefile.in, classpath/external/Makefile.in, classpath/external/jsr166/Makefile.in, classpath/external/sax/Makefile.in, classpath/external/w3c_dom/Makefile.in, classpath/external/relaxngDatatype/Makefile.in, classpath/include/Makefile.in, classpath/examples/Makefile.in: Regenerate. * classpath/config.guess, classpath/config.sub, classpath/ltmain.sh : Update. * classpath/configure, classpath/depcomp, classpath/missing, classpath/aclocal.m4, classpath/install-sh: Regenerate. * gnu/classpath/Configuration.java (CLASSPATH_VERSION): Now 0.95. * sources.am: Regenerate. * Makefile.in: Regenerate. * Update the .class files and generated CNI header files, add new .class and generated CNI header files. * Remove generated files for removed java source files: classpath/gnu/java/net/BASE64.java, classpath/gnu/java/security/util/Base64.java, classpath/gnu/java/awt/peer/gtk/GThreadMutex.java, classpath/gnu/java/awt/peer/gtk/GThreadNativeMethodRunner.java, classpath/gnu/java/awt/font/autofit/Scaler.java, classpath/gnu/classpath/jdwp/util/Value.java, classpath/gnu/javax/net/ssl/Base64.java. * Remove empty directories. * Makefile.am(nat_source_files): Add natVMOperatingSystemMXBeanImpl.cc. * java/lang/Class.java(setAccessible): Merge from classpath. * java/util/Locale.java: Remove. * gnu/java/lang/management/VMOperatingSystemMXBeanImpl.java, gnu/java/lang/management/natVMOperatingSystemMXBeanImpl.cc: New. * gcj/javaprims.h: Update class declarations. * scripts/classes.pl: Update usage. * HACKING: Mention to build all peers. From-SVN: r125302
This commit is contained in:
parent
af333b9a7f
commit
e1bea0c068
2951 changed files with 80982 additions and 68583 deletions
|
@ -1139,7 +1139,7 @@ public class FTPConnection
|
|||
* @param pathname the directory pathname, or null
|
||||
* @return a list of filenames(strings)
|
||||
*/
|
||||
public List nameList(String pathname)
|
||||
public List<String> nameList(String pathname)
|
||||
throws IOException
|
||||
{
|
||||
if (dtp == null || transferMode == MODE_STREAM)
|
||||
|
@ -1164,7 +1164,7 @@ public class FTPConnection
|
|||
in = new BufferedInputStream(in);
|
||||
in = new CRLFInputStream(in); // TODO ensure that TYPE is correct
|
||||
LineInputStream li = new LineInputStream(in);
|
||||
List ret = new ArrayList();
|
||||
ArrayList<String> ret = new ArrayList<String>();
|
||||
for (String line = li.readLine();
|
||||
line != null;
|
||||
line = li.readLine())
|
||||
|
|
|
@ -50,7 +50,9 @@ import java.net.InetAddress;
|
|||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.security.AccessController;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
|
@ -112,7 +114,7 @@ public class FTPURLConnection
|
|||
{
|
||||
username = "anonymous";
|
||||
GetLocalHostAction a = new GetLocalHostAction();
|
||||
InetAddress localhost =(InetAddress) AccessController.doPrivileged(a);
|
||||
InetAddress localhost = AccessController.doPrivileged(a);
|
||||
password = SystemProperties.getProperty("user.name") + "@" +
|
||||
((localhost == null) ? "localhost" : localhost.getHostName());
|
||||
}
|
||||
|
@ -232,9 +234,9 @@ public class FTPURLConnection
|
|||
return null;
|
||||
}
|
||||
|
||||
public Map getRequestProperties()
|
||||
public Map<String, List<String>> getRequestProperties()
|
||||
{
|
||||
Map map = new HashMap();
|
||||
Map<String, List<String>> map = new HashMap<String, List<String>>();
|
||||
addRequestPropertyValue(map, "passive");
|
||||
addRequestPropertyValue(map, "representationType");
|
||||
addRequestPropertyValue(map, "fileStructure");
|
||||
|
@ -242,10 +244,13 @@ public class FTPURLConnection
|
|||
return map;
|
||||
}
|
||||
|
||||
private void addRequestPropertyValue(Map map, String key)
|
||||
private void addRequestPropertyValue(Map<String, List<String>> map,
|
||||
String key)
|
||||
{
|
||||
String value = getRequestProperty(key);
|
||||
map.put(key, value);
|
||||
ArrayList<String> l = new ArrayList<String>();
|
||||
l.add(value);
|
||||
map.put(key, l);
|
||||
}
|
||||
|
||||
public void setRequestProperty(String key, String value)
|
||||
|
|
|
@ -58,10 +58,6 @@ import java.net.ProtocolException;
|
|||
public class ChunkedInputStream
|
||||
extends InputStream
|
||||
{
|
||||
|
||||
private static final byte CR = 0x0d;
|
||||
private static final byte LF = 0x0a;
|
||||
|
||||
Headers headers;
|
||||
|
||||
/** The underlying stream. */
|
||||
|
|
|
@ -129,7 +129,7 @@ public class HTTPConnection
|
|||
*/
|
||||
protected int minorVersion;
|
||||
|
||||
private final List handshakeCompletedListeners;
|
||||
private final List<HandshakeCompletedListener> handshakeCompletedListeners;
|
||||
|
||||
/**
|
||||
* The socket this connection communicates on.
|
||||
|
@ -154,7 +154,7 @@ public class HTTPConnection
|
|||
/**
|
||||
* Nonce values seen by this connection.
|
||||
*/
|
||||
private Map nonceCounts;
|
||||
private Map<String, Integer> nonceCounts;
|
||||
|
||||
/**
|
||||
* The cookie manager for this connection.
|
||||
|
@ -244,7 +244,8 @@ public class HTTPConnection
|
|||
this.connectionTimeout = connectionTimeout;
|
||||
this.timeout = timeout;
|
||||
majorVersion = minorVersion = 1;
|
||||
handshakeCompletedListeners = new ArrayList(2);
|
||||
handshakeCompletedListeners
|
||||
= new ArrayList<HandshakeCompletedListener>(2);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -357,7 +358,8 @@ public class HTTPConnection
|
|||
/**
|
||||
* The pool
|
||||
*/
|
||||
final LinkedList connectionPool = new LinkedList();
|
||||
final LinkedList<HTTPConnection> connectionPool
|
||||
= new LinkedList<HTTPConnection>();
|
||||
|
||||
/**
|
||||
* Maximum size of the pool.
|
||||
|
@ -857,7 +859,7 @@ public class HTTPConnection
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
return((Integer) nonceCounts.get(nonce)).intValue();
|
||||
return nonceCounts.get(nonce).intValue();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -868,7 +870,7 @@ public class HTTPConnection
|
|||
int current = getNonceCount(nonce);
|
||||
if (nonceCounts == null)
|
||||
{
|
||||
nonceCounts = new HashMap();
|
||||
nonceCounts = new HashMap<String, Integer>();
|
||||
}
|
||||
nonceCounts.put(nonce, new Integer(current + 1));
|
||||
}
|
||||
|
|
|
@ -50,11 +50,11 @@ import java.net.URL;
|
|||
import java.security.cert.Certificate;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.net.ssl.HandshakeCompletedEvent;
|
||||
import javax.net.ssl.HandshakeCompletedListener;
|
||||
import javax.net.ssl.HostnameVerifier;
|
||||
import javax.net.ssl.HttpsURLConnection;
|
||||
import javax.net.ssl.SSLPeerUnverifiedException;
|
||||
import javax.net.ssl.SSLSocketFactory;
|
||||
|
@ -170,7 +170,8 @@ public class HTTPURLConnection
|
|||
if (secure)
|
||||
{
|
||||
SSLSocketFactory factory = getSSLSocketFactory();
|
||||
HostnameVerifier verifier = getHostnameVerifier();
|
||||
// FIXME: use the verifier
|
||||
// HostnameVerifier verifier = getHostnameVerifier();
|
||||
if (factory != null)
|
||||
{
|
||||
connection.setSSLSocketFactory(factory);
|
||||
|
@ -428,12 +429,12 @@ public class HTTPURLConnection
|
|||
return requestHeaders.getValue(key);
|
||||
}
|
||||
|
||||
public Map getRequestProperties()
|
||||
public Map<String, List<String>> getRequestProperties()
|
||||
{
|
||||
if (connected)
|
||||
throw new IllegalStateException("Already connected");
|
||||
|
||||
Map m = requestHeaders.getAsMap();
|
||||
Map<String, List<String>> m = requestHeaders.getAsMap();
|
||||
return Collections.unmodifiableMap(m);
|
||||
}
|
||||
|
||||
|
@ -509,7 +510,7 @@ public class HTTPURLConnection
|
|||
return errorSink;
|
||||
}
|
||||
|
||||
public Map getHeaderFields()
|
||||
public Map<String,List<String>> getHeaderFields()
|
||||
{
|
||||
if (!connected)
|
||||
{
|
||||
|
@ -522,7 +523,7 @@ public class HTTPURLConnection
|
|||
return null;
|
||||
}
|
||||
}
|
||||
Map m = response.getHeaders().getAsMap();
|
||||
Map<String,List<String>> m = response.getHeaders().getAsMap();
|
||||
m.put(null, Collections.singletonList(getStatusLine(response)));
|
||||
return Collections.unmodifiableMap(m);
|
||||
}
|
||||
|
|
|
@ -42,6 +42,7 @@ import gnu.java.net.LineInputStream;
|
|||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.lang.Iterable;
|
||||
import java.text.DateFormat;
|
||||
import java.text.ParseException;
|
||||
import java.util.ArrayList;
|
||||
|
@ -49,6 +50,7 @@ import java.util.Collections;
|
|||
import java.util.Date;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
|
@ -60,12 +62,13 @@ import java.util.Map;
|
|||
* @author Chris Burdess (dog@gnu.org)
|
||||
* @author David Daney (ddaney@avtrex.com)
|
||||
*/
|
||||
class Headers
|
||||
class Headers implements Iterable<Headers.HeaderElement>
|
||||
{
|
||||
/**
|
||||
* A list of HeaderElements
|
||||
*/
|
||||
private final ArrayList headers = new ArrayList();
|
||||
private final ArrayList<HeaderElement> headers
|
||||
= new ArrayList<HeaderElement>();
|
||||
|
||||
/**
|
||||
* The HTTP dateformat used to parse date header fields.
|
||||
|
@ -102,7 +105,7 @@ class Headers
|
|||
*
|
||||
* @return the Iterator.
|
||||
*/
|
||||
Iterator iterator()
|
||||
public Iterator<HeaderElement> iterator()
|
||||
{
|
||||
return headers.iterator();
|
||||
}
|
||||
|
@ -118,7 +121,7 @@ class Headers
|
|||
{
|
||||
for (int i = headers.size() - 1; i >= 0; i--)
|
||||
{
|
||||
HeaderElement e = (HeaderElement)headers.get(i);
|
||||
HeaderElement e = headers.get(i);
|
||||
if (e.name.equalsIgnoreCase(header))
|
||||
{
|
||||
return e.value;
|
||||
|
@ -219,7 +222,7 @@ class Headers
|
|||
{
|
||||
for (int i = headers.size() - 1; i >= 0; i--)
|
||||
{
|
||||
HeaderElement e = (HeaderElement)headers.get(i);
|
||||
HeaderElement e = headers.get(i);
|
||||
if (e.name.equalsIgnoreCase(name))
|
||||
{
|
||||
e.value = value;
|
||||
|
@ -240,9 +243,9 @@ class Headers
|
|||
*/
|
||||
public void putAll(Headers o)
|
||||
{
|
||||
for (Iterator it = o.iterator(); it.hasNext(); )
|
||||
for (Iterator<HeaderElement> it = o.iterator(); it.hasNext(); )
|
||||
{
|
||||
HeaderElement e = (HeaderElement)it.next();
|
||||
HeaderElement e = it.next();
|
||||
remove(e.name);
|
||||
addValue(e.name, e.value);
|
||||
}
|
||||
|
@ -256,9 +259,9 @@ class Headers
|
|||
*/
|
||||
public void remove(String name)
|
||||
{
|
||||
for (Iterator it = headers.iterator(); it.hasNext(); )
|
||||
for (Iterator<HeaderElement> it = headers.iterator(); it.hasNext(); )
|
||||
{
|
||||
HeaderElement e = (HeaderElement)it.next();
|
||||
HeaderElement e = it.next();
|
||||
if (e.name.equalsIgnoreCase(name))
|
||||
it.remove();
|
||||
}
|
||||
|
@ -358,26 +361,26 @@ class Headers
|
|||
*
|
||||
* @return a Map containing all the headers.
|
||||
*/
|
||||
public Map getAsMap()
|
||||
public Map<String,List<String>> getAsMap()
|
||||
{
|
||||
LinkedHashMap m = new LinkedHashMap();
|
||||
for (Iterator it = headers.iterator(); it.hasNext(); )
|
||||
LinkedHashMap<String,List<String>> m = new LinkedHashMap<String,List<String>>();
|
||||
for (Iterator<HeaderElement> it = headers.iterator(); it.hasNext(); )
|
||||
{
|
||||
HeaderElement e = (HeaderElement)it.next();
|
||||
ArrayList l = (ArrayList)m.get(e.name);
|
||||
HeaderElement e = it.next();
|
||||
ArrayList<String> l = (ArrayList<String>)m.get(e.name);
|
||||
if (l == null)
|
||||
{
|
||||
l = new ArrayList(1);
|
||||
l = new ArrayList<String>(1);
|
||||
l.add(e.value);
|
||||
m.put(e.name, l);
|
||||
}
|
||||
else
|
||||
l.add(0, e.value);
|
||||
}
|
||||
for (Iterator it = m.entrySet().iterator(); it.hasNext(); )
|
||||
for (Iterator<Map.Entry<String,List<String>>> it = m.entrySet().iterator(); it.hasNext(); )
|
||||
{
|
||||
Map.Entry me = (Map.Entry)it.next();
|
||||
ArrayList l = (ArrayList)me.getValue();
|
||||
Map.Entry<String,List<String>> me = it.next();
|
||||
List<String> l = me.getValue();
|
||||
me.setValue(Collections.unmodifiableList(l));
|
||||
}
|
||||
return m;
|
||||
|
@ -397,7 +400,7 @@ class Headers
|
|||
if (i >= headers.size() || i < 0)
|
||||
return null;
|
||||
|
||||
return ((HeaderElement)headers.get(i)).name;
|
||||
return headers.get(i).name;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -414,8 +417,6 @@ class Headers
|
|||
if (i >= headers.size() || i < 0)
|
||||
return null;
|
||||
|
||||
return ((HeaderElement)headers.get(i)).value;
|
||||
return headers.get(i).value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Request.java --
|
||||
Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
|
@ -38,8 +38,8 @@ exception statement from your version. */
|
|||
|
||||
package gnu.java.net.protocol.http;
|
||||
|
||||
import gnu.java.net.BASE64;
|
||||
import gnu.java.net.LineInputStream;
|
||||
import gnu.java.util.Base64;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
@ -96,7 +96,7 @@ public class Request
|
|||
/**
|
||||
* Map of response header handlers.
|
||||
*/
|
||||
protected Map responseHeaderHandlers;
|
||||
protected Map<String, ResponseHeaderHandler> responseHeaderHandlers;
|
||||
|
||||
/**
|
||||
* The authenticator.
|
||||
|
@ -121,7 +121,7 @@ public class Request
|
|||
this.method = method;
|
||||
this.path = path;
|
||||
requestHeaders = new Headers();
|
||||
responseHeaderHandlers = new HashMap();
|
||||
responseHeaderHandlers = new HashMap<String, ResponseHeaderHandler>();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -302,9 +302,8 @@ public class Request
|
|||
String line = method + ' ' + requestUri + ' ' + version + CRLF;
|
||||
out.write(line.getBytes(US_ASCII));
|
||||
// Request headers
|
||||
for (Iterator i = requestHeaders.iterator(); i.hasNext(); )
|
||||
for (Headers.HeaderElement elt : requestHeaders)
|
||||
{
|
||||
Headers.HeaderElement elt = (Headers.HeaderElement)i.next();
|
||||
line = elt.name + HEADER_SEP + elt.value + CRLF;
|
||||
out.write(line.getBytes(US_ASCII));
|
||||
}
|
||||
|
@ -439,9 +438,8 @@ public class Request
|
|||
|
||||
void notifyHeaderHandlers(Headers headers)
|
||||
{
|
||||
for (Iterator i = headers.iterator(); i.hasNext(); )
|
||||
for (Headers.HeaderElement entry : headers)
|
||||
{
|
||||
Headers.HeaderElement entry = (Headers.HeaderElement) i.next();
|
||||
// Handle Set-Cookie
|
||||
if ("Set-Cookie".equalsIgnoreCase(entry.name))
|
||||
handleSetCookie(entry.value);
|
||||
|
@ -461,7 +459,6 @@ public class Request
|
|||
throws IOException
|
||||
{
|
||||
long contentLength = -1;
|
||||
Headers trailer = null;
|
||||
|
||||
// Persistent connections are the default in HTTP/1.1
|
||||
boolean doClose = "close".equalsIgnoreCase(getHeader("Connection")) ||
|
||||
|
@ -532,7 +529,7 @@ public class Request
|
|||
Credentials creds = authenticator.getCredentials(realm, attempts);
|
||||
String userPass = creds.getUsername() + ':' + creds.getPassword();
|
||||
byte[] b_userPass = userPass.getBytes("US-ASCII");
|
||||
byte[] b_encoded = BASE64.encode(b_userPass);
|
||||
byte[] b_encoded = Base64.encode(b_userPass).getBytes("US-ASCII");
|
||||
String authorization =
|
||||
scheme + " " + new String(b_encoded, "US-ASCII");
|
||||
setHeader("Authorization", authorization);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* CookieManager.java --
|
||||
Copyright (C) 2004 Free Software Foundation, Inc.
|
||||
Copyright (C) 2004, 2006 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
|
@ -42,7 +42,6 @@ import java.util.ArrayList;
|
|||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
|
@ -59,23 +58,23 @@ public class SimpleCookieManager
|
|||
* The cookie cache.
|
||||
* This is a dictionary mapping domains to maps of cookies by name.
|
||||
*/
|
||||
protected Map cookies;
|
||||
protected Map<String, Map<String, Cookie>> cookies;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
public SimpleCookieManager()
|
||||
{
|
||||
cookies = new HashMap();
|
||||
cookies = new HashMap<String, Map<String, Cookie>>();
|
||||
}
|
||||
|
||||
public void setCookie(Cookie cookie)
|
||||
{
|
||||
String domain = cookie.getDomain();
|
||||
Map map =(Map) cookies.get(domain);
|
||||
Map<String, Cookie> map = cookies.get(domain);
|
||||
if (map == null)
|
||||
{
|
||||
map = new HashMap();
|
||||
map = new HashMap<String, Cookie>();
|
||||
cookies.put(domain, map);
|
||||
}
|
||||
String name = cookie.getName();
|
||||
|
@ -84,7 +83,7 @@ public class SimpleCookieManager
|
|||
|
||||
public Cookie[] getCookies(String host, boolean secure, String path)
|
||||
{
|
||||
List matches = new ArrayList();
|
||||
ArrayList<Cookie> matches = new ArrayList<Cookie>();
|
||||
Date now = new Date();
|
||||
if (Character.isLetter(host.charAt(0)))
|
||||
{
|
||||
|
@ -102,17 +101,16 @@ public class SimpleCookieManager
|
|||
return ret;
|
||||
}
|
||||
|
||||
private void addCookies(List matches, String domain, boolean secure,
|
||||
String path, Date now)
|
||||
private void addCookies(ArrayList<Cookie> matches, String domain,
|
||||
boolean secure, String path, Date now)
|
||||
{
|
||||
Map map = (Map) cookies.get(domain);
|
||||
Map<String, Cookie> map = cookies.get(domain);
|
||||
if (map != null)
|
||||
{
|
||||
List expired = new ArrayList();
|
||||
for (Iterator i = map.entrySet().iterator(); i.hasNext(); )
|
||||
ArrayList<String> expired = new ArrayList<String>();
|
||||
for (Map.Entry<String, Cookie> entry : map.entrySet())
|
||||
{
|
||||
Map.Entry entry = (Map.Entry) i.next();
|
||||
Cookie cookie = (Cookie) entry.getValue();
|
||||
Cookie cookie = entry.getValue();
|
||||
Date expires = cookie.getExpiryDate();
|
||||
if (expires != null && expires.before(now))
|
||||
{
|
||||
|
@ -129,7 +127,7 @@ public class SimpleCookieManager
|
|||
}
|
||||
}
|
||||
// Good housekeeping
|
||||
for (Iterator i = expired.iterator(); i.hasNext(); )
|
||||
for (Iterator<String> i = expired.iterator(); i.hasNext(); )
|
||||
{
|
||||
map.remove(i.next());
|
||||
}
|
||||
|
|
|
@ -76,7 +76,8 @@ public final class Connection extends JarURLConnection
|
|||
|
||||
public static class JarFileCache
|
||||
{
|
||||
private static Hashtable cache = new Hashtable();
|
||||
private static Hashtable<URL, JarFile> cache
|
||||
= new Hashtable<URL, JarFile>();
|
||||
private static final int READBUFSIZE = 4*1024;
|
||||
|
||||
public static synchronized JarFile get (URL url, boolean useCaches)
|
||||
|
@ -85,7 +86,7 @@ public final class Connection extends JarURLConnection
|
|||
JarFile jf;
|
||||
if (useCaches)
|
||||
{
|
||||
jf = (JarFile) cache.get (url);
|
||||
jf = cache.get (url);
|
||||
if (jf != null)
|
||||
return jf;
|
||||
}
|
||||
|
|
|
@ -164,7 +164,7 @@ public class Handler extends URLStreamHandler
|
|||
if (jar_path.indexOf("/.") < 0)
|
||||
return url_string;
|
||||
|
||||
ArrayList tokens = new ArrayList();
|
||||
ArrayList<String> tokens = new ArrayList<String>();
|
||||
StringTokenizer st = new StringTokenizer(jar_path, "/");
|
||||
while (st.hasMoreTokens())
|
||||
{
|
||||
|
@ -183,7 +183,7 @@ public class Handler extends URLStreamHandler
|
|||
StringBuffer path = new StringBuffer(url_string.length());
|
||||
path.append(url_string.substring(0, jar_stop + 1));
|
||||
|
||||
Iterator it = tokens.iterator();
|
||||
Iterator<String> it = tokens.iterator();
|
||||
while (it.hasNext())
|
||||
path.append('/').append(it.next());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue