diff --git a/extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/IncrementalPublishingRabbitStreamIndexTaskRunner.java b/extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/IncrementalPublishingRabbitStreamIndexTaskRunner.java index 32266f32e6e5..75663d23063f 100644 --- a/extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/IncrementalPublishingRabbitStreamIndexTaskRunner.java +++ b/extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/IncrementalPublishingRabbitStreamIndexTaskRunner.java @@ -148,9 +148,8 @@ protected TreeMap> getCheckPointsFromContext( log.debug("Got checkpoints from task context[%s].", checkpointsString); return toolbox.getJsonMapper().readValue( checkpointsString, - new TypeReference<>() - { - }); + new TypeReference<>() {} + ); } else { return null; } diff --git a/extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisor.java b/extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisor.java index 23dbe14cf40f..9ce9bd331cfc 100644 --- a/extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisor.java +++ b/extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisor.java @@ -83,9 +83,7 @@ */ public class RabbitStreamSupervisor extends SeekableStreamSupervisor { - public static final TypeReference>> CHECKPOINTS_TYPE_REF = new TypeReference<>() - { - }; + public static final TypeReference>> CHECKPOINTS_TYPE_REF = new TypeReference<>() {}; private static final EmittingLogger log = new EmittingLogger(RabbitStreamSupervisor.class); private static final Long NOT_SET = -1L; diff --git a/extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/sync/CatalogClient.java b/extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/sync/CatalogClient.java index 6793da30d415..21c198480908 100644 --- a/extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/sync/CatalogClient.java +++ b/extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/sync/CatalogClient.java @@ -59,13 +59,9 @@ public class CatalogClient implements CatalogSource { public static final String SCHEMA_SYNC_PATH = CatalogResource.ROOT_PATH + CatalogResource.SCHEMA_SYNC; public static final String TABLE_SYNC_PATH = CatalogResource.ROOT_PATH + CatalogResource.TABLE_SYNC; - private static final TypeReference> LIST_OF_TABLE_METADATA_TYPE = new TypeReference<>() - { - }; + private static final TypeReference> LIST_OF_TABLE_METADATA_TYPE = new TypeReference<>() {}; // Not strictly needed as a TypeReference, but doing so makes the code simpler. - private static final TypeReference TABLE_METADATA_TYPE = new TypeReference<>() - { - }; + private static final TypeReference TABLE_METADATA_TYPE = new TypeReference<>() {}; private final DruidLeaderClient coordClient; private final ObjectMapper smileMapper; diff --git a/extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/IncrementalPublishingKafkaIndexTaskRunner.java b/extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/IncrementalPublishingKafkaIndexTaskRunner.java index f98021c53ac1..b16f825308fc 100644 --- a/extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/IncrementalPublishingKafkaIndexTaskRunner.java +++ b/extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/IncrementalPublishingKafkaIndexTaskRunner.java @@ -232,9 +232,7 @@ protected TreeMap> getCheckPointsFromCon log.debug("Got checkpoints from task context[%s].", checkpointsString); return toolbox.getJsonMapper().readValue( checkpointsString, - new TypeReference<>() - { - } + new TypeReference<>() {} ); } else { return null; diff --git a/extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/indexing/kinesis/KinesisIndexTaskRunner.java b/extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/indexing/kinesis/KinesisIndexTaskRunner.java index 9c850048cfb0..dfca894d2819 100644 --- a/extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/indexing/kinesis/KinesisIndexTaskRunner.java +++ b/extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/indexing/kinesis/KinesisIndexTaskRunner.java @@ -195,9 +195,7 @@ protected TreeMap> getCheckPointsFromContext( log.debug("Got checkpoints from task context[%s]", checkpointsString); return toolbox.getJsonMapper().readValue( checkpointsString, - new TypeReference<>() - { - } + new TypeReference<>() {} ); } else { return null; diff --git a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/indexing/TaskReportQueryListenerTest.java b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/indexing/TaskReportQueryListenerTest.java index 30a5892799e3..252419f7227a 100644 --- a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/indexing/TaskReportQueryListenerTest.java +++ b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/indexing/TaskReportQueryListenerTest.java @@ -114,9 +114,7 @@ public void test_taskReportDestination() throws IOException final TaskReport.ReportMap reportMap = JSON_MAPPER.readValue( baos.toByteArray(), - new TypeReference<>() - { - } + new TypeReference<>() {} ); Assert.assertEquals(ImmutableSet.of("multiStageQuery", TaskContextReport.REPORT_KEY), reportMap.keySet()); @@ -185,9 +183,7 @@ public void test_durableDestination() throws IOException final TaskReport.ReportMap reportMap = JSON_MAPPER.readValue( baos.toByteArray(), - new TypeReference<>() - { - } + new TypeReference<>() {} ); Assert.assertEquals(ImmutableSet.of("multiStageQuery", TaskContextReport.REPORT_KEY), reportMap.keySet()); diff --git a/indexing-hadoop/src/main/java/org/apache/druid/indexer/DetermineHashedPartitionsJob.java b/indexing-hadoop/src/main/java/org/apache/druid/indexer/DetermineHashedPartitionsJob.java index 849e420889be..2328552efb7b 100644 --- a/indexing-hadoop/src/main/java/org/apache/druid/indexer/DetermineHashedPartitionsJob.java +++ b/indexing-hadoop/src/main/java/org/apache/druid/indexer/DetermineHashedPartitionsJob.java @@ -159,9 +159,7 @@ public boolean run() } List intervals = HadoopDruidIndexerConfig.JSON_MAPPER.readValue( Utils.openInputStream(groupByJob, intervalInfoPath), - new TypeReference<>() - { - } + new TypeReference<>() {} ); config.setGranularitySpec( new UniformGranularitySpec( diff --git a/indexing-hadoop/src/main/java/org/apache/druid/indexer/DeterminePartitionsJob.java b/indexing-hadoop/src/main/java/org/apache/druid/indexer/DeterminePartitionsJob.java index 73aee597ff2e..3efb6c5bec7e 100644 --- a/indexing-hadoop/src/main/java/org/apache/druid/indexer/DeterminePartitionsJob.java +++ b/indexing-hadoop/src/main/java/org/apache/druid/indexer/DeterminePartitionsJob.java @@ -272,9 +272,7 @@ public boolean run() } if (Utils.exists(dimSelectionJob, fileSystem, partitionInfoPath)) { List specs = HadoopDruidIndexerConfig.JSON_MAPPER.readValue( - Utils.openInputStream(dimSelectionJob, partitionInfoPath), new TypeReference<>() - { - } + Utils.openInputStream(dimSelectionJob, partitionInfoPath), new TypeReference<>() {} ); List actualSpecs = Lists.newArrayListWithExpectedSize(specs.size()); diff --git a/indexing-service/src/main/java/org/apache/druid/indexing/overlord/ForkingTaskRunner.java b/indexing-service/src/main/java/org/apache/druid/indexing/overlord/ForkingTaskRunner.java index b163adc2f751..18bde7027151 100644 --- a/indexing-service/src/main/java/org/apache/druid/indexing/overlord/ForkingTaskRunner.java +++ b/indexing-service/src/main/java/org/apache/druid/indexing/overlord/ForkingTaskRunner.java @@ -274,9 +274,7 @@ public TaskStatus call() try { List taskJavaOptsArray = jsonMapper.convertValue( task.getContextValue(ForkingTaskRunnerConfig.JAVA_OPTS_ARRAY_PROPERTY), - new TypeReference<>() - { - } + new TypeReference<>() {} ); if (taskJavaOptsArray != null) { command.addAll(taskJavaOptsArray); diff --git a/indexing-service/src/main/java/org/apache/druid/indexing/overlord/hrtr/WorkerHolder.java b/indexing-service/src/main/java/org/apache/druid/indexing/overlord/hrtr/WorkerHolder.java index 1212b9236d45..9d177c654109 100644 --- a/indexing-service/src/main/java/org/apache/druid/indexing/overlord/hrtr/WorkerHolder.java +++ b/indexing-service/src/main/java/org/apache/druid/indexing/overlord/hrtr/WorkerHolder.java @@ -62,9 +62,7 @@ public class WorkerHolder { private static final EmittingLogger log = new EmittingLogger(WorkerHolder.class); - public static final TypeReference> WORKER_SYNC_RESP_TYPE_REF = new TypeReference<>() - { - }; + public static final TypeReference> WORKER_SYNC_RESP_TYPE_REF = new TypeReference<>() {}; private final Worker worker; diff --git a/integration-tests/src/main/java/org/apache/druid/testing/clients/AbstractQueryResourceTestClient.java b/integration-tests/src/main/java/org/apache/druid/testing/clients/AbstractQueryResourceTestClient.java index 9c0e242c5517..18a8affeac7a 100644 --- a/integration-tests/src/main/java/org/apache/druid/testing/clients/AbstractQueryResourceTestClient.java +++ b/integration-tests/src/main/java/org/apache/druid/testing/clients/AbstractQueryResourceTestClient.java @@ -99,9 +99,7 @@ public byte[] encode(Object content) throws IOException @Override public List> decode(byte[] content) throws IOException { - return om.readValue(content, new TypeReference<>() - { - }); + return om.readValue(content, new TypeReference<>() {}); } } diff --git a/integration-tests/src/main/java/org/apache/druid/testing/clients/ClientInfoResourceTestClient.java b/integration-tests/src/main/java/org/apache/druid/testing/clients/ClientInfoResourceTestClient.java index d2706fde7402..0a54ee6e581f 100644 --- a/integration-tests/src/main/java/org/apache/druid/testing/clients/ClientInfoResourceTestClient.java +++ b/integration-tests/src/main/java/org/apache/druid/testing/clients/ClientInfoResourceTestClient.java @@ -89,9 +89,7 @@ public List getDimensions(String dataSource, String interval) ); } return jsonMapper.readValue( - response.getContent(), new TypeReference<>() - { - } + response.getContent(), new TypeReference<>() {} ); } catch (Exception e) { diff --git a/integration-tests/src/main/java/org/apache/druid/testing/clients/CoordinatorResourceTestClient.java b/integration-tests/src/main/java/org/apache/druid/testing/clients/CoordinatorResourceTestClient.java index ae67ad6f0c25..e82580cd312e 100644 --- a/integration-tests/src/main/java/org/apache/druid/testing/clients/CoordinatorResourceTestClient.java +++ b/integration-tests/src/main/java/org/apache/druid/testing/clients/CoordinatorResourceTestClient.java @@ -131,9 +131,7 @@ public List getSegments(final String dataSource) ); segments = jsonMapper.readValue( - response.getContent(), new TypeReference<>() - { - } + response.getContent(), new TypeReference<>() {} ); } catch (Exception e) { @@ -152,9 +150,7 @@ public List getFullSegmentsMetadata(final String dataSource) ); segments = jsonMapper.readValue( - response.getContent(), new TypeReference<>() - { - } + response.getContent(), new TypeReference<>() {} ); } catch (Exception e) { @@ -171,9 +167,7 @@ public List getSegmentIntervals(final String dataSource) StatusResponseHolder response = makeRequest(HttpMethod.GET, getIntervalsURL(dataSource)); segments = jsonMapper.readValue( - response.getContent(), new TypeReference<>() - { - } + response.getContent(), new TypeReference<>() {} ); } catch (Exception e) { @@ -189,9 +183,7 @@ public List getAvailableSegments(final String dataSource) StatusResponseHolder response = makeRequest(HttpMethod.GET, getFullSegmentsURL(dataSource)); return jsonMapper.readValue( - response.getContent(), new TypeReference<>() - { - } + response.getContent(), new TypeReference<>() {} ); } catch (Exception e) { @@ -222,9 +214,7 @@ private Map getLoadStatus(String dataSource) } status = jsonMapper.readValue( - response.getContent(), new TypeReference<>() - { - } + response.getContent(), new TypeReference<>() {} ); } catch (Exception e) { @@ -365,9 +355,7 @@ private Map() - { - } + new TypeReference<>() {} ); } catch (Exception e) { diff --git a/integration-tests/src/main/java/org/apache/druid/testing/clients/OverlordResourceTestClient.java b/integration-tests/src/main/java/org/apache/druid/testing/clients/OverlordResourceTestClient.java index 5b4b15af7120..9b6c3ec1ef74 100644 --- a/integration-tests/src/main/java/org/apache/druid/testing/clients/OverlordResourceTestClient.java +++ b/integration-tests/src/main/java/org/apache/druid/testing/clients/OverlordResourceTestClient.java @@ -147,9 +147,7 @@ public TaskStatusPlus getTaskStatus(String taskID) LOG.debug("Index status response" + response.getContent()); TaskStatusResponse taskStatusResponse = jsonMapper.readValue( response.getContent(), - new TypeReference<>() - { - } + new TypeReference<>() {} ); return taskStatusResponse.getStatus(); } @@ -236,9 +234,7 @@ private List getTasks(String identifier) LOG.debug("Tasks %s response %s", identifier, response.getContent()); } return jsonMapper.readValue( - response.getContent(), new TypeReference<>() - { - } + response.getContent(), new TypeReference<>() {} ); } catch (Exception e) { @@ -257,9 +253,7 @@ public TaskPayloadResponse getTaskPayload(String taskId) LOG.debug("Task %s response %s", taskId, response.getContent()); } return jsonMapper.readValue( - response.getContent(), new TypeReference<>() - { - } + response.getContent(), new TypeReference<>() {} ); } catch (ISE e) { @@ -350,9 +344,7 @@ public Map> getLockedIntervals(List loc ).get(); return jsonMapper.readValue( response.getContent(), - new TypeReference<>() - { - } + new TypeReference<>() {} ); } catch (Exception e) { @@ -758,9 +750,7 @@ public List getSupervisorHistory(String id) ); } List responseData = jsonMapper.readValue( - response.getContent(), new TypeReference<>() - { - } + response.getContent(), new TypeReference<>() {} ); return responseData; } diff --git a/integration-tests/src/main/java/org/apache/druid/testing/utils/AbstractTestQueryHelper.java b/integration-tests/src/main/java/org/apache/druid/testing/utils/AbstractTestQueryHelper.java index 3f6a56d967ed..673db41e7f74 100644 --- a/integration-tests/src/main/java/org/apache/druid/testing/utils/AbstractTestQueryHelper.java +++ b/integration-tests/src/main/java/org/apache/druid/testing/utils/AbstractTestQueryHelper.java @@ -117,9 +117,7 @@ public void testQueriesFromFile(String url, String filePath) throws Exception List queries = jsonMapper.readValue( TestQueryHelper.class.getResourceAsStream(filePath), - new TypeReference<>() - { - } + new TypeReference<>() {} ); testQueries(url, queries); @@ -131,9 +129,7 @@ public void testQueriesFromString(String url, String str) throws Exception List queries = jsonMapper.readValue( str, - new TypeReference<>() - { - } + new TypeReference<>() {} ); testQueries(url, queries); } diff --git a/integration-tests/src/main/java/org/apache/druid/testing/utils/MsqTestQueryHelper.java b/integration-tests/src/main/java/org/apache/druid/testing/utils/MsqTestQueryHelper.java index a1c1557f8ab1..0b544244509a 100644 --- a/integration-tests/src/main/java/org/apache/druid/testing/utils/MsqTestQueryHelper.java +++ b/integration-tests/src/main/java/org/apache/druid/testing/utils/MsqTestQueryHelper.java @@ -269,9 +269,7 @@ public void testQueriesFromFile(String filePath, String fullDatasourcePath) thro List queries = jsonMapper.readValue( TestQueryHelper.class.getResourceAsStream(filePath), - new TypeReference<>() - { - } + new TypeReference<>() {} ); for (MsqQueryWithResults queryWithResults : queries) { String queryString = queryWithResults.getQuery(); diff --git a/integration-tests/src/test/java/org/apache/druid/tests/query/ITQueryRetryTestOnMissingSegments.java b/integration-tests/src/test/java/org/apache/druid/tests/query/ITQueryRetryTestOnMissingSegments.java index f40b50222e79..f05e5c42e6e8 100644 --- a/integration-tests/src/test/java/org/apache/druid/tests/query/ITQueryRetryTestOnMissingSegments.java +++ b/integration-tests/src/test/java/org/apache/druid/tests/query/ITQueryRetryTestOnMissingSegments.java @@ -154,9 +154,7 @@ private void testQueries(List queries, Expectation expectation List> result = jsonMapper.readValue( responseHolder.getContent(), - new TypeReference<>() - { - } + new TypeReference<>() {} ); if (!QueryResultVerifier.compareResults( result, diff --git a/processing/src/main/java/org/apache/druid/query/groupby/GroupByQueryQueryToolChest.java b/processing/src/main/java/org/apache/druid/query/groupby/GroupByQueryQueryToolChest.java index c3a33e839109..b5712ebdda38 100644 --- a/processing/src/main/java/org/apache/druid/query/groupby/GroupByQueryQueryToolChest.java +++ b/processing/src/main/java/org/apache/druid/query/groupby/GroupByQueryQueryToolChest.java @@ -90,9 +90,7 @@ public class GroupByQueryQueryToolChest extends QueryToolChest OBJECT_TYPE_REFERENCE = new TypeReference<>() {}; - private static final TypeReference TYPE_REFERENCE = new TypeReference<>() - { - }; + private static final TypeReference TYPE_REFERENCE = new TypeReference<>() {}; private final GroupingEngine groupingEngine; private final GroupByQueryConfig queryConfig; diff --git a/processing/src/main/java/org/apache/druid/query/lookup/LookupSnapshotTaker.java b/processing/src/main/java/org/apache/druid/query/lookup/LookupSnapshotTaker.java index 5d404f5285ea..4cdd88973135 100644 --- a/processing/src/main/java/org/apache/druid/query/lookup/LookupSnapshotTaker.java +++ b/processing/src/main/java/org/apache/druid/query/lookup/LookupSnapshotTaker.java @@ -69,9 +69,7 @@ public synchronized List pullExistingSnapshot(final String tier) LOGGER.warn("found empty file no lookups to load from [%s]", persistFile.getAbsolutePath()); return Collections.emptyList(); } - lookupBeanList = objectMapper.readValue(persistFile, new TypeReference<>() - { - }); + lookupBeanList = objectMapper.readValue(persistFile, new TypeReference<>() {}); return lookupBeanList; } catch (IOException e) { diff --git a/processing/src/main/java/org/apache/druid/query/metadata/SegmentMetadataQueryQueryToolChest.java b/processing/src/main/java/org/apache/druid/query/metadata/SegmentMetadataQueryQueryToolChest.java index 6e7181127797..23e583214c84 100644 --- a/processing/src/main/java/org/apache/druid/query/metadata/SegmentMetadataQueryQueryToolChest.java +++ b/processing/src/main/java/org/apache/druid/query/metadata/SegmentMetadataQueryQueryToolChest.java @@ -76,9 +76,7 @@ public class SegmentMetadataQueryQueryToolChest extends QueryToolChest { - private static final TypeReference TYPE_REFERENCE = new TypeReference<>() - { - }; + private static final TypeReference TYPE_REFERENCE = new TypeReference<>() {}; private static final byte SEGMENT_METADATA_CACHE_PREFIX = 0x4; private static final byte SEGMENT_METADATA_QUERY = 0x16; private static final Function MERGE_TRANSFORM_FN = diff --git a/processing/src/main/java/org/apache/druid/query/scan/ScanQueryQueryToolChest.java b/processing/src/main/java/org/apache/druid/query/scan/ScanQueryQueryToolChest.java index 08b99d2544a0..57bbe6a49429 100644 --- a/processing/src/main/java/org/apache/druid/query/scan/ScanQueryQueryToolChest.java +++ b/processing/src/main/java/org/apache/druid/query/scan/ScanQueryQueryToolChest.java @@ -46,9 +46,7 @@ public class ScanQueryQueryToolChest extends QueryToolChest { - private static final TypeReference TYPE_REFERENCE = new TypeReference<>() - { - }; + private static final TypeReference TYPE_REFERENCE = new TypeReference<>() {}; private final GenericQueryMetricsFactory queryMetricsFactory; diff --git a/processing/src/main/java/org/apache/druid/query/search/SearchQueryQueryToolChest.java b/processing/src/main/java/org/apache/druid/query/search/SearchQueryQueryToolChest.java index ee36ffaa8fc1..fba270cdcc69 100644 --- a/processing/src/main/java/org/apache/druid/query/search/SearchQueryQueryToolChest.java +++ b/processing/src/main/java/org/apache/druid/query/search/SearchQueryQueryToolChest.java @@ -59,12 +59,8 @@ public class SearchQueryQueryToolChest extends QueryToolChest, SearchQuery> { private static final byte SEARCH_QUERY = 0x15; - private static final TypeReference> TYPE_REFERENCE = new TypeReference<>() - { - }; - private static final TypeReference OBJECT_TYPE_REFERENCE = new TypeReference<>() - { - }; + private static final TypeReference> TYPE_REFERENCE = new TypeReference<>() {}; + private static final TypeReference OBJECT_TYPE_REFERENCE = new TypeReference<>() {}; private final SearchQueryConfig config; private final SearchQueryMetricsFactory queryMetricsFactory; diff --git a/processing/src/main/java/org/apache/druid/query/timeboundary/TimeBoundaryQueryQueryToolChest.java b/processing/src/main/java/org/apache/druid/query/timeboundary/TimeBoundaryQueryQueryToolChest.java index 9fa82a07054c..ffa31c3cea6b 100644 --- a/processing/src/main/java/org/apache/druid/query/timeboundary/TimeBoundaryQueryQueryToolChest.java +++ b/processing/src/main/java/org/apache/druid/query/timeboundary/TimeBoundaryQueryQueryToolChest.java @@ -62,12 +62,8 @@ public class TimeBoundaryQueryQueryToolChest { private static final byte TIMEBOUNDARY_QUERY = 0x3; - private static final TypeReference> TYPE_REFERENCE = new TypeReference<>() - { - }; - private static final TypeReference OBJECT_TYPE_REFERENCE = new TypeReference<>() - { - }; + private static final TypeReference> TYPE_REFERENCE = new TypeReference<>() {}; + private static final TypeReference OBJECT_TYPE_REFERENCE = new TypeReference<>() {}; private final GenericQueryMetricsFactory queryMetricsFactory; diff --git a/processing/src/main/java/org/apache/druid/query/topn/TopNQueryQueryToolChest.java b/processing/src/main/java/org/apache/druid/query/topn/TopNQueryQueryToolChest.java index da859ac15923..f0d5fa586718 100644 --- a/processing/src/main/java/org/apache/druid/query/topn/TopNQueryQueryToolChest.java +++ b/processing/src/main/java/org/apache/druid/query/topn/TopNQueryQueryToolChest.java @@ -80,12 +80,8 @@ public class TopNQueryQueryToolChest extends QueryToolChest, TopNQuery> { private static final byte TOPN_QUERY = 0x1; - private static final TypeReference> TYPE_REFERENCE = new TypeReference<>() - { - }; - private static final TypeReference OBJECT_TYPE_REFERENCE = new TypeReference<>() - { - }; + private static final TypeReference> TYPE_REFERENCE = new TypeReference<>() {}; + private static final TypeReference OBJECT_TYPE_REFERENCE = new TypeReference<>() {}; private final TopNQueryConfig config; private final TopNQueryMetricsFactory queryMetricsFactory; diff --git a/processing/src/test/java/org/apache/druid/query/aggregation/AggregationTestHelper.java b/processing/src/test/java/org/apache/druid/query/aggregation/AggregationTestHelper.java index e07e47028dea..81f62cb7421c 100644 --- a/processing/src/test/java/org/apache/druid/query/aggregation/AggregationTestHelper.java +++ b/processing/src/test/java/org/apache/druid/query/aggregation/AggregationTestHelper.java @@ -471,9 +471,7 @@ public void createIndex( LineIterator iter = IOUtils.lineIterator(inputDataStream, "UTF-8"); List aggregatorSpecs = mapper.readValue( aggregators, - new TypeReference<>() - { - } + new TypeReference<>() {} ); createIndex( diff --git a/processing/src/test/java/org/apache/druid/query/explain/ExplainPlanTest.java b/processing/src/test/java/org/apache/druid/query/explain/ExplainPlanTest.java index 2440a423f9e9..0273ec412851 100644 --- a/processing/src/test/java/org/apache/druid/query/explain/ExplainPlanTest.java +++ b/processing/src/test/java/org/apache/druid/query/explain/ExplainPlanTest.java @@ -110,9 +110,7 @@ private void testSerde( try { observedExplainPlans = MAPPER.readValue( MAPPER.writeValueAsString(givenPlans), - new TypeReference<>() - { - } + new TypeReference<>() {} ); } catch (Exception e) { diff --git a/processing/src/test/java/org/apache/druid/segment/nested/NestedPathPartTest.java b/processing/src/test/java/org/apache/druid/segment/nested/NestedPathPartTest.java index 5fd7ec770e18..f11c748789e1 100644 --- a/processing/src/test/java/org/apache/druid/segment/nested/NestedPathPartTest.java +++ b/processing/src/test/java/org/apache/druid/segment/nested/NestedPathPartTest.java @@ -32,9 +32,7 @@ public class NestedPathPartTest { private static final ObjectMapper JSON_MAPPER = new DefaultObjectMapper(); - private static final TypeReference> TYPE_REF = new TypeReference<>() - { - }; + private static final TypeReference> TYPE_REF = new TypeReference<>() {}; @Test public void testMapFieldSerde() throws JsonProcessingException diff --git a/server/src/main/java/org/apache/druid/catalog/model/ModelProperties.java b/server/src/main/java/org/apache/druid/catalog/model/ModelProperties.java index df471a67b6b1..6069321a0d3f 100644 --- a/server/src/main/java/org/apache/druid/catalog/model/ModelProperties.java +++ b/server/src/main/java/org/apache/druid/catalog/model/ModelProperties.java @@ -364,9 +364,7 @@ public StringListPropertyDefn(String name) super( name, "string list", - new TypeReference<>() - { - } + new TypeReference<>() {} ); } } diff --git a/server/src/main/java/org/apache/druid/catalog/model/table/DatasourceDefn.java b/server/src/main/java/org/apache/druid/catalog/model/table/DatasourceDefn.java index 4713f850f57b..297188dd9cc1 100644 --- a/server/src/main/java/org/apache/druid/catalog/model/table/DatasourceDefn.java +++ b/server/src/main/java/org/apache/druid/catalog/model/table/DatasourceDefn.java @@ -110,9 +110,7 @@ public ClusterKeysDefn() super( CLUSTER_KEYS_PROPERTY, "ClusterKeySpec list", - new TypeReference<>() - { - } + new TypeReference<>() {} ); } diff --git a/server/src/main/java/org/apache/druid/catalog/model/table/ExternalTableDefn.java b/server/src/main/java/org/apache/druid/catalog/model/table/ExternalTableDefn.java index b18b19b42a67..015f7195c2a3 100644 --- a/server/src/main/java/org/apache/druid/catalog/model/table/ExternalTableDefn.java +++ b/server/src/main/java/org/apache/druid/catalog/model/table/ExternalTableDefn.java @@ -236,9 +236,7 @@ public class ExternalTableDefn extends TableDefn * Type reference used to deserialize JSON to a generic map. */ @VisibleForTesting - public static final TypeReference> MAP_TYPE_REF = new TypeReference<>() - { - }; + public static final TypeReference> MAP_TYPE_REF = new TypeReference<>() {}; private TableDefnRegistry registry; diff --git a/server/src/main/java/org/apache/druid/client/BatchServerInventoryView.java b/server/src/main/java/org/apache/druid/client/BatchServerInventoryView.java index 6b37765adeb6..58d4fb0927ee 100644 --- a/server/src/main/java/org/apache/druid/client/BatchServerInventoryView.java +++ b/server/src/main/java/org/apache/druid/client/BatchServerInventoryView.java @@ -115,9 +115,7 @@ public DruidServer deserializeContainer(byte[] bytes) public Set deserializeInventory(byte[] bytes) { try { - return jsonMapper.readValue(bytes, new TypeReference<>() - { - }); + return jsonMapper.readValue(bytes, new TypeReference<>() {}); } catch (IOException e) { log.error(e, "Could not parse json: %s", StringUtils.fromUtf8(bytes)); diff --git a/server/src/main/java/org/apache/druid/client/coordinator/CoordinatorClientImpl.java b/server/src/main/java/org/apache/druid/client/coordinator/CoordinatorClientImpl.java index 3e6efc84e574..224a766c719d 100644 --- a/server/src/main/java/org/apache/druid/client/coordinator/CoordinatorClientImpl.java +++ b/server/src/main/java/org/apache/druid/client/coordinator/CoordinatorClientImpl.java @@ -118,9 +118,7 @@ public Iterable fetchServerViewSegments(String dataSou holder -> JacksonUtils.readValue( jsonMapper, holder.getContent(), - new TypeReference<>() - { - } + new TypeReference<>() {} ) ); FutureUtils.getUnchecked(segments, true).forEach(retVal::add); diff --git a/server/src/main/java/org/apache/druid/rpc/indexing/OverlordClientImpl.java b/server/src/main/java/org/apache/druid/rpc/indexing/OverlordClientImpl.java index a7f609c5e45e..76077a2fbddb 100644 --- a/server/src/main/java/org/apache/druid/rpc/indexing/OverlordClientImpl.java +++ b/server/src/main/java/org/apache/druid/rpc/indexing/OverlordClientImpl.java @@ -173,9 +173,7 @@ public ListenableFuture> taskStatuses(final Set new BytesFullResponseHandler() ), holder -> - JacksonUtils.readValue(jsonMapper, holder.getContent(), new TypeReference<>() - { - }) + JacksonUtils.readValue(jsonMapper, holder.getContent(), new TypeReference<>() {}) ); } @@ -210,9 +208,7 @@ public ListenableFuture>> findLockedIntervals( final Map> response = JacksonUtils.readValue( jsonMapper, holder.getContent(), - new TypeReference<>() - { - } + new TypeReference<>() {} ); return response == null ? Collections.emptyMap() : response; @@ -259,9 +255,7 @@ public ListenableFuture> getWorkers() new BytesFullResponseHandler() ), holder -> - JacksonUtils.readValue(jsonMapper, holder.getContent(), new TypeReference<>() - { - }) + JacksonUtils.readValue(jsonMapper, holder.getContent(), new TypeReference<>() {}) ); } diff --git a/server/src/main/java/org/apache/druid/server/ClientQuerySegmentWalker.java b/server/src/main/java/org/apache/druid/server/ClientQuerySegmentWalker.java index fd6f79209175..6b5b89124ceb 100644 --- a/server/src/main/java/org/apache/druid/server/ClientQuerySegmentWalker.java +++ b/server/src/main/java/org/apache/druid/server/ClientQuerySegmentWalker.java @@ -594,9 +594,7 @@ private QueryRunner decorateClusterRunner(Query query, QueryRunner .postProcess( objectMapper.convertValue( query.context().getString("postProcessing"), - new TypeReference<>() - { - } + new TypeReference<>() {} ) ) .map( diff --git a/server/src/main/java/org/apache/druid/server/coordination/BatchDataSegmentAnnouncer.java b/server/src/main/java/org/apache/druid/server/coordination/BatchDataSegmentAnnouncer.java index a1b2e51df9b0..d95dee729af0 100644 --- a/server/src/main/java/org/apache/druid/server/coordination/BatchDataSegmentAnnouncer.java +++ b/server/src/main/java/org/apache/druid/server/coordination/BatchDataSegmentAnnouncer.java @@ -433,9 +433,7 @@ public Set getSegments() try { return jsonMapper.readValue( bytes, - new TypeReference<>() - { - } + new TypeReference<>() {} ); } catch (Exception e) { diff --git a/server/src/test/java/org/apache/druid/metadata/SQLMetadataStorageActionHandlerTest.java b/server/src/test/java/org/apache/druid/metadata/SQLMetadataStorageActionHandlerTest.java index a38da6c170d7..56ff7751efb3 100644 --- a/server/src/test/java/org/apache/druid/metadata/SQLMetadataStorageActionHandlerTest.java +++ b/server/src/test/java/org/apache/druid/metadata/SQLMetadataStorageActionHandlerTest.java @@ -85,25 +85,19 @@ public void setUp() @Override public TypeReference> getEntryType() { - return new TypeReference<>() - { - }; + return new TypeReference<>() {}; } @Override public TypeReference> getStatusType() { - return new TypeReference<>() - { - }; + return new TypeReference<>() {}; } @Override public TypeReference> getLockType() { - return new TypeReference<>() - { - }; + return new TypeReference<>() {}; } }, entryType, diff --git a/server/src/test/java/org/apache/druid/server/StatusResourceTest.java b/server/src/test/java/org/apache/druid/server/StatusResourceTest.java index 91e1f5682ec9..41c52382f557 100644 --- a/server/src/test/java/org/apache/druid/server/StatusResourceTest.java +++ b/server/src/test/java/org/apache/druid/server/StatusResourceTest.java @@ -94,7 +94,8 @@ private void testHiddenPropertiesWithPropertyFileName(String fileName) throws Ex Set hiddenProperties = new ObjectMapper().readValue( returnedProperties.get("druid.server.hiddenProperties"), - new TypeReference<>() {}); + new TypeReference<>() {} + ); hiddenProperties.forEach( (property) -> { diff --git a/server/src/test/java/org/apache/druid/server/coordination/coordination/BatchDataSegmentAnnouncerTest.java b/server/src/test/java/org/apache/druid/server/coordination/coordination/BatchDataSegmentAnnouncerTest.java index 839f092274ac..98644cdc5655 100644 --- a/server/src/test/java/org/apache/druid/server/coordination/coordination/BatchDataSegmentAnnouncerTest.java +++ b/server/src/test/java/org/apache/druid/server/coordination/coordination/BatchDataSegmentAnnouncerTest.java @@ -606,9 +606,7 @@ public Set read(String path) try { if (cf.checkExists().forPath(path) != null) { return jsonMapper.readValue( - cf.getData().forPath(path), new TypeReference<>() - { - } + cf.getData().forPath(path), new TypeReference<>() {} ); } } diff --git a/server/src/test/java/org/apache/druid/server/coordinator/duty/CompactSegmentsTest.java b/server/src/test/java/org/apache/druid/server/coordinator/duty/CompactSegmentsTest.java index 379cb32de025..882bb87a25a5 100644 --- a/server/src/test/java/org/apache/druid/server/coordinator/duty/CompactSegmentsTest.java +++ b/server/src/test/java/org/apache/druid/server/coordinator/duty/CompactSegmentsTest.java @@ -2175,9 +2175,7 @@ private void compactSegments( transformSpec = jsonMapper.readValue( jsonMapper.writeValueAsString(new TransformSpec(clientCompactionTaskQuery.getTransformSpec() .getFilter(), null)), - new TypeReference<>() - { - } + new TypeReference<>() {} ); } } diff --git a/server/src/test/java/org/apache/druid/server/coordinator/loading/HttpLoadQueuePeonTest.java b/server/src/test/java/org/apache/druid/server/coordinator/loading/HttpLoadQueuePeonTest.java index ceedc7bd3816..66ea1ee9eda0 100644 --- a/server/src/test/java/org/apache/druid/server/coordinator/loading/HttpLoadQueuePeonTest.java +++ b/server/src/test/java/org/apache/druid/server/coordinator/loading/HttpLoadQueuePeonTest.java @@ -350,9 +350,7 @@ public ListenableFuture go( httpResponseHandler.handleResponse(httpResponse, null); try { List changeRequests = MAPPER.readValue( - request.getContent().array(), new TypeReference<>() - { - } + request.getContent().array(), new TypeReference<>() {} ); List statuses = new ArrayList<>(changeRequests.size()); diff --git a/services/src/main/java/org/apache/druid/cli/CliCoordinator.java b/services/src/main/java/org/apache/druid/cli/CliCoordinator.java index eff73a646e3b..207090a06ddf 100644 --- a/services/src/main/java/org/apache/druid/cli/CliCoordinator.java +++ b/services/src/main/java/org/apache/druid/cli/CliCoordinator.java @@ -367,9 +367,7 @@ public CoordinatorCustomDutyGroups get() if (Strings.isNullOrEmpty(props.getProperty(dutyListProperty))) { throw new IAE("Coordinator custom duty group given without any duty for group %s", coordinatorCustomDutyGroupName); } - List dutyForGroup = jsonMapper.readValue(props.getProperty(dutyListProperty), new TypeReference<>() - { - }); + List dutyForGroup = jsonMapper.readValue(props.getProperty(dutyListProperty), new TypeReference<>() {}); List coordinatorCustomDuties = new ArrayList<>(); for (String dutyName : dutyForGroup) { final String dutyPropertyBase = StringUtils.format(