576 lines
31 KiB
Java
576 lines
31 KiB
Java
/*
|
|
* 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;
|
|
}
|
|
}
|
|
}
|
|
|