diff --git a/.mvn/modernizer/violations.xml b/.mvn/modernizer/violations.xml index 70edd8642b06..cbb8b4926b57 100644 --- a/.mvn/modernizer/violations.xml +++ b/.mvn/modernizer/violations.xml @@ -54,6 +54,52 @@ Use buildOrThrow() instead, as it makes it clear that it will throw on duplicated values + + com/google/common/collect/ImmutableBiMap$Builder."<init>":()V + 1.8 + Use builder() static factory method instead + + + com/google/common/collect/ImmutableList$Builder."<init>":()V + 1.8 + Use builder() static factory method instead + + + com/google/common/collect/ImmutableMap$Builder."<init>":()V + 1.8 + Use builder() static factory method instead + + + com/google/common/collect/ImmutableMultimap$Builder."<init>":()V + 1.8 + Use builder() static factory method instead + + + com/google/common/collect/ImmutableMultiset$Builder."<init>":()V + 1.8 + Use builder() static factory method instead + + + com/google/common/collect/ImmutableSet$Builder."<init>":()V + 1.8 + Use builder() static factory method instead + + + com/google/common/collect/ImmutableSortedMap$Builder."<init>":()V + 1.8 + Use orderedBy() static factory method instead + + + com/google/common/collect/ImmutableSortedSet$Builder."<init>":()V + 1.8 + Use orderedBy() static factory method instead + + + com/google/common/collect/ImmutableTable$Builder."<init>":()V + 1.8 + Use builder() static factory method instead + + com/google/common/cache/CacheBuilder.build:()Lcom/google/common/cache/Cache; 1.8 diff --git a/core/trino-main/src/main/java/io/trino/execution/ClusterSizeMonitor.java b/core/trino-main/src/main/java/io/trino/execution/ClusterSizeMonitor.java index 6cfb34f9adfc..d2a03bb7bcd9 100644 --- a/core/trino-main/src/main/java/io/trino/execution/ClusterSizeMonitor.java +++ b/core/trino-main/src/main/java/io/trino/execution/ClusterSizeMonitor.java @@ -142,7 +142,7 @@ private synchronized void updateAllNodes(AllNodes allNodes) currentCount = Sets.difference(allNodes.getActiveNodes(), allNodes.getActiveCoordinators()).size(); } - ImmutableList.Builder> listenersBuilder = new ImmutableList.Builder<>(); + ImmutableList.Builder> listenersBuilder = ImmutableList.builder(); while (!futuresQueue.isEmpty()) { MinNodesFuture minNodesFuture = futuresQueue.peek(); if (minNodesFuture == null || minNodesFuture.getExecutionMinCount() > currentCount) { diff --git a/core/trino-main/src/main/java/io/trino/operator/DynamicFilterSourceOperator.java b/core/trino-main/src/main/java/io/trino/operator/DynamicFilterSourceOperator.java index 731cab4047dc..4e552af01d43 100644 --- a/core/trino-main/src/main/java/io/trino/operator/DynamicFilterSourceOperator.java +++ b/core/trino-main/src/main/java/io/trino/operator/DynamicFilterSourceOperator.java @@ -361,7 +361,7 @@ public void finish() return; } finished = true; - ImmutableMap.Builder domainsBuilder = new ImmutableMap.Builder<>(); + ImmutableMap.Builder domainsBuilder = ImmutableMap.builder(); if (valueSets == null) { if (minValues == null) { // there were too many rows to collect min/max range diff --git a/core/trino-main/src/main/java/io/trino/operator/GroupedTopNRankBuilder.java b/core/trino-main/src/main/java/io/trino/operator/GroupedTopNRankBuilder.java index c724748e1c82..7e1b06098906 100644 --- a/core/trino-main/src/main/java/io/trino/operator/GroupedTopNRankBuilder.java +++ b/core/trino-main/src/main/java/io/trino/operator/GroupedTopNRankBuilder.java @@ -148,7 +148,7 @@ private class ResultIterator ResultIterator() { - ImmutableList.Builder sourceTypesBuilders = new ImmutableList.Builder().addAll(sourceTypes); + ImmutableList.Builder sourceTypesBuilders = ImmutableList.builder().addAll(sourceTypes); if (produceRanking) { sourceTypesBuilders.add(BIGINT); } diff --git a/core/trino-main/src/main/java/io/trino/operator/GroupedTopNRowNumberBuilder.java b/core/trino-main/src/main/java/io/trino/operator/GroupedTopNRowNumberBuilder.java index 159bd00ab587..019208427ffe 100644 --- a/core/trino-main/src/main/java/io/trino/operator/GroupedTopNRowNumberBuilder.java +++ b/core/trino-main/src/main/java/io/trino/operator/GroupedTopNRowNumberBuilder.java @@ -128,7 +128,7 @@ private class ResultIterator ResultIterator() { - ImmutableList.Builder sourceTypesBuilders = new ImmutableList.Builder().addAll(sourceTypes); + ImmutableList.Builder sourceTypesBuilders = ImmutableList.builder().addAll(sourceTypes); if (produceRowNumber) { sourceTypesBuilders.add(BIGINT); } diff --git a/core/trino-main/src/main/java/io/trino/operator/aggregation/ApproximateMostFrequentHistogram.java b/core/trino-main/src/main/java/io/trino/operator/aggregation/ApproximateMostFrequentHistogram.java index a51564404dec..e94f00d1d3d2 100644 --- a/core/trino-main/src/main/java/io/trino/operator/aggregation/ApproximateMostFrequentHistogram.java +++ b/core/trino-main/src/main/java/io/trino/operator/aggregation/ApproximateMostFrequentHistogram.java @@ -145,7 +145,7 @@ public void forEachBucket(BucketConsumer consumer) @VisibleForTesting public Map getBuckets() { - ImmutableMap.Builder buckets = new ImmutableMap.Builder<>(); + ImmutableMap.Builder buckets = ImmutableMap.builder(); forEachBucket(buckets::put); return buckets.buildOrThrow(); diff --git a/core/trino-main/src/main/java/io/trino/server/QueryResource.java b/core/trino-main/src/main/java/io/trino/server/QueryResource.java index b11930fe9d2e..77073dda812f 100644 --- a/core/trino-main/src/main/java/io/trino/server/QueryResource.java +++ b/core/trino-main/src/main/java/io/trino/server/QueryResource.java @@ -79,7 +79,7 @@ public List getAllQueryInfo(@QueryParam("state") String stateFil List queries = dispatchManager.getQueries(); queries = filterQueries(sessionContextFactory.extractAuthorizedIdentity(servletRequest, httpHeaders, alternateHeaderName), queries, accessControl); - ImmutableList.Builder builder = new ImmutableList.Builder<>(); + ImmutableList.Builder builder = ImmutableList.builder(); for (BasicQueryInfo queryInfo : queries) { if (stateFilter == null || queryInfo.getState() == expectedState) { builder.add(queryInfo); diff --git a/core/trino-main/src/main/java/io/trino/server/ui/UiQueryResource.java b/core/trino-main/src/main/java/io/trino/server/ui/UiQueryResource.java index 7737bb1f9c70..b0cb7eed37a6 100644 --- a/core/trino-main/src/main/java/io/trino/server/ui/UiQueryResource.java +++ b/core/trino-main/src/main/java/io/trino/server/ui/UiQueryResource.java @@ -78,7 +78,7 @@ public List getAllQueryInfo(@QueryParam("state") String s List queries = dispatchManager.getQueries(); queries = filterQueries(sessionContextFactory.extractAuthorizedIdentity(servletRequest, httpHeaders, alternateHeaderName), queries, accessControl); - ImmutableList.Builder builder = new ImmutableList.Builder<>(); + ImmutableList.Builder builder = ImmutableList.builder(); for (BasicQueryInfo queryInfo : queries) { if (stateFilter == null || queryInfo.getState() == expectedState) { builder.add(new TrimmedBasicQueryInfo(queryInfo)); diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/PushAggregationIntoTableScan.java b/core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/PushAggregationIntoTableScan.java index 3540a8c57991..9dd6453bb1ce 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/PushAggregationIntoTableScan.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/PushAggregationIntoTableScan.java @@ -162,10 +162,10 @@ public static Optional pushAggregationIntoTableScan( AggregationApplicationResult result = aggregationPushdownResult.get(); // The new scan outputs should be the symbols associated with grouping columns plus the symbols associated with aggregations. - ImmutableList.Builder newScanOutputs = new ImmutableList.Builder<>(); + ImmutableList.Builder newScanOutputs = ImmutableList.builder(); newScanOutputs.addAll(tableScan.getOutputSymbols()); - ImmutableBiMap.Builder newScanAssignments = new ImmutableBiMap.Builder<>(); + ImmutableBiMap.Builder newScanAssignments = ImmutableBiMap.builder(); newScanAssignments.putAll(tableScan.getAssignments()); Map variableMappings = new HashMap<>(); @@ -221,7 +221,7 @@ private static AggregateFunction toAggregateFunction(Metadata metadata, Context String canonicalName = metadata.getFunctionMetadata(aggregation.getResolvedFunction()).getCanonicalName(); BoundSignature signature = aggregation.getResolvedFunction().getSignature(); - ImmutableList.Builder arguments = new ImmutableList.Builder<>(); + ImmutableList.Builder arguments = ImmutableList.builder(); for (int i = 0; i < aggregation.getArguments().size(); i++) { SymbolReference argument = (SymbolReference) aggregation.getArguments().get(i); arguments.add(new Variable(argument.getName(), signature.getArgumentTypes().get(i))); diff --git a/core/trino-main/src/test/java/io/trino/event/TestQueryMonitorConfig.java b/core/trino-main/src/test/java/io/trino/event/TestQueryMonitorConfig.java index 9ec33598898e..4692b7db9ae4 100644 --- a/core/trino-main/src/test/java/io/trino/event/TestQueryMonitorConfig.java +++ b/core/trino-main/src/test/java/io/trino/event/TestQueryMonitorConfig.java @@ -36,7 +36,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("event.max-output-stage-size", "512kB") .buildOrThrow(); diff --git a/core/trino-main/src/test/java/io/trino/eventlistener/TestEventListenerConfig.java b/core/trino-main/src/test/java/io/trino/eventlistener/TestEventListenerConfig.java index 233c17b3b3e3..8a02fb5cf876 100644 --- a/core/trino-main/src/test/java/io/trino/eventlistener/TestEventListenerConfig.java +++ b/core/trino-main/src/test/java/io/trino/eventlistener/TestEventListenerConfig.java @@ -42,7 +42,7 @@ public void testExplicitPropertyMappings() Path config1 = Files.createTempFile(null, null); Path config2 = Files.createTempFile(null, null); - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("event-listener.config-files", config1.toString() + "," + config2.toString()) .buildOrThrow(); diff --git a/core/trino-main/src/test/java/io/trino/execution/TestDynamicFilterConfig.java b/core/trino-main/src/test/java/io/trino/execution/TestDynamicFilterConfig.java index 4e0853de46f1..8c82465ab67d 100644 --- a/core/trino-main/src/test/java/io/trino/execution/TestDynamicFilterConfig.java +++ b/core/trino-main/src/test/java/io/trino/execution/TestDynamicFilterConfig.java @@ -51,7 +51,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("enable-dynamic-filtering", "false") .put("enable-coordinator-dynamic-filters-distribution", "false") .put("enable-large-dynamic-filters", "true") diff --git a/core/trino-main/src/test/java/io/trino/execution/TestFailureInjectionConfig.java b/core/trino-main/src/test/java/io/trino/execution/TestFailureInjectionConfig.java index c05514af3942..434ccbaf950b 100644 --- a/core/trino-main/src/test/java/io/trino/execution/TestFailureInjectionConfig.java +++ b/core/trino-main/src/test/java/io/trino/execution/TestFailureInjectionConfig.java @@ -37,7 +37,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("failure-injection.request-timeout", "12m") .put("failure-injection.expiration-period", "7m") .buildOrThrow(); diff --git a/core/trino-main/src/test/java/io/trino/execution/TestNodeSchedulerConfig.java b/core/trino-main/src/test/java/io/trino/execution/TestNodeSchedulerConfig.java index 3fb8b50b6ef9..d2699e30e0bb 100644 --- a/core/trino-main/src/test/java/io/trino/execution/TestNodeSchedulerConfig.java +++ b/core/trino-main/src/test/java/io/trino/execution/TestNodeSchedulerConfig.java @@ -44,7 +44,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("node-scheduler.policy", "topology") .put("node-scheduler.min-candidates", "11") .put("node-scheduler.include-coordinator", "false") diff --git a/core/trino-main/src/test/java/io/trino/execution/TestQueryManagerConfig.java b/core/trino-main/src/test/java/io/trino/execution/TestQueryManagerConfig.java index 3250afadddcc..f084b327794c 100644 --- a/core/trino-main/src/test/java/io/trino/execution/TestQueryManagerConfig.java +++ b/core/trino-main/src/test/java/io/trino/execution/TestQueryManagerConfig.java @@ -76,7 +76,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("query.client.timeout", "10s") .put("query.min-expire-age", "30s") .put("query.max-history", "10") diff --git a/core/trino-main/src/test/java/io/trino/execution/TestTaskManagerConfig.java b/core/trino-main/src/test/java/io/trino/execution/TestTaskManagerConfig.java index 2061d6d7600b..07e0de14fdf2 100644 --- a/core/trino-main/src/test/java/io/trino/execution/TestTaskManagerConfig.java +++ b/core/trino-main/src/test/java/io/trino/execution/TestTaskManagerConfig.java @@ -72,7 +72,7 @@ public void testDefaults() public void testExplicitPropertyMappings() { int processorCount = DEFAULT_PROCESSOR_COUNT == 32 ? 16 : 32; - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("task.initial-splits-per-node", "1") .put("task.split-concurrency-adjustment-interval", "1s") .put("task.status-refresh-max-wait", "2s") diff --git a/core/trino-main/src/test/java/io/trino/execution/scheduler/TestSubnetTopologyConfig.java b/core/trino-main/src/test/java/io/trino/execution/scheduler/TestSubnetTopologyConfig.java index 86e532271d5a..5935c9bec376 100644 --- a/core/trino-main/src/test/java/io/trino/execution/scheduler/TestSubnetTopologyConfig.java +++ b/core/trino-main/src/test/java/io/trino/execution/scheduler/TestSubnetTopologyConfig.java @@ -37,7 +37,7 @@ public void testDefaults() public void testExplicitPropertyMappings() throws IOException { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("node-scheduler.network-topology.subnet.cidr-prefix-lengths", "24,26") .put("node-scheduler.network-topology.subnet.ip-address-protocol", "IPv6") .buildOrThrow(); diff --git a/core/trino-main/src/test/java/io/trino/execution/scheduler/TestTopologyAwareNodeSelectorConfig.java b/core/trino-main/src/test/java/io/trino/execution/scheduler/TestTopologyAwareNodeSelectorConfig.java index dfcd0d224fc8..2e719236fe91 100644 --- a/core/trino-main/src/test/java/io/trino/execution/scheduler/TestTopologyAwareNodeSelectorConfig.java +++ b/core/trino-main/src/test/java/io/trino/execution/scheduler/TestTopologyAwareNodeSelectorConfig.java @@ -34,7 +34,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("node-scheduler.network-topology.type", "FILE") .put("node-scheduler.network-topology.segments", "rack,machine") .buildOrThrow(); diff --git a/core/trino-main/src/test/java/io/trino/execution/scheduler/TestTopologyFileConfig.java b/core/trino-main/src/test/java/io/trino/execution/scheduler/TestTopologyFileConfig.java index 5a561eb8647f..56eb3b9e3ddc 100644 --- a/core/trino-main/src/test/java/io/trino/execution/scheduler/TestTopologyFileConfig.java +++ b/core/trino-main/src/test/java/io/trino/execution/scheduler/TestTopologyFileConfig.java @@ -41,7 +41,7 @@ public void testExplicitPropertyMappings() { Path networkTopologyFile = Files.createTempFile(null, null); - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("node-scheduler.network-topology.file", networkTopologyFile.toString()) .put("node-scheduler.network-topology.refresh-period", "27m") .buildOrThrow(); diff --git a/core/trino-main/src/test/java/io/trino/memory/TestMemoryManagerConfig.java b/core/trino-main/src/test/java/io/trino/memory/TestMemoryManagerConfig.java index 393eae7d042b..11ddc9122ae8 100644 --- a/core/trino-main/src/test/java/io/trino/memory/TestMemoryManagerConfig.java +++ b/core/trino-main/src/test/java/io/trino/memory/TestMemoryManagerConfig.java @@ -44,7 +44,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("query.low-memory-killer.policy", "none") .put("query.low-memory-killer.delay", "20s") .put("query.max-memory", "2GB") diff --git a/core/trino-main/src/test/java/io/trino/memory/TestNodeMemoryConfig.java b/core/trino-main/src/test/java/io/trino/memory/TestNodeMemoryConfig.java index f02280c69f77..87499c756ee6 100644 --- a/core/trino-main/src/test/java/io/trino/memory/TestNodeMemoryConfig.java +++ b/core/trino-main/src/test/java/io/trino/memory/TestNodeMemoryConfig.java @@ -40,7 +40,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("query.max-memory-per-node", "1GB") .put("query.max-memory-per-task", "200MB") .put("memory.heap-headroom-per-node", "1GB") diff --git a/core/trino-main/src/test/java/io/trino/metadata/TestInformationSchemaMetadata.java b/core/trino-main/src/test/java/io/trino/metadata/TestInformationSchemaMetadata.java index e91d4d94fd87..b0cd1410f518 100644 --- a/core/trino-main/src/test/java/io/trino/metadata/TestInformationSchemaMetadata.java +++ b/core/trino-main/src/test/java/io/trino/metadata/TestInformationSchemaMetadata.java @@ -93,7 +93,7 @@ public void testInformationSchemaPredicatePushdown() { TransactionId transactionId = transactionManager.beginTransaction(false); - ImmutableMap.Builder domains = new ImmutableMap.Builder<>(); + ImmutableMap.Builder domains = ImmutableMap.builder(); domains.put(new InformationSchemaColumnHandle("table_schema"), Domain.singleValue(VARCHAR, Slices.utf8Slice("test_schema"))); domains.put(new InformationSchemaColumnHandle("table_name"), Domain.singleValue(VARCHAR, Slices.utf8Slice("test_view"))); Constraint constraint = new Constraint(TupleDomain.withColumnDomains(domains.buildOrThrow())); @@ -133,7 +133,7 @@ public void testInformationSchemaPredicatePushdownWithoutSchemaPredicate() TransactionId transactionId = transactionManager.beginTransaction(false); // predicate without schema predicates should cause schemas to be enumerated when table predicates are present - ImmutableMap.Builder domains = new ImmutableMap.Builder<>(); + ImmutableMap.Builder domains = ImmutableMap.builder(); domains.put(new InformationSchemaColumnHandle("table_name"), Domain.singleValue(VARCHAR, Slices.utf8Slice("test_view"))); Constraint constraint = new Constraint(TupleDomain.withColumnDomains(domains.buildOrThrow())); @@ -157,7 +157,7 @@ public void testInformationSchemaPredicatePushdownWithoutTablePredicate() TransactionId transactionId = transactionManager.beginTransaction(false); // predicate without table name predicates should not cause table level prefixes to be evaluated - ImmutableMap.Builder domains = new ImmutableMap.Builder<>(); + ImmutableMap.Builder domains = ImmutableMap.builder(); domains.put(new InformationSchemaColumnHandle("table_schema"), Domain.singleValue(VARCHAR, Slices.utf8Slice("test_schema"))); Constraint constraint = new Constraint(TupleDomain.withColumnDomains(domains.buildOrThrow())); diff --git a/core/trino-main/src/test/java/io/trino/metadata/TestStaticCatalogStoreConfig.java b/core/trino-main/src/test/java/io/trino/metadata/TestStaticCatalogStoreConfig.java index c21106edf842..d00d87b59c20 100644 --- a/core/trino-main/src/test/java/io/trino/metadata/TestStaticCatalogStoreConfig.java +++ b/core/trino-main/src/test/java/io/trino/metadata/TestStaticCatalogStoreConfig.java @@ -37,7 +37,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("catalog.config-dir", "/foo") .put("catalog.disabled-catalogs", "abc,xyz") .buildOrThrow(); diff --git a/core/trino-main/src/test/java/io/trino/operator/TestDirectExchangeClientConfig.java b/core/trino-main/src/test/java/io/trino/operator/TestDirectExchangeClientConfig.java index cc7dc9c73f38..12630b8b225d 100644 --- a/core/trino-main/src/test/java/io/trino/operator/TestDirectExchangeClientConfig.java +++ b/core/trino-main/src/test/java/io/trino/operator/TestDirectExchangeClientConfig.java @@ -47,7 +47,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("exchange.max-buffer-size", "1GB") .put("exchange.concurrent-request-multiplier", "13") .put("exchange.min-error-duration", "13s") diff --git a/core/trino-main/src/test/java/io/trino/operator/aggregation/TestArrayMaxNAggregation.java b/core/trino-main/src/test/java/io/trino/operator/aggregation/TestArrayMaxNAggregation.java index ae2dd00173c5..7a9e7c860da8 100644 --- a/core/trino-main/src/test/java/io/trino/operator/aggregation/TestArrayMaxNAggregation.java +++ b/core/trino-main/src/test/java/io/trino/operator/aggregation/TestArrayMaxNAggregation.java @@ -104,7 +104,7 @@ private void testCustomAggregation(Long[] values, int n) { PriorityQueue heap = new PriorityQueue<>(n); Arrays.stream(values).filter(Objects::nonNull).forEach(heap::add); - ImmutableList.Builder> expected = new ImmutableList.Builder<>(); + ImmutableList.Builder> expected = ImmutableList.builder(); for (int i = heap.size() - 1; i >= 0; i--) { expected.add(ImmutableList.of(heap.remove())); } diff --git a/core/trino-main/src/test/java/io/trino/operator/aggregation/minmaxby/TestMinMaxByAggregation.java b/core/trino-main/src/test/java/io/trino/operator/aggregation/minmaxby/TestMinMaxByAggregation.java index 7cb0555058cd..4874d0e6063f 100644 --- a/core/trino-main/src/test/java/io/trino/operator/aggregation/minmaxby/TestMinMaxByAggregation.java +++ b/core/trino-main/src/test/java/io/trino/operator/aggregation/minmaxby/TestMinMaxByAggregation.java @@ -75,7 +75,7 @@ public void testAllRegistered() private static List getTypes() { - return new ImmutableList.Builder() + return ImmutableList.builder() .addAll(STANDARD_TYPES) .add(VARCHAR) .add(createDecimalType(1)) diff --git a/core/trino-main/src/test/java/io/trino/security/TestAccessControlConfig.java b/core/trino-main/src/test/java/io/trino/security/TestAccessControlConfig.java index d6f8b366b1bc..8303981b12d7 100644 --- a/core/trino-main/src/test/java/io/trino/security/TestAccessControlConfig.java +++ b/core/trino-main/src/test/java/io/trino/security/TestAccessControlConfig.java @@ -39,7 +39,7 @@ public void testExplicitPropertyMappings() Path config1 = Files.createTempFile(null, null); Path config2 = Files.createTempFile(null, null); - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("access-control.config-files", config1.toString() + "," + config2.toString()) .buildOrThrow(); diff --git a/core/trino-main/src/test/java/io/trino/server/TestEmbeddedDiscoveryConfig.java b/core/trino-main/src/test/java/io/trino/server/TestEmbeddedDiscoveryConfig.java index 7ad7b2e39709..4ed0dc15bda9 100644 --- a/core/trino-main/src/test/java/io/trino/server/TestEmbeddedDiscoveryConfig.java +++ b/core/trino-main/src/test/java/io/trino/server/TestEmbeddedDiscoveryConfig.java @@ -34,7 +34,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("discovery-server.enabled", "false") .buildOrThrow(); diff --git a/core/trino-main/src/test/java/io/trino/server/TestFailureDetectorConfig.java b/core/trino-main/src/test/java/io/trino/server/TestFailureDetectorConfig.java index cb11eaabd45b..a3210a76490d 100644 --- a/core/trino-main/src/test/java/io/trino/server/TestFailureDetectorConfig.java +++ b/core/trino-main/src/test/java/io/trino/server/TestFailureDetectorConfig.java @@ -41,7 +41,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("failure-detector.expiration-grace-interval", "5m") .put("failure-detector.warmup-interval", "60s") .put("failure-detector.heartbeat-interval", "10s") diff --git a/core/trino-main/src/test/java/io/trino/server/TestInternalCommunicationConfig.java b/core/trino-main/src/test/java/io/trino/server/TestInternalCommunicationConfig.java index d9c529cd6eff..d05bdf6c1658 100644 --- a/core/trino-main/src/test/java/io/trino/server/TestInternalCommunicationConfig.java +++ b/core/trino-main/src/test/java/io/trino/server/TestInternalCommunicationConfig.java @@ -48,7 +48,7 @@ public void testExplicitPropertyMappings() Path keystoreFile = Files.createTempFile(null, null); Path truststoreFile = Files.createTempFile(null, null); - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("internal-communication.shared-secret", "secret") .put("internal-communication.http2.enabled", "true") .put("internal-communication.https.required", "true") diff --git a/core/trino-main/src/test/java/io/trino/server/TestJmxNamingConfig.java b/core/trino-main/src/test/java/io/trino/server/TestJmxNamingConfig.java index 751ec4f9fc32..35311540f937 100644 --- a/core/trino-main/src/test/java/io/trino/server/TestJmxNamingConfig.java +++ b/core/trino-main/src/test/java/io/trino/server/TestJmxNamingConfig.java @@ -34,7 +34,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("jmx.base-name", "my.stuff") .buildOrThrow(); diff --git a/core/trino-main/src/test/java/io/trino/server/TestProtocolConfig.java b/core/trino-main/src/test/java/io/trino/server/TestProtocolConfig.java index c99ef4dcc7e6..1679cae97cfe 100644 --- a/core/trino-main/src/test/java/io/trino/server/TestProtocolConfig.java +++ b/core/trino-main/src/test/java/io/trino/server/TestProtocolConfig.java @@ -36,7 +36,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("protocol.v1.alternate-header-name", "taco") .put("protocol.v1.prepared-statement-compression.length-threshold", "412") .put("protocol.v1.prepared-statement-compression.min-gain", "0") diff --git a/core/trino-main/src/test/java/io/trino/server/TestServerConfig.java b/core/trino-main/src/test/java/io/trino/server/TestServerConfig.java index fd0e6862e678..645b7acadd3d 100644 --- a/core/trino-main/src/test/java/io/trino/server/TestServerConfig.java +++ b/core/trino-main/src/test/java/io/trino/server/TestServerConfig.java @@ -41,7 +41,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("coordinator", "false") .put("experimental.concurrent-startup", "true") .put("http.include-exception-in-response", "false") diff --git a/core/trino-main/src/test/java/io/trino/server/TestServerPluginsProviderConfig.java b/core/trino-main/src/test/java/io/trino/server/TestServerPluginsProviderConfig.java index 71138a35d9cd..75a706f8fd06 100644 --- a/core/trino-main/src/test/java/io/trino/server/TestServerPluginsProviderConfig.java +++ b/core/trino-main/src/test/java/io/trino/server/TestServerPluginsProviderConfig.java @@ -35,7 +35,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("plugin.dir", "plugins-dir") .buildOrThrow(); diff --git a/core/trino-main/src/test/java/io/trino/server/security/TestCertificateConfig.java b/core/trino-main/src/test/java/io/trino/server/security/TestCertificateConfig.java index 11cea1640eb8..1face4ec07e0 100644 --- a/core/trino-main/src/test/java/io/trino/server/security/TestCertificateConfig.java +++ b/core/trino-main/src/test/java/io/trino/server/security/TestCertificateConfig.java @@ -41,7 +41,7 @@ public void testExplicitPropertyMappings() { Path userMappingFile = Files.createTempFile(null, null); - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("http-server.authentication.certificate.user-mapping.pattern", "(.*)@something") .put("http-server.authentication.certificate.user-mapping.file", userMappingFile.toString()) .buildOrThrow(); diff --git a/core/trino-main/src/test/java/io/trino/server/security/TestHeaderAuthenticatorConfig.java b/core/trino-main/src/test/java/io/trino/server/security/TestHeaderAuthenticatorConfig.java index 44f41646f87c..375864b1c009 100644 --- a/core/trino-main/src/test/java/io/trino/server/security/TestHeaderAuthenticatorConfig.java +++ b/core/trino-main/src/test/java/io/trino/server/security/TestHeaderAuthenticatorConfig.java @@ -45,7 +45,7 @@ public void testExplicitPropertyMappings() Path config1 = Files.createTempFile(null, null); Path config2 = Files.createTempFile(null, null); - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("http-server.authentication.header.user-mapping.pattern", "(.*)@something") .put("http-server.authentication.header.user-mapping.file", userMappingFile.toString()) .put("header-authenticator.config-files", config1.toString() + "," + config2.toString()) diff --git a/core/trino-main/src/test/java/io/trino/server/security/TestInsecureAuthenticatorConfig.java b/core/trino-main/src/test/java/io/trino/server/security/TestInsecureAuthenticatorConfig.java index a41cb3ef4edb..0e081d2f5946 100644 --- a/core/trino-main/src/test/java/io/trino/server/security/TestInsecureAuthenticatorConfig.java +++ b/core/trino-main/src/test/java/io/trino/server/security/TestInsecureAuthenticatorConfig.java @@ -41,7 +41,7 @@ public void testExplicitPropertyMappings() { Path userMappingFile = Files.createTempFile(null, null); - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("http-server.authentication.insecure.user-mapping.pattern", "(.*)@something") .put("http-server.authentication.insecure.user-mapping.file", userMappingFile.toString()) .buildOrThrow(); diff --git a/core/trino-main/src/test/java/io/trino/server/security/TestKerberosConfig.java b/core/trino-main/src/test/java/io/trino/server/security/TestKerberosConfig.java index 4fda0beb3247..15200b47a8f7 100644 --- a/core/trino-main/src/test/java/io/trino/server/security/TestKerberosConfig.java +++ b/core/trino-main/src/test/java/io/trino/server/security/TestKerberosConfig.java @@ -50,7 +50,7 @@ public void testExplicitPropertyMappings() Path keytabFile = Files.createTempFile(null, null); Path userMappingFile = Files.createTempFile(null, null); - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("http.authentication.krb5.config", krbConfigFile.toString()) .put("http-server.authentication.krb5.service-name", "airlift") .put("http-server.authentication.krb5.keytab", keytabFile.toString()) diff --git a/core/trino-main/src/test/java/io/trino/server/security/TestPasswordAuthenticatorConfig.java b/core/trino-main/src/test/java/io/trino/server/security/TestPasswordAuthenticatorConfig.java index f3feb0f17352..0ecf79e06f9a 100644 --- a/core/trino-main/src/test/java/io/trino/server/security/TestPasswordAuthenticatorConfig.java +++ b/core/trino-main/src/test/java/io/trino/server/security/TestPasswordAuthenticatorConfig.java @@ -44,7 +44,7 @@ public void testExplicitPropertyMappings() Path config1 = Files.createTempFile(null, null); Path config2 = Files.createTempFile(null, null); - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("http-server.authentication.password.user-mapping.pattern", "(.*)@something") .put("http-server.authentication.password.user-mapping.file", userMappingFile.toString()) .put("password-authenticator.config-files", config1.toString() + "," + config2.toString()) diff --git a/core/trino-main/src/test/java/io/trino/server/security/TestSecurityConfig.java b/core/trino-main/src/test/java/io/trino/server/security/TestSecurityConfig.java index 181a956d7984..5b7b32966197 100644 --- a/core/trino-main/src/test/java/io/trino/server/security/TestSecurityConfig.java +++ b/core/trino-main/src/test/java/io/trino/server/security/TestSecurityConfig.java @@ -38,7 +38,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("http-server.authentication.type", "KERBEROS,PASSWORD") .put("http-server.authentication.allow-insecure-over-http", "false") .put("management.user", "management-user") diff --git a/core/trino-main/src/test/java/io/trino/server/security/jwt/TestJwtAuthenticatorConfig.java b/core/trino-main/src/test/java/io/trino/server/security/jwt/TestJwtAuthenticatorConfig.java index e58e288e1976..a83d74d76442 100644 --- a/core/trino-main/src/test/java/io/trino/server/security/jwt/TestJwtAuthenticatorConfig.java +++ b/core/trino-main/src/test/java/io/trino/server/security/jwt/TestJwtAuthenticatorConfig.java @@ -46,7 +46,7 @@ public void testExplicitPropertyMappings() Path jwtKeyFile = Files.createTempFile(null, null); Path userMappingFile = Files.createTempFile(null, null); - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("http-server.authentication.jwt.key-file", jwtKeyFile.toString()) .put("http-server.authentication.jwt.required-audience", "some-audience") .put("http-server.authentication.jwt.required-issuer", "some-issuer") diff --git a/core/trino-main/src/test/java/io/trino/server/security/oauth2/TestOAuth2Config.java b/core/trino-main/src/test/java/io/trino/server/security/oauth2/TestOAuth2Config.java index e7b480df2d95..29b0b75a0a6e 100644 --- a/core/trino-main/src/test/java/io/trino/server/security/oauth2/TestOAuth2Config.java +++ b/core/trino-main/src/test/java/io/trino/server/security/oauth2/TestOAuth2Config.java @@ -59,7 +59,7 @@ public void testExplicitPropertyMappings() throws IOException { Path userMappingFile = Files.createTempFile(null, null); - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("http-server.authentication.oauth2.state-key", "key-secret") .put("http-server.authentication.oauth2.issuer", "http://127.0.0.1:9000/oauth2") .put("http-server.authentication.oauth2.access-token-issuer", "http://127.0.0.1:9000/oauth2/access-token") diff --git a/core/trino-main/src/test/java/io/trino/server/ui/TestFixedUserWebUiConfig.java b/core/trino-main/src/test/java/io/trino/server/ui/TestFixedUserWebUiConfig.java index a4a7bc605dac..8b762bccda70 100644 --- a/core/trino-main/src/test/java/io/trino/server/ui/TestFixedUserWebUiConfig.java +++ b/core/trino-main/src/test/java/io/trino/server/ui/TestFixedUserWebUiConfig.java @@ -34,7 +34,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("web-ui.user", "some-user") .buildOrThrow(); diff --git a/core/trino-main/src/test/java/io/trino/server/ui/TestFormWebUiConfig.java b/core/trino-main/src/test/java/io/trino/server/ui/TestFormWebUiConfig.java index ecc9a8e4d9fb..e83844ab4e80 100644 --- a/core/trino-main/src/test/java/io/trino/server/ui/TestFormWebUiConfig.java +++ b/core/trino-main/src/test/java/io/trino/server/ui/TestFormWebUiConfig.java @@ -37,7 +37,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("web-ui.session-timeout", "33s") .put("web-ui.shared-secret", "test-secret") .buildOrThrow(); diff --git a/core/trino-main/src/test/java/io/trino/server/ui/TestWebUiConfig.java b/core/trino-main/src/test/java/io/trino/server/ui/TestWebUiConfig.java index 4d60b2c4d35b..1231b7d9b18d 100644 --- a/core/trino-main/src/test/java/io/trino/server/ui/TestWebUiConfig.java +++ b/core/trino-main/src/test/java/io/trino/server/ui/TestWebUiConfig.java @@ -34,7 +34,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("web-ui.enabled", "false") .buildOrThrow(); diff --git a/core/trino-main/src/test/java/io/trino/spiller/TestNodeSpillConfig.java b/core/trino-main/src/test/java/io/trino/spiller/TestNodeSpillConfig.java index bc7b921cd761..bf953b29cd78 100644 --- a/core/trino-main/src/test/java/io/trino/spiller/TestNodeSpillConfig.java +++ b/core/trino-main/src/test/java/io/trino/spiller/TestNodeSpillConfig.java @@ -40,7 +40,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("max-spill-per-node", "10MB") .put("query-max-spill-per-node", "15 MB") .put("spill-compression-enabled", "true") diff --git a/core/trino-main/src/test/java/io/trino/sql/TestSqlEnvironmentConfig.java b/core/trino-main/src/test/java/io/trino/sql/TestSqlEnvironmentConfig.java index 6f6f9e3cac9d..b423c9c052f2 100644 --- a/core/trino-main/src/test/java/io/trino/sql/TestSqlEnvironmentConfig.java +++ b/core/trino-main/src/test/java/io/trino/sql/TestSqlEnvironmentConfig.java @@ -39,7 +39,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("sql.path", "a.b, c.d") .put("sql.default-catalog", "some-catalog") .put("sql.default-schema", "some-schema") diff --git a/core/trino-main/src/test/java/io/trino/sql/analyzer/TestFeaturesConfig.java b/core/trino-main/src/test/java/io/trino/sql/analyzer/TestFeaturesConfig.java index 3d5c6e38a49b..5eedcd802045 100644 --- a/core/trino-main/src/test/java/io/trino/sql/analyzer/TestFeaturesConfig.java +++ b/core/trino-main/src/test/java/io/trino/sql/analyzer/TestFeaturesConfig.java @@ -120,7 +120,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("cpu-cost-weight", "0.4") .put("memory-cost-weight", "0.3") .put("network-cost-weight", "0.2") diff --git a/core/trino-main/src/test/java/io/trino/sql/planner/TestCompilerConfig.java b/core/trino-main/src/test/java/io/trino/sql/planner/TestCompilerConfig.java index b7b227c6442e..d2fa9f6e256b 100644 --- a/core/trino-main/src/test/java/io/trino/sql/planner/TestCompilerConfig.java +++ b/core/trino-main/src/test/java/io/trino/sql/planner/TestCompilerConfig.java @@ -34,7 +34,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("compiler.expression-cache-size", "52") .buildOrThrow(); diff --git a/core/trino-main/src/test/java/io/trino/transaction/TestTransactionManagerConfig.java b/core/trino-main/src/test/java/io/trino/transaction/TestTransactionManagerConfig.java index e0836a5885b0..db11f432414a 100644 --- a/core/trino-main/src/test/java/io/trino/transaction/TestTransactionManagerConfig.java +++ b/core/trino-main/src/test/java/io/trino/transaction/TestTransactionManagerConfig.java @@ -38,7 +38,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("transaction.idle-check-interval", "1s") .put("transaction.idle-timeout", "10s") .put("transaction.max-finishing-concurrency", "100") diff --git a/lib/trino-orc/src/main/java/io/trino/orc/metadata/OrcMetadataReader.java b/lib/trino-orc/src/main/java/io/trino/orc/metadata/OrcMetadataReader.java index 46fd6b0215b3..600c3e597fed 100644 --- a/lib/trino-orc/src/main/java/io/trino/orc/metadata/OrcMetadataReader.java +++ b/lib/trino-orc/src/main/java/io/trino/orc/metadata/OrcMetadataReader.java @@ -585,7 +585,7 @@ private static OrcTypeKind toTypeKind(OrcProto.Type.Kind typeKind) // This method assumes type attributes have no duplicate key private static Map toMap(List attributes) { - ImmutableMap.Builder results = new ImmutableMap.Builder<>(); + ImmutableMap.Builder results = ImmutableMap.builder(); if (attributes != null) { for (OrcProto.StringPair attribute : attributes) { if (attribute.hasKey() && attribute.hasValue()) { diff --git a/lib/trino-plugin-toolkit/src/test/java/io/trino/plugin/base/security/TestFileBasedAccessControlConfig.java b/lib/trino-plugin-toolkit/src/test/java/io/trino/plugin/base/security/TestFileBasedAccessControlConfig.java index a3a1a6f36555..56432398ed23 100644 --- a/lib/trino-plugin-toolkit/src/test/java/io/trino/plugin/base/security/TestFileBasedAccessControlConfig.java +++ b/lib/trino-plugin-toolkit/src/test/java/io/trino/plugin/base/security/TestFileBasedAccessControlConfig.java @@ -48,7 +48,7 @@ public void testExplicitPropertyMappings() { Path securityConfigFile = Files.createTempFile(null, null); - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put(SECURITY_CONFIG_FILE, securityConfigFile.toString()) .put(SECURITY_REFRESH_PERIOD, "1s") .buildOrThrow(); diff --git a/plugin/trino-atop/src/test/java/io/trino/plugin/atop/TestAtopConnectorConfig.java b/plugin/trino-atop/src/test/java/io/trino/plugin/atop/TestAtopConnectorConfig.java index 74fb29182b7a..faf2b72cf67c 100644 --- a/plugin/trino-atop/src/test/java/io/trino/plugin/atop/TestAtopConnectorConfig.java +++ b/plugin/trino-atop/src/test/java/io/trino/plugin/atop/TestAtopConnectorConfig.java @@ -49,7 +49,7 @@ public void testExplicitPropertyMappings() { Path atopExecutable = Files.createTempFile(null, null); - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("atop.executable-path", atopExecutable.toString()) .put("atop.concurrent-readers-per-node", "10") .put("atop.executable-read-timeout", "1m") diff --git a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestBaseJdbcConfig.java b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestBaseJdbcConfig.java index 309c43849af5..c78ca674cc0d 100644 --- a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestBaseJdbcConfig.java +++ b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestBaseJdbcConfig.java @@ -47,7 +47,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("connection-url", "jdbc:h2:mem:config") .put("jdbc-types-mapped-to-varchar", "mytype,struct_type1") .put("metadata.cache-ttl", "1s") diff --git a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestCredentialProviderTypeConfig.java b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestCredentialProviderTypeConfig.java index 6576b182be05..5c7730d9db59 100644 --- a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestCredentialProviderTypeConfig.java +++ b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestCredentialProviderTypeConfig.java @@ -37,7 +37,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("credential-provider.type", "FILE") .buildOrThrow(); diff --git a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestDecimalConfig.java b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestDecimalConfig.java index 89032b7f5f2c..03bafa36bc5d 100644 --- a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestDecimalConfig.java +++ b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestDecimalConfig.java @@ -40,7 +40,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("decimal-mapping", "allow_overflow") .put("decimal-default-scale", "16") .put("decimal-rounding-mode", "HALF_UP") diff --git a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestJdbcMetadataConfig.java b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestJdbcMetadataConfig.java index 88e980eaf9e3..f84e8026f9a0 100644 --- a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestJdbcMetadataConfig.java +++ b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestJdbcMetadataConfig.java @@ -37,7 +37,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("join-pushdown.enabled", "true") .put("aggregation-pushdown.enabled", "false") .put("domain-compaction-threshold", "42") diff --git a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestJdbcWriteConfig.java b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestJdbcWriteConfig.java index 1eb9b7e2df35..b0e84043e49e 100644 --- a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestJdbcWriteConfig.java +++ b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestJdbcWriteConfig.java @@ -38,7 +38,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("write.batch-size", "24") .put("insert.non-transactional-insert.enabled", "true") .buildOrThrow(); diff --git a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestRemoteQueryCancellationConfig.java b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestRemoteQueryCancellationConfig.java index 4cad37e13d62..769958a0c5f9 100644 --- a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestRemoteQueryCancellationConfig.java +++ b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestRemoteQueryCancellationConfig.java @@ -34,7 +34,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("remote-query-async-cancellation.enabled", "false") .buildOrThrow(); diff --git a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestTypeHandlingJdbcConfig.java b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestTypeHandlingJdbcConfig.java index 2b3d1d890c97..4369f3a3cad8 100644 --- a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestTypeHandlingJdbcConfig.java +++ b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestTypeHandlingJdbcConfig.java @@ -35,7 +35,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("unsupported-type-handling", "CONVERT_TO_VARCHAR") .buildOrThrow(); diff --git a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/credential/TestCredentialProvider.java b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/credential/TestCredentialProvider.java index bedef3519d10..dfd37396809c 100644 --- a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/credential/TestCredentialProvider.java +++ b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/credential/TestCredentialProvider.java @@ -57,7 +57,7 @@ public void testFileCredentialProvider() @Test public void testKeyStoreBasedCredentialProvider() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("connection-url", "jdbc:h2:mem:config") .put("credential-provider.type", "KEYSTORE") .put("keystore-file-path", getResourceFilePath("credentials.jceks")) diff --git a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/credential/TestExtraCredentialConfig.java b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/credential/TestExtraCredentialConfig.java index 08059ae8b916..cb7cc513e775 100644 --- a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/credential/TestExtraCredentialConfig.java +++ b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/credential/TestExtraCredentialConfig.java @@ -35,7 +35,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("user-credential-name", "foo") .put("password-credential-name", "bar") .buildOrThrow(); diff --git a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/credential/file/TestConfigFileBasedCredentialProviderConfig.java b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/credential/file/TestConfigFileBasedCredentialProviderConfig.java index 2d2c88c4a4a1..c55ed12b9337 100644 --- a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/credential/file/TestConfigFileBasedCredentialProviderConfig.java +++ b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/credential/file/TestConfigFileBasedCredentialProviderConfig.java @@ -40,7 +40,7 @@ public void testExplicitPropertyMappings() { Path credentialFile = Files.createTempFile(null, null); - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("connection-credential-file", credentialFile.toString()) .buildOrThrow(); diff --git a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/credential/keystore/TestKeyStoreBasedCredentialProviderConfig.java b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/credential/keystore/TestKeyStoreBasedCredentialProviderConfig.java index 28cb030d3ca4..9aaf10555268 100644 --- a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/credential/keystore/TestKeyStoreBasedCredentialProviderConfig.java +++ b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/credential/keystore/TestKeyStoreBasedCredentialProviderConfig.java @@ -46,7 +46,7 @@ public void testExplicitPropertyMappings() { Path keystoreFile = Files.createTempFile(null, null); - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("keystore-file-path", keystoreFile.toString()) .put("keystore-type", "JCEKS") .put("keystore-password", "keystore_password") diff --git a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/mapping/TestMappingConfig.java b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/mapping/TestMappingConfig.java index 6c6f614cecaf..b2917520fb7e 100644 --- a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/mapping/TestMappingConfig.java +++ b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/mapping/TestMappingConfig.java @@ -43,7 +43,7 @@ public void testExplicitPropertyMappings() throws Exception { String configFile = createRuleBasedIdentifierMappingFile().toFile().getAbsolutePath(); - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("case-insensitive-name-matching", "true") .put("case-insensitive-name-matching.cache-ttl", "1s") .put("case-insensitive-name-matching.config-file", configFile) diff --git a/plugin/trino-bigquery/src/main/java/io/trino/plugin/bigquery/BigQueryType.java b/plugin/trino-bigquery/src/main/java/io/trino/plugin/bigquery/BigQueryType.java index 964e739c263e..de541c54226b 100644 --- a/plugin/trino-bigquery/src/main/java/io/trino/plugin/bigquery/BigQueryType.java +++ b/plugin/trino-bigquery/src/main/java/io/trino/plugin/bigquery/BigQueryType.java @@ -263,7 +263,7 @@ private static Field toInnerField(String name, Type type, boolean repeated) private static FieldList toFieldList(RowType rowType) { - ImmutableList.Builder fields = new ImmutableList.Builder<>(); + ImmutableList.Builder fields = ImmutableList.builder(); for (RowType.Field field : rowType.getFields()) { String fieldName = field.getName() .orElseThrow(() -> new TrinoException(NOT_SUPPORTED, "ROW type does not have field names declared: " + rowType)); diff --git a/plugin/trino-bigquery/src/test/java/io/trino/plugin/bigquery/TestBigQueryConfig.java b/plugin/trino-bigquery/src/test/java/io/trino/plugin/bigquery/TestBigQueryConfig.java index eb80087c2eb5..9aae513ccf5e 100644 --- a/plugin/trino-bigquery/src/test/java/io/trino/plugin/bigquery/TestBigQueryConfig.java +++ b/plugin/trino-bigquery/src/test/java/io/trino/plugin/bigquery/TestBigQueryConfig.java @@ -46,7 +46,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappingsWithCredentialsKey() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("bigquery.project-id", "pid") .put("bigquery.parent-project-id", "ppid") .put("bigquery.parallelism", "20") diff --git a/plugin/trino-bigquery/src/test/java/io/trino/plugin/bigquery/TestStaticCredentialsConfig.java b/plugin/trino-bigquery/src/test/java/io/trino/plugin/bigquery/TestStaticCredentialsConfig.java index ebf4f0577db1..e80807047f36 100644 --- a/plugin/trino-bigquery/src/test/java/io/trino/plugin/bigquery/TestStaticCredentialsConfig.java +++ b/plugin/trino-bigquery/src/test/java/io/trino/plugin/bigquery/TestStaticCredentialsConfig.java @@ -43,7 +43,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappingsWithCredentialsKey() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("bigquery.credentials-key", "key") .buildOrThrow(); @@ -60,7 +60,7 @@ public void testExplicitPropertyMappingsWithCredentialsFile() try { Path file = Files.createTempFile("config", ".json"); - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("bigquery.credentials-file", file.toString()) .buildOrThrow(); @@ -78,7 +78,7 @@ public void testExplicitPropertyMappingsWithCredentialsFile() @Test public void testExplicitPropertyMappingsValidation() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("bigquery.credentials-key", "key") .put("bigquery.credentials-file", "file") .buildOrThrow(); diff --git a/plugin/trino-cassandra/src/main/java/io/trino/plugin/cassandra/CassandraType.java b/plugin/trino-cassandra/src/main/java/io/trino/plugin/cassandra/CassandraType.java index 872064e6698f..bdff2fde76ac 100644 --- a/plugin/trino-cassandra/src/main/java/io/trino/plugin/cassandra/CassandraType.java +++ b/plugin/trino-cassandra/src/main/java/io/trino/plugin/cassandra/CassandraType.java @@ -241,7 +241,7 @@ private static Optional createTypeForUserType(DataType dataType) { UserType userType = (UserType) dataType; // Using ImmutableMap is important as we exploit the fact that entries iteration order matches the order of putting values via builder - ImmutableMap.Builder argumentTypes = new ImmutableMap.Builder<>(); + ImmutableMap.Builder argumentTypes = ImmutableMap.builder(); for (UserType.Field field : userType) { Optional cassandraType = CassandraType.toCassandraType(field.getType()); if (cassandraType.isEmpty()) { diff --git a/plugin/trino-cassandra/src/test/java/io/trino/plugin/cassandra/TestCassandraClientConfig.java b/plugin/trino-cassandra/src/test/java/io/trino/plugin/cassandra/TestCassandraClientConfig.java index b540b36dbe83..df3b3706fd4c 100644 --- a/plugin/trino-cassandra/src/test/java/io/trino/plugin/cassandra/TestCassandraClientConfig.java +++ b/plugin/trino-cassandra/src/test/java/io/trino/plugin/cassandra/TestCassandraClientConfig.java @@ -78,7 +78,7 @@ public void testExplicitPropertyMappings() Path keystoreFile = Files.createTempFile(null, null); Path truststoreFile = Files.createTempFile(null, null); - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("cassandra.contact-points", "host1,host2") .put("cassandra.native-protocol-port", "9999") .put("cassandra.fetch-size", "10000") diff --git a/plugin/trino-clickhouse/src/main/java/io/trino/plugin/clickhouse/ClickHouseClient.java b/plugin/trino-clickhouse/src/main/java/io/trino/plugin/clickhouse/ClickHouseClient.java index 8e46a29649fb..bcc6e6289762 100644 --- a/plugin/trino-clickhouse/src/main/java/io/trino/plugin/clickhouse/ClickHouseClient.java +++ b/plugin/trino-clickhouse/src/main/java/io/trino/plugin/clickhouse/ClickHouseClient.java @@ -268,7 +268,7 @@ public Map getTableProperties(ConnectorSession session, JdbcTabl statement.setString(2, tableHandle.asPlainTable().getRemoteTableName().getTableName()); try (ResultSet resultSet = statement.executeQuery()) { - ImmutableMap.Builder properties = new ImmutableMap.Builder<>(); + ImmutableMap.Builder properties = ImmutableMap.builder(); while (resultSet.next()) { String engine = resultSet.getString("engine"); if (!isNullOrEmpty(engine)) { diff --git a/plugin/trino-clickhouse/src/test/java/io/trino/plugin/clickhouse/TestClickHouseConfig.java b/plugin/trino-clickhouse/src/test/java/io/trino/plugin/clickhouse/TestClickHouseConfig.java index 201609c1c273..22caafd51111 100644 --- a/plugin/trino-clickhouse/src/test/java/io/trino/plugin/clickhouse/TestClickHouseConfig.java +++ b/plugin/trino-clickhouse/src/test/java/io/trino/plugin/clickhouse/TestClickHouseConfig.java @@ -49,7 +49,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("clickhouse.map-string-as-varchar", "true") .put("clickhouse.legacy-driver", "true") .buildOrThrow(); diff --git a/plugin/trino-clickhouse/src/test/java/io/trino/plugin/clickhouse/TestClickHouseConnectorTest.java b/plugin/trino-clickhouse/src/test/java/io/trino/plugin/clickhouse/TestClickHouseConnectorTest.java index 288425511feb..d8ede1a3c65b 100644 --- a/plugin/trino-clickhouse/src/test/java/io/trino/plugin/clickhouse/TestClickHouseConnectorTest.java +++ b/plugin/trino-clickhouse/src/test/java/io/trino/plugin/clickhouse/TestClickHouseConnectorTest.java @@ -572,7 +572,7 @@ private Map getTableProperties(String schemaName, String tableNa preparedStatement.setString(2, tableName); ResultSet resultSet = preparedStatement.executeQuery(); - ImmutableMap.Builder properties = new ImmutableMap.Builder<>(); + ImmutableMap.Builder properties = ImmutableMap.builder(); while (resultSet.next()) { properties.put(ENGINE_PROPERTY, resultSet.getString("engine")); properties.put(ORDER_BY_PROPERTY, resultSet.getString("sorting_key")); diff --git a/plugin/trino-elasticsearch/src/test/java/io/trino/plugin/elasticsearch/TestAwsSecurityConfig.java b/plugin/trino-elasticsearch/src/test/java/io/trino/plugin/elasticsearch/TestAwsSecurityConfig.java index 990a7f671c6e..83cadcceb261 100644 --- a/plugin/trino-elasticsearch/src/test/java/io/trino/plugin/elasticsearch/TestAwsSecurityConfig.java +++ b/plugin/trino-elasticsearch/src/test/java/io/trino/plugin/elasticsearch/TestAwsSecurityConfig.java @@ -38,7 +38,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("elasticsearch.aws.access-key", "access") .put("elasticsearch.aws.secret-key", "secret") .put("elasticsearch.aws.region", "region") diff --git a/plugin/trino-elasticsearch/src/test/java/io/trino/plugin/elasticsearch/TestElasticsearchConfig.java b/plugin/trino-elasticsearch/src/test/java/io/trino/plugin/elasticsearch/TestElasticsearchConfig.java index 658d49a6b291..dfdb38d0617b 100644 --- a/plugin/trino-elasticsearch/src/test/java/io/trino/plugin/elasticsearch/TestElasticsearchConfig.java +++ b/plugin/trino-elasticsearch/src/test/java/io/trino/plugin/elasticsearch/TestElasticsearchConfig.java @@ -66,7 +66,7 @@ public void testExplicitPropertyMappings() Path keystoreFile = Files.createTempFile(null, null); Path truststoreFile = Files.createTempFile(null, null); - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("elasticsearch.host", "example.com") .put("elasticsearch.port", "9999") .put("elasticsearch.default-schema-name", "test") diff --git a/plugin/trino-elasticsearch/src/test/java/io/trino/plugin/elasticsearch/TestPasswordConfig.java b/plugin/trino-elasticsearch/src/test/java/io/trino/plugin/elasticsearch/TestPasswordConfig.java index f4c75379f0be..1c87b2b69725 100644 --- a/plugin/trino-elasticsearch/src/test/java/io/trino/plugin/elasticsearch/TestPasswordConfig.java +++ b/plugin/trino-elasticsearch/src/test/java/io/trino/plugin/elasticsearch/TestPasswordConfig.java @@ -35,7 +35,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("elasticsearch.auth.user", "user") .put("elasticsearch.auth.password", "password") .buildOrThrow(); diff --git a/plugin/trino-example-http/src/test/java/io/trino/plugin/example/TestExampleConfig.java b/plugin/trino-example-http/src/test/java/io/trino/plugin/example/TestExampleConfig.java index 363128eedd7a..befd42acd30a 100644 --- a/plugin/trino-example-http/src/test/java/io/trino/plugin/example/TestExampleConfig.java +++ b/plugin/trino-example-http/src/test/java/io/trino/plugin/example/TestExampleConfig.java @@ -35,7 +35,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("metadata-uri", "file://test.json") .buildOrThrow(); diff --git a/plugin/trino-exchange/src/test/java/io/trino/plugin/exchange/TestFileSystemExchangeConfig.java b/plugin/trino-exchange/src/test/java/io/trino/plugin/exchange/TestFileSystemExchangeConfig.java index 684d9e30fe58..d1a323a66ebf 100644 --- a/plugin/trino-exchange/src/test/java/io/trino/plugin/exchange/TestFileSystemExchangeConfig.java +++ b/plugin/trino-exchange/src/test/java/io/trino/plugin/exchange/TestFileSystemExchangeConfig.java @@ -36,7 +36,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("exchange.base-directory", "s3n://exchange-spooling-test/") .put("exchange.encryption-enabled", "true") .put("exchange.sink-buffer-pool-min-size", "10") diff --git a/plugin/trino-exchange/src/test/java/io/trino/plugin/exchange/containers/MinioStorage.java b/plugin/trino-exchange/src/test/java/io/trino/plugin/exchange/containers/MinioStorage.java index 79f77eda43d8..99e9eae28f04 100644 --- a/plugin/trino-exchange/src/test/java/io/trino/plugin/exchange/containers/MinioStorage.java +++ b/plugin/trino-exchange/src/test/java/io/trino/plugin/exchange/containers/MinioStorage.java @@ -85,7 +85,7 @@ public void close() public static Map getExchangeManagerProperties(MinioStorage minioStorage) { - return new ImmutableMap.Builder() + return ImmutableMap.builder() .put("exchange.base-directory", "s3n://" + minioStorage.getBucketName()) .put("exchange.s3.aws-access-key", MinioStorage.ACCESS_KEY) .put("exchange.s3.aws-secret-key", MinioStorage.SECRET_KEY) diff --git a/plugin/trino-exchange/src/test/java/io/trino/plugin/exchange/s3/TestExchangeS3Config.java b/plugin/trino-exchange/src/test/java/io/trino/plugin/exchange/s3/TestExchangeS3Config.java index 72d58d4bb5cd..1978f4990153 100644 --- a/plugin/trino-exchange/src/test/java/io/trino/plugin/exchange/s3/TestExchangeS3Config.java +++ b/plugin/trino-exchange/src/test/java/io/trino/plugin/exchange/s3/TestExchangeS3Config.java @@ -41,7 +41,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("exchange.s3.aws-access-key", "access") .put("exchange.s3.aws-secret-key", "secret") .put("exchange.s3.region", "us-west-1") diff --git a/plugin/trino-google-sheets/src/test/java/io/trino/plugin/google/sheets/TestSheetsConfig.java b/plugin/trino-google-sheets/src/test/java/io/trino/plugin/google/sheets/TestSheetsConfig.java index 8ab51b521cd8..1c167183f3e0 100644 --- a/plugin/trino-google-sheets/src/test/java/io/trino/plugin/google/sheets/TestSheetsConfig.java +++ b/plugin/trino-google-sheets/src/test/java/io/trino/plugin/google/sheets/TestSheetsConfig.java @@ -45,7 +45,7 @@ public void testExplicitPropertyMappings() { Path credentialsFile = Files.createTempFile(null, null); - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("credentials-path", credentialsFile.toString()) .put("metadata-sheet-id", "foo_bar_sheet_id#Sheet1") .put("sheets-data-max-cache-size", "2000") diff --git a/plugin/trino-google-sheets/src/test/java/io/trino/plugin/google/sheets/TestSheetsPlugin.java b/plugin/trino-google-sheets/src/test/java/io/trino/plugin/google/sheets/TestSheetsPlugin.java index 1828fa206731..37f286bd3a0e 100644 --- a/plugin/trino-google-sheets/src/test/java/io/trino/plugin/google/sheets/TestSheetsPlugin.java +++ b/plugin/trino-google-sheets/src/test/java/io/trino/plugin/google/sheets/TestSheetsPlugin.java @@ -13,6 +13,7 @@ */ package io.trino.plugin.google.sheets; +import com.google.common.collect.ImmutableMap; import com.google.common.io.Resources; import io.trino.spi.Plugin; import io.trino.spi.connector.Connector; @@ -24,7 +25,6 @@ import java.nio.file.Files; import java.util.Base64; -import static com.google.common.collect.ImmutableMap.Builder; import static com.google.common.collect.Iterables.getOnlyElement; import static io.trino.plugin.google.sheets.TestGoogleSheets.GOOGLE_SHEETS; import static java.io.File.createTempFile; @@ -52,7 +52,7 @@ public void testCreateConnector() { Plugin plugin = new SheetsPlugin(); ConnectorFactory factory = getOnlyElement(plugin.getConnectorFactories()); - Builder propertiesMap = new Builder().put("credentials-path", getTestCredentialsPath()).put("metadata-sheet-id", TEST_METADATA_SHEET_ID); + ImmutableMap.Builder propertiesMap = ImmutableMap.builder().put("credentials-path", getTestCredentialsPath()).put("metadata-sheet-id", TEST_METADATA_SHEET_ID); Connector connector = factory.create(GOOGLE_SHEETS, propertiesMap.buildOrThrow(), new TestingConnectorContext()); assertNotNull(connector); connector.shutdown(); diff --git a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/TestHdfsConfig.java b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/TestHdfsConfig.java index 9482d4e2d9ea..b1a739c39092 100644 --- a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/TestHdfsConfig.java +++ b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/TestHdfsConfig.java @@ -60,7 +60,7 @@ public void testExplicitPropertyMappings() Path resource1 = Files.createTempFile(null, null); Path resource2 = Files.createTempFile(null, null); - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("hive.config.resources", resource1.toString() + "," + resource2.toString()) .put("hive.fs.new-directory-permissions", "0700") .put("hive.fs.new-file-inherit-ownership", "true") @@ -99,7 +99,7 @@ public void testExplicitPropertyMappings() @Test public void testNewDirectoryPermissionsMapping() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("hive.fs.new-directory-permissions", "skip") .buildOrThrow(); diff --git a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/TestHiveConfig.java b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/TestHiveConfig.java index 1ee9564b365e..8d3cb0cd33da 100644 --- a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/TestHiveConfig.java +++ b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/TestHiveConfig.java @@ -115,7 +115,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("hive.single-statement-writes", "true") .put("hive.max-split-size", "256MB") .put("hive.max-partitions-per-scan", "123") diff --git a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/TestOrcWriterConfig.java b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/TestOrcWriterConfig.java index c9ef6e7c33d1..9677c6772cb5 100644 --- a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/TestOrcWriterConfig.java +++ b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/TestOrcWriterConfig.java @@ -50,7 +50,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("hive.orc.writer.stripe-min-size", "13MB") .put("hive.orc.writer.stripe-max-size", "27MB") .put("hive.orc.writer.stripe-max-rows", "44") diff --git a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/TestRecordingMetastoreConfig.java b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/TestRecordingMetastoreConfig.java index 1ab4b2de75fc..ce599444bfdb 100644 --- a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/TestRecordingMetastoreConfig.java +++ b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/TestRecordingMetastoreConfig.java @@ -38,7 +38,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("hive.metastore-recording-path", "/foo/bar") .put("hive.metastore-recording-duration", "42s") .put("hive.replay-metastore-recording", "true") diff --git a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/authentication/TestHdfsAuthenticationConfig.java b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/authentication/TestHdfsAuthenticationConfig.java index df5484cfd4ef..5a5ae1699241 100644 --- a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/authentication/TestHdfsAuthenticationConfig.java +++ b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/authentication/TestHdfsAuthenticationConfig.java @@ -36,7 +36,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("hive.hdfs.authentication.type", "KERBEROS") .put("hive.hdfs.impersonation.enabled", "true") .buildOrThrow(); diff --git a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/authentication/TestHdfsKerberosConfig.java b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/authentication/TestHdfsKerberosConfig.java index fb78242f91f2..1669d843db37 100644 --- a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/authentication/TestHdfsKerberosConfig.java +++ b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/authentication/TestHdfsKerberosConfig.java @@ -41,7 +41,7 @@ public void testExplicitPropertyMappings() { Path keytab = Files.createTempFile(null, null); - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("hive.hdfs.trino.principal", "trino@EXAMPLE.COM") .put("hive.hdfs.trino.keytab", keytab.toString()) .buildOrThrow(); diff --git a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/authentication/TestMetastoreKerberosConfig.java b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/authentication/TestMetastoreKerberosConfig.java index 0f1afc54f168..4625dd81424e 100644 --- a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/authentication/TestMetastoreKerberosConfig.java +++ b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/authentication/TestMetastoreKerberosConfig.java @@ -42,7 +42,7 @@ public void testExplicitPropertyMappings() { Path clientKeytabFile = Files.createTempFile(null, null); - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("hive.metastore.service.principal", "hive/_HOST@EXAMPLE.COM") .put("hive.metastore.client.principal", "metastore@EXAMPLE.COM") .put("hive.metastore.client.keytab", clientKeytabFile.toString()) diff --git a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/azure/TestHiveAzureConfig.java b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/azure/TestHiveAzureConfig.java index 7dc565ad120e..6c0d9b9ea7bb 100644 --- a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/azure/TestHiveAzureConfig.java +++ b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/azure/TestHiveAzureConfig.java @@ -45,7 +45,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("hive.azure.wasb-storage-account", "testwasbstorage") .put("hive.azure.wasb-access-key", "secret") .put("hive.azure.abfs-storage-account", "abfsstorage") diff --git a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/gcs/TestHiveGcsConfig.java b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/gcs/TestHiveGcsConfig.java index 94ad826108a8..2f6cdad578dd 100644 --- a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/gcs/TestHiveGcsConfig.java +++ b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/gcs/TestHiveGcsConfig.java @@ -41,7 +41,7 @@ public void testExplicitPropertyMappings() { Path jsonKeyFile = Files.createTempFile(null, null); - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("hive.gcs.json-key-file-path", jsonKeyFile.toString()) .put("hive.gcs.use-access-token", "true") .buildOrThrow(); diff --git a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/TestMetastoreConfig.java b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/TestMetastoreConfig.java index 2c148f1ee2a8..4b3930439f75 100644 --- a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/TestMetastoreConfig.java +++ b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/TestMetastoreConfig.java @@ -34,7 +34,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("hive.hide-delta-lake-tables", "true") .buildOrThrow(); diff --git a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/TestMetastoreTypeConfig.java b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/TestMetastoreTypeConfig.java index c2b4a46f590b..8fbd78a038f8 100644 --- a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/TestMetastoreTypeConfig.java +++ b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/TestMetastoreTypeConfig.java @@ -34,7 +34,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("hive.metastore", "foo") .buildOrThrow(); diff --git a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/alluxio/TestAlluxioHiveMetastoreConfig.java b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/alluxio/TestAlluxioHiveMetastoreConfig.java index a03963b08d4c..ed77cffb4438 100644 --- a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/alluxio/TestAlluxioHiveMetastoreConfig.java +++ b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/alluxio/TestAlluxioHiveMetastoreConfig.java @@ -34,7 +34,7 @@ public void testDefaults() @Test public void testExplicitPropertyMapping() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("hive.metastore.alluxio.master.address", "localhost:19998") .buildOrThrow(); diff --git a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/file/TestFileHiveMetastoreConfig.java b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/file/TestFileHiveMetastoreConfig.java index 05537955d2de..0846fc0e7b93 100644 --- a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/file/TestFileHiveMetastoreConfig.java +++ b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/file/TestFileHiveMetastoreConfig.java @@ -38,7 +38,7 @@ public void testDefaults() @Test public void testExplicitPropertyMapping() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("hive.metastore.catalog.dir", "some path") .put("hive.metastore.version-compatibility", "UNSAFE_ASSUME_COMPATIBILITY") .put("hive.metastore.user", "some user") diff --git a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/glue/TestGlueHiveMetastoreConfig.java b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/glue/TestGlueHiveMetastoreConfig.java index ad3d1678e813..9ba3d794da96 100644 --- a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/glue/TestGlueHiveMetastoreConfig.java +++ b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/glue/TestGlueHiveMetastoreConfig.java @@ -50,7 +50,7 @@ public void testDefaults() @Test public void testExplicitPropertyMapping() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("hive.metastore.glue.region", "us-east-1") .put("hive.metastore.glue.endpoint-url", "http://foo.bar") .put("hive.metastore.glue.pin-client-to-current-region", "true") diff --git a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/thrift/TestStaticMetastoreConfig.java b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/thrift/TestStaticMetastoreConfig.java index c7e9b080d764..d94c46512982 100644 --- a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/thrift/TestStaticMetastoreConfig.java +++ b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/thrift/TestStaticMetastoreConfig.java @@ -38,7 +38,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappingsSingleMetastore() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("hive.metastore.uri", "thrift://localhost:9083") .put("hive.metastore.username", "trino") .buildOrThrow(); @@ -55,7 +55,7 @@ public void testExplicitPropertyMappingsSingleMetastore() @Test public void testExplicitPropertyMappingsMultipleMetastores() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("hive.metastore.uri", "thrift://localhost:9083,thrift://192.0.2.3:8932") .put("hive.metastore.username", "trino") .buildOrThrow(); diff --git a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/thrift/TestThriftMetastoreAuthenticationConfig.java b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/thrift/TestThriftMetastoreAuthenticationConfig.java index 2da84c77db01..4b8023bf50d4 100644 --- a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/thrift/TestThriftMetastoreAuthenticationConfig.java +++ b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/thrift/TestThriftMetastoreAuthenticationConfig.java @@ -35,7 +35,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("hive.metastore.authentication.type", "KERBEROS") .buildOrThrow(); diff --git a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/thrift/TestThriftMetastoreConfig.java b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/thrift/TestThriftMetastoreConfig.java index bc5364149a1a..009c1d8c7d20 100644 --- a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/thrift/TestThriftMetastoreConfig.java +++ b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/thrift/TestThriftMetastoreConfig.java @@ -64,7 +64,7 @@ public void testExplicitPropertyMappings() Path keystoreFile = Files.createTempFile(null, null); Path truststoreFile = Files.createTempFile(null, null); - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("hive.metastore-timeout", "20s") .put("hive.metastore.thrift.client.socks-proxy", "localhost:1234") .put("hive.metastore.thrift.client.max-retries", "15") diff --git a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/orc/TestOrcReaderConfig.java b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/orc/TestOrcReaderConfig.java index 76228098dff2..fea3f4ba09af 100644 --- a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/orc/TestOrcReaderConfig.java +++ b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/orc/TestOrcReaderConfig.java @@ -44,7 +44,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("hive.orc.use-column-names", "true") .put("hive.orc.bloom-filters.enabled", "true") .put("hive.orc.max-merge-distance", "22kB") diff --git a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/parquet/AbstractTestParquetReader.java b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/parquet/AbstractTestParquetReader.java index 9d5ff8320926..f2416f258bd1 100644 --- a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/parquet/AbstractTestParquetReader.java +++ b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/parquet/AbstractTestParquetReader.java @@ -909,9 +909,9 @@ public void testDecimalBackedByFixedLenByteArray() { for (int precision = 1; precision < MAX_PRECISION; precision++) { int scale = ThreadLocalRandom.current().nextInt(precision); - ImmutableList.Builder expectedValues = new ImmutableList.Builder<>(); - ImmutableList.Builder expectedValuesMaxPrecision = new ImmutableList.Builder<>(); - ImmutableList.Builder writeValues = new ImmutableList.Builder<>(); + ImmutableList.Builder expectedValues = ImmutableList.builder(); + ImmutableList.Builder expectedValuesMaxPrecision = ImmutableList.builder(); + ImmutableList.Builder writeValues = ImmutableList.builder(); BigInteger start = BigDecimal.valueOf(Math.pow(10, precision - 1)).negate().toBigInteger(); BigInteger end = BigDecimal.valueOf(Math.pow(10, precision)).toBigInteger(); @@ -950,7 +950,7 @@ public void testParquetShortDecimalWriteToTrinoTinyintBlock() for (int precision = 1; precision <= MAX_PRECISION_INT64; precision++) { MessageType parquetSchema = parseMessageType(format("message hive_decimal { optional INT64 test (DECIMAL(%d, %d)); }", precision, 0)); ContiguousSet longValues = longsBetween(Byte.MIN_VALUE, Byte.MAX_VALUE); - ImmutableList.Builder expectedValues = new ImmutableList.Builder<>(); + ImmutableList.Builder expectedValues = ImmutableList.builder(); for (Long value : longValues) { expectedValues.add(value.byteValue()); } @@ -965,7 +965,7 @@ public void testParquetShortDecimalWriteToTrinoSmallintBlock() for (int precision = 1; precision <= MAX_PRECISION_INT64; precision++) { MessageType parquetSchema = parseMessageType(format("message hive_decimal { optional INT64 test (DECIMAL(%d, %d)); }", precision, 0)); ContiguousSet longValues = longsBetween(-1_000, 1_000); - ImmutableList.Builder expectedValues = new ImmutableList.Builder<>(); + ImmutableList.Builder expectedValues = ImmutableList.builder(); for (Long value : longValues) { expectedValues.add(value.shortValue()); } @@ -980,7 +980,7 @@ public void testParquetShortDecimalWriteToTrinoIntegerBlock() for (int precision = 1; precision <= MAX_PRECISION_INT64; precision++) { MessageType parquetSchema = parseMessageType(format("message hive_decimal { optional INT64 test (DECIMAL(%d, %d)); }", precision, 0)); ContiguousSet longValues = longsBetween(-1_000, 1_000); - ImmutableList.Builder expectedValues = new ImmutableList.Builder<>(); + ImmutableList.Builder expectedValues = ImmutableList.builder(); for (Long value : longValues) { expectedValues.add(value.intValue()); } @@ -995,7 +995,7 @@ public void testParquetShortDecimalWriteToTrinoBigintBlock() for (int precision = 4; precision <= MAX_PRECISION_INT64; precision++) { MessageType parquetSchema = parseMessageType(format("message hive_decimal { optional INT64 test (DECIMAL(%d, %d)); }", precision, 0)); ContiguousSet longValues = longsBetween(-1_000, 1_000); - ImmutableList.Builder expectedValues = new ImmutableList.Builder<>(); + ImmutableList.Builder expectedValues = ImmutableList.builder(); for (Long value : longValues) { expectedValues.add(value); } diff --git a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/parquet/TestParquetReaderConfig.java b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/parquet/TestParquetReaderConfig.java index 9e34a3678caa..70a4ea1b7222 100644 --- a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/parquet/TestParquetReaderConfig.java +++ b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/parquet/TestParquetReaderConfig.java @@ -41,7 +41,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("parquet.ignore-statistics", "true") .put("parquet.max-read-block-size", "66kB") .put("parquet.max-buffer-size", "1431kB") diff --git a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/parquet/TestTimestamp.java b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/parquet/TestTimestamp.java index 1cee7e68dc11..9227bd7650e9 100644 --- a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/parquet/TestTimestamp.java +++ b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/parquet/TestTimestamp.java @@ -58,8 +58,8 @@ public void testTimestampBackedByInt64() { MessageType parquetSchema = parseMessageType("message hive_timestamp { optional int64 test (TIMESTAMP_MILLIS); }"); ContiguousSet epochMillisValues = ContiguousSet.create(Range.closedOpen((long) -1_000, (long) 1_000), DiscreteDomain.longs()); - ImmutableList.Builder timestampsMillis = new ImmutableList.Builder<>(); - ImmutableList.Builder bigints = new ImmutableList.Builder<>(); + ImmutableList.Builder timestampsMillis = ImmutableList.builder(); + ImmutableList.Builder bigints = ImmutableList.builder(); for (long value : epochMillisValues) { timestampsMillis.add(SqlTimestamp.fromMillis(3, value)); bigints.add(value); diff --git a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/rubix/TestRubixConfig.java b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/rubix/TestRubixConfig.java index 6c28742941f1..7e2be5bcf773 100644 --- a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/rubix/TestRubixConfig.java +++ b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/rubix/TestRubixConfig.java @@ -50,7 +50,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("hive.cache.read-mode", "read-through") .put("hive.cache.location", "/some-directory") .put("hive.cache.ttl", "5h") diff --git a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/rubix/TestRubixEnabledConfig.java b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/rubix/TestRubixEnabledConfig.java index 0490a3267426..4d70ec2376bb 100644 --- a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/rubix/TestRubixEnabledConfig.java +++ b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/rubix/TestRubixEnabledConfig.java @@ -34,7 +34,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("hive.cache.enabled", "true") .buildOrThrow(); diff --git a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/s3/TestHiveS3Config.java b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/s3/TestHiveS3Config.java index 55b2cdd79a98..6bffe30eb10d 100644 --- a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/s3/TestHiveS3Config.java +++ b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/s3/TestHiveS3Config.java @@ -77,7 +77,7 @@ public void testExplicitPropertyMappings() { Path stagingDirectory = Files.createTempDirectory(null); - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("hive.s3.aws-access-key", "abc123") .put("hive.s3.aws-secret-key", "secret") .put("hive.s3.endpoint", "endpoint.example.com") diff --git a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/s3/TestHiveS3TypeConfig.java b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/s3/TestHiveS3TypeConfig.java index d78cf16b952c..4aa64c886de6 100644 --- a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/s3/TestHiveS3TypeConfig.java +++ b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/s3/TestHiveS3TypeConfig.java @@ -34,7 +34,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("hive.s3-file-system-type", "EMRFS") .buildOrThrow(); diff --git a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/s3/TestS3SecurityMappingConfig.java b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/s3/TestS3SecurityMappingConfig.java index 6adc46cdd0a7..26efd2bd556e 100644 --- a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/s3/TestS3SecurityMappingConfig.java +++ b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/s3/TestS3SecurityMappingConfig.java @@ -47,7 +47,7 @@ public void testExplicitPropertyMappingsWithFile() { Path securityMappingConfigFile = Files.createTempFile(null, null); - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("hive.s3.security-mapping.config-file", securityMappingConfigFile.toString()) .put("hive.s3.security-mapping.json-pointer", "/data") .put("hive.s3.security-mapping.iam-role-credential-name", "iam-role-credential-name") @@ -70,7 +70,7 @@ public void testExplicitPropertyMappingsWithFile() @Test public void testExplicitPropertyMappingsWithUrl() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("hive.s3.security-mapping.config-file", "http://test:1234/example") .put("hive.s3.security-mapping.json-pointer", "/data") .put("hive.s3.security-mapping.iam-role-credential-name", "iam-role-credential-name") diff --git a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/security/TestLegacySecurityConfig.java b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/security/TestLegacySecurityConfig.java index 5bee26961459..ec955643ef53 100644 --- a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/security/TestLegacySecurityConfig.java +++ b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/security/TestLegacySecurityConfig.java @@ -40,7 +40,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("hive.allow-add-column", "true") .put("hive.allow-drop-column", "true") .put("hive.allow-drop-table", "true") diff --git a/plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/TestIcebergConfig.java b/plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/TestIcebergConfig.java index 37ad431f1cb2..e57bdcd7e04d 100644 --- a/plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/TestIcebergConfig.java +++ b/plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/TestIcebergConfig.java @@ -50,7 +50,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("iceberg.file-format", "Parquet") .put("iceberg.compression-codec", "NONE") .put("iceberg.use-file-size-from-metadata", "false") diff --git a/plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/TestIcebergSecurityConfig.java b/plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/TestIcebergSecurityConfig.java index f6c11f7ebb44..6e30079bf96c 100644 --- a/plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/TestIcebergSecurityConfig.java +++ b/plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/TestIcebergSecurityConfig.java @@ -36,7 +36,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("iceberg.security", "read-only") .buildOrThrow(); diff --git a/plugin/trino-jmx/src/test/java/io/trino/plugin/jmx/TestJmxConnectorConfig.java b/plugin/trino-jmx/src/test/java/io/trino/plugin/jmx/TestJmxConnectorConfig.java index 61abe8f85277..31915e3f9cf3 100644 --- a/plugin/trino-jmx/src/test/java/io/trino/plugin/jmx/TestJmxConnectorConfig.java +++ b/plugin/trino-jmx/src/test/java/io/trino/plugin/jmx/TestJmxConnectorConfig.java @@ -40,7 +40,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("jmx.dump-tables", "table1,table\\,with\\,commas") .put("jmx.dump-period", "1s") .put("jmx.max-entries", "100") diff --git a/plugin/trino-kafka/src/main/java/io/trino/plugin/kafka/KafkaInternalFieldManager.java b/plugin/trino-kafka/src/main/java/io/trino/plugin/kafka/KafkaInternalFieldManager.java index 5f8abc09c20b..6fa7ef0c72cf 100644 --- a/plugin/trino-kafka/src/main/java/io/trino/plugin/kafka/KafkaInternalFieldManager.java +++ b/plugin/trino-kafka/src/main/java/io/trino/plugin/kafka/KafkaInternalFieldManager.java @@ -138,7 +138,7 @@ public KafkaInternalFieldManager(TypeManager typeManager) { Type varcharMapType = typeManager.getType(mapType(VARCHAR.getTypeSignature(), arrayType(VARBINARY.getTypeSignature()))); - internalFields = new ImmutableMap.Builder() + internalFields = ImmutableMap.builder() .put(PARTITION_ID_FIELD, new InternalField( PARTITION_ID_FIELD, "Partition Id", diff --git a/plugin/trino-kafka/src/test/java/io/trino/plugin/kafka/TestKafkaConfig.java b/plugin/trino-kafka/src/test/java/io/trino/plugin/kafka/TestKafkaConfig.java index ad35c221b1d5..5f1a61806c99 100644 --- a/plugin/trino-kafka/src/test/java/io/trino/plugin/kafka/TestKafkaConfig.java +++ b/plugin/trino-kafka/src/test/java/io/trino/plugin/kafka/TestKafkaConfig.java @@ -41,7 +41,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("kafka.default-schema", "kafka") .put("kafka.table-description-supplier", "test") .put("kafka.nodes", "localhost:12345,localhost:23456") diff --git a/plugin/trino-kafka/src/test/java/io/trino/plugin/kafka/TestKafkaSecurityConfig.java b/plugin/trino-kafka/src/test/java/io/trino/plugin/kafka/TestKafkaSecurityConfig.java index a630a9a6e85b..ad88c8801850 100644 --- a/plugin/trino-kafka/src/test/java/io/trino/plugin/kafka/TestKafkaSecurityConfig.java +++ b/plugin/trino-kafka/src/test/java/io/trino/plugin/kafka/TestKafkaSecurityConfig.java @@ -41,7 +41,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("kafka.security-protocol", "SSL") .buildOrThrow(); diff --git a/plugin/trino-kafka/src/test/java/io/trino/plugin/kafka/TestKafkaSslConfig.java b/plugin/trino-kafka/src/test/java/io/trino/plugin/kafka/TestKafkaSslConfig.java index 5bf0590463ec..cc89fa0858b8 100644 --- a/plugin/trino-kafka/src/test/java/io/trino/plugin/kafka/TestKafkaSslConfig.java +++ b/plugin/trino-kafka/src/test/java/io/trino/plugin/kafka/TestKafkaSslConfig.java @@ -71,7 +71,7 @@ public void testExplicitPropertyMappings() writeToFile(keystorePath, secret); writeToFile(truststorePath, secret); - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("kafka.ssl.keystore.location", keystorePath.toString()) .put("kafka.ssl.keystore.password", "keystore-password") .put("kafka.ssl.keystore.type", "PKCS12") diff --git a/plugin/trino-kafka/src/test/java/io/trino/plugin/kafka/schema/confluent/TestConfluentSchemaRegistryConfig.java b/plugin/trino-kafka/src/test/java/io/trino/plugin/kafka/schema/confluent/TestConfluentSchemaRegistryConfig.java index 7c8325b75202..fae19b6beb15 100644 --- a/plugin/trino-kafka/src/test/java/io/trino/plugin/kafka/schema/confluent/TestConfluentSchemaRegistryConfig.java +++ b/plugin/trino-kafka/src/test/java/io/trino/plugin/kafka/schema/confluent/TestConfluentSchemaRegistryConfig.java @@ -41,7 +41,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("kafka.confluent-schema-registry-url", "http://schema-registry-a:8081, http://schema-registry-b:8081") .put("kafka.confluent-schema-registry-client-cache-size", "1500") .put("kafka.empty-field-strategy", "ADD_DUMMY") diff --git a/plugin/trino-kafka/src/test/java/io/trino/plugin/kafka/schema/file/TestFileTableDescriptionSupplierConfig.java b/plugin/trino-kafka/src/test/java/io/trino/plugin/kafka/schema/file/TestFileTableDescriptionSupplierConfig.java index 59ec69afee81..bb3ad0f30346 100644 --- a/plugin/trino-kafka/src/test/java/io/trino/plugin/kafka/schema/file/TestFileTableDescriptionSupplierConfig.java +++ b/plugin/trino-kafka/src/test/java/io/trino/plugin/kafka/schema/file/TestFileTableDescriptionSupplierConfig.java @@ -36,7 +36,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("kafka.table-description-dir", "/var/lib/kafka") .put("kafka.table-names", "table1, table2, table3") .buildOrThrow(); diff --git a/plugin/trino-kinesis/src/test/java/io/trino/plugin/kinesis/TestKinesisConfig.java b/plugin/trino-kinesis/src/test/java/io/trino/plugin/kinesis/TestKinesisConfig.java index e16028b7e092..a8a63bcb5fe3 100644 --- a/plugin/trino-kinesis/src/test/java/io/trino/plugin/kinesis/TestKinesisConfig.java +++ b/plugin/trino-kinesis/src/test/java/io/trino/plugin/kinesis/TestKinesisConfig.java @@ -51,7 +51,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("kinesis.table-description-location", "/var/lib/kinesis") .put("kinesis.default-schema", "kinesis") .put("kinesis.hide-internal-columns", "false") diff --git a/plugin/trino-kinesis/src/test/java/io/trino/plugin/kinesis/TestKinesisTableDescriptionSupplier.java b/plugin/trino-kinesis/src/test/java/io/trino/plugin/kinesis/TestKinesisTableDescriptionSupplier.java index a4d0707b5e26..170d1c5a7904 100644 --- a/plugin/trino-kinesis/src/test/java/io/trino/plugin/kinesis/TestKinesisTableDescriptionSupplier.java +++ b/plugin/trino-kinesis/src/test/java/io/trino/plugin/kinesis/TestKinesisTableDescriptionSupplier.java @@ -41,7 +41,7 @@ public class TestKinesisTableDescriptionSupplier public void start() { // Create dependent objects, including the minimal config needed for this test - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("kinesis.table-description-location", "etc/kinesis") .put("kinesis.default-schema", "kinesis") .put("kinesis.hide-internal-columns", "true") diff --git a/plugin/trino-kinesis/src/test/java/io/trino/plugin/kinesis/s3config/TestS3TableConfigClient.java b/plugin/trino-kinesis/src/test/java/io/trino/plugin/kinesis/s3config/TestS3TableConfigClient.java index 0d0484162f96..cb2c19cc3444 100644 --- a/plugin/trino-kinesis/src/test/java/io/trino/plugin/kinesis/s3config/TestS3TableConfigClient.java +++ b/plugin/trino-kinesis/src/test/java/io/trino/plugin/kinesis/s3config/TestS3TableConfigClient.java @@ -88,7 +88,7 @@ public void testTableReading(String tableDescriptionS3, String accessKey, String // MinimalTable.json in that folder. // Create dependent objects, including the minimal config needed for this test - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("kinesis.table-description-location", tableDescriptionS3) .put("kinesis.default-schema", "kinesis") .put("kinesis.hide-internal-columns", "false") diff --git a/plugin/trino-kudu/src/test/java/io/trino/plugin/kudu/TestKuduAuthenticationConfig.java b/plugin/trino-kudu/src/test/java/io/trino/plugin/kudu/TestKuduAuthenticationConfig.java index 857702489abc..efd17ceada5d 100644 --- a/plugin/trino-kudu/src/test/java/io/trino/plugin/kudu/TestKuduAuthenticationConfig.java +++ b/plugin/trino-kudu/src/test/java/io/trino/plugin/kudu/TestKuduAuthenticationConfig.java @@ -34,7 +34,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappingsKerberos() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("kudu.authentication.type", "KERBEROS") .buildOrThrow(); diff --git a/plugin/trino-kudu/src/test/java/io/trino/plugin/kudu/TestKuduClientConfig.java b/plugin/trino-kudu/src/test/java/io/trino/plugin/kudu/TestKuduClientConfig.java index fbb0638ffe90..d0985923ae4c 100644 --- a/plugin/trino-kudu/src/test/java/io/trino/plugin/kudu/TestKuduClientConfig.java +++ b/plugin/trino-kudu/src/test/java/io/trino/plugin/kudu/TestKuduClientConfig.java @@ -44,7 +44,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappingsWithCredentialsKey() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("kudu.client.master-addresses", "localhost") .put("kudu.client.default-admin-operation-timeout", "1m") .put("kudu.client.default-operation-timeout", "5m") diff --git a/plugin/trino-kudu/src/test/java/io/trino/plugin/kudu/TestKuduKerberosConfig.java b/plugin/trino-kudu/src/test/java/io/trino/plugin/kudu/TestKuduKerberosConfig.java index 1c518ab70039..9f34d4e2a1f1 100644 --- a/plugin/trino-kudu/src/test/java/io/trino/plugin/kudu/TestKuduKerberosConfig.java +++ b/plugin/trino-kudu/src/test/java/io/trino/plugin/kudu/TestKuduKerberosConfig.java @@ -47,7 +47,7 @@ public void testExplicitPropertyMappings() Path keytab = createTempFile(null, null); Path config = createTempFile(null, null); - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("kudu.authentication.client.principal", "principal") .put("kudu.authentication.client.keytab", keytab.toString()) .put("kudu.authentication.config", config.toString()) @@ -66,7 +66,7 @@ public void testExplicitPropertyMappings() @Test public void testExplicitPropertyMappingsWithNonExistentPathsThrowsErrors() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("kudu.authentication.client.principal", "principal") .put("kudu.authentication.client.keytab", "/path/does/not/exist") .put("kudu.authentication.config", "/path/does/not/exist") diff --git a/plugin/trino-local-file/src/test/java/io/trino/plugin/localfile/MetadataUtil.java b/plugin/trino-local-file/src/test/java/io/trino/plugin/localfile/MetadataUtil.java index 3108d0b00f72..dc5f8d793d4e 100644 --- a/plugin/trino-local-file/src/test/java/io/trino/plugin/localfile/MetadataUtil.java +++ b/plugin/trino-local-file/src/test/java/io/trino/plugin/localfile/MetadataUtil.java @@ -52,7 +52,7 @@ private MetadataUtil() public static final class TestingTypeDeserializer extends FromStringDeserializer { - private final Map types = new ImmutableMap.Builder() + private final Map types = ImmutableMap.builder() .put(BOOLEAN.getTypeId(), BOOLEAN) .put(BIGINT.getTypeId(), BIGINT) .put(DOUBLE.getTypeId(), DOUBLE) diff --git a/plugin/trino-local-file/src/test/java/io/trino/plugin/localfile/TestLocalFileConfig.java b/plugin/trino-local-file/src/test/java/io/trino/plugin/localfile/TestLocalFileConfig.java index bee6ca823798..93eefbe207d7 100644 --- a/plugin/trino-local-file/src/test/java/io/trino/plugin/localfile/TestLocalFileConfig.java +++ b/plugin/trino-local-file/src/test/java/io/trino/plugin/localfile/TestLocalFileConfig.java @@ -41,7 +41,7 @@ public void testExplicitPropertyMappings() { Path httpRequestLogFile = Files.createTempFile(null, null); - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("trino-logs.http-request-log.location", httpRequestLogFile.toString()) .put("trino-logs.http-request-log.pattern", "bar") .buildOrThrow(); diff --git a/plugin/trino-memsql/src/test/java/io/trino/plugin/memsql/TestMemSqlConfig.java b/plugin/trino-memsql/src/test/java/io/trino/plugin/memsql/TestMemSqlConfig.java index 848c6b17ebf8..c9fb7c2ef546 100644 --- a/plugin/trino-memsql/src/test/java/io/trino/plugin/memsql/TestMemSqlConfig.java +++ b/plugin/trino-memsql/src/test/java/io/trino/plugin/memsql/TestMemSqlConfig.java @@ -37,7 +37,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("memsql.auto-reconnect", "false") .put("memsql.connection-timeout", "4s") .buildOrThrow(); diff --git a/plugin/trino-mongodb/src/main/java/io/trino/plugin/mongodb/MongoSession.java b/plugin/trino-mongodb/src/main/java/io/trino/plugin/mongodb/MongoSession.java index d67b4b3063c2..d47505989098 100644 --- a/plugin/trino-mongodb/src/main/java/io/trino/plugin/mongodb/MongoSession.java +++ b/plugin/trino-mongodb/src/main/java/io/trino/plugin/mongodb/MongoSession.java @@ -703,7 +703,7 @@ private String toRemoteTableName(String schemaName, String tableName) private boolean isView(String schemaName, String tableName) { - Document listCollectionsCommand = new Document(new ImmutableMap.Builder() + Document listCollectionsCommand = new Document(ImmutableMap.builder() .put("listCollections", 1.0) .put("filter", documentOf("name", tableName)) .put("nameOnly", true) diff --git a/plugin/trino-mongodb/src/test/java/io/trino/plugin/mongodb/TestMongoClientConfig.java b/plugin/trino-mongodb/src/test/java/io/trino/plugin/mongodb/TestMongoClientConfig.java index e05f05e5c85a..bd4bda62fc3b 100644 --- a/plugin/trino-mongodb/src/test/java/io/trino/plugin/mongodb/TestMongoClientConfig.java +++ b/plugin/trino-mongodb/src/test/java/io/trino/plugin/mongodb/TestMongoClientConfig.java @@ -52,7 +52,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("mongodb.schema-collection", "_my_schema") .put("mongodb.case-insensitive-name-matching", "true") .put("mongodb.seeds", "") diff --git a/plugin/trino-mysql/src/test/java/io/trino/plugin/mysql/TestMySqlConfig.java b/plugin/trino-mysql/src/test/java/io/trino/plugin/mysql/TestMySqlConfig.java index 9922efef9d7b..446ba35ff7a0 100644 --- a/plugin/trino-mysql/src/test/java/io/trino/plugin/mysql/TestMySqlConfig.java +++ b/plugin/trino-mysql/src/test/java/io/trino/plugin/mysql/TestMySqlConfig.java @@ -39,7 +39,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("mysql.auto-reconnect", "false") .put("mysql.max-reconnects", "4") .put("mysql.connection-timeout", "4s") diff --git a/plugin/trino-oracle/src/test/java/io/trino/plugin/oracle/TestOracleConfig.java b/plugin/trino-oracle/src/test/java/io/trino/plugin/oracle/TestOracleConfig.java index d123c6f6188d..340b2881b1c0 100644 --- a/plugin/trino-oracle/src/test/java/io/trino/plugin/oracle/TestOracleConfig.java +++ b/plugin/trino-oracle/src/test/java/io/trino/plugin/oracle/TestOracleConfig.java @@ -49,7 +49,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("oracle.synonyms.enabled", "true") .put("oracle.remarks-reporting.enabled", "true") .put("oracle.number.default-scale", "2") diff --git a/plugin/trino-password-authenticators/src/test/java/io/trino/plugin/password/file/TestFileConfig.java b/plugin/trino-password-authenticators/src/test/java/io/trino/plugin/password/file/TestFileConfig.java index 04177fa3fea2..c70b5cd5e77b 100644 --- a/plugin/trino-password-authenticators/src/test/java/io/trino/plugin/password/file/TestFileConfig.java +++ b/plugin/trino-password-authenticators/src/test/java/io/trino/plugin/password/file/TestFileConfig.java @@ -45,7 +45,7 @@ public void testExplicitConfig() { Path passwordFile = Files.createTempFile(null, null); - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("file.password-file", passwordFile.toString()) .put("file.refresh-period", "42s") .put("file.auth-token-cache.max-size", "1234") diff --git a/plugin/trino-password-authenticators/src/test/java/io/trino/plugin/password/file/TestFileGroupConfig.java b/plugin/trino-password-authenticators/src/test/java/io/trino/plugin/password/file/TestFileGroupConfig.java index cf68a2409a64..3f437baa9860 100644 --- a/plugin/trino-password-authenticators/src/test/java/io/trino/plugin/password/file/TestFileGroupConfig.java +++ b/plugin/trino-password-authenticators/src/test/java/io/trino/plugin/password/file/TestFileGroupConfig.java @@ -44,7 +44,7 @@ public void testExplicitConfig() { Path groupFile = Files.createTempFile(null, null); - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("file.group-file", groupFile.toString()) .put("file.refresh-period", "42s") .buildOrThrow(); diff --git a/plugin/trino-password-authenticators/src/test/java/io/trino/plugin/password/ldap/TestLdapConfig.java b/plugin/trino-password-authenticators/src/test/java/io/trino/plugin/password/ldap/TestLdapConfig.java index 4e9130f1e702..cceb5607d5e5 100644 --- a/plugin/trino-password-authenticators/src/test/java/io/trino/plugin/password/ldap/TestLdapConfig.java +++ b/plugin/trino-password-authenticators/src/test/java/io/trino/plugin/password/ldap/TestLdapConfig.java @@ -61,7 +61,7 @@ public void testExplicitConfig() { Path trustCertificateFile = Files.createTempFile(null, null); - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("ldap.url", "ldaps://localhost:636") .put("ldap.allow-insecure", "true") .put("ldap.ssl-trust-certificate", trustCertificateFile.toString()) diff --git a/plugin/trino-password-authenticators/src/test/java/io/trino/plugin/password/salesforce/TestSalesforceConfig.java b/plugin/trino-password-authenticators/src/test/java/io/trino/plugin/password/salesforce/TestSalesforceConfig.java index 9d53802e7310..56c94650427d 100644 --- a/plugin/trino-password-authenticators/src/test/java/io/trino/plugin/password/salesforce/TestSalesforceConfig.java +++ b/plugin/trino-password-authenticators/src/test/java/io/trino/plugin/password/salesforce/TestSalesforceConfig.java @@ -46,7 +46,7 @@ public void testExplicitConfig() String cacheSize = "111"; String cacheExpire = "3333s"; - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("salesforce.allowed-organizations", org) .put("salesforce.cache-size", cacheSize) .put("salesforce.cache-expire-duration", cacheExpire) diff --git a/plugin/trino-phoenix/src/test/java/io/trino/plugin/phoenix/TestPhoenixConfig.java b/plugin/trino-phoenix/src/test/java/io/trino/plugin/phoenix/TestPhoenixConfig.java index 9119684a85c9..dd58843cd8e1 100644 --- a/plugin/trino-phoenix/src/test/java/io/trino/plugin/phoenix/TestPhoenixConfig.java +++ b/plugin/trino-phoenix/src/test/java/io/trino/plugin/phoenix/TestPhoenixConfig.java @@ -42,7 +42,7 @@ public void testExplicitPropertyMappings() { Path configFile = Files.createTempFile(null, null); - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("phoenix.connection-url", "jdbc:phoenix:localhost:2181:/hbase") .put("phoenix.config.resources", configFile.toString()) .put("phoenix.max-scans-per-split", "1") diff --git a/plugin/trino-phoenix5/src/test/java/io/trino/plugin/phoenix5/TestPhoenixConfig.java b/plugin/trino-phoenix5/src/test/java/io/trino/plugin/phoenix5/TestPhoenixConfig.java index 32e4779779e0..779b7c82cc71 100644 --- a/plugin/trino-phoenix5/src/test/java/io/trino/plugin/phoenix5/TestPhoenixConfig.java +++ b/plugin/trino-phoenix5/src/test/java/io/trino/plugin/phoenix5/TestPhoenixConfig.java @@ -42,7 +42,7 @@ public void testExplicitPropertyMappings() { Path configFile = Files.createTempFile(null, null); - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("phoenix.connection-url", "jdbc:phoenix:localhost:2181:/hbase") .put("phoenix.config.resources", configFile.toString()) .put("phoenix.max-scans-per-split", "1") diff --git a/plugin/trino-pinot/src/test/java/io/trino/plugin/pinot/TestPinotConfig.java b/plugin/trino-pinot/src/test/java/io/trino/plugin/pinot/TestPinotConfig.java index 7bd9ad3d73db..2d1cabf7484f 100755 --- a/plugin/trino-pinot/src/test/java/io/trino/plugin/pinot/TestPinotConfig.java +++ b/plugin/trino-pinot/src/test/java/io/trino/plugin/pinot/TestPinotConfig.java @@ -54,7 +54,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("pinot.controller-urls", "host1:1111,host2:1111") .put("pinot.idle-timeout", "1h") .put("pinot.max-backlog-per-server", "15") diff --git a/plugin/trino-pinot/src/test/java/io/trino/plugin/pinot/auth/TestPinotAuthenticationTypeConfig.java b/plugin/trino-pinot/src/test/java/io/trino/plugin/pinot/auth/TestPinotAuthenticationTypeConfig.java index e9f2ce2d39cb..d4032ab3cebb 100644 --- a/plugin/trino-pinot/src/test/java/io/trino/plugin/pinot/auth/TestPinotAuthenticationTypeConfig.java +++ b/plugin/trino-pinot/src/test/java/io/trino/plugin/pinot/auth/TestPinotAuthenticationTypeConfig.java @@ -38,7 +38,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("pinot.controller.authentication.type", "password") .put("pinot.broker.authentication.type", "password") .buildOrThrow(); diff --git a/plugin/trino-pinot/src/test/java/io/trino/plugin/pinot/auth/password/inline/TestPinotPasswordBrokerAuthenticationConfig.java b/plugin/trino-pinot/src/test/java/io/trino/plugin/pinot/auth/password/inline/TestPinotPasswordBrokerAuthenticationConfig.java index 855794d319f8..211513479a9f 100644 --- a/plugin/trino-pinot/src/test/java/io/trino/plugin/pinot/auth/password/inline/TestPinotPasswordBrokerAuthenticationConfig.java +++ b/plugin/trino-pinot/src/test/java/io/trino/plugin/pinot/auth/password/inline/TestPinotPasswordBrokerAuthenticationConfig.java @@ -25,7 +25,7 @@ public class TestPinotPasswordBrokerAuthenticationConfig @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("pinot.broker.authentication.user", "query") .put("pinot.broker.authentication.password", "secret") .buildOrThrow(); diff --git a/plugin/trino-pinot/src/test/java/io/trino/plugin/pinot/auth/password/inline/TestPinotPasswordControllerAuthenticationConfig.java b/plugin/trino-pinot/src/test/java/io/trino/plugin/pinot/auth/password/inline/TestPinotPasswordControllerAuthenticationConfig.java index e428ccf13117..c204899ac23f 100644 --- a/plugin/trino-pinot/src/test/java/io/trino/plugin/pinot/auth/password/inline/TestPinotPasswordControllerAuthenticationConfig.java +++ b/plugin/trino-pinot/src/test/java/io/trino/plugin/pinot/auth/password/inline/TestPinotPasswordControllerAuthenticationConfig.java @@ -25,7 +25,7 @@ public class TestPinotPasswordControllerAuthenticationConfig @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("pinot.controller.authentication.user", "admin") .put("pinot.controller.authentication.password", "verysecret") .buildOrThrow(); diff --git a/plugin/trino-postgresql/src/test/java/io/trino/plugin/postgresql/TestPostgreSqlConfig.java b/plugin/trino-postgresql/src/test/java/io/trino/plugin/postgresql/TestPostgreSqlConfig.java index abe57354111b..8ca80f04f058 100644 --- a/plugin/trino-postgresql/src/test/java/io/trino/plugin/postgresql/TestPostgreSqlConfig.java +++ b/plugin/trino-postgresql/src/test/java/io/trino/plugin/postgresql/TestPostgreSqlConfig.java @@ -36,7 +36,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("postgresql.array-mapping", "AS_ARRAY") .put("postgresql.include-system-tables", "true") .put("postgresql.experimental.enable-string-pushdown-with-collate", "true") diff --git a/plugin/trino-prometheus/src/test/java/io/trino/plugin/prometheus/TestPrometheusConnectorConfig.java b/plugin/trino-prometheus/src/test/java/io/trino/plugin/prometheus/TestPrometheusConnectorConfig.java index 36d48c561ece..1dce5b9efb81 100644 --- a/plugin/trino-prometheus/src/test/java/io/trino/plugin/prometheus/TestPrometheusConnectorConfig.java +++ b/plugin/trino-prometheus/src/test/java/io/trino/plugin/prometheus/TestPrometheusConnectorConfig.java @@ -48,7 +48,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("prometheus.uri", "file://test.json") .put("prometheus.query.chunk.size.duration", "365d") .put("prometheus.max.query.range.duration", "1095d") diff --git a/plugin/trino-prometheus/src/test/java/io/trino/plugin/prometheus/TestPrometheusSplit.java b/plugin/trino-prometheus/src/test/java/io/trino/plugin/prometheus/TestPrometheusSplit.java index 9324b908553e..1294ebaeb6e5 100644 --- a/plugin/trino-prometheus/src/test/java/io/trino/plugin/prometheus/TestPrometheusSplit.java +++ b/plugin/trino-prometheus/src/test/java/io/trino/plugin/prometheus/TestPrometheusSplit.java @@ -475,7 +475,7 @@ private static String doubleToPlainString(Double aDouble) * $ curl "http://127.0.0.1:9090/api/v1/query?query=up[120s]&time=1568638172" * Just the time items from the "values" section of the response */ - private static final ImmutableList promTimeValuesMock = new ImmutableList.Builder() + private static final ImmutableList promTimeValuesMock = ImmutableList.builder() .add(1568638066.999) .add(1568638081.996) .add(1568638097.0) diff --git a/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/backup/TestBackupConfig.java b/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/backup/TestBackupConfig.java index 3f55480d1574..9c8084fdaa35 100644 --- a/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/backup/TestBackupConfig.java +++ b/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/backup/TestBackupConfig.java @@ -40,7 +40,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("backup.provider", "file") .put("backup.timeout", "42s") .put("backup.timeout-threads", "13") diff --git a/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/backup/TestFileBackupConfig.java b/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/backup/TestFileBackupConfig.java index a368e5951f31..e37d6d7c3920 100644 --- a/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/backup/TestFileBackupConfig.java +++ b/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/backup/TestFileBackupConfig.java @@ -35,7 +35,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("backup.directory", "/backup") .buildOrThrow(); diff --git a/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/backup/TestHttpBackupConfig.java b/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/backup/TestHttpBackupConfig.java index e3f23c069a72..092f54c5b960 100644 --- a/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/backup/TestHttpBackupConfig.java +++ b/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/backup/TestHttpBackupConfig.java @@ -35,7 +35,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("backup.http.uri", "http://example.net:8080") .buildOrThrow(); diff --git a/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/metadata/TestMetadataConfig.java b/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/metadata/TestMetadataConfig.java index be84ddae1f08..fb2fd6c889b1 100644 --- a/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/metadata/TestMetadataConfig.java +++ b/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/metadata/TestMetadataConfig.java @@ -38,7 +38,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("raptor.startup-grace-period", "42m") .put("raptor.reassignment-delay", "6m") .put("raptor.reassignment-interval", "7m") diff --git a/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/metadata/TestShardCleanerConfig.java b/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/metadata/TestShardCleanerConfig.java index d545bad1f177..9c4710d7acaf 100644 --- a/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/metadata/TestShardCleanerConfig.java +++ b/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/metadata/TestShardCleanerConfig.java @@ -45,7 +45,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("raptor.max-transaction-age", "42m") .put("raptor.transaction-cleaner-interval", "43m") .put("raptor.local-cleaner-interval", "31m") diff --git a/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/security/TestRaptorSecurityConfig.java b/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/security/TestRaptorSecurityConfig.java index 79b6214fecbb..417b95c315a7 100644 --- a/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/security/TestRaptorSecurityConfig.java +++ b/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/security/TestRaptorSecurityConfig.java @@ -36,7 +36,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("raptor.security", "read-only") .buildOrThrow(); diff --git a/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/storage/TestBucketBalancerConfig.java b/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/storage/TestBucketBalancerConfig.java index 907151cd8127..f4a2b7edbebe 100644 --- a/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/storage/TestBucketBalancerConfig.java +++ b/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/storage/TestBucketBalancerConfig.java @@ -37,7 +37,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("storage.balancer-enabled", "false") .put("storage.balancer-interval", "5h") .buildOrThrow(); diff --git a/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/storage/TestStorageManagerConfig.java b/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/storage/TestStorageManagerConfig.java index ad55cff7a707..e4edc7206e28 100644 --- a/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/storage/TestStorageManagerConfig.java +++ b/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/storage/TestStorageManagerConfig.java @@ -71,7 +71,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("storage.data-directory", "/data") .put("storage.min-available-space", "123GB") .put("storage.orc.max-merge-distance", "16kB") diff --git a/plugin/trino-redis/src/test/java/io/trino/plugin/redis/TestRedisConnectorConfig.java b/plugin/trino-redis/src/test/java/io/trino/plugin/redis/TestRedisConnectorConfig.java index 09961e808220..d2fa39d64ef4 100644 --- a/plugin/trino-redis/src/test/java/io/trino/plugin/redis/TestRedisConnectorConfig.java +++ b/plugin/trino-redis/src/test/java/io/trino/plugin/redis/TestRedisConnectorConfig.java @@ -45,7 +45,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("redis.table-description-dir", "/var/lib/redis") .put("redis.table-names", "table1, table2, table3") .put("redis.default-schema", "redis") diff --git a/plugin/trino-resource-group-managers/src/test/java/io/trino/plugin/resourcegroups/TestFileResourceGroupConfig.java b/plugin/trino-resource-group-managers/src/test/java/io/trino/plugin/resourcegroups/TestFileResourceGroupConfig.java index 18ea7905df1c..d4f86120d9f5 100644 --- a/plugin/trino-resource-group-managers/src/test/java/io/trino/plugin/resourcegroups/TestFileResourceGroupConfig.java +++ b/plugin/trino-resource-group-managers/src/test/java/io/trino/plugin/resourcegroups/TestFileResourceGroupConfig.java @@ -40,7 +40,7 @@ public void testExplicitPropertyMappings() { Path resourceGroupConfigFile = Files.createTempFile(null, null); - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("resource-groups.config-file", resourceGroupConfigFile.toString()) .buildOrThrow(); diff --git a/plugin/trino-resource-group-managers/src/test/java/io/trino/plugin/resourcegroups/db/TestDbResourceGroupConfig.java b/plugin/trino-resource-group-managers/src/test/java/io/trino/plugin/resourcegroups/db/TestDbResourceGroupConfig.java index a28d448b4acf..de86e8e07d79 100644 --- a/plugin/trino-resource-group-managers/src/test/java/io/trino/plugin/resourcegroups/db/TestDbResourceGroupConfig.java +++ b/plugin/trino-resource-group-managers/src/test/java/io/trino/plugin/resourcegroups/db/TestDbResourceGroupConfig.java @@ -41,7 +41,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("resource-groups.config-db-url", "jdbc:mysql://localhost:3306/config") .put("resource-groups.config-db-user", "trino_admin") .put("resource-groups.config-db-password", "trino_admin_pass") diff --git a/plugin/trino-session-property-managers/src/test/java/io/trino/plugin/session/db/TestDbSessionPropertyManagerConfig.java b/plugin/trino-session-property-managers/src/test/java/io/trino/plugin/session/db/TestDbSessionPropertyManagerConfig.java index 7572d66e9d6f..c5c4a071524e 100644 --- a/plugin/trino-session-property-managers/src/test/java/io/trino/plugin/session/db/TestDbSessionPropertyManagerConfig.java +++ b/plugin/trino-session-property-managers/src/test/java/io/trino/plugin/session/db/TestDbSessionPropertyManagerConfig.java @@ -40,7 +40,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("session-property-manager.db.url", "foo") .put("session-property-manager.db.username", "bar") .put("session-property-manager.db.password", "pass") diff --git a/plugin/trino-session-property-managers/src/test/java/io/trino/plugin/session/file/TestFileSessionPropertyManagerConfig.java b/plugin/trino-session-property-managers/src/test/java/io/trino/plugin/session/file/TestFileSessionPropertyManagerConfig.java index 84ea13d44a67..2df08f07fa64 100644 --- a/plugin/trino-session-property-managers/src/test/java/io/trino/plugin/session/file/TestFileSessionPropertyManagerConfig.java +++ b/plugin/trino-session-property-managers/src/test/java/io/trino/plugin/session/file/TestFileSessionPropertyManagerConfig.java @@ -40,7 +40,7 @@ public void testExplicitPropertyMappings() { Path configFile = Files.createTempFile(null, null); - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("session-property-manager.config-file", configFile.toString()) .buildOrThrow(); diff --git a/plugin/trino-sqlserver/src/test/java/io/trino/plugin/sqlserver/TestSqlServerConfig.java b/plugin/trino-sqlserver/src/test/java/io/trino/plugin/sqlserver/TestSqlServerConfig.java index 51521f1b0ced..168ca2539c83 100644 --- a/plugin/trino-sqlserver/src/test/java/io/trino/plugin/sqlserver/TestSqlServerConfig.java +++ b/plugin/trino-sqlserver/src/test/java/io/trino/plugin/sqlserver/TestSqlServerConfig.java @@ -34,7 +34,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("sqlserver.snapshot-isolation.disabled", "true") .buildOrThrow(); diff --git a/plugin/trino-thrift/src/main/java/io/trino/plugin/thrift/ThriftIndexPageSource.java b/plugin/trino-thrift/src/main/java/io/trino/plugin/thrift/ThriftIndexPageSource.java index 4b31f0a44861..2978bb66a7c6 100644 --- a/plugin/trino-thrift/src/main/java/io/trino/plugin/thrift/ThriftIndexPageSource.java +++ b/plugin/trino-thrift/src/main/java/io/trino/plugin/thrift/ThriftIndexPageSource.java @@ -117,8 +117,8 @@ public ThriftIndexPageSource( .collect(toImmutableList()); requireNonNull(outputColumns, "outputColumns is null"); - ImmutableList.Builder outputColumnNames = new ImmutableList.Builder<>(); - ImmutableList.Builder outputColumnTypes = new ImmutableList.Builder<>(); + ImmutableList.Builder outputColumnNames = ImmutableList.builder(); + ImmutableList.Builder outputColumnTypes = ImmutableList.builder(); for (ColumnHandle columnHandle : outputColumns) { ThriftColumnHandle thriftColumnHandle = (ThriftColumnHandle) columnHandle; outputColumnNames.add(thriftColumnHandle.getColumnName()); diff --git a/plugin/trino-thrift/src/main/java/io/trino/plugin/thrift/ThriftPageSource.java b/plugin/trino-thrift/src/main/java/io/trino/plugin/thrift/ThriftPageSource.java index 93d4724460d7..bd36318bdae9 100644 --- a/plugin/trino-thrift/src/main/java/io/trino/plugin/thrift/ThriftPageSource.java +++ b/plugin/trino-thrift/src/main/java/io/trino/plugin/thrift/ThriftPageSource.java @@ -67,8 +67,8 @@ public ThriftPageSource( { // init columns requireNonNull(columns, "columns is null"); - ImmutableList.Builder columnNames = new ImmutableList.Builder<>(); - ImmutableList.Builder columnTypes = new ImmutableList.Builder<>(); + ImmutableList.Builder columnNames = ImmutableList.builder(); + ImmutableList.Builder columnTypes = ImmutableList.builder(); for (ColumnHandle columnHandle : columns) { ThriftColumnHandle thriftColumnHandle = (ThriftColumnHandle) columnHandle; columnNames.add(thriftColumnHandle.getColumnName()); diff --git a/plugin/trino-thrift/src/test/java/io/trino/plugin/thrift/TestThriftConnectorConfig.java b/plugin/trino-thrift/src/test/java/io/trino/plugin/thrift/TestThriftConnectorConfig.java index 849e83ae6baa..bb5ab374b39c 100644 --- a/plugin/trino-thrift/src/test/java/io/trino/plugin/thrift/TestThriftConnectorConfig.java +++ b/plugin/trino-thrift/src/test/java/io/trino/plugin/thrift/TestThriftConnectorConfig.java @@ -38,7 +38,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("trino-thrift.max-response-size", "2MB") .put("trino-thrift.metadata-refresh-threads", "10") .put("trino-thrift.lookup-requests-concurrency", "8") diff --git a/service/trino-proxy/src/test/java/io/trino/proxy/TestJwtHandlerConfig.java b/service/trino-proxy/src/test/java/io/trino/proxy/TestJwtHandlerConfig.java index 69697f64537d..1e46f5263cb8 100644 --- a/service/trino-proxy/src/test/java/io/trino/proxy/TestJwtHandlerConfig.java +++ b/service/trino-proxy/src/test/java/io/trino/proxy/TestJwtHandlerConfig.java @@ -44,7 +44,7 @@ public void testExplicitPropertyMappings() { Path keyFile = Files.createTempFile(null, null); - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("jwt.key-file", keyFile.toString()) .put("jwt.key-file-password", "password") .put("jwt.key-id", "testkeyid") diff --git a/service/trino-proxy/src/test/java/io/trino/proxy/TestProxyConfig.java b/service/trino-proxy/src/test/java/io/trino/proxy/TestProxyConfig.java index 0353f45163a7..61b91223ce65 100644 --- a/service/trino-proxy/src/test/java/io/trino/proxy/TestProxyConfig.java +++ b/service/trino-proxy/src/test/java/io/trino/proxy/TestProxyConfig.java @@ -42,7 +42,7 @@ public void testExplicitPropertyMappings() { Path sharedSecretFile = Files.createTempFile(null, null); - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("proxy.uri", "http://example.net/") .put("proxy.shared-secret-file", sharedSecretFile.toString()) .buildOrThrow(); diff --git a/service/trino-verifier/src/main/java/io/trino/verifier/QueryRewriter.java b/service/trino-verifier/src/main/java/io/trino/verifier/QueryRewriter.java index fefc102586a9..83394c637ae4 100644 --- a/service/trino-verifier/src/main/java/io/trino/verifier/QueryRewriter.java +++ b/service/trino-verifier/src/main/java/io/trino/verifier/QueryRewriter.java @@ -178,7 +178,7 @@ private List getColumnsForTable(Connection connection, String catalog, S throws SQLException { ResultSet columns = connection.getMetaData().getColumns(catalog, escapeLikeExpression(connection, schema), escapeLikeExpression(connection, table), null); - ImmutableList.Builder columnBuilder = new ImmutableList.Builder<>(); + ImmutableList.Builder columnBuilder = ImmutableList.builder(); while (columns.next()) { String name = columns.getString("COLUMN_NAME"); int type = columns.getInt("DATA_TYPE"); diff --git a/service/trino-verifier/src/test/java/io/trino/verifier/TestVerifierConfig.java b/service/trino-verifier/src/test/java/io/trino/verifier/TestVerifierConfig.java index 769010986157..21f5f1a21ba0 100644 --- a/service/trino-verifier/src/test/java/io/trino/verifier/TestVerifierConfig.java +++ b/service/trino-verifier/src/test/java/io/trino/verifier/TestVerifierConfig.java @@ -87,7 +87,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("suites", "my_suite") .put("suite", "my_suite") .put("control.query-types", Joiner.on(",").join(CREATE, MODIFY)) diff --git a/testing/trino-product-tests/src/main/java/io/trino/tests/product/hive/BaseTestAvroSchemaEvolution.java b/testing/trino-product-tests/src/main/java/io/trino/tests/product/hive/BaseTestAvroSchemaEvolution.java index 62f62a052e26..a7a1b069c76e 100644 --- a/testing/trino-product-tests/src/main/java/io/trino/tests/product/hive/BaseTestAvroSchemaEvolution.java +++ b/testing/trino-product-tests/src/main/java/io/trino/tests/product/hive/BaseTestAvroSchemaEvolution.java @@ -233,7 +233,7 @@ private Row createRow(int rowNumber, Object... data) private List prepareShowColumnsResultRows(Row... rows) { - ImmutableList.Builder rowsWithPartitionsBuilder = new ImmutableList.Builder<>(); + ImmutableList.Builder rowsWithPartitionsBuilder = ImmutableList.builder(); rowsWithPartitionsBuilder.add(rows); varcharPartitionColumns.stream() .map(partition -> row(partition, "varchar", "partition key", "")) diff --git a/testing/trino-server-dev/src/test/java/io/trino/server/TestDevelopmentLoaderConfig.java b/testing/trino-server-dev/src/test/java/io/trino/server/TestDevelopmentLoaderConfig.java index 806987c590ee..6b7f6ff9b323 100644 --- a/testing/trino-server-dev/src/test/java/io/trino/server/TestDevelopmentLoaderConfig.java +++ b/testing/trino-server-dev/src/test/java/io/trino/server/TestDevelopmentLoaderConfig.java @@ -38,7 +38,7 @@ public void testDefaults() @Test public void testExplicitPropertyMappings() { - Map properties = new ImmutableMap.Builder() + Map properties = ImmutableMap.builder() .put("plugin.bundles", "a,b,c") .put("maven.repo.local", "local-repo") .put("maven.repo.remote", "remote-a,remote-b") diff --git a/testing/trino-testing/src/main/java/io/trino/testing/DistributedQueryRunner.java b/testing/trino-testing/src/main/java/io/trino/testing/DistributedQueryRunner.java index 7291ffe74ee0..01410fd54af7 100644 --- a/testing/trino-testing/src/main/java/io/trino/testing/DistributedQueryRunner.java +++ b/testing/trino-testing/src/main/java/io/trino/testing/DistributedQueryRunner.java @@ -256,7 +256,7 @@ private static TestingTrinoServer createTestingTrinoServer( public void addServers(int nodeCount) throws Exception { - ImmutableList.Builder serverBuilder = new ImmutableList.Builder() + ImmutableList.Builder serverBuilder = ImmutableList.builder() .addAll(servers); for (int i = 0; i < nodeCount; i++) { TestingTrinoServer server = closer.register(createTestingTrinoServer(