public final class org.glassfish.grizzly.http.util.FastHttpDateFormat extends java.lang.Object
{
private static final java.lang.String ASCII_CHARSET_NAME;
private static final int CACHE_SIZE;
private static final java.util.TimeZone GMT_TIME_ZONE;
private static final org.glassfish.grizzly.http.util.FastHttpDateFormat$SimpleDateFormatter FORMATTER;
private static final java.lang.ThreadLocal FORMAT;
private static final java.lang.ThreadLocal FORMATS;
private static volatile long nextGeneration;
private static final java.util.concurrent.atomic.AtomicBoolean isGeneratingNow;
private static final java.lang.StringBuffer currentDateBuffer;
private static byte[] currentDateBytes;
private static java.lang.String cachedStringDate;
private static volatile byte[] dateBytesForCachedStringDate;
private static final java.util.concurrent.ConcurrentMap formatCache;
private static final java.util.concurrent.ConcurrentMap parseCache;
public void <init>()
{
org.glassfish.grizzly.http.util.FastHttpDateFormat v;
v := @this: org.glassfish.grizzly.http.util.FastHttpDateFormat;
specialinvoke v.<java.lang.Object: void <init>()>();
return;
}
public static java.lang.String getCurrentDate()
{
byte[] v, v;
java.lang.String v, v, v;
java.io.UnsupportedEncodingException v;
v = staticinvoke <org.glassfish.grizzly.http.util.FastHttpDateFormat: byte[] getCurrentDateBytes()>();
v = <org.glassfish.grizzly.http.util.FastHttpDateFormat: byte[] dateBytesForCachedStringDate>;
if v == v goto label;
label:
v = new java.lang.String;
v = <org.glassfish.grizzly.http.util.FastHttpDateFormat: java.lang.String ASCII_CHARSET_NAME>;
specialinvoke v.<java.lang.String: void <init>(byte[],java.lang.String)>(v, v);
<org.glassfish.grizzly.http.util.FastHttpDateFormat: java.lang.String cachedStringDate> = v;
<org.glassfish.grizzly.http.util.FastHttpDateFormat: byte[] dateBytesForCachedStringDate> = v;
label:
goto label;
label:
v := @caughtexception;
label:
v = <org.glassfish.grizzly.http.util.FastHttpDateFormat: java.lang.String cachedStringDate>;
return v;
catch java.io.UnsupportedEncodingException from label to label with label;
}
public static byte[] getCurrentDateBytes()
{
java.lang.Throwable v;
byte[] v, v;
java.util.concurrent.atomic.AtomicBoolean v, v, v;
long v, v, v, v, v;
byte v, v, v;
java.lang.StringBuffer v, v, v;
boolean v, v;
java.lang.ThreadLocal v;
org.glassfish.grizzly.http.util.FastHttpDateFormat$SimpleDateFormatter v;
v = staticinvoke <java.lang.System: long currentTimeMillis()>();
v = <org.glassfish.grizzly.http.util.FastHttpDateFormat: long nextGeneration>;
v = v - v;
v = v cmp 0L;
if v <= 0 goto label;
v = v cmp 5000L;
if v > 0 goto label;
v = <org.glassfish.grizzly.http.util.FastHttpDateFormat: java.util.concurrent.atomic.AtomicBoolean isGeneratingNow>;
v = virtualinvoke v.<java.util.concurrent.atomic.AtomicBoolean: boolean get()>();
if v != 0 goto label;
v = <org.glassfish.grizzly.http.util.FastHttpDateFormat: java.util.concurrent.atomic.AtomicBoolean isGeneratingNow>;
v = virtualinvoke v.<java.util.concurrent.atomic.AtomicBoolean: boolean compareAndSet(boolean,boolean)>(0, 1);
if v == 0 goto label;
label:
v = <org.glassfish.grizzly.http.util.FastHttpDateFormat: java.lang.ThreadLocal FORMAT>;
entermonitor v;
label:
v = <org.glassfish.grizzly.http.util.FastHttpDateFormat: long nextGeneration>;
v = v cmp v;
if v <= 0 goto label;
v = <org.glassfish.grizzly.http.util.FastHttpDateFormat: java.lang.StringBuffer currentDateBuffer>;
virtualinvoke v.<java.lang.StringBuffer: void setLength(int)>(0);
v = <org.glassfish.grizzly.http.util.FastHttpDateFormat: org.glassfish.grizzly.http.util.FastHttpDateFormat$SimpleDateFormatter FORMATTER>;
v = <org.glassfish.grizzly.http.util.FastHttpDateFormat: java.lang.StringBuffer currentDateBuffer>;
virtualinvoke v.<org.glassfish.grizzly.http.util.FastHttpDateFormat$SimpleDateFormatter: java.lang.StringBuffer formatTo(long,java.lang.StringBuffer)>(v, v);
v = <org.glassfish.grizzly.http.util.FastHttpDateFormat: java.lang.StringBuffer currentDateBuffer>;
v = staticinvoke <org.glassfish.grizzly.http.util.HttpCodecUtils: byte[] toCheckedByteArray(java.lang.CharSequence)>(v);
<org.glassfish.grizzly.http.util.FastHttpDateFormat: byte[] currentDateBytes> = v;
v = v + 1000L;
<org.glassfish.grizzly.http.util.FastHttpDateFormat: long nextGeneration> = v;
label:
v = <org.glassfish.grizzly.http.util.FastHttpDateFormat: java.util.concurrent.atomic.AtomicBoolean isGeneratingNow>;
virtualinvoke v.<java.util.concurrent.atomic.AtomicBoolean: void set(boolean)>(0);
exitmonitor v;
label:
goto label;
label:
v := @caughtexception;
exitmonitor v;
throw v;
label:
v = <org.glassfish.grizzly.http.util.FastHttpDateFormat: byte[] currentDateBytes>;
return v;
catch java.lang.Throwable from label to label with label;
}
public static java.lang.String formatDate(long, java.text.DateFormat)
{
java.lang.ThreadLocal v;
long v, v, v;
java.util.concurrent.ConcurrentMap v;
java.lang.Long v, v;
java.lang.Object v, v;
java.lang.String v;
java.text.DateFormat v;
v := @parameter: long;
v := @parameter: java.text.DateFormat;
v = v / 1000L;
v = v * 1000L;
v = staticinvoke <java.lang.Long: java.lang.Long valueOf(long)>(v);
v = <org.glassfish.grizzly.http.util.FastHttpDateFormat: java.util.concurrent.ConcurrentMap formatCache>;
v = interfaceinvoke v.<java.util.concurrent.ConcurrentMap: java.lang.Object get(java.lang.Object)>(v);
if v == null goto label;
return v;
label:
if v == null goto label;
v = staticinvoke <java.lang.Long: java.lang.Long valueOf(long)>(v);
v = virtualinvoke v.<java.text.DateFormat: java.lang.String format(java.lang.Object)>(v);
goto label;
label:
v = <org.glassfish.grizzly.http.util.FastHttpDateFormat: java.lang.ThreadLocal FORMAT>;
v = virtualinvoke v.<java.lang.ThreadLocal: java.lang.Object get()>();
v = virtualinvoke v.<org.glassfish.grizzly.http.util.FastHttpDateFormat$SimpleDateFormatter: java.lang.String format(long)>(v);
label:
staticinvoke <org.glassfish.grizzly.http.util.FastHttpDateFormat: void updateFormatCache(java.lang.Long,java.lang.String)>(v, v);
return v;
}
public static long parseDate(java.lang.String, java.text.DateFormat[])
{
java.lang.ThreadLocal v;
java.text.DateFormat[] v;
long v, v;
java.util.concurrent.ConcurrentMap v;
byte v;
java.lang.Long v;
java.lang.Object v, v;
java.lang.String v;
v := @parameter: java.lang.String;
v := @parameter: java.text.DateFormat[];
v = <org.glassfish.grizzly.http.util.FastHttpDateFormat: java.util.concurrent.ConcurrentMap parseCache>;
v = interfaceinvoke v.<java.util.concurrent.ConcurrentMap: java.lang.Object get(java.lang.Object)>(v);
if v == null goto label;
v = virtualinvoke v.<java.lang.Long: long longValue()>();
return v;
label:
if v == null goto label;
v = staticinvoke <org.glassfish.grizzly.http.util.FastHttpDateFormat: long internalParseDate(java.lang.String,java.text.DateFormat[])>(v, v);
goto label;
label:
v = <org.glassfish.grizzly.http.util.FastHttpDateFormat: java.lang.ThreadLocal FORMATS>;
v = virtualinvoke v.<java.lang.ThreadLocal: java.lang.Object get()>();
v = staticinvoke <org.glassfish.grizzly.http.util.FastHttpDateFormat: long internalParseDate(java.lang.String,java.text.DateFormat[])>(v, v);
label:
v = v cmp -1L;
if v == 0 goto label;
v = staticinvoke <java.lang.Long: java.lang.Long valueOf(long)>(v);
staticinvoke <org.glassfish.grizzly.http.util.FastHttpDateFormat: void updateParseCache(java.lang.String,java.lang.Long)>(v, v);
label:
return v;
}
private static long internalParseDate(java.lang.String, java.text.DateFormat[])
{
java.util.Date v;
java.text.DateFormat[] v;
long v;
int v, v;
java.lang.String v;
java.text.ParseException v;
java.text.DateFormat v;
v := @parameter: java.lang.String;
v := @parameter: java.text.DateFormat[];
v = 0;
label:
v = lengthof v;
if v >= v goto label;
label:
v = v[v];
v = virtualinvoke v.<java.text.DateFormat: java.util.Date parse(java.lang.String)>(v);
v = virtualinvoke v.<java.util.Date: long getTime()>();
label:
return v;
label:
v := @caughtexception;
v = v + 1;
goto label;
label:
return -1L;
catch java.text.ParseException from label to label with label;
}
private static void updateFormatCache(java.lang.Long, java.lang.String)
{
java.lang.Long v;
int v;
java.lang.String v;
java.util.concurrent.ConcurrentMap v, v, v;
v := @parameter: java.lang.Long;
v := @parameter: java.lang.String;
if v != null goto label;
return;
label:
v = <org.glassfish.grizzly.http.util.FastHttpDateFormat: java.util.concurrent.ConcurrentMap formatCache>;
v = interfaceinvoke v.<java.util.concurrent.ConcurrentMap: int size()>();
if v <= 1000 goto label;
v = <org.glassfish.grizzly.http.util.FastHttpDateFormat: java.util.concurrent.ConcurrentMap formatCache>;
interfaceinvoke v.<java.util.concurrent.ConcurrentMap: void clear()>();
label:
v = <org.glassfish.grizzly.http.util.FastHttpDateFormat: java.util.concurrent.ConcurrentMap formatCache>;
interfaceinvoke v.<java.util.concurrent.ConcurrentMap: java.lang.Object put(java.lang.Object,java.lang.Object)>(v, v);
return;
}
private static void updateParseCache(java.lang.String, java.lang.Long)
{
java.lang.Long v;
int v;
java.lang.String v;
java.util.concurrent.ConcurrentMap v, v, v;
v := @parameter: java.lang.String;
v := @parameter: java.lang.Long;
v = <org.glassfish.grizzly.http.util.FastHttpDateFormat: java.util.concurrent.ConcurrentMap parseCache>;
v = interfaceinvoke v.<java.util.concurrent.ConcurrentMap: int size()>();
if v <= 1000 goto label;
v = <org.glassfish.grizzly.http.util.FastHttpDateFormat: java.util.concurrent.ConcurrentMap parseCache>;
interfaceinvoke v.<java.util.concurrent.ConcurrentMap: void clear()>();
label:
v = <org.glassfish.grizzly.http.util.FastHttpDateFormat: java.util.concurrent.ConcurrentMap parseCache>;
interfaceinvoke v.<java.util.concurrent.ConcurrentMap: java.lang.Object put(java.lang.Object,java.lang.Object)>(v, v);
return;
}
static void <clinit>()
{
org.glassfish.grizzly.http.util.FastHttpDateFormat$2 v;
org.glassfish.grizzly.http.util.FastHttpDateFormat$1 v;
java.util.TimeZone v;
java.util.concurrent.ConcurrentHashMap v, v;
java.util.concurrent.atomic.AtomicBoolean v;
org.glassfish.grizzly.http.util.FastHttpDateFormat$SimpleDateFormatter v;
java.nio.charset.Charset v;
java.lang.StringBuffer v;
java.lang.String v;
v = <org.glassfish.grizzly.utils.Charsets: java.nio.charset.Charset ASCII_CHARSET>;
v = virtualinvoke v.<java.nio.charset.Charset: java.lang.String name()>();
<org.glassfish.grizzly.http.util.FastHttpDateFormat: java.lang.String ASCII_CHARSET_NAME> = v;
v = staticinvoke <java.util.TimeZone: java.util.TimeZone getTimeZone(java.lang.String)>("GMT");
<org.glassfish.grizzly.http.util.FastHttpDateFormat: java.util.TimeZone GMT_TIME_ZONE> = v;
v = new org.glassfish.grizzly.http.util.FastHttpDateFormat$SimpleDateFormatter;
specialinvoke v.<org.glassfish.grizzly.http.util.FastHttpDateFormat$SimpleDateFormatter: void <init>()>();
<org.glassfish.grizzly.http.util.FastHttpDateFormat: org.glassfish.grizzly.http.util.FastHttpDateFormat$SimpleDateFormatter FORMATTER> = v;
v = new org.glassfish.grizzly.http.util.FastHttpDateFormat$1;
specialinvoke v.<org.glassfish.grizzly.http.util.FastHttpDateFormat$1: void <init>()>();
<org.glassfish.grizzly.http.util.FastHttpDateFormat: java.lang.ThreadLocal FORMAT> = v;
v = new org.glassfish.grizzly.http.util.FastHttpDateFormat$2;
specialinvoke v.<org.glassfish.grizzly.http.util.FastHttpDateFormat$2: void <init>()>();
<org.glassfish.grizzly.http.util.FastHttpDateFormat: java.lang.ThreadLocal FORMATS> = v;
v = new java.util.concurrent.atomic.AtomicBoolean;
specialinvoke v.<java.util.concurrent.atomic.AtomicBoolean: void <init>()>();
<org.glassfish.grizzly.http.util.FastHttpDateFormat: java.util.concurrent.atomic.AtomicBoolean isGeneratingNow> = v;
v = new java.lang.StringBuffer;
specialinvoke v.<java.lang.StringBuffer: void <init>()>();
<org.glassfish.grizzly.http.util.FastHttpDateFormat: java.lang.StringBuffer currentDateBuffer> = v;
v = new java.util.concurrent.ConcurrentHashMap;
specialinvoke v.<java.util.concurrent.ConcurrentHashMap: void <init>(int,float,int)>(1000, 0.75F, 64);
<org.glassfish.grizzly.http.util.FastHttpDateFormat: java.util.concurrent.ConcurrentMap formatCache> = v;
v = new java.util.concurrent.ConcurrentHashMap;
specialinvoke v.<java.util.concurrent.ConcurrentHashMap: void <init>(int,float,int)>(1000, 0.75F, 64);
<org.glassfish.grizzly.http.util.FastHttpDateFormat: java.util.concurrent.ConcurrentMap parseCache> = v;
return;
}
}