Work around the fact that AssertionError(String message, Throwable cause) is a Java 1.7-only API.

This commit is contained in:
Adrien Grand 2013-07-19 09:47:55 +02:00
parent 12d9268db2
commit fe4c2a9d02
1 changed files with 4 additions and 1 deletions

View File

@ -112,7 +112,10 @@ public class FSTBytesAtomicFieldData implements AtomicFieldData.WithOrdinals<Scr
}
assert fstEnum.next() == null;
} catch (IOException e) {
throw new AssertionError("Cannot happen", e);
// Don't use new "AssertionError("Cannot happen", e)" directly as this is a Java 1.7-only API
final AssertionError error = new AssertionError("Cannot happen");
error.initCause(e);
throw error;
}
this.hashes = hashes;
}