Skip to content

Commit a299f14

Browse files
committed
version update
uses tzdb2018f + new time4j-version v5.0
1 parent 6c808f9 commit a299f14

File tree

5 files changed

+26
-15
lines changed

5 files changed

+26
-15
lines changed

pom.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<modelVersion>4.0.0</modelVersion>
55
<groupId>net.time4j</groupId>
66
<artifactId>time4j-tzdata</artifactId>
7-
<version>3.0-2018e</version>
7+
<version>5.0-2018f</version>
88
<packaging>jar</packaging>
99
<name>Time4J-TZDATA</name>
1010

@@ -69,8 +69,8 @@
6969
<fork>true</fork>
7070
<compilerVersion>${jdk.min.version}</compilerVersion>
7171
<encoding>${project.build.sourceEncoding}</encoding>
72-
<source>1.6</source>
73-
<target>1.6</target>
72+
<source>1.8</source>
73+
<target>1.8</target>
7474
<showDeprecation>true</showDeprecation>
7575
<showWarnings>true</showWarnings>
7676
<debug>true</debug>
@@ -225,14 +225,14 @@
225225
<properties>
226226
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
227227
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
228-
<jdk.min.version>1.6</jdk.min.version>
228+
<jdk.min.version>1.8</jdk.min.version>
229229
</properties>
230230

231231
<dependencies>
232232
<dependency>
233233
<groupId>net.time4j</groupId>
234234
<artifactId>time4j-base</artifactId>
235-
<version>[4.99.0-beta]</version>
235+
<version>5.0</version>
236236
<scope>provided</scope>
237237
</dependency>
238238
<dependency>

src/main/java/net/time4j/tz/repo/TimezoneRepositoryProviderSPI.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,15 @@ public TimezoneRepositoryProviderSPI() {
8888
String tmpLocation = "";
8989
PlainDate tmpExpires = PlainDate.axis().getMinimum();
9090

91-
Map<String, byte[]> tmpData = new HashMap<String, byte[]>();
92-
Map<String, String> tmpAliases = new HashMap<String, String>();
91+
Map<String, byte[]> tmpData = new HashMap<>();
92+
Map<String, String> tmpAliases = new HashMap<>();
9393

9494
boolean noLeaps =
9595
(System.getProperty("net.time4j.scale.leapseconds.path") != null);
9696
if (noLeaps) {
9797
this.leapsecs = Collections.emptyMap();
9898
} else {
99-
this.leapsecs = new LinkedHashMap<GregorianDate, Integer>(50);
99+
this.leapsecs = new LinkedHashMap<>(50);
100100
}
101101

102102
String repositoryPath =
@@ -154,7 +154,7 @@ public TimezoneRepositoryProviderSPI() {
154154
String v = dis.readUTF();
155155
int sizeOfZones = dis.readInt();
156156

157-
List<String> zones = new ArrayList<String>(sizeOfZones);
157+
List<String> zones = new ArrayList<>(sizeOfZones);
158158

159159
for (int i = 0; i < sizeOfZones; i++) {
160160
String zoneID = dis.readUTF();
@@ -273,9 +273,7 @@ public TransitionHistory load(String zoneID) {
273273
ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(bytes));
274274
return (TransitionHistory) ois.readObject();
275275
}
276-
} catch (IOException e) {
277-
e.printStackTrace();
278-
} catch (ClassNotFoundException e) {
276+
} catch (IOException | ClassNotFoundException e) {
279277
e.printStackTrace();
280278
}
281279

25 Bytes
Binary file not shown.

src/test/java/net/time4j/tz/repo/RepositoryTest.java

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public class RepositoryTest {
3737
TZDATA.init();
3838
}
3939

40-
private static final String STD_VERSION = "2018e";
40+
private static final String STD_VERSION = "2018f";
4141
private static final ChronoFormatter<Moment> PARSER = Iso8601Format.EXTENDED_DATE_TIME_OFFSET;
4242

4343
private String propertyValue = null;
@@ -628,14 +628,14 @@ public void tzEuropeDublin() throws IOException {
628628

629629
@Test
630630
public void leapSecondAtEndOf2016() {
631-
use("2018e");
631+
use("2018f");
632632
LeapSecondProvider repo = new TimezoneRepositoryProviderSPI();
633633
assertThat(
634634
repo.getLeapSecondTable().size(),
635635
is(27));
636636
assertThat(
637637
repo.getDateOfExpiration().toString(),
638-
is("2018-12-28"));
638+
is("2019-06-28"));
639639
assertThat(
640640
repo.getLeapSecondTable().get(PlainDate.of(2016, 12, 31)).intValue(),
641641
is(1));
@@ -662,6 +662,19 @@ public void tzEuropePrague() throws ParseException {
662662
checkTransitions(zoneID, start, end, data);
663663
}
664664

665+
@Test
666+
public void tzAsiaTokyo() throws ParseException, IOException {
667+
use("2018f");
668+
String zoneID = "Asia/Tokyo";
669+
int start = 1950;
670+
int end = 1950;
671+
Object[][] data = {
672+
{"1950-05-06T15:00:00Z", 9, 10, 1},
673+
{"1950-09-09T15:00:00Z", 10, 9, 0},
674+
};
675+
checkTransitions(zoneID, start, end, data);
676+
}
677+
665678
@Test
666679
public void normalize() {
667680
assertThat(
92.7 KB
Binary file not shown.

0 commit comments

Comments
 (0)