Skip to content

Commit 6c519f2

Browse files
committed
Fix compiling on Java 8
1 parent 2885bdd commit 6c519f2

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

src/main/java/org/xbill/DNS/Cache.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,13 @@ public Cache(InputStream input) throws IOException {
213213

214214
private <T> Cache(Master m) throws IOException {
215215
this();
216-
try (m) {
216+
try {
217217
Record r;
218218
while ((r = m.nextRecord()) != null) {
219219
addRecord(r, Credibility.HINT);
220220
}
221+
} finally {
222+
m.close();
221223
}
222224
}
223225

src/main/java/org/xbill/DNS/Zone.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,13 @@ public Zone(Name zone, int dclass, String remote) throws IOException, ZoneTransf
177177

178178
private void fromMasterFile(Name origin, Master m) throws IOException {
179179
this.origin = origin;
180-
try (m) {
180+
try {
181181
Record r;
182182
while ((r = m.nextRecord()) != null) {
183183
maybeAddRecord(r);
184184
}
185+
} finally {
186+
m.close();
185187
}
186188
validate();
187189
}

0 commit comments

Comments
 (0)