link start!
This commit is contained in:
@@ -0,0 +1,153 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package com.tridium.timezone;
|
||||
|
||||
import com.tridium.timezone.HistoricalTimeZoneDate;
|
||||
|
||||
public final class HistoricalDstRule {
|
||||
private String ruleName;
|
||||
private String ruleType;
|
||||
private String ruleLetters;
|
||||
private int daylightAdjMillis;
|
||||
private boolean isStartRule;
|
||||
private HistoricalTimeZoneDate occursOnAnnualDate;
|
||||
private HistoricalTimeZoneDate validFromDate;
|
||||
private HistoricalTimeZoneDate validUntilDate;
|
||||
|
||||
public static final HistoricalDstRule make() {
|
||||
return HistoricalDstRule.make("null", "-", "null", HistoricalTimeZoneDate.makeMinimumDate(), HistoricalTimeZoneDate.makeMinimumDate(), HistoricalTimeZoneDate.makeMinimumDate(), 0);
|
||||
}
|
||||
|
||||
public static final HistoricalDstRule make(String string, String string2, String string3, HistoricalTimeZoneDate historicalTimeZoneDate, HistoricalTimeZoneDate historicalTimeZoneDate2, HistoricalTimeZoneDate historicalTimeZoneDate3, int n) {
|
||||
HistoricalDstRule historicalDstRule = new HistoricalDstRule();
|
||||
historicalDstRule.ruleName = string;
|
||||
historicalDstRule.ruleType = string3;
|
||||
historicalDstRule.ruleLetters = string2;
|
||||
historicalDstRule.validFromDate = historicalTimeZoneDate;
|
||||
historicalDstRule.validUntilDate = historicalTimeZoneDate2;
|
||||
historicalDstRule.occursOnAnnualDate = historicalTimeZoneDate3;
|
||||
historicalDstRule.daylightAdjMillis = n;
|
||||
boolean bl = false;
|
||||
if (historicalDstRule.daylightAdjMillis != 0) {
|
||||
bl = true;
|
||||
}
|
||||
historicalDstRule.isStartRule = bl;
|
||||
return historicalDstRule;
|
||||
}
|
||||
|
||||
public final boolean equals(Object object) {
|
||||
if (this == object) {
|
||||
return true;
|
||||
}
|
||||
if (!(object instanceof HistoricalDstRule)) {
|
||||
return false;
|
||||
}
|
||||
HistoricalDstRule historicalDstRule = (HistoricalDstRule)object;
|
||||
boolean bl = false;
|
||||
if (this.ruleName.equals(historicalDstRule.ruleName) && this.validFromDate.equals(historicalDstRule.validFromDate) && this.validUntilDate.equals(historicalDstRule.validUntilDate) && this.ruleType.equals(historicalDstRule.ruleType) && this.occursOnAnnualDate.equals(historicalDstRule.occursOnAnnualDate) && this.daylightAdjMillis == historicalDstRule.daylightAdjMillis && this.ruleLetters.equals(historicalDstRule.ruleLetters) && this.isStartRule == historicalDstRule.isStartRule) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public final String toString() {
|
||||
String string = this.isStartRule ? "DST starts on" : "DST ends on";
|
||||
return string + ' ' + this.occursOnAnnualDate.toString();
|
||||
}
|
||||
|
||||
public final String toVerboseString() {
|
||||
return " From " + this.validFromDate.toString() + " until " + this.validUntilDate.toString() + " : Change " + this.occursOnAnnualDate.toString() + ' ' + this.daylightAdjMillis + ' ' + this.ruleLetters;
|
||||
}
|
||||
|
||||
public final boolean ruleAppliesForInterval(HistoricalTimeZoneDate historicalTimeZoneDate, HistoricalTimeZoneDate historicalTimeZoneDate2) {
|
||||
if (this.validFromDate.getTheYear() == historicalTimeZoneDate.getTheYear() && this.validUntilDate.getTheYear() == historicalTimeZoneDate2.getTheYear()) {
|
||||
if (this.validUntilDate.getTheYear() - this.validFromDate.getTheYear() >= 2) {
|
||||
return true;
|
||||
}
|
||||
boolean bl = false;
|
||||
if (historicalTimeZoneDate.occursBeforeAbsolute(this.occursOnAnnualDate) && historicalTimeZoneDate2.occursAfterAbsolute(this.occursOnAnnualDate)) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
if (this.validFromDate.getTheYear() == historicalTimeZoneDate2.getTheYear()) {
|
||||
return historicalTimeZoneDate2.occursAfterAbsolute(this.occursOnAnnualDate);
|
||||
}
|
||||
if (this.validUntilDate.getTheYear() == historicalTimeZoneDate.getTheYear()) {
|
||||
return historicalTimeZoneDate.occursBeforeAbsolute(this.occursOnAnnualDate);
|
||||
}
|
||||
if (this.validUntilDate.occursBeforeAbsolute(historicalTimeZoneDate) || this.validFromDate.occursAfterAbsolute(historicalTimeZoneDate2)) {
|
||||
return false;
|
||||
}
|
||||
if (this.validFromDate.occursAfterOrOnAbsolute(historicalTimeZoneDate) && this.validUntilDate.occursBeforeOrOnAbsolute(historicalTimeZoneDate2)) {
|
||||
return true;
|
||||
}
|
||||
if (this.validFromDate.occursBeforeOrOnAbsolute(historicalTimeZoneDate) && this.validUntilDate.occursAfterOrOnAbsolute(historicalTimeZoneDate2)) {
|
||||
return true;
|
||||
}
|
||||
if (this.validFromDate.occursAfterAbsolute(historicalTimeZoneDate) && this.validFromDate.occursBeforeAbsolute(historicalTimeZoneDate2)) {
|
||||
return true;
|
||||
}
|
||||
return this.validUntilDate.occursAfterAbsolute(historicalTimeZoneDate) && this.validUntilDate.occursBeforeAbsolute(historicalTimeZoneDate2);
|
||||
}
|
||||
|
||||
public final boolean ruleAppliesForYear(int n) {
|
||||
boolean bl = false;
|
||||
if (this.validFromDate.getTheYear() <= n && n <= this.validUntilDate.getTheYear()) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public final HistoricalTimeZoneDate getOccursOnAnnualDate() {
|
||||
return this.occursOnAnnualDate;
|
||||
}
|
||||
|
||||
public final String getRuleLetters() {
|
||||
return this.ruleLetters;
|
||||
}
|
||||
|
||||
public final String getRuleName() {
|
||||
return this.ruleName;
|
||||
}
|
||||
|
||||
public final String getRuleType() {
|
||||
return this.ruleType;
|
||||
}
|
||||
|
||||
public final HistoricalTimeZoneDate getStartDate() {
|
||||
return this.validFromDate;
|
||||
}
|
||||
|
||||
public final HistoricalTimeZoneDate getEndDate() {
|
||||
return this.validUntilDate;
|
||||
}
|
||||
|
||||
public final int getDaylightAdjMillis() {
|
||||
return this.daylightAdjMillis;
|
||||
}
|
||||
|
||||
public final boolean isStartRule() {
|
||||
return this.isStartRule;
|
||||
}
|
||||
|
||||
public final boolean isEndRule() {
|
||||
return this.isStartRule ^ true;
|
||||
}
|
||||
|
||||
private HistoricalDstRule() {
|
||||
}
|
||||
|
||||
public HistoricalDstRule(HistoricalDstRule historicalDstRule) {
|
||||
this.ruleName = new String(historicalDstRule.ruleName);
|
||||
this.ruleLetters = new String(historicalDstRule.ruleLetters);
|
||||
this.ruleType = new String(historicalDstRule.ruleType);
|
||||
this.validFromDate = new HistoricalTimeZoneDate(historicalDstRule.validFromDate);
|
||||
this.validUntilDate = new HistoricalTimeZoneDate(historicalDstRule.validUntilDate);
|
||||
this.occursOnAnnualDate = new HistoricalTimeZoneDate(historicalDstRule.occursOnAnnualDate);
|
||||
this.daylightAdjMillis = historicalDstRule.daylightAdjMillis;
|
||||
this.isStartRule = historicalDstRule.isStartRule;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,575 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.nre.util.Array
|
||||
*/
|
||||
package com.tridium.timezone;
|
||||
|
||||
import com.tridium.timezone.HistoricalDstRule;
|
||||
import com.tridium.timezone.HistoricalTimeZoneDate;
|
||||
import com.tridium.timezone.HistoricalTimeZoneEra;
|
||||
import com.tridium.timezone.TimeZoneDatabaseManifest;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.util.LinkedList;
|
||||
import javax.baja.log.Log;
|
||||
import javax.baja.nre.util.Array;
|
||||
import javax.baja.sys.BAbsTime;
|
||||
import javax.baja.sys.BRelTime;
|
||||
import javax.baja.sys.BSimple;
|
||||
import javax.baja.sys.BTime;
|
||||
import javax.baja.timezone.BTimeZone;
|
||||
import javax.baja.timezone.DstRule;
|
||||
import javax.baja.timezone.TimeZoneDatabase;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public final class HistoricalTimeZone {
|
||||
private static final short INVALID_INDEX = 7334;
|
||||
private static final Log logger = Log.getLog("historical timezone");
|
||||
public static final int MAX_YEAR;
|
||||
public static final int MIN_YEAR;
|
||||
private String historicalTimeZoneName;
|
||||
private Array myEras;
|
||||
private Array myRules;
|
||||
static /* synthetic */ Class class$com$tridium$timezone$HistoricalTimeZoneEra;
|
||||
static /* synthetic */ Class class$com$tridium$timezone$HistoricalDstRule;
|
||||
static /* synthetic */ Class class$java$lang$String;
|
||||
|
||||
public static final HistoricalTimeZone make(String string) {
|
||||
return HistoricalTimeZone.make(string, null);
|
||||
}
|
||||
|
||||
public static final HistoricalTimeZone make(String string, HistoricalTimeZoneEra historicalTimeZoneEra) {
|
||||
HistoricalTimeZone historicalTimeZone = new HistoricalTimeZone();
|
||||
historicalTimeZone.historicalTimeZoneName = string;
|
||||
if (historicalTimeZoneEra != null) {
|
||||
Class clazz = class$com$tridium$timezone$HistoricalTimeZoneEra;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$timezone$HistoricalTimeZoneEra = HistoricalTimeZone.class("[Lcom.tridium.timezone.HistoricalTimeZoneEra;", false);
|
||||
}
|
||||
historicalTimeZone.myEras = new Array(clazz);
|
||||
historicalTimeZone.myEras.add((Object)historicalTimeZoneEra);
|
||||
} else {
|
||||
historicalTimeZone.myEras = null;
|
||||
}
|
||||
historicalTimeZone.myRules = null;
|
||||
return historicalTimeZone;
|
||||
}
|
||||
|
||||
public final boolean equals(Object object) {
|
||||
if (this == object) {
|
||||
return true;
|
||||
}
|
||||
if (!(object instanceof HistoricalTimeZone)) {
|
||||
return false;
|
||||
}
|
||||
HistoricalTimeZone historicalTimeZone = (HistoricalTimeZone)object;
|
||||
boolean bl = false;
|
||||
if (this.nameEquals(historicalTimeZone.historicalTimeZoneName) && this.myRules.equals((Object)historicalTimeZone.myRules) && this.myEras.equals((Object)historicalTimeZone.myEras)) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public final String toString() {
|
||||
return this.myEras != null ? this.historicalTimeZoneName + ' ' + ((HistoricalTimeZoneEra)this.myEras.get(0)).toVerboseString() : this.historicalTimeZoneName;
|
||||
}
|
||||
|
||||
public final String toVerboseString() {
|
||||
StringBuffer stringBuffer = new StringBuffer(this.historicalTimeZoneName + '\n');
|
||||
int n = 0;
|
||||
while (n < this.myEras.size()) {
|
||||
stringBuffer.append("\t" + ((HistoricalTimeZoneEra)this.myEras.get(n)).toVerboseString() + '\n');
|
||||
n = (short)(n + 1);
|
||||
}
|
||||
return stringBuffer.toString();
|
||||
}
|
||||
|
||||
public final boolean nameEquals(String string) {
|
||||
return this.historicalTimeZoneName.equals(string);
|
||||
}
|
||||
|
||||
public final boolean write(OutputStream outputStream) {
|
||||
short s;
|
||||
short s2 = 7334;
|
||||
short s3 = 7334;
|
||||
int n = 7334;
|
||||
short s4 = 7334;
|
||||
int n2 = 7334;
|
||||
HistoricalTimeZoneDate historicalTimeZoneDate = HistoricalTimeZoneDate.makeMinimumDate();
|
||||
HistoricalTimeZoneDate historicalTimeZoneDate2 = HistoricalTimeZoneDate.makeMinimumDate();
|
||||
HistoricalTimeZoneDate historicalTimeZoneDate3 = HistoricalTimeZoneDate.makeMinimumDate();
|
||||
HistoricalTimeZoneEra historicalTimeZoneEra = null;
|
||||
HistoricalDstRule historicalDstRule = null;
|
||||
HistoricalDstRule historicalDstRule2 = null;
|
||||
HistoricalDstRule historicalDstRule3 = null;
|
||||
Class clazz = class$com$tridium$timezone$HistoricalDstRule;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$timezone$HistoricalDstRule = HistoricalTimeZone.class("[Lcom.tridium.timezone.HistoricalDstRule;", false);
|
||||
}
|
||||
Array array = new Array(clazz);
|
||||
Class clazz2 = class$com$tridium$timezone$HistoricalDstRule;
|
||||
if (clazz2 == null) {
|
||||
clazz2 = class$com$tridium$timezone$HistoricalDstRule = HistoricalTimeZone.class("[Lcom.tridium.timezone.HistoricalDstRule;", false);
|
||||
}
|
||||
Array array2 = new Array(clazz2);
|
||||
Class clazz3 = class$java$lang$String;
|
||||
if (clazz3 == null) {
|
||||
clazz3 = class$java$lang$String = HistoricalTimeZone.class("[Ljava.lang.String;", false);
|
||||
}
|
||||
Array array3 = new Array(clazz3);
|
||||
Class clazz4 = class$java$lang$String;
|
||||
if (clazz4 == null) {
|
||||
clazz4 = class$java$lang$String = HistoricalTimeZone.class("[Ljava.lang.String;", false);
|
||||
}
|
||||
Array array4 = new Array(clazz4);
|
||||
LinkedList<EraPlaceHolder> linkedList = new LinkedList<EraPlaceHolder>();
|
||||
int n3 = 0;
|
||||
while (n3 < this.myEras.size()) {
|
||||
historicalTimeZoneEra = (HistoricalTimeZoneEra)this.myEras.get(n3);
|
||||
s = 0;
|
||||
while (s < historicalTimeZoneEra.getNumberStartRules()) {
|
||||
historicalDstRule = historicalTimeZoneEra.getStartRuleAtIndex(s);
|
||||
if (!array.contains((Object)historicalDstRule)) {
|
||||
array.add((Object)historicalDstRule);
|
||||
}
|
||||
if (!array3.contains((Object)historicalDstRule.getRuleLetters())) {
|
||||
array3.add((Object)historicalDstRule.getRuleLetters());
|
||||
}
|
||||
s = (short)(s + 1);
|
||||
}
|
||||
s = 0;
|
||||
while (s < historicalTimeZoneEra.getNumberEndRules()) {
|
||||
historicalDstRule = historicalTimeZoneEra.getEndRuleAtIndex(s);
|
||||
if (!array2.contains((Object)historicalDstRule)) {
|
||||
array2.add((Object)historicalDstRule);
|
||||
}
|
||||
if (!array3.contains((Object)historicalDstRule.getRuleLetters())) {
|
||||
array3.add((Object)historicalDstRule.getRuleLetters());
|
||||
}
|
||||
s = (short)(s + 1);
|
||||
}
|
||||
if (!array4.contains((Object)historicalTimeZoneEra.getActiveZoneFormat())) {
|
||||
array4.add((Object)historicalTimeZoneEra.getActiveZoneFormat());
|
||||
}
|
||||
n3 = (short)(n3 + 1);
|
||||
}
|
||||
try {
|
||||
int n4;
|
||||
String string;
|
||||
DataOutputStream dataOutputStream = new DataOutputStream(outputStream);
|
||||
dataOutputStream.writeShort((short)array3.size());
|
||||
dataOutputStream.writeShort((short)array4.size());
|
||||
dataOutputStream.writeShort((short)array.size());
|
||||
dataOutputStream.writeShort((short)array2.size());
|
||||
s = 0;
|
||||
while (s < array3.size()) {
|
||||
string = (String)array3.get((int)s);
|
||||
n4 = 0;
|
||||
while (n4 < string.length()) {
|
||||
dataOutputStream.writeChar(string.charAt(n4));
|
||||
n4 = (short)(n4 + 1);
|
||||
}
|
||||
if (s + 1 != array3.size()) {
|
||||
dataOutputStream.writeChar(44);
|
||||
} else {
|
||||
dataOutputStream.writeChar(59);
|
||||
}
|
||||
s = (short)(s + 1);
|
||||
}
|
||||
s = 0;
|
||||
while (s < array4.size()) {
|
||||
string = (String)array4.get((int)s);
|
||||
n4 = 0;
|
||||
while (n4 < string.length()) {
|
||||
dataOutputStream.writeChar(string.charAt(n4));
|
||||
n4 = (short)(n4 + 1);
|
||||
}
|
||||
if (s + 1 != array4.size()) {
|
||||
dataOutputStream.writeChar(44);
|
||||
} else {
|
||||
dataOutputStream.writeChar(59);
|
||||
}
|
||||
s = (short)(s + 1);
|
||||
}
|
||||
s = 0;
|
||||
while (s < array.size()) {
|
||||
n = 7334;
|
||||
historicalDstRule = (HistoricalDstRule)array.get((int)s);
|
||||
n = (short)array3.indexOf((Object)historicalDstRule.getRuleLetters());
|
||||
dataOutputStream.writeShort((short)historicalDstRule.getOccursOnAnnualDate().getTheMonth().getOrdinal());
|
||||
dataOutputStream.writeShort(historicalDstRule.getOccursOnAnnualDate().getTheDay().getCalendarDay());
|
||||
dataOutputStream.writeShort(historicalDstRule.getOccursOnAnnualDate().getTheDay().getDayExpressedAs());
|
||||
dataOutputStream.writeShort((short)historicalDstRule.getOccursOnAnnualDate().getTheDay().getDayOfWeek().getOrdinal());
|
||||
dataOutputStream.writeInt((int)historicalDstRule.getOccursOnAnnualDate().getTheTimeOfDay().getTimeOfDayMillis());
|
||||
dataOutputStream.writeShort(historicalDstRule.getOccursOnAnnualDate().getTheTimeOfDayIsExpressedAs());
|
||||
dataOutputStream.writeInt(historicalDstRule.getDaylightAdjMillis());
|
||||
dataOutputStream.writeShort(n);
|
||||
s = (short)(s + 1);
|
||||
}
|
||||
s = 0;
|
||||
while (s < array2.size()) {
|
||||
n = 7334;
|
||||
historicalDstRule = (HistoricalDstRule)array2.get((int)s);
|
||||
n = (short)array3.indexOf((Object)historicalDstRule.getRuleLetters());
|
||||
dataOutputStream.writeShort((short)historicalDstRule.getOccursOnAnnualDate().getTheMonth().getOrdinal());
|
||||
dataOutputStream.writeShort(historicalDstRule.getOccursOnAnnualDate().getTheDay().getCalendarDay());
|
||||
dataOutputStream.writeShort(historicalDstRule.getOccursOnAnnualDate().getTheDay().getDayExpressedAs());
|
||||
dataOutputStream.writeShort((short)historicalDstRule.getOccursOnAnnualDate().getTheDay().getDayOfWeek().getOrdinal());
|
||||
dataOutputStream.writeInt((int)historicalDstRule.getOccursOnAnnualDate().getTheTimeOfDay().getTimeOfDayMillis());
|
||||
dataOutputStream.writeShort(historicalDstRule.getOccursOnAnnualDate().getTheTimeOfDayIsExpressedAs());
|
||||
dataOutputStream.writeInt(historicalDstRule.getDaylightAdjMillis());
|
||||
dataOutputStream.writeShort(n);
|
||||
s = (short)(s + 1);
|
||||
}
|
||||
s = 0;
|
||||
while (s < this.myEras.size()) {
|
||||
Object object;
|
||||
Object object2;
|
||||
BSimple bSimple;
|
||||
Object object3;
|
||||
BSimple bSimple2;
|
||||
Object object4;
|
||||
s2 = 7334;
|
||||
s3 = 7334;
|
||||
historicalTimeZoneEra = (HistoricalTimeZoneEra)this.myEras.get((int)s);
|
||||
s4 = (short)array4.indexOf((Object)historicalTimeZoneEra.getActiveZoneFormat());
|
||||
n2 = (short)(historicalTimeZoneEra.getNumberStartRules() + historicalTimeZoneEra.getNumberEndRules());
|
||||
if (n2 == 0) {
|
||||
HistoricalTimeZoneDate historicalTimeZoneDate4 = null;
|
||||
if (historicalTimeZoneEra.getValidUntilDate().getTheTimeOfDayIsExpressedAs() != 2) {
|
||||
BTimeZone bTimeZone = BTimeZone.makeIgnoringCache(this.historicalTimeZoneName, historicalTimeZoneEra.getActiveUtcOffsetMillis());
|
||||
object4 = BAbsTime.make(historicalTimeZoneEra.getValidUntilDate().getTheYear(), historicalTimeZoneEra.getValidUntilDate().getTheMonth(), historicalTimeZoneEra.getValidUntilDate().getTheDay().getCalendarDay(), historicalTimeZoneEra.getValidUntilDate().getTheTimeOfDay().getHour(), historicalTimeZoneEra.getValidUntilDate().getTheTimeOfDay().getMinute(), historicalTimeZoneEra.getValidUntilDate().getTheTimeOfDay().getSecond(), historicalTimeZoneEra.getValidUntilDate().getTheTimeOfDay().getMillisecond(), bTimeZone).toUtcTime();
|
||||
bSimple2 = BTime.make(BRelTime.make(((BAbsTime)object4).getTimeOfDayMillis()));
|
||||
object3 = HistoricalTimeZoneDate.HistoricalTimeZoneDay.make((short)((BAbsTime)object4).getDay(), (short)0, ((BAbsTime)object4).getWeekday());
|
||||
historicalTimeZoneDate4 = HistoricalTimeZoneDate.make((short)((BAbsTime)object4).getYear(), ((BAbsTime)object4).getMonth(), (HistoricalTimeZoneDate.HistoricalTimeZoneDay)object3, bSimple2, (short)2);
|
||||
} else {
|
||||
historicalTimeZoneDate4 = historicalTimeZoneEra.getValidUntilDate();
|
||||
}
|
||||
linkedList.addFirst(new EraPlaceHolder(historicalTimeZoneDate4, historicalTimeZoneEra.getActiveUtcOffsetMillis(), s2, s3, s4));
|
||||
} else if (n2 == 1) {
|
||||
if (historicalTimeZoneEra.getNumberStartRules() == 1) {
|
||||
historicalDstRule = historicalTimeZoneEra.getStartRuleAtIndex((short)0);
|
||||
s2 = (short)array.indexOf((Object)historicalDstRule2);
|
||||
} else {
|
||||
historicalDstRule = historicalTimeZoneEra.getEndRuleAtIndex((short)0);
|
||||
s3 = (short)array2.indexOf(historicalDstRule3);
|
||||
}
|
||||
HistoricalTimeZoneDate historicalTimeZoneDate5 = null;
|
||||
if (historicalTimeZoneEra.getValidUntilDate().getTheTimeOfDayIsExpressedAs() != 2) {
|
||||
DstRule dstRule = historicalDstRule.isStartRule() ? (DstRule)DstRule.fw(1103, historicalDstRule) : null;
|
||||
object4 = historicalDstRule.isEndRule() ? (DstRule)DstRule.fw(1103, historicalDstRule) : null;
|
||||
int n5 = 0;
|
||||
if (dstRule != null) {
|
||||
n5 = historicalDstRule.getDaylightAdjMillis();
|
||||
}
|
||||
int n6 = n5;
|
||||
object3 = BTimeZone.makeIgnoringCache(this.historicalTimeZoneName, "", "", "", "", historicalTimeZoneEra.getActiveUtcOffsetMillis(), n6, dstRule, (DstRule)object4);
|
||||
bSimple = BAbsTime.make(historicalTimeZoneEra.getValidUntilDate().getTheYear(), historicalTimeZoneEra.getValidUntilDate().getTheMonth(), historicalTimeZoneEra.getValidUntilDate().getTheDay().getCalendarDay(), historicalTimeZoneEra.getValidUntilDate().getTheTimeOfDay().getHour(), historicalTimeZoneEra.getValidUntilDate().getTheTimeOfDay().getMinute(), historicalTimeZoneEra.getValidUntilDate().getTheTimeOfDay().getSecond(), historicalTimeZoneEra.getValidUntilDate().getTheTimeOfDay().getMillisecond(), (BTimeZone)object3).toUtcTime();
|
||||
object2 = BTime.make(BRelTime.make(((BAbsTime)bSimple).getTimeOfDayMillis()));
|
||||
object = HistoricalTimeZoneDate.HistoricalTimeZoneDay.make((short)((BAbsTime)bSimple).getDay(), (short)0, ((BAbsTime)bSimple).getWeekday());
|
||||
historicalTimeZoneDate5 = HistoricalTimeZoneDate.make((short)((BAbsTime)bSimple).getYear(), ((BAbsTime)bSimple).getMonth(), (HistoricalTimeZoneDate.HistoricalTimeZoneDay)object, (BTime)object2, (short)2);
|
||||
} else {
|
||||
historicalTimeZoneDate5 = historicalTimeZoneEra.getValidUntilDate();
|
||||
}
|
||||
linkedList.addFirst(new EraPlaceHolder(historicalTimeZoneDate5, historicalTimeZoneEra.getActiveUtcOffsetMillis(), s2, s3, s4));
|
||||
} else if (n2 == 2) {
|
||||
if (historicalTimeZoneEra.getNumberStartRules() != 1 && historicalTimeZoneEra.getNumberEndRules() != 1) {
|
||||
logger.warning("2 or more rules of the same type, can not create the timezone");
|
||||
} else {
|
||||
historicalDstRule2 = historicalTimeZoneEra.getStartRule();
|
||||
historicalDstRule3 = historicalTimeZoneEra.getEndRule();
|
||||
s2 = (short)array.indexOf((Object)historicalDstRule2);
|
||||
s3 = (short)array2.indexOf((Object)historicalDstRule3);
|
||||
HistoricalTimeZoneDate historicalTimeZoneDate6 = null;
|
||||
if (historicalTimeZoneEra.getValidUntilDate().getTheTimeOfDayIsExpressedAs() != 2) {
|
||||
DstRule dstRule = (DstRule)DstRule.fw(1103, historicalDstRule2);
|
||||
object4 = (DstRule)DstRule.fw(1103, historicalDstRule3);
|
||||
bSimple2 = BTimeZone.makeIgnoringCache(this.historicalTimeZoneName, "", "", "", "", historicalTimeZoneEra.getActiveUtcOffsetMillis(), historicalDstRule2.getDaylightAdjMillis(), dstRule, (DstRule)object4);
|
||||
object3 = BAbsTime.make(historicalTimeZoneEra.getValidUntilDate().getTheYear(), historicalTimeZoneEra.getValidUntilDate().getTheMonth(), historicalTimeZoneEra.getValidUntilDate().getTheDay().getCalendarDay(), historicalTimeZoneEra.getValidUntilDate().getTheTimeOfDay().getHour(), historicalTimeZoneEra.getValidUntilDate().getTheTimeOfDay().getMinute(), historicalTimeZoneEra.getValidUntilDate().getTheTimeOfDay().getSecond(), historicalTimeZoneEra.getValidUntilDate().getTheTimeOfDay().getMillisecond(), (BTimeZone)bSimple2).toUtcTime();
|
||||
bSimple = BTime.make(BRelTime.make(((BAbsTime)object3).getTimeOfDayMillis()));
|
||||
object2 = HistoricalTimeZoneDate.HistoricalTimeZoneDay.make((short)((BAbsTime)object3).getDay(), (short)0, ((BAbsTime)object3).getWeekday());
|
||||
historicalTimeZoneDate6 = HistoricalTimeZoneDate.make((short)((BAbsTime)object3).getYear(), ((BAbsTime)object3).getMonth(), (HistoricalTimeZoneDate.HistoricalTimeZoneDay)object2, (BTime)bSimple, (short)2);
|
||||
} else {
|
||||
historicalTimeZoneDate6 = historicalTimeZoneEra.getValidUntilDate();
|
||||
}
|
||||
linkedList.addFirst(new EraPlaceHolder(historicalTimeZoneDate6, historicalTimeZoneEra.getActiveUtcOffsetMillis(), s2, s3, s4));
|
||||
}
|
||||
} else {
|
||||
short s5 = 0;
|
||||
short s6 = 0;
|
||||
while (s5 + s6 < n2) {
|
||||
if (s5 + s6 == 0 || historicalTimeZoneDate.occursOnAbsolute(historicalTimeZoneDate2)) {
|
||||
if (s5 + s6 != n2 - 1) {
|
||||
short s7 = s5;
|
||||
s5 = (short)(s7 + 1);
|
||||
historicalDstRule2 = historicalTimeZoneEra.getStartRuleAtIndex(s7);
|
||||
short s8 = s6;
|
||||
s6 = (short)(s8 + 1);
|
||||
historicalDstRule3 = historicalTimeZoneEra.getEndRuleAtIndex(s8);
|
||||
if (historicalDstRule2 == null || historicalDstRule3 == null) {
|
||||
logger.warning("2 or more rules of the same type, can not create the timezone");
|
||||
break;
|
||||
}
|
||||
s2 = (short)array.indexOf((Object)historicalDstRule2);
|
||||
s3 = (short)array2.indexOf((Object)historicalDstRule3);
|
||||
historicalTimeZoneDate = historicalDstRule2.getEndDate();
|
||||
historicalTimeZoneDate2 = historicalDstRule3.getEndDate();
|
||||
} else if (s5 != historicalTimeZoneEra.getNumberStartRules()) {
|
||||
short s9 = s5;
|
||||
s5 = (short)(s9 + 1);
|
||||
historicalDstRule2 = historicalTimeZoneEra.getStartRuleAtIndex(s9);
|
||||
s2 = (short)array.indexOf((Object)historicalDstRule2);
|
||||
historicalTimeZoneDate = historicalDstRule2.getEndDate();
|
||||
} else {
|
||||
short s10 = s6;
|
||||
s6 = (short)(s10 + 1);
|
||||
historicalDstRule3 = historicalTimeZoneEra.getEndRuleAtIndex(s10);
|
||||
s3 = (short)array2.indexOf((Object)historicalDstRule3);
|
||||
historicalTimeZoneDate2 = historicalDstRule3.getEndDate();
|
||||
}
|
||||
} else if (historicalTimeZoneDate.occursBeforeAbsolute(historicalTimeZoneDate2)) {
|
||||
short s11 = s5;
|
||||
s5 = (short)(s11 + 1);
|
||||
historicalDstRule2 = historicalTimeZoneEra.getStartRuleAtIndex(s11);
|
||||
s2 = (short)array.indexOf((Object)historicalDstRule2);
|
||||
historicalTimeZoneDate = historicalDstRule2.getEndDate();
|
||||
} else {
|
||||
short s12 = s6;
|
||||
s6 = (short)(s12 + 1);
|
||||
historicalDstRule3 = historicalTimeZoneEra.getEndRuleAtIndex(s12);
|
||||
s3 = (short)array2.indexOf((Object)historicalDstRule3);
|
||||
historicalTimeZoneDate2 = historicalDstRule3.getEndDate();
|
||||
}
|
||||
if (s5 + s6 != n2) {
|
||||
historicalTimeZoneDate3 = historicalTimeZoneDate.occursBeforeOrOnAbsolute(historicalTimeZoneDate2) ? historicalTimeZoneDate : historicalTimeZoneDate2;
|
||||
historicalTimeZoneDate3 = historicalTimeZoneDate3.occursBeforeAbsolute(historicalTimeZoneEra.getValidUntilDate()) ? historicalTimeZoneDate3 : historicalTimeZoneEra.getValidUntilDate();
|
||||
} else {
|
||||
historicalTimeZoneDate3 = historicalTimeZoneEra.getValidUntilDate();
|
||||
}
|
||||
object4 = null;
|
||||
if (historicalTimeZoneDate3.getTheTimeOfDayIsExpressedAs() != 2) {
|
||||
bSimple2 = historicalDstRule2 != null ? (DstRule)DstRule.fw(1103, historicalDstRule2) : null;
|
||||
object3 = historicalDstRule3 != null ? (DstRule)DstRule.fw(1103, historicalDstRule3) : null;
|
||||
int n7 = historicalTimeZoneEra.getActiveUtcOffsetMillis();
|
||||
int n8 = 0;
|
||||
if (historicalDstRule2 != null) {
|
||||
n8 = historicalDstRule2.getDaylightAdjMillis();
|
||||
}
|
||||
bSimple = BTimeZone.makeIgnoringCache(this.historicalTimeZoneName, "", "", "", "", n7, n8, (DstRule)((Object)bSimple2), (DstRule)object3);
|
||||
object2 = BAbsTime.make(historicalTimeZoneDate3.getTheYear(), historicalTimeZoneDate3.getTheMonth(), historicalTimeZoneDate3.getTheDay().getCalendarDay(), historicalTimeZoneDate3.getTheTimeOfDay().getHour(), historicalTimeZoneDate3.getTheTimeOfDay().getMinute(), historicalTimeZoneDate3.getTheTimeOfDay().getSecond(), historicalTimeZoneDate3.getTheTimeOfDay().getMillisecond(), (BTimeZone)bSimple);
|
||||
object2 = ((BAbsTime)object2).toUtcTime();
|
||||
object = BTime.make(BRelTime.make(((BAbsTime)object2).getTimeOfDayMillis()));
|
||||
HistoricalTimeZoneDate.HistoricalTimeZoneDay historicalTimeZoneDay = HistoricalTimeZoneDate.HistoricalTimeZoneDay.make((short)((BAbsTime)object2).getDay(), (short)0, ((BAbsTime)object2).getWeekday());
|
||||
object4 = HistoricalTimeZoneDate.make((short)((BAbsTime)object2).getYear(), ((BAbsTime)object2).getMonth(), historicalTimeZoneDay, (BTime)object, (short)2);
|
||||
} else {
|
||||
object4 = historicalTimeZoneDate3;
|
||||
}
|
||||
linkedList.addFirst(new EraPlaceHolder((HistoricalTimeZoneDate)object4, historicalTimeZoneEra.getActiveUtcOffsetMillis(), s2, s3, s4));
|
||||
}
|
||||
}
|
||||
s = (short)(s + 1);
|
||||
}
|
||||
dataOutputStream.writeShort((short)linkedList.size());
|
||||
s = 0;
|
||||
while (s < linkedList.size()) {
|
||||
this.eraToBinary(dataOutputStream, (EraPlaceHolder)linkedList.get(s));
|
||||
s = (short)(s + 1);
|
||||
}
|
||||
}
|
||||
catch (IOException iOException) {
|
||||
logger.error("could not create the file: " + iOException.getMessage());
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private final void eraToBinary(DataOutputStream dataOutputStream, EraPlaceHolder eraPlaceHolder) throws IOException {
|
||||
dataOutputStream.writeShort(eraPlaceHolder.dateToWrite.getTheYear());
|
||||
dataOutputStream.writeShort((short)eraPlaceHolder.dateToWrite.getTheMonth().getOrdinal());
|
||||
dataOutputStream.writeShort(eraPlaceHolder.dateToWrite.getTheDay().getCalendarDay());
|
||||
dataOutputStream.writeShort(eraPlaceHolder.dateToWrite.getTheDay().getDayExpressedAs());
|
||||
dataOutputStream.writeShort((short)eraPlaceHolder.dateToWrite.getTheDay().getDayOfWeek().getOrdinal());
|
||||
dataOutputStream.writeInt((int)eraPlaceHolder.dateToWrite.getTheTimeOfDay().getTimeOfDayMillis());
|
||||
dataOutputStream.writeShort(eraPlaceHolder.dateToWrite.getTheTimeOfDayIsExpressedAs());
|
||||
dataOutputStream.writeInt(eraPlaceHolder.offset);
|
||||
dataOutputStream.writeShort(eraPlaceHolder.startRule);
|
||||
dataOutputStream.writeShort(eraPlaceHolder.endRule);
|
||||
dataOutputStream.writeShort(eraPlaceHolder.format);
|
||||
}
|
||||
|
||||
public final void setName(String string) {
|
||||
this.historicalTimeZoneName = string;
|
||||
}
|
||||
|
||||
public final boolean addEra(HistoricalTimeZoneEra historicalTimeZoneEra) {
|
||||
if (this.myEras == null) {
|
||||
Class clazz = class$com$tridium$timezone$HistoricalTimeZoneEra;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$timezone$HistoricalTimeZoneEra = HistoricalTimeZone.class("[Lcom.tridium.timezone.HistoricalTimeZoneEra;", false);
|
||||
}
|
||||
this.myEras = new Array(clazz);
|
||||
}
|
||||
return this.myEras.add((Object)historicalTimeZoneEra);
|
||||
}
|
||||
|
||||
public final short getNumberEras() {
|
||||
short s = 0;
|
||||
if (this.myEras != null) {
|
||||
s = (short)this.myEras.size();
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
public final short getNumberRules() {
|
||||
short s = 0;
|
||||
if (this.myRules != null) {
|
||||
s = (short)this.myRules.size();
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
public final HistoricalTimeZoneEra getEraAtIndex(short s) {
|
||||
return this.myEras != null && s >= 0 && s < this.myEras.size() ? (HistoricalTimeZoneEra)this.myEras.get((int)s) : null;
|
||||
}
|
||||
|
||||
public final void setEraAtIndex(HistoricalTimeZoneEra historicalTimeZoneEra, short s) {
|
||||
this.myEras.set((int)s, (Object)historicalTimeZoneEra);
|
||||
}
|
||||
|
||||
public final HistoricalDstRule getRuleAtIndex(short s) {
|
||||
return this.myRules != null && s >= 0 && s < this.myRules.size() ? (HistoricalDstRule)this.myRules.get((int)s) : null;
|
||||
}
|
||||
|
||||
public final HistoricalDstRule getFirstRule() {
|
||||
return this.getRuleAtIndex((short)0);
|
||||
}
|
||||
|
||||
public final HistoricalDstRule getLastRule() {
|
||||
return this.getRuleAtIndex((short)(this.myRules.size() - 1));
|
||||
}
|
||||
|
||||
public final HistoricalTimeZoneEra getFirstEra() {
|
||||
return this.getEraAtIndex((short)0);
|
||||
}
|
||||
|
||||
public final HistoricalTimeZoneEra getLastEra() {
|
||||
return this.getEraAtIndex((short)(this.myEras.size() - 1));
|
||||
}
|
||||
|
||||
public final HistoricalTimeZoneEra getEraForMillis(long l) {
|
||||
HistoricalTimeZoneEra historicalTimeZoneEra = null;
|
||||
HistoricalTimeZoneDate historicalTimeZoneDate = HistoricalTimeZoneDate.makeFromEpochMillis(l);
|
||||
int n = 0;
|
||||
while (n < this.myEras.size()) {
|
||||
historicalTimeZoneEra = (HistoricalTimeZoneEra)this.myEras.get(n);
|
||||
if (historicalTimeZoneEra.getValidFromDate().occursBeforeAbsolute(historicalTimeZoneDate) && historicalTimeZoneEra.getValidUntilDate().occursAfterOrOnAbsolute(historicalTimeZoneDate)) {
|
||||
return historicalTimeZoneEra;
|
||||
}
|
||||
n = (short)(n + 1);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public final String getHistoricalTimeZoneName() {
|
||||
return this.historicalTimeZoneName;
|
||||
}
|
||||
|
||||
static /* synthetic */ Class class(String string, boolean bl) {
|
||||
try {
|
||||
Class<?> clazz = Class.forName(string);
|
||||
if (!bl) {
|
||||
clazz = clazz.getComponentType();
|
||||
}
|
||||
return clazz;
|
||||
}
|
||||
catch (ClassNotFoundException classNotFoundException) {
|
||||
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private HistoricalTimeZone() {
|
||||
}
|
||||
|
||||
public HistoricalTimeZone(HistoricalTimeZone historicalTimeZone) {
|
||||
this.historicalTimeZoneName = new String(historicalTimeZone.historicalTimeZoneName);
|
||||
if (historicalTimeZone.myEras != null) {
|
||||
Class clazz = class$com$tridium$timezone$HistoricalTimeZoneEra;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$timezone$HistoricalTimeZoneEra = HistoricalTimeZone.class("[Lcom.tridium.timezone.HistoricalTimeZoneEra;", false);
|
||||
}
|
||||
this.myEras = new Array(clazz);
|
||||
this.myEras.addAll(historicalTimeZone.myEras);
|
||||
} else {
|
||||
this.myEras = null;
|
||||
}
|
||||
if (historicalTimeZone.myRules != null) {
|
||||
Class clazz = class$com$tridium$timezone$HistoricalDstRule;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$timezone$HistoricalDstRule = HistoricalTimeZone.class("[Lcom.tridium.timezone.HistoricalDstRule;", false);
|
||||
}
|
||||
this.myRules = new Array(clazz);
|
||||
this.myRules.addAll(historicalTimeZone.myRules);
|
||||
} else {
|
||||
this.myRules = null;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* WARNING - Removed back jump from a try to a catch block - possible behaviour change.
|
||||
* Enabled aggressive block sorting
|
||||
* Enabled unnecessary exception pruning
|
||||
* Enabled aggressive exception aggregation
|
||||
*/
|
||||
static {
|
||||
int n = 2015;
|
||||
int n2 = 1995;
|
||||
try {
|
||||
try {
|
||||
TimeZoneDatabaseManifest timeZoneDatabaseManifest = TimeZoneDatabase.getManifest();
|
||||
n = timeZoneDatabaseManifest.getMaxYear();
|
||||
n2 = timeZoneDatabaseManifest.getMinYear();
|
||||
}
|
||||
catch (Exception exception) {
|
||||
logger.error("error loading timezones.jar: " + exception.getMessage(), exception);
|
||||
exception.printStackTrace();
|
||||
}
|
||||
}
|
||||
catch (Throwable throwable) {
|
||||
Object var3_5 = null;
|
||||
MAX_YEAR = n;
|
||||
MIN_YEAR = n2;
|
||||
throw throwable;
|
||||
}
|
||||
{
|
||||
Object var3_6 = null;
|
||||
MAX_YEAR = n;
|
||||
MIN_YEAR = n2;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
private final class EraPlaceHolder {
|
||||
private final HistoricalTimeZoneDate dateToWrite;
|
||||
private final int offset;
|
||||
private final short startRule;
|
||||
private final short endRule;
|
||||
private final short format;
|
||||
|
||||
public EraPlaceHolder(HistoricalTimeZoneDate historicalTimeZoneDate, int n, short s, short s2, short s3) {
|
||||
this.dateToWrite = historicalTimeZoneDate;
|
||||
this.offset = n;
|
||||
this.startRule = s;
|
||||
this.endRule = s2;
|
||||
this.format = s3;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,391 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.nre.util.Array
|
||||
* javax.baja.nre.util.TextUtil
|
||||
*/
|
||||
package com.tridium.timezone;
|
||||
|
||||
import com.tridium.timezone.HistoricalDstRule;
|
||||
import com.tridium.timezone.HistoricalTimeZoneDate;
|
||||
import java.util.LinkedList;
|
||||
import javax.baja.nre.util.Array;
|
||||
import javax.baja.nre.util.TextUtil;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public final class HistoricalTimeZoneEra {
|
||||
private int activeUtcOffsetMillis;
|
||||
private String activeZoneFormat;
|
||||
private String activeRuleName;
|
||||
private HistoricalTimeZoneDate validUntilDate;
|
||||
private HistoricalTimeZoneDate validFromDate;
|
||||
private Array myStartRules;
|
||||
private Array myEndRules;
|
||||
static /* synthetic */ Class class$com$tridium$timezone$HistoricalDstRule;
|
||||
|
||||
public static final HistoricalTimeZoneEra make() {
|
||||
return HistoricalTimeZoneEra.make(0, "none", "none", HistoricalTimeZoneDate.makeMaximumDate());
|
||||
}
|
||||
|
||||
public static final HistoricalTimeZoneEra make(int n, String string, String string2, HistoricalTimeZoneDate historicalTimeZoneDate) {
|
||||
HistoricalTimeZoneEra historicalTimeZoneEra = new HistoricalTimeZoneEra();
|
||||
historicalTimeZoneEra.activeZoneFormat = string2;
|
||||
historicalTimeZoneEra.activeRuleName = string;
|
||||
historicalTimeZoneEra.activeUtcOffsetMillis = n;
|
||||
historicalTimeZoneEra.validUntilDate = historicalTimeZoneDate.convertToExactDate();
|
||||
historicalTimeZoneEra.validFromDate = null;
|
||||
historicalTimeZoneEra.myStartRules = null;
|
||||
historicalTimeZoneEra.myEndRules = null;
|
||||
return historicalTimeZoneEra;
|
||||
}
|
||||
|
||||
public final boolean equals(Object object) {
|
||||
if (this == object) {
|
||||
return true;
|
||||
}
|
||||
if (!(object instanceof HistoricalTimeZoneEra)) {
|
||||
return false;
|
||||
}
|
||||
HistoricalTimeZoneEra historicalTimeZoneEra = (HistoricalTimeZoneEra)object;
|
||||
boolean bl = false;
|
||||
if (this.activeZoneFormat.equals(historicalTimeZoneEra.activeZoneFormat) && this.activeRuleName.equals(historicalTimeZoneEra.activeRuleName) && this.activeUtcOffsetMillis == historicalTimeZoneEra.activeUtcOffsetMillis && this.validUntilDate.equals(historicalTimeZoneEra.validUntilDate) && this.validFromDate.equals(historicalTimeZoneEra.validFromDate) && this.myEndRules.equals((Object)historicalTimeZoneEra.myEndRules) && this.myStartRules.equals((Object)historicalTimeZoneEra.myStartRules)) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public final String toString() {
|
||||
String string;
|
||||
HistoricalDstRule historicalDstRule = this.getStartRule();
|
||||
String string2 = string = this.activeUtcOffsetMillis > 0 ? "+" : "";
|
||||
if (historicalDstRule != null) {
|
||||
return "(" + string + this.utcOffsetAsString(this.activeUtcOffsetMillis) + '/' + string + this.utcOffsetAsString(this.activeUtcOffsetMillis + historicalDstRule.getDaylightAdjMillis()) + ')';
|
||||
}
|
||||
return new String("(" + string + this.utcOffsetAsString(this.activeUtcOffsetMillis) + ')');
|
||||
}
|
||||
|
||||
public final String toVerboseString() {
|
||||
int n;
|
||||
HistoricalDstRule historicalDstRule;
|
||||
StringBuffer stringBuffer = new StringBuffer("Format: " + this.activeZoneFormat + " Utc Offset: " + this.utcOffsetAsString(this.activeUtcOffsetMillis) + '\n');
|
||||
if (this.validFromDate != null) {
|
||||
stringBuffer.append(" Valid From: " + this.validFromDate + '\n');
|
||||
}
|
||||
if (this.validUntilDate != null) {
|
||||
stringBuffer.append(" Valid Until: " + this.validUntilDate + '\n');
|
||||
}
|
||||
if (this.myStartRules != null) {
|
||||
historicalDstRule = null;
|
||||
n = 0;
|
||||
while (n < this.myStartRules.size()) {
|
||||
historicalDstRule = (HistoricalDstRule)this.myStartRules.get(n);
|
||||
stringBuffer.append("\t\t" + historicalDstRule.toVerboseString() + ' ' + this.getShortForRule(historicalDstRule) + '\n');
|
||||
++n;
|
||||
}
|
||||
}
|
||||
if (this.myEndRules != null) {
|
||||
historicalDstRule = null;
|
||||
n = 0;
|
||||
while (n < this.myEndRules.size()) {
|
||||
historicalDstRule = (HistoricalDstRule)this.myEndRules.get(n);
|
||||
stringBuffer.append("\t\t" + historicalDstRule.toVerboseString() + ' ' + this.getShortForRule(historicalDstRule) + '\n');
|
||||
++n;
|
||||
}
|
||||
}
|
||||
return stringBuffer.toString();
|
||||
}
|
||||
|
||||
private final String utcOffsetAsString(int n) {
|
||||
String string;
|
||||
String string2;
|
||||
String string3;
|
||||
short s;
|
||||
boolean bl = false;
|
||||
boolean bl2 = false;
|
||||
boolean bl3 = false;
|
||||
int n2 = n;
|
||||
short s2 = (short)((long)n2 / 3600000L);
|
||||
if (n2 < 0) {
|
||||
n2 = -n2;
|
||||
}
|
||||
if ((s = (short)((long)(n2 = (int)((long)n2 - (long)Math.abs(s2) * 3600000L)) / 60000L)) < 10) {
|
||||
if (s == 0) {
|
||||
bl = true;
|
||||
string3 = new String("00");
|
||||
} else {
|
||||
string3 = new String("0" + s);
|
||||
}
|
||||
} else {
|
||||
string3 = new String("" + s);
|
||||
}
|
||||
n2 = (int)((long)n2 - (long)s * 60000L);
|
||||
short s3 = (short)((long)n2 / 1000L);
|
||||
if (s3 < 10) {
|
||||
if (s3 == 0) {
|
||||
bl2 = true;
|
||||
string2 = new String("00");
|
||||
} else {
|
||||
string2 = new String("0" + s3);
|
||||
}
|
||||
} else {
|
||||
string2 = new String("" + s3);
|
||||
}
|
||||
n2 = (int)((long)n2 - (long)s3 * 1000L);
|
||||
short s4 = (short)n2;
|
||||
if (s4 < 100) {
|
||||
if (s4 < 10) {
|
||||
if (s4 == 0) {
|
||||
bl3 = true;
|
||||
string = new String("000");
|
||||
} else {
|
||||
string = new String("00" + s4);
|
||||
}
|
||||
} else {
|
||||
string = new String("0" + s4);
|
||||
}
|
||||
} else {
|
||||
string = new String("" + s4);
|
||||
}
|
||||
if (bl && bl2 && bl3) {
|
||||
return new String("" + s2);
|
||||
}
|
||||
if (bl2 && bl3) {
|
||||
return new String("" + s2 + ':' + string3);
|
||||
}
|
||||
if (bl3) {
|
||||
return new String("" + s2 + ':' + string3 + ':' + string2);
|
||||
}
|
||||
return new String("" + s2 + ':' + string3 + ':' + string2 + '.' + string);
|
||||
}
|
||||
|
||||
public final boolean determineRules(HistoricalTimeZoneDate historicalTimeZoneDate, LinkedList linkedList) {
|
||||
if (this.activeRuleName.equals("-")) {
|
||||
return true;
|
||||
}
|
||||
HistoricalDstRule historicalDstRule = null;
|
||||
boolean bl = false;
|
||||
short s = (short)(linkedList.size() - 1);
|
||||
while (s >= 0) {
|
||||
historicalDstRule = (HistoricalDstRule)linkedList.get(s);
|
||||
if (historicalDstRule.getRuleName().equals(this.activeRuleName)) {
|
||||
bl = true;
|
||||
if (historicalDstRule.ruleAppliesForInterval(historicalTimeZoneDate, this.validUntilDate)) {
|
||||
if (historicalDstRule.isStartRule()) {
|
||||
if (this.myStartRules == null) {
|
||||
Class clazz = class$com$tridium$timezone$HistoricalDstRule;
|
||||
if (clazz == null) {
|
||||
clazz = HistoricalTimeZoneEra.class("[Lcom.tridium.timezone.HistoricalDstRule;", false);
|
||||
}
|
||||
this.myStartRules = new Array(clazz);
|
||||
}
|
||||
this.myStartRules.add(0, (Object)new HistoricalDstRule(historicalDstRule));
|
||||
} else {
|
||||
if (this.myEndRules == null) {
|
||||
Class clazz = class$com$tridium$timezone$HistoricalDstRule;
|
||||
if (clazz == null) {
|
||||
clazz = HistoricalTimeZoneEra.class("[Lcom.tridium.timezone.HistoricalDstRule;", false);
|
||||
}
|
||||
this.myEndRules = new Array(clazz);
|
||||
}
|
||||
this.myEndRules.add(0, (Object)new HistoricalDstRule(historicalDstRule));
|
||||
}
|
||||
}
|
||||
} else if (bl && !this.activeRuleName.equals("NZ") && !this.activeRuleName.equals("Chatham")) break;
|
||||
s = (short)(s - 1);
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public final void addRule(HistoricalDstRule historicalDstRule) {
|
||||
if (historicalDstRule.isStartRule()) {
|
||||
if (this.myStartRules == null) {
|
||||
Class clazz = class$com$tridium$timezone$HistoricalDstRule;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$timezone$HistoricalDstRule = HistoricalTimeZoneEra.class("[Lcom.tridium.timezone.HistoricalDstRule;", false);
|
||||
}
|
||||
this.myStartRules = new Array(clazz);
|
||||
}
|
||||
this.myStartRules.add(0, (Object)historicalDstRule);
|
||||
} else if (historicalDstRule.isEndRule()) {
|
||||
if (this.myEndRules == null) {
|
||||
Class clazz = class$com$tridium$timezone$HistoricalDstRule;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$timezone$HistoricalDstRule = HistoricalTimeZoneEra.class("[Lcom.tridium.timezone.HistoricalDstRule;", false);
|
||||
}
|
||||
this.myEndRules = new Array(clazz);
|
||||
}
|
||||
this.myEndRules.add(0, (Object)historicalDstRule);
|
||||
}
|
||||
}
|
||||
|
||||
public final HistoricalDstRule getStartRuleAtIndex(short s) {
|
||||
return this.myStartRules != null && s >= 0 && s < this.myStartRules.size() ? (HistoricalDstRule)this.myStartRules.get((int)s) : null;
|
||||
}
|
||||
|
||||
public final HistoricalDstRule getEndRuleAtIndex(short s) {
|
||||
return this.myEndRules != null && s >= 0 && s < this.myEndRules.size() ? (HistoricalDstRule)this.myEndRules.get((int)s) : null;
|
||||
}
|
||||
|
||||
private final String getShortForRule(HistoricalDstRule historicalDstRule) {
|
||||
StringBuffer stringBuffer = new StringBuffer("");
|
||||
short s = (short)this.activeZoneFormat.indexOf("%s");
|
||||
if (s != -1) {
|
||||
stringBuffer.append(this.activeZoneFormat.substring(0, this.activeZoneFormat.indexOf("%s")));
|
||||
if (!historicalDstRule.getRuleLetters().equals("-")) {
|
||||
stringBuffer.append(historicalDstRule.getRuleLetters());
|
||||
}
|
||||
} else {
|
||||
return this.activeZoneFormat;
|
||||
}
|
||||
stringBuffer.append(this.activeZoneFormat.substring(this.activeZoneFormat.indexOf("%s") + 2));
|
||||
return new String(stringBuffer.toString());
|
||||
}
|
||||
|
||||
public final String getShortName(boolean bl) {
|
||||
HistoricalDstRule historicalDstRule = null;
|
||||
int n = -1;
|
||||
if (bl) {
|
||||
if (this.myStartRules == null || this.myStartRules.size() == 0) {
|
||||
String string = this.activeZoneFormat;
|
||||
String string2 = null;
|
||||
string2 = string.indexOf("%s") != -1 ? TextUtil.replace((String)string, (String)"%s", (String)"") : (string.indexOf("/") != -1 ? string.substring(string.indexOf("/")) : string);
|
||||
return string2;
|
||||
}
|
||||
short s = (short)this.activeZoneFormat.indexOf(47);
|
||||
n = s;
|
||||
if (s != -1) {
|
||||
return this.activeZoneFormat.substring(n + 1);
|
||||
}
|
||||
historicalDstRule = this.getStartRule();
|
||||
} else {
|
||||
if (this.myEndRules == null || this.myEndRules.size() == 0) {
|
||||
String string = this.activeZoneFormat;
|
||||
String string3 = null;
|
||||
string3 = string.indexOf("%s") != -1 ? TextUtil.replace((String)string, (String)"%s", (String)"") : (string.indexOf("/") != -1 ? string.substring(0, string.indexOf("/")) : string);
|
||||
return string3;
|
||||
}
|
||||
short s = (short)this.activeZoneFormat.indexOf(47);
|
||||
n = s;
|
||||
if (s != -1) {
|
||||
return this.activeZoneFormat.substring(0, n);
|
||||
}
|
||||
historicalDstRule = this.getEndRule();
|
||||
}
|
||||
return historicalDstRule != null ? this.getShortForRule(historicalDstRule) : "";
|
||||
}
|
||||
|
||||
public final HistoricalDstRule getEndRule() {
|
||||
if (this.myEndRules == null || this.myEndRules.size() == 0 || this.myEndRules.size() > 1) {
|
||||
return null;
|
||||
}
|
||||
return (HistoricalDstRule)this.myEndRules.get(0);
|
||||
}
|
||||
|
||||
public final HistoricalDstRule getStartRule() {
|
||||
if (this.myStartRules == null || this.myStartRules.size() == 0 || this.myStartRules.size() > 1) {
|
||||
return null;
|
||||
}
|
||||
return (HistoricalDstRule)this.myStartRules.get(0);
|
||||
}
|
||||
|
||||
public final short getNumberStartRules() {
|
||||
short s = 0;
|
||||
if (this.myStartRules != null) {
|
||||
s = (short)this.myStartRules.size();
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
public final short getNumberEndRules() {
|
||||
short s = 0;
|
||||
if (this.myEndRules != null) {
|
||||
s = (short)this.myEndRules.size();
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
public final void setValidFromDate(HistoricalTimeZoneDate historicalTimeZoneDate) {
|
||||
this.validFromDate = new HistoricalTimeZoneDate(historicalTimeZoneDate);
|
||||
}
|
||||
|
||||
public final void setValidUntilDate(HistoricalTimeZoneDate historicalTimeZoneDate) {
|
||||
this.validUntilDate = new HistoricalTimeZoneDate(historicalTimeZoneDate);
|
||||
}
|
||||
|
||||
public final int getActiveUtcOffsetMillis() {
|
||||
return this.activeUtcOffsetMillis;
|
||||
}
|
||||
|
||||
public final String getActiveRuleName() {
|
||||
return this.activeRuleName;
|
||||
}
|
||||
|
||||
public final String getActiveZoneFormat() {
|
||||
return this.activeZoneFormat;
|
||||
}
|
||||
|
||||
public final HistoricalTimeZoneDate getValidUntilDate() {
|
||||
return this.validUntilDate;
|
||||
}
|
||||
|
||||
public final HistoricalTimeZoneDate getValidFromDate() {
|
||||
return this.validFromDate;
|
||||
}
|
||||
|
||||
public final boolean isValidForEpochMillis(long l) {
|
||||
HistoricalTimeZoneDate historicalTimeZoneDate = HistoricalTimeZoneDate.makeFromEpochMillis(l);
|
||||
boolean bl = false;
|
||||
if (this.validFromDate.occursBeforeOrOnAbsolute(historicalTimeZoneDate) && this.validUntilDate.occursAfterAbsolute(historicalTimeZoneDate)) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
static /* synthetic */ Class class(String string, boolean bl) {
|
||||
try {
|
||||
Class<?> clazz = Class.forName(string);
|
||||
if (!bl) {
|
||||
clazz = clazz.getComponentType();
|
||||
}
|
||||
return clazz;
|
||||
}
|
||||
catch (ClassNotFoundException classNotFoundException) {
|
||||
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private HistoricalTimeZoneEra() {
|
||||
}
|
||||
|
||||
public HistoricalTimeZoneEra(HistoricalTimeZoneEra historicalTimeZoneEra) {
|
||||
this.activeZoneFormat = new String(historicalTimeZoneEra.activeZoneFormat);
|
||||
this.activeRuleName = new String(historicalTimeZoneEra.activeRuleName);
|
||||
this.activeUtcOffsetMillis = historicalTimeZoneEra.activeUtcOffsetMillis;
|
||||
this.validUntilDate = historicalTimeZoneEra.validUntilDate != null ? new HistoricalTimeZoneDate(historicalTimeZoneEra.validUntilDate) : null;
|
||||
HistoricalTimeZoneDate historicalTimeZoneDate = this.validFromDate = historicalTimeZoneEra.validFromDate != null ? new HistoricalTimeZoneDate(historicalTimeZoneEra.validFromDate) : null;
|
||||
if (historicalTimeZoneEra.myStartRules == null) {
|
||||
this.myStartRules = null;
|
||||
} else {
|
||||
Class clazz = class$com$tridium$timezone$HistoricalDstRule;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$timezone$HistoricalDstRule = HistoricalTimeZoneEra.class("[Lcom.tridium.timezone.HistoricalDstRule;", false);
|
||||
}
|
||||
this.myStartRules = new Array(clazz);
|
||||
this.myStartRules.addAll(historicalTimeZoneEra.myStartRules);
|
||||
}
|
||||
if (historicalTimeZoneEra.myEndRules == null) {
|
||||
this.myEndRules = null;
|
||||
} else {
|
||||
Class clazz = class$com$tridium$timezone$HistoricalDstRule;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$timezone$HistoricalDstRule = HistoricalTimeZoneEra.class("[Lcom.tridium.timezone.HistoricalDstRule;", false);
|
||||
}
|
||||
this.myEndRules = new Array(clazz);
|
||||
this.myEndRules.addAll(historicalTimeZoneEra.myEndRules);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,157 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.xml.XContent
|
||||
* javax.baja.xml.XElem
|
||||
* javax.baja.xml.XParser
|
||||
* javax.baja.xml.XWriter
|
||||
*/
|
||||
package com.tridium.timezone;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
import javax.baja.util.Version;
|
||||
import javax.baja.xml.XContent;
|
||||
import javax.baja.xml.XElem;
|
||||
import javax.baja.xml.XParser;
|
||||
import javax.baja.xml.XWriter;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class TimeZoneDatabaseManifest {
|
||||
private XElem rootElem;
|
||||
private Map zoneElemsById;
|
||||
private Version version;
|
||||
|
||||
public static TimeZoneDatabaseManifest make(InputStream inputStream) throws Exception {
|
||||
return TimeZoneDatabaseManifest.make(XParser.make((InputStream)inputStream).parse(true));
|
||||
}
|
||||
|
||||
public static TimeZoneDatabaseManifest make(XElem xElem) {
|
||||
if (xElem.name().equals("htzdb")) {
|
||||
return new TimeZoneDatabaseManifest(xElem);
|
||||
}
|
||||
if (xElem.name().equals("timezonedb")) {
|
||||
TimeZoneDatabaseManifest timeZoneDatabaseManifest = new TimeZoneDatabaseManifest(new XElem("htzdb"));
|
||||
XElem xElem2 = xElem.elem("config");
|
||||
timeZoneDatabaseManifest.setMinYear(xElem2.geti("minYear", 1995));
|
||||
timeZoneDatabaseManifest.setMaxYear(xElem2.geti("maxYear", 2015));
|
||||
XElem[] xElemArray = xElem.elem("timezones").elems("zone");
|
||||
int n = 0;
|
||||
while (n < xElemArray.length) {
|
||||
timeZoneDatabaseManifest.addZoneId(xElemArray[n].get("id"));
|
||||
++n;
|
||||
}
|
||||
return timeZoneDatabaseManifest;
|
||||
}
|
||||
throw new IllegalArgumentException("not a valid time zone database manifest");
|
||||
}
|
||||
|
||||
public void write(OutputStream outputStream) throws IOException {
|
||||
XWriter xWriter = new XWriter(outputStream);
|
||||
this.rootElem.write(xWriter);
|
||||
xWriter.flush();
|
||||
}
|
||||
|
||||
public String getSource() {
|
||||
return this.rootElem.get("source", null);
|
||||
}
|
||||
|
||||
public void setSource(String string) {
|
||||
this.rootElem.setAttr("source", string);
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return this.rootElem.get("description", null);
|
||||
}
|
||||
|
||||
public void setDescription(String string) {
|
||||
this.rootElem.setAttr("description", string);
|
||||
}
|
||||
|
||||
public String getVendor() {
|
||||
return this.rootElem.get("vendor", "");
|
||||
}
|
||||
|
||||
public void setVendor(String string) {
|
||||
this.rootElem.setAttr("vendor", string);
|
||||
}
|
||||
|
||||
public Version getVersion() {
|
||||
if (this.version == null) {
|
||||
this.version = new Version(this.rootElem.get("version", ""));
|
||||
}
|
||||
return this.version;
|
||||
}
|
||||
|
||||
public void setVersion(Version version) {
|
||||
this.version = version;
|
||||
this.rootElem.setAttr("version", version.toString());
|
||||
}
|
||||
|
||||
public int getMinYear() {
|
||||
return this.rootElem.geti("minYear", 1995);
|
||||
}
|
||||
|
||||
public void setMinYear(int n) {
|
||||
this.rootElem.setAttr("minYear", String.valueOf(n));
|
||||
}
|
||||
|
||||
public int getMaxYear() {
|
||||
return this.rootElem.geti("maxYear", 2015);
|
||||
}
|
||||
|
||||
public void setMaxYear(int n) {
|
||||
this.rootElem.setAttr("maxYear", String.valueOf(n));
|
||||
}
|
||||
|
||||
public String[] getZoneIds() {
|
||||
String[] stringArray = new String[this.zoneElemsById.size()];
|
||||
this.zoneElemsById.keySet().toArray(stringArray);
|
||||
return stringArray;
|
||||
}
|
||||
|
||||
public boolean containsZoneId(String string) {
|
||||
return this.zoneElemsById.containsKey(string);
|
||||
}
|
||||
|
||||
public void addZoneId(String string) {
|
||||
if (this.containsZoneId(string)) {
|
||||
return;
|
||||
}
|
||||
XElem xElem = new XElem("zone");
|
||||
xElem.setAttr("id", string);
|
||||
this.rootElem.addContent((XContent)xElem);
|
||||
this.zoneElemsById.put(string, xElem);
|
||||
}
|
||||
|
||||
public void removeZoneId(String string) {
|
||||
XElem xElem = (XElem)this.zoneElemsById.get(string);
|
||||
if (xElem != null) {
|
||||
this.rootElem.removeContent((XContent)xElem);
|
||||
this.zoneElemsById.remove(string);
|
||||
}
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.version = null;
|
||||
}
|
||||
|
||||
private TimeZoneDatabaseManifest(XElem xElem) {
|
||||
this.this();
|
||||
this.rootElem = xElem.copy();
|
||||
this.zoneElemsById = new TreeMap();
|
||||
XElem[] xElemArray = this.rootElem.elems("zone");
|
||||
int n = 0;
|
||||
while (n < xElemArray.length) {
|
||||
this.zoneElemsById.put(xElemArray[n].get("id"), xElemArray[n]);
|
||||
++n;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,722 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.nre.util.Array
|
||||
* javax.baja.nre.util.ByteBuffer
|
||||
*/
|
||||
package com.tridium.timezone;
|
||||
|
||||
import com.tridium.sys.Nre;
|
||||
import com.tridium.timezone.HistoricalDstRule;
|
||||
import com.tridium.timezone.HistoricalTimeZone;
|
||||
import com.tridium.timezone.HistoricalTimeZoneDate;
|
||||
import com.tridium.timezone.HistoricalTimeZoneEra;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.jar.JarEntry;
|
||||
import java.util.jar.JarFile;
|
||||
import java.util.jar.JarInputStream;
|
||||
import javax.baja.log.Log;
|
||||
import javax.baja.nre.util.Array;
|
||||
import javax.baja.nre.util.ByteBuffer;
|
||||
import javax.baja.sys.BAbsTime;
|
||||
import javax.baja.sys.BMonth;
|
||||
import javax.baja.sys.BRelTime;
|
||||
import javax.baja.sys.BTime;
|
||||
import javax.baja.sys.BWeekday;
|
||||
import javax.baja.timezone.BTimeZone;
|
||||
import javax.baja.timezone.TimeZoneDatabase;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class TzJarUtil {
|
||||
private static final short INVALID_INDEX = 7334;
|
||||
private static final Log logger = Log.getLog("timezone.jarUtil");
|
||||
private static final long MAX_MILLIS = 253433923199999L;
|
||||
private static final long MIN_MILLIS = -2208988800000L;
|
||||
static /* synthetic */ Class class$javax$baja$timezone$BTimeZone;
|
||||
static /* synthetic */ Class class$com$tridium$timezone$HistoricalDstRule;
|
||||
static /* synthetic */ Class class$java$lang$String;
|
||||
|
||||
public static final Array getTimeZones(InputStream inputStream) {
|
||||
return TzJarUtil.getTimeZones(inputStream, System.currentTimeMillis());
|
||||
}
|
||||
|
||||
public static final synchronized Array getTimeZones(InputStream inputStream, long l) {
|
||||
logger.trace("entered TzJarUtil::getTimeZones(" + l + ')');
|
||||
Class clazz = class$javax$baja$timezone$BTimeZone;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$timezone$BTimeZone = TzJarUtil.class("[Ljavax.baja.timezone.BTimeZone;", false);
|
||||
}
|
||||
Array array = new Array(clazz);
|
||||
HistoricalTimeZoneDate historicalTimeZoneDate = HistoricalTimeZoneDate.makeFromEpochMillis(l);
|
||||
boolean bl = false;
|
||||
if (historicalTimeZoneDate.getTheYear() < HistoricalTimeZone.MIN_YEAR) {
|
||||
bl = true;
|
||||
}
|
||||
boolean bl2 = bl;
|
||||
boolean bl3 = false;
|
||||
if (historicalTimeZoneDate.getTheYear() >= HistoricalTimeZone.MAX_YEAR) {
|
||||
bl3 = true;
|
||||
}
|
||||
boolean bl4 = bl3;
|
||||
try {
|
||||
HistoricalTimeZoneDate historicalTimeZoneDate2 = null;
|
||||
HistoricalTimeZoneDate historicalTimeZoneDate3 = null;
|
||||
HistoricalTimeZoneDate historicalTimeZoneDate4 = HistoricalTimeZoneDate.makeMinimumDate();
|
||||
HistoricalTimeZoneDate historicalTimeZoneDate5 = HistoricalTimeZoneDate.makeMinimumDate();
|
||||
HistoricalTimeZoneEra historicalTimeZoneEra = null;
|
||||
Class clazz2 = class$com$tridium$timezone$HistoricalDstRule;
|
||||
if (clazz2 == null) {
|
||||
clazz2 = class$com$tridium$timezone$HistoricalDstRule = TzJarUtil.class("[Lcom.tridium.timezone.HistoricalDstRule;", false);
|
||||
}
|
||||
Array array2 = new Array(clazz2);
|
||||
Class clazz3 = class$com$tridium$timezone$HistoricalDstRule;
|
||||
if (clazz3 == null) {
|
||||
clazz3 = class$com$tridium$timezone$HistoricalDstRule = TzJarUtil.class("[Lcom.tridium.timezone.HistoricalDstRule;", false);
|
||||
}
|
||||
Array array3 = new Array(clazz3);
|
||||
Class clazz4 = class$java$lang$String;
|
||||
if (clazz4 == null) {
|
||||
clazz4 = class$java$lang$String = TzJarUtil.class("[Ljava.lang.String;", false);
|
||||
}
|
||||
Array array4 = new Array(clazz4);
|
||||
Class clazz5 = class$java$lang$String;
|
||||
if (clazz5 == null) {
|
||||
clazz5 = class$java$lang$String = TzJarUtil.class("[Ljava.lang.String;", false);
|
||||
}
|
||||
Array array5 = new Array(clazz5);
|
||||
short s = 0;
|
||||
short s2 = 0;
|
||||
short s3 = 0;
|
||||
short s4 = 0;
|
||||
short s5 = 0;
|
||||
short s6 = 0;
|
||||
short s7 = 0;
|
||||
short s8 = 0;
|
||||
short s9 = 0;
|
||||
short s10 = 0;
|
||||
short s11 = 0;
|
||||
short s12 = 7334;
|
||||
short s13 = 7334;
|
||||
short s14 = 7334;
|
||||
short s15 = 7334;
|
||||
int n = 0;
|
||||
int n2 = 0;
|
||||
int n3 = 0;
|
||||
String string = null;
|
||||
String string2 = null;
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
char c = '0';
|
||||
JarDataInputStream jarDataInputStream = new JarDataInputStream(inputStream);
|
||||
JarEntry jarEntry = null;
|
||||
while ((jarEntry = jarDataInputStream.getNextJarEntry()) != null) {
|
||||
if (jarEntry.getName().endsWith(".class") || jarEntry.getName().endsWith(".properties") || jarEntry.getName().startsWith("META-INF") || jarEntry.getName().startsWith("meta-inf")) {
|
||||
jarDataInputStream.closeEntry();
|
||||
continue;
|
||||
}
|
||||
s = jarDataInputStream.readShort();
|
||||
s2 = jarDataInputStream.readShort();
|
||||
s3 = jarDataInputStream.readShort();
|
||||
s4 = jarDataInputStream.readShort();
|
||||
s5 = 0;
|
||||
s6 = 0;
|
||||
s7 = 0;
|
||||
s8 = 0;
|
||||
s9 = 0;
|
||||
s10 = 0;
|
||||
s11 = 0;
|
||||
s12 = 7334;
|
||||
s13 = 7334;
|
||||
s14 = 7334;
|
||||
s15 = 7334;
|
||||
n = 0;
|
||||
n2 = 0;
|
||||
n3 = 0;
|
||||
string = null;
|
||||
string2 = null;
|
||||
stringBuffer = new StringBuffer();
|
||||
c = '\u0000';
|
||||
array2.clear();
|
||||
array3.clear();
|
||||
array4.clear();
|
||||
array5.clear();
|
||||
if (s != 0) {
|
||||
c = jarDataInputStream.readChar();
|
||||
while (c != ';') {
|
||||
if (c == ',') {
|
||||
array4.add((Object)stringBuffer.toString());
|
||||
stringBuffer = new StringBuffer();
|
||||
} else {
|
||||
stringBuffer.append(c);
|
||||
}
|
||||
c = jarDataInputStream.readChar();
|
||||
}
|
||||
array4.add((Object)stringBuffer.toString());
|
||||
stringBuffer = new StringBuffer();
|
||||
}
|
||||
if (s2 != 0) {
|
||||
c = jarDataInputStream.readChar();
|
||||
while (c != ';') {
|
||||
if (c == ',') {
|
||||
array5.add((Object)stringBuffer.toString());
|
||||
stringBuffer = new StringBuffer();
|
||||
} else {
|
||||
stringBuffer.append(c);
|
||||
}
|
||||
c = jarDataInputStream.readChar();
|
||||
}
|
||||
array5.add((Object)stringBuffer.toString());
|
||||
}
|
||||
short s16 = 0;
|
||||
while (s16 < s3) {
|
||||
s7 = jarDataInputStream.readShort();
|
||||
s9 = jarDataInputStream.readShort();
|
||||
s8 = jarDataInputStream.readShort();
|
||||
s10 = jarDataInputStream.readShort();
|
||||
n = jarDataInputStream.readInt();
|
||||
s11 = jarDataInputStream.readShort();
|
||||
n3 = jarDataInputStream.readInt();
|
||||
s15 = jarDataInputStream.readShort();
|
||||
if ((s15 < 0 || s15 >= s) && s15 != 7334) {
|
||||
logger.error("could not parse timezone (invalid dst uses letter) from timezones.jar; returning null");
|
||||
try {
|
||||
jarDataInputStream.closeEntry();
|
||||
}
|
||||
catch (IOException iOException) {}
|
||||
try {
|
||||
jarDataInputStream.readFully();
|
||||
}
|
||||
catch (IOException iOException) {}
|
||||
try {
|
||||
jarDataInputStream.close();
|
||||
}
|
||||
catch (IOException iOException) {}
|
||||
return null;
|
||||
}
|
||||
string = s15 == 7334 ? "" : (String)array4.get((int)s15);
|
||||
array2.add((Object)HistoricalDstRule.make("", string, "", HistoricalTimeZoneDate.START_OF_TIME, HistoricalTimeZoneDate.END_OF_TIME, HistoricalTimeZoneDate.make((short)-1, BMonth.make(s7), HistoricalTimeZoneDate.HistoricalTimeZoneDay.make(s9, s8, BWeekday.make(s10)), BTime.make(BRelTime.make(n)), s11), n3));
|
||||
s16 = (short)(s16 + 1);
|
||||
}
|
||||
s16 = 0;
|
||||
while (s16 < s4) {
|
||||
s7 = jarDataInputStream.readShort();
|
||||
s9 = jarDataInputStream.readShort();
|
||||
s8 = jarDataInputStream.readShort();
|
||||
s10 = jarDataInputStream.readShort();
|
||||
n = jarDataInputStream.readInt();
|
||||
s11 = jarDataInputStream.readShort();
|
||||
n3 = jarDataInputStream.readInt();
|
||||
s15 = jarDataInputStream.readShort();
|
||||
if ((s15 < 0 || s15 >= s) && s15 != 7334) {
|
||||
logger.error("could not parse timezone (invalid std uses letter) from timezones.jar; returning null");
|
||||
try {
|
||||
jarDataInputStream.closeEntry();
|
||||
}
|
||||
catch (IOException iOException) {}
|
||||
try {
|
||||
jarDataInputStream.readFully();
|
||||
}
|
||||
catch (IOException iOException) {}
|
||||
try {
|
||||
jarDataInputStream.close();
|
||||
}
|
||||
catch (IOException iOException) {}
|
||||
return null;
|
||||
}
|
||||
string = s15 == 7334 ? "" : (String)array4.get((int)s15);
|
||||
array3.add((Object)HistoricalDstRule.make("", string, "", HistoricalTimeZoneDate.START_OF_TIME, HistoricalTimeZoneDate.END_OF_TIME, HistoricalTimeZoneDate.make((short)-1, BMonth.make(s7), HistoricalTimeZoneDate.HistoricalTimeZoneDay.make(s9, s8, BWeekday.make(s10)), BTime.make(BRelTime.make(n)), s11), n3));
|
||||
s16 = (short)(s16 + 1);
|
||||
}
|
||||
s5 = jarDataInputStream.readShort();
|
||||
historicalTimeZoneDate2 = HistoricalTimeZoneDate.makeMaximumDate();
|
||||
historicalTimeZoneDate3 = HistoricalTimeZoneDate.makeMinimumDate();
|
||||
for (s16 = 0; s16 < s5; s16 = (short)(s16 + 1)) {
|
||||
s6 = jarDataInputStream.readShort();
|
||||
s7 = jarDataInputStream.readShort();
|
||||
s9 = jarDataInputStream.readShort();
|
||||
s8 = jarDataInputStream.readShort();
|
||||
s10 = jarDataInputStream.readShort();
|
||||
n = jarDataInputStream.readInt();
|
||||
s11 = jarDataInputStream.readShort();
|
||||
historicalTimeZoneDate5.update(s6, BMonth.make(s7), HistoricalTimeZoneDate.HistoricalTimeZoneDay.make(s9, s8, BWeekday.make(s10)), BTime.make(BRelTime.make(n)), s11);
|
||||
if (!bl4 && historicalTimeZoneDate5.occursBeforeAbsolute(historicalTimeZoneDate)) {
|
||||
if (s16 != 0) break;
|
||||
bl4 = true;
|
||||
}
|
||||
n2 = jarDataInputStream.readInt();
|
||||
s12 = jarDataInputStream.readShort();
|
||||
s13 = jarDataInputStream.readShort();
|
||||
s14 = jarDataInputStream.readShort();
|
||||
if (bl4) break;
|
||||
historicalTimeZoneDate4.update(historicalTimeZoneDate5);
|
||||
if (s16 != s5 || !bl2) continue;
|
||||
}
|
||||
if (s16 == s5) {
|
||||
historicalTimeZoneDate3.update(HistoricalTimeZoneDate.makeFromEpochMillis(-2208988800000L));
|
||||
historicalTimeZoneDate2.update(historicalTimeZoneDate5);
|
||||
} else {
|
||||
historicalTimeZoneDate3.update(historicalTimeZoneDate5);
|
||||
if (bl4) {
|
||||
historicalTimeZoneDate2.update(HistoricalTimeZoneDate.makeFromEpochMillis(253433923199999L));
|
||||
} else {
|
||||
historicalTimeZoneDate2.update(historicalTimeZoneDate4);
|
||||
}
|
||||
}
|
||||
if ((s14 < 0 || s14 >= s2) && s14 != 7334) {
|
||||
logger.error("could not parse timezone (invalid uses format) from timezones.jar; returning null");
|
||||
try {
|
||||
jarDataInputStream.closeEntry();
|
||||
}
|
||||
catch (IOException iOException) {}
|
||||
try {
|
||||
jarDataInputStream.readFully();
|
||||
}
|
||||
catch (IOException iOException) {}
|
||||
try {
|
||||
jarDataInputStream.close();
|
||||
}
|
||||
catch (IOException iOException) {}
|
||||
return null;
|
||||
}
|
||||
string2 = s14 == 7334 ? "" : (String)array5.get((int)s14);
|
||||
historicalTimeZoneEra = HistoricalTimeZoneEra.make(n2, "", string2, historicalTimeZoneDate2);
|
||||
if (s12 >= 0 && s12 < s3 || s12 == 7334) {
|
||||
if (s12 != 7334) {
|
||||
historicalTimeZoneEra.addRule((HistoricalDstRule)array2.get((int)s12));
|
||||
}
|
||||
} else {
|
||||
logger.error("could not parse timezone (invalid uses start rule) from timezones.jar; returning null");
|
||||
try {
|
||||
jarDataInputStream.closeEntry();
|
||||
}
|
||||
catch (IOException iOException) {}
|
||||
try {
|
||||
jarDataInputStream.readFully();
|
||||
}
|
||||
catch (IOException iOException) {}
|
||||
try {
|
||||
jarDataInputStream.close();
|
||||
}
|
||||
catch (IOException iOException) {}
|
||||
return null;
|
||||
}
|
||||
if (s13 >= 0 && s13 < s4 || s13 == 7334) {
|
||||
if (s13 != 7334) {
|
||||
historicalTimeZoneEra.addRule((HistoricalDstRule)array3.get((int)s13));
|
||||
}
|
||||
} else {
|
||||
logger.error("could not parse timezone (invalid uses end rule) from timezones.jar; returning null");
|
||||
try {
|
||||
jarDataInputStream.closeEntry();
|
||||
}
|
||||
catch (IOException iOException) {}
|
||||
try {
|
||||
jarDataInputStream.readFully();
|
||||
}
|
||||
catch (IOException iOException) {}
|
||||
try {
|
||||
jarDataInputStream.close();
|
||||
}
|
||||
catch (IOException iOException) {}
|
||||
return null;
|
||||
}
|
||||
historicalTimeZoneEra.setValidFromDate(historicalTimeZoneDate3);
|
||||
array.add(BTimeZone.DEFAULT.fw(1102, HistoricalTimeZone.make(jarEntry.getName().replace('\\', '/'), historicalTimeZoneEra), null, null, null));
|
||||
jarDataInputStream.closeEntry();
|
||||
}
|
||||
try {
|
||||
jarDataInputStream.readFully();
|
||||
}
|
||||
catch (IOException iOException) {}
|
||||
try {
|
||||
jarDataInputStream.close();
|
||||
}
|
||||
catch (IOException iOException) {}
|
||||
}
|
||||
catch (IOException iOException) {
|
||||
logger.error("error parsing file: timezones.jar; " + iOException.getMessage());
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
public static final HistoricalTimeZone getTimeZone(String string) {
|
||||
return TzJarUtil.getTimeZone(string, System.currentTimeMillis());
|
||||
}
|
||||
|
||||
public static final HistoricalTimeZone getTimeZone(String string, long l) {
|
||||
return TzJarUtil.decodeTimeZone(string, l, false, false);
|
||||
}
|
||||
|
||||
public static final void dumpTimeZone(String string) {
|
||||
TzJarUtil.decodeTimeZone(string, 0L, false, true);
|
||||
}
|
||||
|
||||
public static final HistoricalTimeZone getCompleteTimeZone(String string) {
|
||||
return TzJarUtil.decodeTimeZone(string, 0L, true, false);
|
||||
}
|
||||
|
||||
private static final synchronized HistoricalTimeZone decodeTimeZone(String string, long l, boolean bl, boolean bl2) {
|
||||
boolean bl3;
|
||||
logger.trace("entered decodeTimeZone(" + string + ", " + l);
|
||||
HistoricalTimeZoneDate historicalTimeZoneDate = HistoricalTimeZoneDate.makeFromEpochMillis(l);
|
||||
boolean bl4 = false;
|
||||
if (historicalTimeZoneDate.getTheYear() < HistoricalTimeZone.MIN_YEAR) {
|
||||
bl4 = true;
|
||||
}
|
||||
boolean bl5 = bl4;
|
||||
boolean bl6 = false;
|
||||
if (historicalTimeZoneDate.getTheYear() >= HistoricalTimeZone.MAX_YEAR) {
|
||||
bl6 = bl3 = true;
|
||||
}
|
||||
if (!TimeZoneDatabase.isZoneIdSupported(string)) {
|
||||
logger.error("the timezone " + string + " is not supported by timezones.jar, returning null");
|
||||
return null;
|
||||
}
|
||||
HistoricalTimeZoneDate historicalTimeZoneDate2 = HistoricalTimeZoneDate.makeMaximumDate();
|
||||
HistoricalTimeZoneDate historicalTimeZoneDate3 = HistoricalTimeZoneDate.makeMinimumDate();
|
||||
HistoricalTimeZoneDate historicalTimeZoneDate4 = HistoricalTimeZoneDate.makeMaximumDate();
|
||||
HistoricalTimeZoneDate historicalTimeZoneDate5 = HistoricalTimeZoneDate.makeMaximumDate();
|
||||
HistoricalTimeZoneEra historicalTimeZoneEra = null;
|
||||
HistoricalTimeZone historicalTimeZone = null;
|
||||
Class clazz = class$com$tridium$timezone$HistoricalDstRule;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$timezone$HistoricalDstRule = TzJarUtil.class("[Lcom.tridium.timezone.HistoricalDstRule;", false);
|
||||
}
|
||||
Array array = new Array(clazz);
|
||||
Class clazz2 = class$com$tridium$timezone$HistoricalDstRule;
|
||||
if (clazz2 == null) {
|
||||
clazz2 = class$com$tridium$timezone$HistoricalDstRule = TzJarUtil.class("[Lcom.tridium.timezone.HistoricalDstRule;", false);
|
||||
}
|
||||
Array array2 = new Array(clazz2);
|
||||
Class clazz3 = class$java$lang$String;
|
||||
if (clazz3 == null) {
|
||||
clazz3 = class$java$lang$String = TzJarUtil.class("[Ljava.lang.String;", false);
|
||||
}
|
||||
Array array3 = new Array(clazz3);
|
||||
Class clazz4 = class$java$lang$String;
|
||||
if (clazz4 == null) {
|
||||
clazz4 = class$java$lang$String = TzJarUtil.class("[Ljava.lang.String;", false);
|
||||
}
|
||||
Array array4 = new Array(clazz4);
|
||||
try {
|
||||
JarEntry jarEntry = null;
|
||||
DataInputStream dataInputStream = null;
|
||||
JarFile jarFile = null;
|
||||
jarFile = new JarFile(Nre.bootEnv.findTimeZoneDatabase());
|
||||
jarEntry = jarFile.getJarEntry(string.replace('/', '\\'));
|
||||
if (jarEntry == null) {
|
||||
logger.error("could not find the timezone: " + string + " in local timezones.jar");
|
||||
jarFile.close();
|
||||
throw new IOException();
|
||||
}
|
||||
dataInputStream = new DataInputStream(jarFile.getInputStream(jarEntry));
|
||||
short s = dataInputStream.readShort();
|
||||
short s2 = dataInputStream.readShort();
|
||||
short s3 = dataInputStream.readShort();
|
||||
short s4 = dataInputStream.readShort();
|
||||
short s5 = 0;
|
||||
short s6 = 0;
|
||||
short s7 = 0;
|
||||
short s8 = 0;
|
||||
short s9 = 0;
|
||||
short s10 = 0;
|
||||
short s11 = 0;
|
||||
short s12 = 7334;
|
||||
short s13 = 7334;
|
||||
short s14 = 7334;
|
||||
short s15 = 7334;
|
||||
int n = 0;
|
||||
int n2 = 0;
|
||||
int n3 = 0;
|
||||
String string2 = null;
|
||||
String string3 = null;
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
char c = '0';
|
||||
if (s != 0) {
|
||||
c = dataInputStream.readChar();
|
||||
while (c != ';') {
|
||||
if (c == ',') {
|
||||
array3.add((Object)stringBuffer.toString());
|
||||
stringBuffer = new StringBuffer();
|
||||
} else {
|
||||
stringBuffer.append(c);
|
||||
}
|
||||
c = dataInputStream.readChar();
|
||||
}
|
||||
array3.add((Object)stringBuffer.toString());
|
||||
stringBuffer = new StringBuffer();
|
||||
}
|
||||
if (s2 != 0) {
|
||||
c = dataInputStream.readChar();
|
||||
while (c != ';') {
|
||||
if (c == ',') {
|
||||
array4.add((Object)stringBuffer.toString());
|
||||
stringBuffer = new StringBuffer();
|
||||
} else {
|
||||
stringBuffer.append(c);
|
||||
}
|
||||
c = dataInputStream.readChar();
|
||||
}
|
||||
array4.add((Object)stringBuffer.toString());
|
||||
}
|
||||
short s16 = 0;
|
||||
while (s16 < s3) {
|
||||
s7 = dataInputStream.readShort();
|
||||
s9 = dataInputStream.readShort();
|
||||
s8 = dataInputStream.readShort();
|
||||
s10 = dataInputStream.readShort();
|
||||
n = dataInputStream.readInt();
|
||||
s11 = dataInputStream.readShort();
|
||||
n3 = dataInputStream.readInt();
|
||||
s15 = dataInputStream.readShort();
|
||||
if ((s15 < 0 || s15 >= s) && s15 != 7334) {
|
||||
logger.error("could not parse timezone (invalid dst uses letter) from timezones.jar; returning null");
|
||||
dataInputStream.close();
|
||||
jarFile.close();
|
||||
return null;
|
||||
}
|
||||
string2 = s15 == 7334 ? "" : (String)array3.get((int)s15);
|
||||
array.add((Object)HistoricalDstRule.make("", string2, "", HistoricalTimeZoneDate.START_OF_TIME, HistoricalTimeZoneDate.END_OF_TIME, HistoricalTimeZoneDate.make((short)-1, BMonth.make(s7), HistoricalTimeZoneDate.HistoricalTimeZoneDay.make(s9, s8, BWeekday.make(s10)), BTime.make(BRelTime.make(n)), s11), n3));
|
||||
s16 = (short)(s16 + 1);
|
||||
}
|
||||
s16 = 0;
|
||||
while (s16 < s4) {
|
||||
s7 = dataInputStream.readShort();
|
||||
s9 = dataInputStream.readShort();
|
||||
s8 = dataInputStream.readShort();
|
||||
s10 = dataInputStream.readShort();
|
||||
n = dataInputStream.readInt();
|
||||
s11 = dataInputStream.readShort();
|
||||
n3 = dataInputStream.readInt();
|
||||
s15 = dataInputStream.readShort();
|
||||
if ((s15 < 0 || s15 >= s) && s15 != 7334) {
|
||||
logger.error("could not parse timezone (invalid std uses letter) from timezones.jar; returning null");
|
||||
dataInputStream.close();
|
||||
jarFile.close();
|
||||
return null;
|
||||
}
|
||||
string2 = s15 == 7334 ? "" : (String)array3.get((int)s15);
|
||||
array2.add((Object)HistoricalDstRule.make("", string2, "", HistoricalTimeZoneDate.START_OF_TIME, HistoricalTimeZoneDate.END_OF_TIME, HistoricalTimeZoneDate.make((short)-1, BMonth.make(s7), HistoricalTimeZoneDate.HistoricalTimeZoneDay.make(s9, s8, BWeekday.make(s10)), BTime.make(BRelTime.make(n)), s11), n3));
|
||||
s16 = (short)(s16 + 1);
|
||||
}
|
||||
s5 = dataInputStream.readShort();
|
||||
s16 = 0;
|
||||
while ((bl2 || bl) && s16 < s5 || !bl2 && !bl && s16 < s5) {
|
||||
s6 = dataInputStream.readShort();
|
||||
s7 = dataInputStream.readShort();
|
||||
s9 = dataInputStream.readShort();
|
||||
s8 = dataInputStream.readShort();
|
||||
s10 = dataInputStream.readShort();
|
||||
n = dataInputStream.readInt();
|
||||
s11 = dataInputStream.readShort();
|
||||
historicalTimeZoneDate5.update(s6, BMonth.make(s7), HistoricalTimeZoneDate.HistoricalTimeZoneDay.make(s9, s8, BWeekday.make(s10)), BTime.make(BRelTime.make(n)), s11);
|
||||
if (!bl2 && !bl && !bl3 && historicalTimeZoneDate5.occursBeforeAbsolute(historicalTimeZoneDate)) {
|
||||
if (s16 != 0) break;
|
||||
bl3 = true;
|
||||
}
|
||||
n2 = dataInputStream.readInt();
|
||||
s12 = dataInputStream.readShort();
|
||||
s13 = dataInputStream.readShort();
|
||||
s14 = dataInputStream.readShort();
|
||||
if (bl3 || (s16 = (short)(s16 + 1)) == s5 && bl5 && !bl && !bl2) break;
|
||||
if (!bl2 && !bl) {
|
||||
historicalTimeZoneDate4.update(historicalTimeZoneDate5);
|
||||
continue;
|
||||
}
|
||||
if ((s14 < 0 || s14 >= s2) && s14 != 7334) {
|
||||
logger.error("could not parse timezone: " + string + " (invalid uses format) from timezones.jar; returning null");
|
||||
dataInputStream.close();
|
||||
jarFile.close();
|
||||
return null;
|
||||
}
|
||||
string3 = s14 == 7334 ? "" : (String)array4.get((int)s14);
|
||||
historicalTimeZoneEra = HistoricalTimeZoneEra.make(n2, "", string3, new HistoricalTimeZoneDate(historicalTimeZoneDate5));
|
||||
if (s12 >= 0 && s12 < s3 || s12 == 7334) {
|
||||
if (s12 != 7334) {
|
||||
historicalTimeZoneEra.addRule((HistoricalDstRule)array.get((int)s12));
|
||||
}
|
||||
} else {
|
||||
logger.error("could not parse timezone: " + string + " (invalid uses start rule) from timezones.jar; returning null");
|
||||
dataInputStream.close();
|
||||
jarFile.close();
|
||||
return null;
|
||||
}
|
||||
if (s13 >= 0 && s13 < s4 || s13 == 7334) {
|
||||
if (s13 != 7334) {
|
||||
historicalTimeZoneEra.addRule((HistoricalDstRule)array2.get((int)s13));
|
||||
}
|
||||
} else {
|
||||
logger.error("could not parse timezone: " + string + " (invalid uses end rule) from timezones.jar; returning null");
|
||||
dataInputStream.close();
|
||||
jarFile.close();
|
||||
return null;
|
||||
}
|
||||
if (historicalTimeZone == null) {
|
||||
historicalTimeZone = HistoricalTimeZone.make(string);
|
||||
}
|
||||
historicalTimeZone.addEra(historicalTimeZoneEra);
|
||||
}
|
||||
if (bl2 || bl) {
|
||||
if (historicalTimeZone != null) {
|
||||
HistoricalTimeZoneEra historicalTimeZoneEra2 = null;
|
||||
short s17 = 0;
|
||||
while (s17 < historicalTimeZone.getNumberEras()) {
|
||||
if (s17 == 0) {
|
||||
historicalTimeZoneEra2 = historicalTimeZone.getEraAtIndex(s17);
|
||||
historicalTimeZoneEra2.setValidUntilDate(HistoricalTimeZoneDate.makeFromEpochMillis(253433923199999L));
|
||||
historicalTimeZone.setEraAtIndex(historicalTimeZoneEra2, s17);
|
||||
}
|
||||
if (s17 != historicalTimeZone.getNumberEras() - 1) {
|
||||
historicalTimeZoneEra2 = historicalTimeZone.getEraAtIndex(s17);
|
||||
historicalTimeZoneEra2.setValidFromDate(historicalTimeZone.getEraAtIndex((short)(s17 + 1)).getValidUntilDate());
|
||||
historicalTimeZone.setEraAtIndex(historicalTimeZoneEra2, s17);
|
||||
} else {
|
||||
historicalTimeZoneEra2 = historicalTimeZone.getEraAtIndex(s17);
|
||||
historicalTimeZoneEra2.setValidFromDate(HistoricalTimeZoneDate.makeFromEpochMillis(-2208988800000L));
|
||||
historicalTimeZone.setEraAtIndex(historicalTimeZoneEra2, s17);
|
||||
}
|
||||
s17 = (short)(s17 + 1);
|
||||
}
|
||||
}
|
||||
dataInputStream.close();
|
||||
jarFile.close();
|
||||
if (bl2) {
|
||||
if (historicalTimeZone != null) {
|
||||
System.out.println(historicalTimeZone.toVerboseString());
|
||||
System.out.println(" Current Time in this Time Zone: ");
|
||||
System.out.println("\t\t" + BAbsTime.make(System.currentTimeMillis(), BTimeZone.getTimeZone(historicalTimeZone.getHistoricalTimeZoneName())));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
return historicalTimeZone;
|
||||
}
|
||||
if (s16 == s5) {
|
||||
historicalTimeZoneDate3.update(HistoricalTimeZoneDate.makeFromEpochMillis(-2208988800000L));
|
||||
historicalTimeZoneDate2.update(historicalTimeZoneDate5);
|
||||
} else {
|
||||
historicalTimeZoneDate3.update(historicalTimeZoneDate5);
|
||||
if (bl3) {
|
||||
historicalTimeZoneDate2.update(HistoricalTimeZoneDate.makeFromEpochMillis(253433923199999L));
|
||||
} else {
|
||||
historicalTimeZoneDate2.update(historicalTimeZoneDate4);
|
||||
}
|
||||
}
|
||||
if ((s14 < 0 || s14 >= s2) && s14 != 7334) {
|
||||
logger.error("could not parse timezone: " + string + " (invalid uses format) from timezones.jar; returning null");
|
||||
dataInputStream.close();
|
||||
jarFile.close();
|
||||
return null;
|
||||
}
|
||||
string3 = s14 == 7334 ? "" : (String)array4.get((int)s14);
|
||||
historicalTimeZoneEra = HistoricalTimeZoneEra.make(n2, "", string3, historicalTimeZoneDate2);
|
||||
if (s12 >= 0 && s12 < s3 || s12 == 7334) {
|
||||
if (s12 != 7334) {
|
||||
historicalTimeZoneEra.addRule((HistoricalDstRule)array.get((int)s12));
|
||||
}
|
||||
} else {
|
||||
logger.error("could not parse timezone: " + string + " (invalid uses start rule) from timezones.jar; returning null");
|
||||
dataInputStream.close();
|
||||
jarFile.close();
|
||||
return null;
|
||||
}
|
||||
if (s13 >= 0 && s13 < s4 || s13 == 7334) {
|
||||
if (s13 != 7334) {
|
||||
historicalTimeZoneEra.addRule((HistoricalDstRule)array2.get((int)s13));
|
||||
}
|
||||
} else {
|
||||
logger.error("could not parse timezone: " + string + " (invalid uses end rule) from timezones.jar; returning null");
|
||||
dataInputStream.close();
|
||||
jarFile.close();
|
||||
return null;
|
||||
}
|
||||
historicalTimeZoneEra.setValidFromDate(new HistoricalTimeZoneDate(historicalTimeZoneDate3));
|
||||
historicalTimeZone = HistoricalTimeZone.make(string, historicalTimeZoneEra);
|
||||
dataInputStream.close();
|
||||
jarFile.close();
|
||||
}
|
||||
catch (Exception exception) {
|
||||
return null;
|
||||
}
|
||||
logger.trace("successfully generated timezone:" + string + " for " + l);
|
||||
return historicalTimeZone;
|
||||
}
|
||||
|
||||
static /* synthetic */ Class class(String string, boolean bl) {
|
||||
try {
|
||||
Class<?> clazz = Class.forName(string);
|
||||
if (!bl) {
|
||||
clazz = clazz.getComponentType();
|
||||
}
|
||||
return clazz;
|
||||
}
|
||||
catch (ClassNotFoundException classNotFoundException) {
|
||||
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public static class JarDataInputStream
|
||||
extends JarInputStream {
|
||||
private static final int SIZE_OF_CHAR = 2;
|
||||
private static final int SIZE_OF_SHORT = 2;
|
||||
private static final int SIZE_OF_INT = 4;
|
||||
private static final int SIZE_OF_LONG = 8;
|
||||
private int entryBytesRead = 0;
|
||||
|
||||
public JarEntry getNextJarEntry() throws IOException {
|
||||
this.entryBytesRead = 0;
|
||||
return super.getNextJarEntry();
|
||||
}
|
||||
|
||||
byte readByte() throws IOException {
|
||||
byte[] byArray = new byte[1];
|
||||
this.entryBytesRead += super.read(byArray, 0, 1);
|
||||
return byArray[0];
|
||||
}
|
||||
|
||||
char readChar() throws IOException {
|
||||
return new ByteBuffer(this.read(2)).readChar();
|
||||
}
|
||||
|
||||
short readShort() throws IOException {
|
||||
return new ByteBuffer(this.read(2)).readShort();
|
||||
}
|
||||
|
||||
int readInt() throws IOException {
|
||||
return new ByteBuffer(this.read(4)).readInt();
|
||||
}
|
||||
|
||||
long readLong() throws IOException {
|
||||
return new ByteBuffer(this.read(8)).readLong();
|
||||
}
|
||||
|
||||
byte[] read(int n) throws IOException {
|
||||
byte[] byArray = new byte[n];
|
||||
int n2 = 0;
|
||||
while (n2 < n) {
|
||||
byArray[n2] = (byte)super.read();
|
||||
++n2;
|
||||
}
|
||||
this.entryBytesRead += n;
|
||||
return byArray;
|
||||
}
|
||||
|
||||
int getEntryBytesRead() {
|
||||
return this.entryBytesRead;
|
||||
}
|
||||
|
||||
void readFully() throws IOException {
|
||||
byte[] byArray = new byte[1024];
|
||||
while (this.in.read(byArray, 0, 1024) > 0) {
|
||||
}
|
||||
}
|
||||
|
||||
public JarDataInputStream(InputStream inputStream) throws IOException {
|
||||
super(inputStream);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,172 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.xml.XElem
|
||||
* javax.baja.xml.XException
|
||||
*/
|
||||
package com.tridium.timezone;
|
||||
|
||||
import java.io.IOException;
|
||||
import javax.baja.sys.BMonth;
|
||||
import javax.baja.sys.BTime;
|
||||
import javax.baja.sys.BWeekday;
|
||||
import javax.baja.timezone.BTimeZone;
|
||||
import javax.baja.timezone.DstRule;
|
||||
import javax.baja.xml.XElem;
|
||||
import javax.baja.xml.XException;
|
||||
|
||||
public class TzXmlDecoder {
|
||||
public static BTimeZone getTimeZone(XElem xElem) throws IOException {
|
||||
return TzXmlDecoder.getTimeZone(xElem, true);
|
||||
}
|
||||
|
||||
public static BTimeZone getTimeZone(XElem xElem, boolean bl) throws IOException {
|
||||
XElem xElem2;
|
||||
BTimeZone bTimeZone = null;
|
||||
String string = xElem.get("id");
|
||||
int n = TzXmlDecoder.getRelTime("utcOffset", xElem, true);
|
||||
String string2 = string;
|
||||
String string3 = string;
|
||||
String string4 = string;
|
||||
String string5 = string;
|
||||
XElem xElem3 = xElem.elem("display");
|
||||
if (xElem3 != null) {
|
||||
string2 = xElem3.get("name", string);
|
||||
string3 = xElem3.get("short", string2);
|
||||
string4 = xElem3.get("dstName", string);
|
||||
string5 = xElem3.get("dstShort", string4);
|
||||
}
|
||||
if ((xElem2 = xElem.elem("dst")) == null) {
|
||||
bTimeZone = bl ? BTimeZone.make(string, n) : BTimeZone.makeIgnoringCache(string, n);
|
||||
} else {
|
||||
int n2 = TzXmlDecoder.getRelTime("savings", xElem2, true);
|
||||
DstRule dstRule = TzXmlDecoder.getRule("start", xElem2, true);
|
||||
DstRule dstRule2 = TzXmlDecoder.getRule("end", xElem2, true);
|
||||
bTimeZone = bl ? BTimeZone.make(string, string2, string3, string4, string5, n, n2, dstRule, dstRule2) : BTimeZone.makeIgnoringCache(string, string2, string3, string4, string5, n, n2, dstRule, dstRule2);
|
||||
}
|
||||
return bTimeZone;
|
||||
}
|
||||
|
||||
public static int getRelTime(String string, XElem xElem, boolean bl) {
|
||||
String string2 = xElem.get(string, null);
|
||||
if (string2 == null) {
|
||||
if (bl) {
|
||||
throw new XException("Missing \"" + string + "\" attribute.", xElem);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
try {
|
||||
if (string2.endsWith("h")) {
|
||||
return (int)(Float.parseFloat(string2.substring(0, string2.length() - 1)) * 3600000.0f);
|
||||
}
|
||||
return Integer.parseInt(string2);
|
||||
}
|
||||
catch (Exception exception) {
|
||||
throw new XException("Invalid time format: " + string2, xElem);
|
||||
}
|
||||
}
|
||||
|
||||
public static DstRule getRule(String string, XElem xElem, boolean bl) throws IOException {
|
||||
String string2;
|
||||
String string3;
|
||||
BTime bTime = null;
|
||||
int n = -1;
|
||||
BMonth bMonth = null;
|
||||
int n2 = 0;
|
||||
int n3 = -1;
|
||||
int n4 = -1;
|
||||
BWeekday bWeekday = null;
|
||||
XElem xElem2 = xElem.elem(string);
|
||||
if (xElem2 == null) {
|
||||
if (bl) {
|
||||
throw new XException("Missing \"" + string + "\" element.", xElem);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
String string4 = xElem2.get("time");
|
||||
int n5 = string4.indexOf(32);
|
||||
if (n5 == -1) {
|
||||
bTime = TzXmlDecoder.parseTime(string4);
|
||||
n = 0;
|
||||
} else {
|
||||
bTime = TzXmlDecoder.parseTime(string4.substring(0, n5));
|
||||
n = DstRule.decodeTimeMode(string4.substring(n5 + 1));
|
||||
}
|
||||
String string5 = xElem2.get("month");
|
||||
bMonth = (BMonth)BMonth.january.decodeFromString(string5);
|
||||
String string6 = xElem2.get("weekday", null);
|
||||
if (string6 != null) {
|
||||
bWeekday = (BWeekday)BWeekday.sunday.decodeFromString(string6);
|
||||
}
|
||||
if ((string3 = xElem2.get("week", null)) != null) {
|
||||
try {
|
||||
n4 = DstRule.decodeWeek(string3);
|
||||
}
|
||||
catch (IllegalArgumentException illegalArgumentException) {
|
||||
throw new XException("Invalid week specification: " + string3, xElem2);
|
||||
}
|
||||
} else {
|
||||
n4 = -1;
|
||||
}
|
||||
if ((string2 = xElem2.get("day", null)) != null) {
|
||||
if (string2.endsWith("...")) {
|
||||
n3 = 1;
|
||||
n2 = Integer.parseInt(string2.substring(0, string2.length() - 3));
|
||||
} else if (string2.startsWith("...")) {
|
||||
n3 = 2;
|
||||
n2 = Integer.parseInt(string2.substring(3));
|
||||
} else {
|
||||
n3 = 0;
|
||||
n2 = Integer.parseInt(string2);
|
||||
}
|
||||
} else {
|
||||
n3 = -1;
|
||||
}
|
||||
if (n3 == -1) {
|
||||
if (n4 == -1) {
|
||||
throw new XException("Week is required if no day is specified.", xElem2);
|
||||
}
|
||||
if (bWeekday == null) {
|
||||
throw new XException("Weekday is required if no day is specified.", xElem2);
|
||||
}
|
||||
return DstRule.makeWeekday(bTime, n, n4, bWeekday, bMonth);
|
||||
}
|
||||
if (n3 == 0) {
|
||||
if (n4 != -1) {
|
||||
throw new XException("\"week\" is not a valid attribute for exact day rules.", xElem2);
|
||||
}
|
||||
if (bWeekday != null) {
|
||||
throw new XException("\"weekday\" is not a valid attribute for exact day rules.", xElem2);
|
||||
}
|
||||
return DstRule.makeExact(bTime, n, bMonth, n2);
|
||||
}
|
||||
if (n3 == 1) {
|
||||
if (n4 != -1) {
|
||||
throw new XException("\"week\" is not a valid attribute for \"on or after\" rules.", xElem2);
|
||||
}
|
||||
if (bWeekday == null) {
|
||||
throw new XException("\"weekday\" is a required attribute for \"on or after\" rules.", xElem2);
|
||||
}
|
||||
return DstRule.makeOnOrAfter(bTime, n, bMonth, n2, bWeekday);
|
||||
}
|
||||
if (n3 == 2) {
|
||||
if (n4 != -1) {
|
||||
throw new XException("\"week\" is not a valid attribute for \"on or before\" rules.", xElem2);
|
||||
}
|
||||
if (bWeekday == null) {
|
||||
throw new XException("\"weekday\" is a required attribute for \"on or before\" rules.", xElem2);
|
||||
}
|
||||
return DstRule.makeOnOrBefore(bTime, n, bMonth, n2, bWeekday);
|
||||
}
|
||||
throw new XException("Invalid day mode: " + n3, xElem2);
|
||||
}
|
||||
|
||||
public static BTime parseTime(String string) {
|
||||
int n = string.indexOf(58);
|
||||
int n2 = Integer.parseInt(string.substring(0, n));
|
||||
int n3 = Integer.parseInt(string.substring(n + 1));
|
||||
return BTime.make(n2, n3, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user