mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-12-05 09:44:10 +08:00
re GNATS libgcj/38 (Static initializer in DecimalFormat eventually depends on itself)
2000-02-25 Bryce McKinlay <bryce@albatross.co.nz> * java/net/URLConnection.java (initializeDateFormats): New private method. (getHeaderFieldDate): Call initializeDateFormats if required. locale, dateFormat1, dateFormat2, dateFormat3: Don't initialize these. Fix for PR libgcj/38. From-SVN: r32153
This commit is contained in:
parent
0ad913af75
commit
4ae4a3c973
@ -1,3 +1,12 @@
|
||||
2000-02-25 Bryce McKinlay <bryce@albatross.co.nz>
|
||||
|
||||
* java/net/URLConnection.java (initializeDateFormats): New
|
||||
private method.
|
||||
(getHeaderFieldDate): Call initializeDateFormats if required.
|
||||
locale, dateFormat1, dateFormat2, dateFormat3: Don't initialize
|
||||
these.
|
||||
Fix for PR libgcj/38.
|
||||
|
||||
2000-02-24 Warren Levy <warrenl@cygnus.com>
|
||||
|
||||
* java/math/BigInteger.java(ival): Made private.
|
||||
|
@ -47,13 +47,9 @@ public abstract class URLConnection
|
||||
private static ContentHandlerFactory factory;
|
||||
private static ContentHandler contentHandler;
|
||||
private static Hashtable handlers = new Hashtable();
|
||||
private static Locale locale = new Locale("En", "Us", "Unix");
|
||||
private static SimpleDateFormat dateFormat1 =
|
||||
new SimpleDateFormat("EEE, dd MMM yyyy hh:mm:ss 'GMT'", locale);
|
||||
private static SimpleDateFormat dateFormat2 =
|
||||
new SimpleDateFormat("EEEE, dd-MMM-yy hh:mm:ss 'GMT'", locale);
|
||||
private static SimpleDateFormat dateFormat3 =
|
||||
new SimpleDateFormat("EEE MMM d hh:mm:ss yyyy", locale);
|
||||
private static Locale locale;
|
||||
private static SimpleDateFormat dateFormat1, dateFormat2, dateFormat3;
|
||||
private static boolean dateformats_initialized = false;
|
||||
|
||||
protected URLConnection(URL url)
|
||||
{
|
||||
@ -128,6 +124,8 @@ public abstract class URLConnection
|
||||
|
||||
public long getHeaderFieldDate(String name, long val)
|
||||
{
|
||||
if (! dateformats_initialized)
|
||||
initializeDateFormats();
|
||||
String str = getHeaderField(name);
|
||||
if (str != null)
|
||||
{
|
||||
@ -437,4 +435,20 @@ public abstract class URLConnection
|
||||
handlers.put(contentType, contentType);
|
||||
return null;
|
||||
}
|
||||
|
||||
// We don't put these in a static initializer, because it creates problems
|
||||
// with initializer co-dependency: SimpleDateFormat's constructors eventually
|
||||
// depend on URLConnection (via the java.text.*Symbols classes).
|
||||
private synchronized void initializeDateFormats()
|
||||
{
|
||||
if (dateformats_initialized)
|
||||
return;
|
||||
locale = new Locale("En", "Us", "Unix");
|
||||
dateFormat1 = new SimpleDateFormat("EEE, dd MMM yyyy hh:mm:ss 'GMT'",
|
||||
locale);
|
||||
dateFormat2 = new SimpleDateFormat("EEEE, dd-MMM-yy hh:mm:ss 'GMT'",
|
||||
locale);
|
||||
dateFormat3 = new SimpleDateFormat("EEE MMM d hh:mm:ss yyyy", locale);
|
||||
dateformats_initialized = true;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user