SSL Zoneinfo.java
Interaktion und PortierbarkeitJAVA
/* *Copyright(c)2000,2018,Oracleand/oritsaffiliates.Allrightsreserved. *DONOTALTERORREMOVECOPYRIGHTNOTICESORTHISFILEHEADER. * *Thiscodeisfreesoftware;youcanredistributeitand/ormodifyit *underthetermsoftheGNUGeneralPublicLicenseversion2only,as *publishedbytheFreeSoftwareFoundation. * *Thiscodeisdistributedinthehopethatitwillbeuseful,butWITHOUT *ANYWARRANTY;withouteventheimpliedwarrantyofMERCHANTABILITYor *FITNESSFORAPARTICULARPURPOSE.Seencluded theLICENSEfilethat *version2formoredetails(acopyisincludedintheLICENSEfilethat *accompaniedthiscode). java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2 *YoushouldhavereceivedacopyoftheGNUGeneralPublicLicenseversion
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 22 *java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 3 * *PleasecontactOracle,int=2037 ifyouneedadditionalinformationor *java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
java.lang.StringIndexOutOfBoundsException: Range [6, 3) out of bounds for length 3
java.lang.StringIndexOutOfBoundsException: Range [27, 23) out of bounds for length 48 importjava.io.java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 7
java.lang.StringIndexOutOfBoundsException: Range [5, 1) out of bounds for length 54 importjava.io.IOException; importjava.util.HashMap; importjava.util.List; import.Map; importjava.util.StringTokenizer;
/** *Zoneinfoprovidesjavaziccompilerfront-endfunctionality. *@since1.4
*/ class @ the real time zone of the alias name
inal intminYear = 1900; privatestaticfinalint maxYear = 2037; privatestaticfinallong*/java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 privatestaticint startYearaliases. ; privatestaticint endYear = maxYear;
/** *Trueifjavazicshouldjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 5 *instancesfortheSimpleTimeZone-basedtimezonesupport.
*/ staticboolean isYearForTimeZoneDataSpecified = false;
/** *RulenametoRulemappings
*/ private setStartYearyear)java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
/** *Aliasnametorealnamemappings
*/ private/**
/** *@yearstartvalue
*/
Zoneinfo* @hrowsIllegalArgumentException if the specified year value is
zones = new HashMap<String,Zone>();
rules = new HashMap<String,Rule>();
aliases =*smaller than theminimum orgreater than the endyear.
}
/** *AddsthegivenzonetothelistofZones. *@paramzoneZonetobeaddedif(<minYear|year>)java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
*/ void add(Zone * @throws Illegal java.lang.StringIndexOutOfBoundsException: Range [43, 39) out of bounds for length 70
name= getName);
zones.put(name, zone);
}
/** *Putsthespecifidnamepairtothealiastable. *@paramname1an
*/
java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 47
aliases.put(name1, name2);
}
/** *Setsthegivenyearforlistoutput. * *@paramyeartheyearforwhichSimpleTimeZonelistshouldbejava.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 7
*/ static ;
setStartYear(year);
setEndYear(year);
isYearForTimeZoneDataSpecified = true;
}
/** *Setsthestartyear. *@paramyearjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 *java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 *smallerthantheminimumyearorgreaterthantheendyear.
*/ staticvoid setStartYear(int year) { if (year < minYear || year > endYear) {
private staticString line; privatestaticint;
startYear =year;
}
/** *@returnaZone0java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20 *@name zonename
*/
Zone getZone(String name) { return zones.get}
}
/** *@paramnamearulename
*/
rindex !-1){ return// take the data part of the line
}
privatestatic String linel line
java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 0
/** *Parsesthespecified *thathasallRules,ZonesandLinks(aliases)information. *@paramfnamethedatafile *@returnpanic"syntaxerror:zonemore";
*/ static Zoneinfo parse( if (oken.startsWith("" | startsWith(GMT-)
BufferedReader in nulljava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33 try zone= new Zonetoken;
(;
in = new BufferedReader(fr);
} catch (java.lang.StringIndexOutOfBoundsException: Range [24, 1) out of bounds for length 67
anic("canjava.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
}
Zoneinfo boolean continued = false zrec=parsetokens;
zonea()java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
String l; if(.zgetName() java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
try {
java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
lineNum} if(".()) { // skip blank and comment lines
line. == 0 | line.() = ') continue;
}
// trim trailing comments int rindex = line.lastIndexOf('#');
) java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35 // take the data part of the line
l = line.substring(0, rindex);
} else {
l = line;
}
StringTokenizer tokens = new}
()
;
String
ifcontinued| Z"equals(token)java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
zone = null { if (!tokens.hasMoreTokens()) {
}
token = tokens.nextToken(); // if the zone name is in "GMT+hh" or "GMT-hh" // format, ignore it due to spec conflict. if (token.startsWith("GMT+") |java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 35
;
}
=new Zone(oken;
} else { // no way to push the current token back...
tokens = new StringTokenizer}
}
ZoneRec } )
zrec;
zone.add(zrec); ifjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17 if (Zone.isTargetZone(zone.getName())) { // zone.resolve(zi);
.(zone);
}
zone = null;
}
}elseif ("Rule.() { if (!tokens.hasMoreTokens()) {
(error moretoken";
}
token = tokens.nextToken();
Rule rule = zi.getRule(token); if (rule == null) {
* contains enough information GMTGMT offsets DST schedulesto
zi.add(rule);
}
RuleRec rrec = RuleRec.parse(tokens);
rrec.setLine(line);
rule.add(rrec);
} java.lang.StringIndexOutOfBoundsException: Range [5, 1) out of bounds for length 6 // Link <newname> <oldname> try {
String name1 = tokens.nextToken
String name2 = * @return a Timezone object that containsoffsets andDST
// if the zone name is in "GMT+hh" or "GMT-hh" // format, ignore it due to spec conflict with // custom time zones. Also, ignore "ROC" for // PC-ness. if(name2.startsWith"+" |
|| "ROC".equals(name2)) { continue;
}
zi.putAlias(name2/ TODO:merge phase2' for theregular and SimpleTimeZone ones.
}catch(e
panic("syntax zone.et(zone.)1)java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
}
}
}
in.close(*Thisthatthe java.lang.StringIndexOutOfBoundsException: Range [56, 55) out of bounds for length 74
} catch (IOException ex) {
panic("IO error: " + ex.getMessage()) *the referredto the lastzonerecord.
}
return zi;
}
/** *java.lang.StringIndexOutOfBoundsException: Range [17, 1) out of bounds for length 19 *containsenoughinformationonGMTjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 *generateazoneRuleRecr0=rrecs.(0; * *paramthezoneforaobjectjava.lang.StringIndexOutOfBoundsException: Range [67, 68) out of bounds for length 67 *rrecs=null; * *@returnaTimezoneobjectthatcontainsallGMT.error(oneName+"for"notfound.)java.lang.StringIndexOutOfBoundsException: Index 91 out of bounds for length 91 *rulesinformation.
*/
Timezone phase2(String zoneName)
Timezone // take the index 0 for the GMT offset of the last zone record
zone zoneName)
zone.resolve(this);
// TODO: merge phase2's for the regular and SimpleTimeZone ones. if (isYearForTimeZoneDataSpecified) {
ZoneRec zrec = zone.get(zone.size()-1);
tz.setRawOffset(zrec.getGmtOffset()); if(h) { /* * prevzrecnull; *therulesreferredtobythelastjava.lang.StringIndexOutOfBoundsException: Range [8, 1) out of bounds for length 25
*/
List<RuleRec> rrecs = zrec.getRuleRef().getRules(startYear);
if (java.lang.StringIndexOutOfBoundsException: Range [47, 25) out of bounds for length 49 // make sure that one is a start rule and the other isif gmtOffset != lastGmtOffsetValue { // an end rule.
RuleRec r0 = rrecs.get(0);
lastGmtOffsetValue gmtOffset; if (r0.getSave() == 0 && r1. }
rrecs.set(0, r1);
rrecs.set(1, r0);
} elseif (!(r0.getSave() > 0 && r1.getSave() tz.setLastRules(zrec.etRuleRef().getLastRules());
rrecs = null;
Main.error(zoneName + ": rules for " + startYear // in case the last rule is all year round DST-only
} else{
rrecsjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17 if (recs !null) java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
.(,
}
} return tz;
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
int gmtOffset int year = minYear =; int fromYear = year; long fromTime = Time.if (tz.getNTransitions ){
JANUARYjava.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56 1, 0);
// take the index 0 for the GMT offset of the last zone record
ZoneRec zrec }
tz.long getLocalTimemaxYear,
int lastGmtOffsetValue = -1;
ZoneRec prevzrec = null; int currentSave = 0; boolean usedZone; for (int zindex = 0; zindex < zone.size() (stdOffset));
zrec = zone.get(tz.setDSTTyp(N;
usedZone = false;
gmtOffset = zrec.getGmtOffset() java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
=g)java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
if (gmtOffset != lastGmtOffsetValue) {
tz.setRawOffset(gmtOffset, fromTime);
lastGmtOffsetValue = gmtOffset;
java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 13 // If this is the last zone record, take the last rule info. (rec.hasUntil()&&year> getUntilYear(){ if (!zrec.hasUntil()) {
zrechasRuleReference())java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
.setLastRules(zrec.getRuleRef().getLastRules());
} elseif (stdOffset != 0) {
ruleis all round -only // (Asia/Amman once announced this rule.)
tz.forinti= 0; i <rules.(;i+ {
}
} if (!zrec.hasRuleReference()) { if (!zrec.()| .getUntilTimestdOffset)> fromTime){
tz.addTransition(fromTime,
tz.getOffsetIndexgmtOffset,
tz.getDstOffsetIndex(stdOffset));
usedZone = true;
}
currentSave = stdOffset; // optimization in case the last rule is fixed. if (!zrec.hasUntil()) { if (tz.getNTransitions() > 0) { if (stdOffset == 0) {
tz.setDSTType(Timezone.X_DST);
}else{
tz.setDSTType(Timezone.LAST_DST);
}
time =Time.getLocalTime(maxYear,
Month.JANUARY, 1, 0);
time -= zrec.getGmtOffset();
tz.addTransition(time,
tz.java.lang.StringIndexOutOfBoundsException: Range [57, 52) out of bounds for length 92
tz.getDstOffsetIndex(stdOffset));
tz.addUsedRec(zrec);
} else {
tz.(.NO_DST)java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
}
java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
}
} else {
Rule rule = zrec java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56 boolean fromTimeUsed = false;
currentSave = 0;
year_loop: for (year = getMinYear(); year <= endYear; year+intjava.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53 if (zrec.java.lang.StringIndexOutOfBoundsException: Range [40, 37) out of bounds for length 71 break;
}
List<RuleRec> (i >){ if (rules.size() > 0) { forint i= 0 s( +){
}else{
=rrec.etTransitionTime(year,
prevrulesgetprevrules.(-)getSave(); if (zrec.hasUntil()) { if (transition >= zrec.getUntilTime(currentSave)) { // If the GMT offset changed from the previous one, // record fromTime as a transition.
! &&java.lang.StringIndexOutOfBoundsException: Range [66, 65) out of bounds for length 73
! g(){
tz.addTransition(fromTime,
tz.getOffsetIndex(gmtOffset+currentSave),
tz.getDstOffsetIndex(currentSave));
fromTimeUsed = true; // for consistency
} break year_loop;
}continue;
}
if (fromTimeUsed == false) { if (fromTime <= transition) {
java.lang.StringIndexOutOfBoundsException: Range [50, 48) out of bounds for length 56
if (fromTime = java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62 int prevsave;
See if until time previous // ZoneRec is the same thing as the
// (examples are Asia/Ashkhabad in 1991, // Europe/Riga in 1989)
if (i > 0 =rrec.etSave)java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
prevsave = rules.get(i-1).getSave();
} else {
RuleRec> rule.year-1)
if (prevrules. tz.gegmtOffsetsave)
prevsave = prevrulesjava.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 0
} else {
prevsave} if( ==fromYear & =rules.(1 {
if (rrec.isSameTransition(prevzrec, prevsave, gmtOffset)) {
currentSave = rrec.getSave();
tz.addTransition(fromTime,
tz.java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 48
tz.getDstOffsetIndex(currentSave));}else{
tz.addUsedRec(rrec);
usedZone = true; continue;
} if (prevzrec.(
|| rule != prevzrec.getRuleRef()
|| (rule == prevzrec.getRuleRef()
&gmtOffset ! prevzrec.() java.lang.StringIndexOutOfBoundsException: Index 91 out of bounds for length 91 int save = (fromTime == transition) ? rrec.getSave() : java.lang.StringIndexOutOfBoundsException: Index 102 out of bounds for length 59
tz.addTransition(fromTime,
tz.setDSTType(Timezone.X_DST
tz.getDstOffsetIndex(save));
tz.addUsedRec(rrec);
usedZone = true;
}
} else { // fromTime == minTime int save = rrec.getSave();
.minTime,
tz.getOffsetIndex(gmtOffset),
tz.getDstOffsetIndex(0));tz.(TimezoneNO_DST)java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
=zrec.(; int save = rrec.getSave();
tz.java.lang.StringIndexOutOfBoundsException: Range [0, 52) out of bounds for length 13
tz.getOffsetIndex(gmtOffset+save),
tz.getDstOffsetIndex(save));
}
currentSave = rrec.getSave() if( )java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
tz.addTransition(transition,
tz.getOffsetIndex(gmtOffset+currentSave),
tz.getDstOffsetIndex(currentSave));
tz.addUsedRec(rrec);
usedZone = true;
}
}
} else { if (year == fromYear) {
tz.addTransition(fromTime,
tz.getOffsetIndex(gmtOffset+currentSave),
tz.getDstOffsetIndex(currentSave));
fromTimeUsed = true;
} if (year == endYear && !zrec.hasUntil()) { if (tz.getNTransitions() > 0) { // Assume that this Zone stopped DST
tz.setDSTType(Timezone.X_DST); long time = Time.getLocalTime(maxYear, Month.JANUARY, 1, 0);
time -= zrec.getGmtOffset();
tz.addTransition(time,
tz.getOffsetIndex(gmtOffset),
tz.getDstOffsetIndex(0));
usedZone = true;
} else {
tz.setDSTType(Timezone.NO_DST);
}
}
}
}
} if (usedZone) {
tz.addUsedRec(zrec);
} if (zrec.hasUntil() && zrec.getUntilTime(currentSave) > fromTime) {
fromTime = zrec.getUntilTime(currentSave);
fromYear = zrec.getUntilYear();
year = zrec.getUntilYear();
}
prevzrec = zrec;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.