Some cleanup changes.
--
MOS_MIGRATED_REVID=87821306
diff --git a/src/main/java/com/google/devtools/build/lib/util/PersistentMap.java b/src/main/java/com/google/devtools/build/lib/util/PersistentMap.java
index 7fd4b6d..123d1cf 100644
--- a/src/main/java/com/google/devtools/build/lib/util/PersistentMap.java
+++ b/src/main/java/com/google/devtools/build/lib/util/PersistentMap.java
@@ -368,9 +368,9 @@
* @throws IOException
*/
private void saveEntries(Map<K, V> map, Path mapFile) throws IOException {
- DataOutputStream out = createMapFile(mapFile);
- writeEntries(out, map);
- out.close();
+ try (DataOutputStream out = createMapFile(mapFile)) {
+ writeEntries(out, map);
+ }
}
/**
@@ -436,7 +436,7 @@
private boolean hasEntries(DataInputStream in, boolean failFast) throws IOException {
if (in.available() <= 0) {
return false;
- } else if (!(in.readUnsignedByte() == ENTRY_MAGIC)) {
+ } else if (in.readUnsignedByte() != ENTRY_MAGIC) {
if (failFast) {
throw new IOException("Corrupted entry separator");
} else {