diff --git a/.baseline/checkstyle/checkstyle.xml b/.baseline/checkstyle/checkstyle.xml
index 0297c79f472..fd1fa38972e 100644
--- a/.baseline/checkstyle/checkstyle.xml
+++ b/.baseline/checkstyle/checkstyle.xml
@@ -43,7 +43,7 @@
-
+
diff --git a/atlasdb-api/src/main/java/com/palantir/atlasdb/keyvalue/api/RowResult.java b/atlasdb-api/src/main/java/com/palantir/atlasdb/keyvalue/api/RowResult.java
index 4469e3fb7e8..46cf40dbdc9 100644
--- a/atlasdb-api/src/main/java/com/palantir/atlasdb/keyvalue/api/RowResult.java
+++ b/atlasdb-api/src/main/java/com/palantir/atlasdb/keyvalue/api/RowResult.java
@@ -45,7 +45,7 @@ public static RowResult of(Cell cell, T value) {
cell.getRowName(),
ImmutableSortedMap.orderedBy(UnsignedBytes.lexicographicalComparator())
.put(cell.getColumnName(), value)
- .build());
+ .buildOrThrow());
}
public static RowResult create(byte[] row, SortedMap columns) {
diff --git a/atlasdb-autobatch/src/main/java/com/palantir/atlasdb/autobatch/Autobatchers.java b/atlasdb-autobatch/src/main/java/com/palantir/atlasdb/autobatch/Autobatchers.java
index bbcf559c99a..bf713b70f2d 100644
--- a/atlasdb-autobatch/src/main/java/com/palantir/atlasdb/autobatch/Autobatchers.java
+++ b/atlasdb-autobatch/src/main/java/com/palantir/atlasdb/autobatch/Autobatchers.java
@@ -237,7 +237,7 @@ public DisruptorAutobatcher build() {
new TracingEventHandler<>(handler, parameters.batchSize());
EventHandler> profiledHandler =
- new ProfilingEventHandler<>(tracingHandler, purpose, safeTags.build());
+ new ProfilingEventHandler<>(tracingHandler, purpose, safeTags.buildOrThrow());
return DisruptorAutobatcher.create(
profiledHandler,
diff --git a/atlasdb-autobatch/src/test/java/com/palantir/atlasdb/autobatch/BatchSizeRecorderTest.java b/atlasdb-autobatch/src/test/java/com/palantir/atlasdb/autobatch/BatchSizeRecorderTest.java
index d43b98b7d8d..58a7f7785e8 100644
--- a/atlasdb-autobatch/src/test/java/com/palantir/atlasdb/autobatch/BatchSizeRecorderTest.java
+++ b/atlasdb-autobatch/src/test/java/com/palantir/atlasdb/autobatch/BatchSizeRecorderTest.java
@@ -53,7 +53,7 @@ public void tagsArePassedThrough() {
Map customTags = ImmutableMap.builder()
.put("tag1", "value1")
.put("tag2", "value2")
- .build();
+ .buildOrThrow();
BatchSizeRecorder recorder = BatchSizeRecorder.create(SAFE_IDENTIFIER, customTags);
recorder.markBatchProcessed(5);
diff --git a/atlasdb-cassandra-integration-tests/src/test/java/com/palantir/atlasdb/keyvalue/cassandra/CassandraKeyValueServiceIntegrationTest.java b/atlasdb-cassandra-integration-tests/src/test/java/com/palantir/atlasdb/keyvalue/cassandra/CassandraKeyValueServiceIntegrationTest.java
index 6299432e0d3..45bc6005890 100644
--- a/atlasdb-cassandra-integration-tests/src/test/java/com/palantir/atlasdb/keyvalue/cassandra/CassandraKeyValueServiceIntegrationTest.java
+++ b/atlasdb-cassandra-integration-tests/src/test/java/com/palantir/atlasdb/keyvalue/cassandra/CassandraKeyValueServiceIntegrationTest.java
@@ -829,7 +829,7 @@ private CfDef createDefaultCfDef(String namespace, String tableName) {
.setCompression_options(ImmutableMap.builder()
.put("sstable_compression", "org.apache.cassandra.io.compress.LZ4Compressor")
.put("chunk_length_kb", "4")
- .build())
+ .buildOrThrow())
.setBloom_filter_fp_chance(0.1)
.setCaching("KEYS_ONLY")
.setDclocal_read_repair_chance(0.0)
diff --git a/atlasdb-cassandra/src/main/java/com/palantir/atlasdb/keyvalue/cassandra/CassandraKeyValueServiceImpl.java b/atlasdb-cassandra/src/main/java/com/palantir/atlasdb/keyvalue/cassandra/CassandraKeyValueServiceImpl.java
index 6a7543320a7..913a4272156 100644
--- a/atlasdb-cassandra/src/main/java/com/palantir/atlasdb/keyvalue/cassandra/CassandraKeyValueServiceImpl.java
+++ b/atlasdb-cassandra/src/main/java/com/palantir/atlasdb/keyvalue/cassandra/CassandraKeyValueServiceImpl.java
@@ -820,7 +820,7 @@ public Map get(TableReference tableRef, Map timestampBy
}
builder.putAll(collector.getCollectedResults());
}
- return builder.build();
+ return builder.buildOrThrow();
} catch (Exception e) {
throw Throwables.unwrapAndThrowAtlasDbDependencyException(e);
}
diff --git a/atlasdb-cassandra/src/main/java/com/palantir/atlasdb/keyvalue/cassandra/ColumnFamilyDefinitions.java b/atlasdb-cassandra/src/main/java/com/palantir/atlasdb/keyvalue/cassandra/ColumnFamilyDefinitions.java
index f5ed0000dc3..1c66f9e37a3 100644
--- a/atlasdb-cassandra/src/main/java/com/palantir/atlasdb/keyvalue/cassandra/ColumnFamilyDefinitions.java
+++ b/atlasdb-cassandra/src/main/java/com/palantir/atlasdb/keyvalue/cassandra/ColumnFamilyDefinitions.java
@@ -94,7 +94,7 @@ private static Map getCompressionOptions(Optional
.put(
CassandraConstants.CFDEF_COMPRESSION_CHUNK_LENGTH_KEY,
Integer.toString(actualCompressionBlockSizeKb))
- .build();
+ .buildOrThrow();
}
/**
diff --git a/atlasdb-cassandra/src/main/java/com/palantir/atlasdb/keyvalue/cassandra/pool/CassandraClientPoolMetrics.java b/atlasdb-cassandra/src/main/java/com/palantir/atlasdb/keyvalue/cassandra/pool/CassandraClientPoolMetrics.java
index f25fb55991f..b0532af816e 100644
--- a/atlasdb-cassandra/src/main/java/com/palantir/atlasdb/keyvalue/cassandra/pool/CassandraClientPoolMetrics.java
+++ b/atlasdb-cassandra/src/main/java/com/palantir/atlasdb/keyvalue/cassandra/pool/CassandraClientPoolMetrics.java
@@ -57,7 +57,7 @@ private static Map>builder()
.put(COLUMN_NAME_1, Pair.create(EMPTY_BYTE_ARRAY, VALUE_1))
.put(COLUMN_NAME_2, Pair.create(EMPTY_BYTE_ARRAY, VALUE_2))
- .build();
+ .buildOrThrow();
@Test
public void canGetValuesFromSelectionResult() {
diff --git a/atlasdb-cli/src/test/java/com/palantir/atlasdb/cli/command/TestKvsMigrationCommand.java b/atlasdb-cli/src/test/java/com/palantir/atlasdb/cli/command/TestKvsMigrationCommand.java
index 0593eb61d8a..f2b4f3c45e6 100644
--- a/atlasdb-cli/src/test/java/com/palantir/atlasdb/cli/command/TestKvsMigrationCommand.java
+++ b/atlasdb-cli/src/test/java/com/palantir/atlasdb/cli/command/TestKvsMigrationCommand.java
@@ -175,7 +175,7 @@ private void seedKvs(AtlasDbServices services, int numTables, int numEntriesPerT
Cell cell = Cell.create(PtBytes.toBytes("row" + j), PtBytes.toBytes("col"));
toWrite.put(cell, PtBytes.toBytes("val" + j));
}
- t.put(table, toWrite.build());
+ t.put(table, toWrite.buildOrThrow());
return null;
});
}
@@ -190,7 +190,7 @@ private void checkKvs(AtlasDbServices services, int numTables, int numEntriesPer
Cell cell = Cell.create(PtBytes.toBytes("row" + j), PtBytes.toBytes("col"));
expectedBuilder.put(cell, PtBytes.toBytes("val" + j));
}
- Map expected = expectedBuilder.build();
+ Map expected = expectedBuilder.buildOrThrow();
Map result = t.get(table, expected.keySet());
assertThat(result.keySet()).containsExactlyInAnyOrderElementsOf(expected.keySet());
for (Map.Entry e : result.entrySet()) {
diff --git a/atlasdb-client/src/main/java/com/palantir/atlasdb/keyvalue/impl/AbstractKeyValueService.java b/atlasdb-client/src/main/java/com/palantir/atlasdb/keyvalue/impl/AbstractKeyValueService.java
index d54e6451e87..af4d1259463 100644
--- a/atlasdb-client/src/main/java/com/palantir/atlasdb/keyvalue/impl/AbstractKeyValueService.java
+++ b/atlasdb-client/src/main/java/com/palantir/atlasdb/keyvalue/impl/AbstractKeyValueService.java
@@ -124,7 +124,7 @@ public Map getMetadataForTables() {
for (TableReference table : getAllTableNames()) {
builder.put(table, getMetadataForTable(table));
}
- return builder.build();
+ return builder.buildOrThrow();
}
protected int getMultiPutBatchCount() {
diff --git a/atlasdb-client/src/main/java/com/palantir/atlasdb/keyvalue/impl/Cells.java b/atlasdb-client/src/main/java/com/palantir/atlasdb/keyvalue/impl/Cells.java
index b6563c48733..381bb086fff 100644
--- a/atlasdb-client/src/main/java/com/palantir/atlasdb/keyvalue/impl/Cells.java
+++ b/atlasdb-client/src/main/java/com/palantir/atlasdb/keyvalue/impl/Cells.java
@@ -147,7 +147,7 @@ protected Map.Entry> computeNext() {
mapBuilder.put(peek.getKey().getColumnName(), peek.getValue());
it.next();
}
- map = mapBuilder.build();
+ map = mapBuilder.buildOrThrow();
return Maps.immutableEntry(row, map);
}
};
diff --git a/atlasdb-client/src/main/java/com/palantir/atlasdb/keyvalue/impl/InMemoryKeyValueService.java b/atlasdb-client/src/main/java/com/palantir/atlasdb/keyvalue/impl/InMemoryKeyValueService.java
index c361150b255..588c1112762 100644
--- a/atlasdb-client/src/main/java/com/palantir/atlasdb/keyvalue/impl/InMemoryKeyValueService.java
+++ b/atlasdb-client/src/main/java/com/palantir/atlasdb/keyvalue/impl/InMemoryKeyValueService.java
@@ -284,7 +284,7 @@ protected RowResult computeNext() {
cellIter = takeCell(it, key);
collectValueForTimestamp(key.col, cellIter, result, range, resultProducer);
}
- SortedMap columns = result.build();
+ SortedMap columns = result.buildOrThrow();
if (!columns.isEmpty()) {
return RowResult.create(row, columns);
}
diff --git a/atlasdb-client/src/main/java/com/palantir/atlasdb/keyvalue/impl/KeyValueServices.java b/atlasdb-client/src/main/java/com/palantir/atlasdb/keyvalue/impl/KeyValueServices.java
index 2cf4fe89b4f..484296016ac 100644
--- a/atlasdb-client/src/main/java/com/palantir/atlasdb/keyvalue/impl/KeyValueServices.java
+++ b/atlasdb-client/src/main/java/com/palantir/atlasdb/keyvalue/impl/KeyValueServices.java
@@ -170,7 +170,7 @@ public static Map filterGetRowsToColumnRange(
IdentityHashMap results = new IdentityHashMap<>();
for (Map.Entry> row : rowsToColumns.entrySet()) {
- SortedMap map = row.getValue().build();
+ SortedMap map = row.getValue().buildOrThrow();
Set> subMap;
if ((columnRangeSelection.getStartCol().length == 0) && (columnRangeSelection.getEndCol().length == 0)) {
subMap = map.entrySet();
diff --git a/atlasdb-client/src/main/java/com/palantir/atlasdb/keyvalue/impl/RowResults.java b/atlasdb-client/src/main/java/com/palantir/atlasdb/keyvalue/impl/RowResults.java
index d1bc1b4bcb9..07f30b07f9c 100644
--- a/atlasdb-client/src/main/java/com/palantir/atlasdb/keyvalue/impl/RowResults.java
+++ b/atlasdb-client/src/main/java/com/palantir/atlasdb/keyvalue/impl/RowResults.java
@@ -83,7 +83,7 @@ public static RowResult merge(RowResult base, RowResult overwrite)
colBuilder.putAll(overwrite.getColumns());
colBuilder.putAll(
Maps.difference(base.getColumns(), overwrite.getColumns()).entriesOnlyOnLeft());
- return RowResult.create(base.getRowName(), colBuilder.build());
+ return RowResult.create(base.getRowName(), colBuilder.buildOrThrow());
}
public static long getApproximateSizeOfRowResult(RowResult rr) {
diff --git a/atlasdb-client/src/main/java/com/palantir/atlasdb/stream/AbstractPersistentStreamStore.java b/atlasdb-client/src/main/java/com/palantir/atlasdb/stream/AbstractPersistentStreamStore.java
index 5baede50bce..c076257d42c 100644
--- a/atlasdb-client/src/main/java/com/palantir/atlasdb/stream/AbstractPersistentStreamStore.java
+++ b/atlasdb-client/src/main/java/com/palantir/atlasdb/stream/AbstractPersistentStreamStore.java
@@ -86,7 +86,7 @@ public final long getByHashOrStoreStreamAndMarkAsUsed(
tx,
ImmutableMap.builder()
.put(streamId, reference)
- .build());
+ .buildOrThrow());
return streamId;
}
Pair pair = storeStream(stream);
@@ -94,7 +94,7 @@ public final long getByHashOrStoreStreamAndMarkAsUsed(
hash.equals(pair.rhSide), "passed hash: %s does not equal stream hash: %s", hash, pair.rhSide);
markStreamsAsUsedInternal(
tx,
- ImmutableMap.builder().put(pair.lhSide, reference).build());
+ ImmutableMap.builder().put(pair.lhSide, reference).buildOrThrow());
return pair.lhSide;
}
@@ -102,14 +102,14 @@ public final long getByHashOrStoreStreamAndMarkAsUsed(
public void unmarkStreamAsUsed(Transaction tx, long streamId, byte[] reference) {
unmarkStreamsAsUsed(
tx,
- ImmutableMap.builder().put(streamId, reference).build());
+ ImmutableMap.builder().put(streamId, reference).buildOrThrow());
}
@Override
public void markStreamAsUsed(Transaction tx, long streamId, byte[] reference) {
markStreamsAsUsed(
tx,
- ImmutableMap.builder().put(streamId, reference).build());
+ ImmutableMap.builder().put(streamId, reference).buildOrThrow());
}
@Override
@@ -251,7 +251,7 @@ private void putMetadataAndHashIndexTask(Transaction tx, Long streamId, StreamMe
tx,
ImmutableMap.builder()
.put(streamId, metadata)
- .build());
+ .buildOrThrow());
}
protected abstract void putMetadataAndHashIndexTask(Transaction tx, Map streamIdsToMetadata);
diff --git a/atlasdb-client/src/main/java/com/palantir/atlasdb/transaction/impl/AbstractTransaction.java b/atlasdb-client/src/main/java/com/palantir/atlasdb/transaction/impl/AbstractTransaction.java
index b0a41ee51dc..7ca7056ad51 100644
--- a/atlasdb-client/src/main/java/com/palantir/atlasdb/transaction/impl/AbstractTransaction.java
+++ b/atlasdb-client/src/main/java/com/palantir/atlasdb/transaction/impl/AbstractTransaction.java
@@ -27,7 +27,7 @@
public abstract class AbstractTransaction implements Transaction {
protected static final ImmutableSortedMap> EMPTY_SORTED_ROWS =
ImmutableSortedMap.>orderedBy(UnsignedBytes.lexicographicalComparator())
- .build();
+ .buildOrThrow();
private TransactionType transactionType = TransactionType.DEFAULT;
diff --git a/atlasdb-client/src/main/java/com/palantir/atlasdb/transaction/impl/CachingTransaction.java b/atlasdb-client/src/main/java/com/palantir/atlasdb/transaction/impl/CachingTransaction.java
index 840ed66a999..e8f5856dd5d 100644
--- a/atlasdb-client/src/main/java/com/palantir/atlasdb/transaction/impl/CachingTransaction.java
+++ b/atlasdb-client/src/main/java/com/palantir/atlasdb/transaction/impl/CachingTransaction.java
@@ -108,13 +108,13 @@ public NavigableMap> getRows(
if (shouldLoad) {
toLoad.add(row);
} else if (nonEmpty) {
- inCache.put(row, RowResult.create(row, matches.build()));
+ inCache.put(row, RowResult.create(row, matches.buildOrThrow()));
}
}
SortedMap> results = super.getRows(tableRef, toLoad, columnSelection);
cacheLoadedRows(tableRef, toLoad, columnSelection.getSelectedColumns(), results);
inCache.putAll(results);
- return inCache.build();
+ return inCache.buildOrThrow();
}
}
diff --git a/atlasdb-client/src/test/java/com/palantir/atlasdb/transaction/impl/ReadTransactionShould.java b/atlasdb-client/src/test/java/com/palantir/atlasdb/transaction/impl/ReadTransactionShould.java
index 7510f633e1e..2664388e5b9 100644
--- a/atlasdb-client/src/test/java/com/palantir/atlasdb/transaction/impl/ReadTransactionShould.java
+++ b/atlasdb-client/src/test/java/com/palantir/atlasdb/transaction/impl/ReadTransactionShould.java
@@ -58,7 +58,7 @@ public class ReadTransactionShould {
.put("getRange", new Object[] {DUMMY_THOROUGH_TABLE, RangeRequest.all()})
.put("getRanges", new Object[] {DUMMY_THOROUGH_TABLE, ImmutableList.of(RangeRequest.all())})
.put("getRangesLazy", new Object[] {DUMMY_THOROUGH_TABLE, ImmutableList.of(RangeRequest.all())})
- .build();
+ .buildOrThrow();
private ReadTransaction readTransaction;
private CallbackAwareTransaction delegateTransaction;
diff --git a/atlasdb-commons/src/main/java/com/palantir/common/collect/MapEntries.java b/atlasdb-commons/src/main/java/com/palantir/common/collect/MapEntries.java
index 0d1bf956e43..792059ffee5 100644
--- a/atlasdb-commons/src/main/java/com/palantir/common/collect/MapEntries.java
+++ b/atlasdb-commons/src/main/java/com/palantir/common/collect/MapEntries.java
@@ -51,7 +51,7 @@ public static ImmutableMap toMap(Iterable> it) {
for (Map.Entry e : it) {
builder.put(e.getKey(), e.getValue());
}
- return builder.build();
+ return builder.buildOrThrow();
}
public static Function, Map.Entry> applyValue(final Function f) {
diff --git a/atlasdb-commons/src/main/java/com/palantir/common/collect/Maps2.java b/atlasdb-commons/src/main/java/com/palantir/common/collect/Maps2.java
index b78ea2717f4..0e159935b46 100644
--- a/atlasdb-commons/src/main/java/com/palantir/common/collect/Maps2.java
+++ b/atlasdb-commons/src/main/java/com/palantir/common/collect/Maps2.java
@@ -32,7 +32,7 @@ public static ImmutableMap fromEntries(Iterable extends Map.Entry
for (Map.Entry e : it) {
builder.put(e.getKey(), e.getValue());
}
- return builder.build();
+ return builder.buildOrThrow();
}
public static ImmutableMap transformKeys(Map map, Function f) {
diff --git a/atlasdb-commons/src/test/java/com/palantir/remoting/HeaderAccessUtilsTest.java b/atlasdb-commons/src/test/java/com/palantir/remoting/HeaderAccessUtilsTest.java
index baf5e91558a..c1e42c10ff8 100644
--- a/atlasdb-commons/src/test/java/com/palantir/remoting/HeaderAccessUtilsTest.java
+++ b/atlasdb-commons/src/test/java/com/palantir/remoting/HeaderAccessUtilsTest.java
@@ -39,7 +39,7 @@ public class HeaderAccessUtilsTest {
.put(KEY_1, VALUE_1)
.put(KEY_2, VALUE_2)
.put(KEY_3, VALUE_3)
- .build();
+ .buildOrThrow();
@Test
public void caseInsensitiveContainsEntryIgnoresCaseOnKeys() {
diff --git a/atlasdb-config/src/main/java/com/palantir/atlasdb/debug/TransactionPostMortemRunner.java b/atlasdb-config/src/main/java/com/palantir/atlasdb/debug/TransactionPostMortemRunner.java
index b7d059242c0..01c4d9a3f6d 100644
--- a/atlasdb-config/src/main/java/com/palantir/atlasdb/debug/TransactionPostMortemRunner.java
+++ b/atlasdb-config/src/main/java/com/palantir/atlasdb/debug/TransactionPostMortemRunner.java
@@ -147,7 +147,7 @@ private static FullDiagnosticDigest.CompletedTransactionDigest transactio
Map> lockRequests = ImmutableMap.>builder()
.putAll(clientLockDigest.lockRequests())
.put(clientLockDigest.immutableTimestampRequestId(), ImmutableSet.of())
- .build();
+ .buildOrThrow();
Map lockDigests = KeyedStream.stream(lockRequests)
.map((requestId, descriptors) ->
lockDigest(descriptors, timelockLockInfo.map(info -> lockState(requestId, info))))
diff --git a/atlasdb-dbkvs-hikari/src/main/java/com/palantir/nexus/db/pool/InterceptorConnection.java b/atlasdb-dbkvs-hikari/src/main/java/com/palantir/nexus/db/pool/InterceptorConnection.java
index 711639f2a03..7e57d569177 100644
--- a/atlasdb-dbkvs-hikari/src/main/java/com/palantir/nexus/db/pool/InterceptorConnection.java
+++ b/atlasdb-dbkvs-hikari/src/main/java/com/palantir/nexus/db/pool/InterceptorConnection.java
@@ -38,7 +38,7 @@ public final class InterceptorConnection extends AbstractInvocationHandler imple
.put("createStatement", Statement.class)
.put("prepareCall", CallableStatement.class)
.put("prepareStatement", PreparedStatement.class)
- .build();
+ .buildOrThrow();
private InterceptorConnection(final Connection delegate) {
this.delegate = delegate;
diff --git a/atlasdb-dbkvs-hikari/src/test/java/com/palantir/nexus/db/pool/config/OracleConnectionConfigTest.java b/atlasdb-dbkvs-hikari/src/test/java/com/palantir/nexus/db/pool/config/OracleConnectionConfigTest.java
index 576e5e7eb9a..f2e37c0ffde 100644
--- a/atlasdb-dbkvs-hikari/src/test/java/com/palantir/nexus/db/pool/config/OracleConnectionConfigTest.java
+++ b/atlasdb-dbkvs-hikari/src/test/java/com/palantir/nexus/db/pool/config/OracleConnectionConfigTest.java
@@ -158,7 +158,7 @@ public void protocolCaseInsensitiveTest() throws IOException {
.put("\"tcp\"", ConnectionProtocol.TCP)
.put("\"TCPS\"", ConnectionProtocol.TCPS)
.put("\"tcps\"", ConnectionProtocol.TCPS)
- .build();
+ .buildOrThrow();
for (Map.Entry entry : serializedProtocols.entrySet()) {
ConnectionProtocol protocol = mapper.readValue(entry.getKey(), ConnectionProtocol.class);
diff --git a/atlasdb-dbkvs/src/main/java/com/palantir/atlasdb/keyvalue/dbkvs/impl/oracle/OracleGetRange.java b/atlasdb-dbkvs/src/main/java/com/palantir/atlasdb/keyvalue/dbkvs/impl/oracle/OracleGetRange.java
index ebf773966b1..545af721c85 100644
--- a/atlasdb-dbkvs/src/main/java/com/palantir/atlasdb/keyvalue/dbkvs/impl/oracle/OracleGetRange.java
+++ b/atlasdb-dbkvs/src/main/java/com/palantir/atlasdb/keyvalue/dbkvs/impl/oracle/OracleGetRange.java
@@ -343,7 +343,7 @@ private static List> createRowResults(
byte[] rowName = sqlRow.cell.getRowName();
if (currentRowName == null || !Arrays.equals(rowName, currentRowName)) {
if (currentRowName != null) {
- rowResults.add(RowResult.create(currentRowName, currentRowCells.build()));
+ rowResults.add(RowResult.create(currentRowName, currentRowCells.buildOrThrow()));
}
currentRowCells = ImmutableSortedMap.orderedBy(UnsignedBytes.lexicographicalComparator());
currentRowName = rowName;
@@ -358,7 +358,7 @@ private static List> createRowResults(
TraceStatistics.incBytesRead(value);
}
if (currentRowName != null) {
- rowResults.add(RowResult.create(currentRowName, currentRowCells.build()));
+ rowResults.add(RowResult.create(currentRowName, currentRowCells.buildOrThrow()));
}
return rowResults;
}
diff --git a/atlasdb-dbkvs/src/main/java/com/palantir/atlasdb/keyvalue/dbkvs/impl/postgres/PostgresGetRange.java b/atlasdb-dbkvs/src/main/java/com/palantir/atlasdb/keyvalue/dbkvs/impl/postgres/PostgresGetRange.java
index fa258824bed..74a1695d2d7 100644
--- a/atlasdb-dbkvs/src/main/java/com/palantir/atlasdb/keyvalue/dbkvs/impl/postgres/PostgresGetRange.java
+++ b/atlasdb-dbkvs/src/main/java/com/palantir/atlasdb/keyvalue/dbkvs/impl/postgres/PostgresGetRange.java
@@ -249,7 +249,7 @@ private void flushCurrentRow(@Output List> results) {
}
private Optional> getCurrentRowResult() {
- ImmutableSortedMap cells = currentRowCells.build();
+ ImmutableSortedMap cells = currentRowCells.buildOrThrow();
if (cells.isEmpty()) {
return Optional.empty();
} else {
diff --git a/atlasdb-dbkvs/src/test/java/com/palantir/atlasdb/keyvalue/dbkvs/OracleTableNameUnmapperTest.java b/atlasdb-dbkvs/src/test/java/com/palantir/atlasdb/keyvalue/dbkvs/OracleTableNameUnmapperTest.java
index 81b7a1b73e5..1aa75ce352a 100644
--- a/atlasdb-dbkvs/src/test/java/com/palantir/atlasdb/keyvalue/dbkvs/OracleTableNameUnmapperTest.java
+++ b/atlasdb-dbkvs/src/test/java/com/palantir/atlasdb/keyvalue/dbkvs/OracleTableNameUnmapperTest.java
@@ -138,7 +138,7 @@ public void getLongTableNamesFromMappingTableReturnsLongNames() throws TableMapp
.put("shortNameOne", "superLongNameOne")
.put("shortNameTwo", "superLongNameTwo")
.put("shortNameThree", "superLongNameThree")
- .build();
+ .buildOrThrow();
mockShortNamesToLongNamesQuery(shortNamesToLongNames.values());
Set longNames = oracleTableNameUnmapper.getLongTableNamesFromMappingTable(
diff --git a/atlasdb-dbkvs/src/test/java/com/palantir/atlasdb/keyvalue/dbkvs/impl/postgres/PostgresDdlTableTest.java b/atlasdb-dbkvs/src/test/java/com/palantir/atlasdb/keyvalue/dbkvs/impl/postgres/PostgresDdlTableTest.java
index ee649293685..5ad6afa76c2 100644
--- a/atlasdb-dbkvs/src/test/java/com/palantir/atlasdb/keyvalue/dbkvs/impl/postgres/PostgresDdlTableTest.java
+++ b/atlasdb-dbkvs/src/test/java/com/palantir/atlasdb/keyvalue/dbkvs/impl/postgres/PostgresDdlTableTest.java
@@ -142,7 +142,7 @@ private SqlConnection setUpSqlConnection(Long lastVacuumTimestamp, Long currentT
.put("LAST", 0)
.put("current", 1)
.put("CURRENT", 1)
- .build()));
+ .buildOrThrow()));
return sqlConnection;
}
diff --git a/atlasdb-ete-tests/src/test/java/com/palantir/atlasdb/ete/DockerClientOrchestrationRule.java b/atlasdb-ete-tests/src/test/java/com/palantir/atlasdb/ete/DockerClientOrchestrationRule.java
index 8308e85eaca..deb29728049 100644
--- a/atlasdb-ete-tests/src/test/java/com/palantir/atlasdb/ete/DockerClientOrchestrationRule.java
+++ b/atlasdb-ete-tests/src/test/java/com/palantir/atlasdb/ete/DockerClientOrchestrationRule.java
@@ -131,7 +131,7 @@ private Map getEnvironment() {
return ImmutableMap.builder()
.putAll(CassandraEnvironment.get())
.put("CONFIG_FILE_MOUNTPOINT", temporaryFolder.getRoot().getAbsolutePath())
- .build();
+ .buildOrThrow();
}
private String dockerExecOnClient(String... arguments) {
diff --git a/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/atomic/ResilientCommitTimestampAtomicTable.java b/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/atomic/ResilientCommitTimestampAtomicTable.java
index 6a39f3ab2e5..a26303dc1ef 100644
--- a/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/atomic/ResilientCommitTimestampAtomicTable.java
+++ b/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/atomic/ResilientCommitTimestampAtomicTable.java
@@ -238,7 +238,7 @@ private Map processReads(Map reads, Map getCachedValues(TableReference table, Set cel
return ImmutableMap.builder()
.putAll(locallyCachedReads)
.putAll(snapshotCachedValues)
- .build();
+ .buildOrThrow();
}
@Override
diff --git a/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/keyvalue/api/cache/TransactionScopedCacheImpl.java b/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/keyvalue/api/cache/TransactionScopedCacheImpl.java
index 19bf6abf6fd..50a7d6d7df4 100644
--- a/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/keyvalue/api/cache/TransactionScopedCacheImpl.java
+++ b/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/keyvalue/api/cache/TransactionScopedCacheImpl.java
@@ -209,7 +209,7 @@ private synchronized Map processUncachedCells(
return ImmutableMap.builder()
.putAll(remoteReadValues)
.putAll(filterEmptyValues(cacheHits))
- .build();
+ .buildOrThrow();
}
private synchronized NavigableMap> processUncachedRows(
diff --git a/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/sweep/metrics/SweepOutcomeMetrics.java b/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/sweep/metrics/SweepOutcomeMetrics.java
index 0720697efe8..5f9ab227f9a 100644
--- a/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/sweep/metrics/SweepOutcomeMetrics.java
+++ b/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/sweep/metrics/SweepOutcomeMetrics.java
@@ -80,7 +80,7 @@ private static Supplier buildMetrics(
ImmutableMap tags = ImmutableMap.builder()
.putAll(additionalTags)
.put(AtlasDbMetricNames.TAG_OUTCOME, outcome.name())
- .build();
+ .buildOrThrow();
filter.ifPresent(presentFilter ->
manager.addMetricFilter(forClass, AtlasDbMetricNames.SWEEP_OUTCOME, tags, filter.get()));
manager.registerOrGet(
diff --git a/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/transaction/impl/SerializableTransaction.java b/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/transaction/impl/SerializableTransaction.java
index e888cdbb4cd..9306f367bc8 100644
--- a/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/transaction/impl/SerializableTransaction.java
+++ b/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/transaction/impl/SerializableTransaction.java
@@ -903,7 +903,7 @@ protected ListenableFuture | | | | | | | | | | |