Commit b7e250eb authored by Andy Wilkinson's avatar Andy Wilkinson

Merge branch '2.1.x' into 2.2.x

parents 18462796 ebebe09a
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -595,11 +595,12 @@ class JarFileTests { ...@@ -595,11 +595,12 @@ class JarFileTests {
jarOutputStream.write(new byte[] { (byte) 1 }); jarOutputStream.write(new byte[] { (byte) 1 });
jarOutputStream.closeEntry(); jarOutputStream.closeEntry();
} }
JarFile jarFile = new JarFile(file); try (JarFile jar = new JarFile(file)) {
Enumeration<java.util.jar.JarEntry> entries = jarFile.entries(); Enumeration<java.util.jar.JarEntry> entries = jar.entries();
JarEntry entry = entries.nextElement(); JarEntry entry = entries.nextElement();
assertThat(entry.getLastModifiedTime().toInstant()).isEqualTo(Instant.EPOCH); assertThat(entry.getLastModifiedTime().toInstant()).isEqualTo(Instant.EPOCH);
assertThat(entry.getName()).isEqualTo("1.dat"); assertThat(entry.getName()).isEqualTo("1.dat");
}
} }
private int getJavaVersion() { private int getJavaVersion() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment