use of java.util.TimeZone in project j2objc by google.
the class GregorianCalendarTest method test_computeTime_enteringDst_DelegatingTimeZone_LosAngeles_2014.
/**
* This test will fail in the RI.
*
* <p>The AOSP behavior is different for backwards compatibility with previous versions of
* Android.
*
* <p>Search in this file for 'OpenJDK Failure' to see more details.
*/
public void test_computeTime_enteringDst_DelegatingTimeZone_LosAngeles_2014() {
TimeZone timeZone = TimeZone.getTimeZone("America/Los_Angeles");
timeZone = new DelegatingTimeZone(timeZone);
checkDstLosAngeles2014(timeZone);
}
use of java.util.TimeZone in project j2objc by google.
the class GregorianCalendarTest method checkOutsideDst.
private void checkOutsideDst(Calendar cal, String description) {
TimeZone timeZone = cal.getTimeZone();
checkOutsideDst(cal, description, timeZone.getRawOffset());
}
use of java.util.TimeZone in project j2objc by google.
the class GregorianCalendarTest method checkInsideDst.
private void checkInsideDst(Calendar cal, String description) {
TimeZone timeZone = cal.getTimeZone();
checkDstFields(cal, description, timeZone.getRawOffset(), timeZone.getDSTSavings());
}
use of java.util.TimeZone in project j2objc by google.
the class GregorianCalendarTest method test_computeTime_enteringDst_TimeZone_LosAngeles_2014.
public void test_computeTime_enteringDst_TimeZone_LosAngeles_2014() {
TimeZone timeZone = TimeZone.getTimeZone("America/Los_Angeles");
checkDstLosAngeles2014(timeZone);
}
use of java.util.TimeZone in project j2objc by google.
the class SimpleDateFormat method readObject.
/**
* After reading an object from the input stream, the format
* pattern in the object is verified.
* <p>
* @exception InvalidObjectException if the pattern is invalid
*/
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {
stream.defaultReadObject();
try {
compiledPattern = compile(pattern);
} catch (Exception e) {
throw new InvalidObjectException("invalid pattern");
}
if (serialVersionOnStream < 1) {
// didn't have defaultCenturyStart field
initializeDefaultCentury();
} else {
// fill in dependent transient field
parseAmbiguousDatesAsAfter(defaultCenturyStart);
}
serialVersionOnStream = currentSerialVersion;
// If the deserialized object has a SimpleTimeZone, try
// to replace it with a ZoneInfo equivalent in order to
// be compatible with the SimpleTimeZone-based
// implementation as much as possible.
TimeZone tz = getTimeZone();
if (tz instanceof SimpleTimeZone) {
String id = tz.getID();
TimeZone zi = TimeZone.getTimeZone(id);
if (zi != null && zi.hasSameRules(tz) && zi.getID().equals(id)) {
setTimeZone(zi);
}
}
}
Aggregations