This is an automated email from the ASF dual-hosted git repository.

exceptionfactory pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git


The following commit(s) were added to refs/heads/main by this push:
     new c14c3c191bf NIFI-16273 Replaced addAll/putAll Collections with 
parametrized constructors (#11605)
c14c3c191bf is described below

commit c14c3c191bfb7217a08e8fca764497d0a3afa614
Author: dan-s1 <[email protected]>
AuthorDate: Tue Sep 1 12:06:10 2026 -0400

    NIFI-16273 Replaced addAll/putAll Collections with parametrized 
constructors (#11605)
    
    Signed-off-by: David Handermann <[email protected]>
---
 .../operation/UpdateConfigurationOperationHandlerTest.java   |  3 +--
 .../azure/loganalytics/AzureLogAnalyticsReportingTask.java   |  3 +--
 .../parameter/gcp/TestGcpSecretManagerParameterProvider.java |  6 ++----
 .../consumer/convert/CreateNewFlowFileGrouping.java          |  4 ++--
 .../java/org/apache/nifi/mongodb/MongoDBLookupServiceIT.java |  6 ++----
 .../apache/nifi/lookup/script/BaseScriptedLookupService.java |  3 +--
 .../test/java/org/apache/nifi/cef/TestCEFRecordReader.java   |  3 +--
 .../nifi/controller/repository/StandardProcessSession.java   |  3 +--
 .../java/org/apache/nifi/groups/StandardProcessGroup.java    |  3 +--
 .../org/apache/nifi/remote/StandardRemoteProcessGroup.java   |  6 ++----
 .../main/java/org/apache/nifi/controller/FlowController.java |  6 ++----
 .../java/org/apache/nifi/controller/StandardFlowSnippet.java |  6 ++----
 .../org/apache/nifi/nar/NarThreadContextClassLoader.java     |  3 +--
 .../java/org/apache/nifi/web/StandardNiFiServiceFacade.java  | 12 ++++--------
 .../org/apache/nifi/registry/bootstrap/RunNiFiRegistry.java  |  3 +--
 .../org/apache/nifi/registry/db/DatabaseMetadataService.java |  8 ++------
 16 files changed, 26 insertions(+), 52 deletions(-)

diff --git 
a/c2/c2-client-bundle/c2-client-service/src/test/java/org/apache/nifi/c2/client/service/operation/UpdateConfigurationOperationHandlerTest.java
 
b/c2/c2-client-bundle/c2-client-service/src/test/java/org/apache/nifi/c2/client/service/operation/UpdateConfigurationOperationHandlerTest.java
index a286c6918f3..829177afdf8 100644
--- 
a/c2/c2-client-bundle/c2-client-service/src/test/java/org/apache/nifi/c2/client/service/operation/UpdateConfigurationOperationHandlerTest.java
+++ 
b/c2/c2-client-bundle/c2-client-service/src/test/java/org/apache/nifi/c2/client/service/operation/UpdateConfigurationOperationHandlerTest.java
@@ -92,8 +92,7 @@ public class UpdateConfigurationOperationHandlerTest {
         C2Operation operation = new C2Operation();
         operation.setIdentifier(OPERATION_ID);
 
-        Map<String, Object> args = new HashMap<>();
-        args.putAll(INCORRECT_LOCATION_MAP);
+        Map<String, Object> args = new HashMap<>(INCORRECT_LOCATION_MAP);
         args.put(FLOW_ID, "argsFlowId");
         operation.setArgs(args);
 
diff --git 
a/nifi-extension-bundles/nifi-azure-bundle/nifi-azure-reporting-task/src/main/java/org/apache/nifi/reporting/azure/loganalytics/AzureLogAnalyticsReportingTask.java
 
b/nifi-extension-bundles/nifi-azure-bundle/nifi-azure-reporting-task/src/main/java/org/apache/nifi/reporting/azure/loganalytics/AzureLogAnalyticsReportingTask.java
index a1883e9336c..8884d41c47a 100644
--- 
a/nifi-extension-bundles/nifi-azure-bundle/nifi-azure-reporting-task/src/main/java/org/apache/nifi/reporting/azure/loganalytics/AzureLogAnalyticsReportingTask.java
+++ 
b/nifi-extension-bundles/nifi-azure-bundle/nifi-azure-reporting-task/src/main/java/org/apache/nifi/reporting/azure/loganalytics/AzureLogAnalyticsReportingTask.java
@@ -155,10 +155,9 @@ public class AzureLogAnalyticsReportingTask extends 
AbstractAzureLogAnalyticsRep
      */
     protected List<Metric> collectMetrics(final String instanceId, final 
ProcessGroupStatus status,
             final String processGroupName, final boolean jvmMetricsCollected) {
-        List<Metric> allMetrics = new ArrayList<>();
 
         // dataflow process group level metrics
-        
allMetrics.addAll(AzureLogAnalyticsMetricsFactory.getDataFlowMetrics(status, 
instanceId));
+        List<Metric> allMetrics = new 
ArrayList<>(AzureLogAnalyticsMetricsFactory.getDataFlowMetrics(status, 
instanceId));
 
         // connections process group level metrics
         final List<ConnectionStatus> connectionStatuses = new ArrayList<>();
diff --git 
a/nifi-extension-bundles/nifi-gcp-bundle/nifi-gcp-parameter-providers/src/test/java/org/apache/nifi/parameter/gcp/TestGcpSecretManagerParameterProvider.java
 
b/nifi-extension-bundles/nifi-gcp-bundle/nifi-gcp-parameter-providers/src/test/java/org/apache/nifi/parameter/gcp/TestGcpSecretManagerParameterProvider.java
index 57a06e423b1..f1116f2d1ad 100644
--- 
a/nifi-extension-bundles/nifi-gcp-bundle/nifi-gcp-parameter-providers/src/test/java/org/apache/nifi/parameter/gcp/TestGcpSecretManagerParameterProvider.java
+++ 
b/nifi-extension-bundles/nifi-gcp-bundle/nifi-gcp-parameter-providers/src/test/java/org/apache/nifi/parameter/gcp/TestGcpSecretManagerParameterProvider.java
@@ -132,10 +132,8 @@ public class TestGcpSecretManagerParameterProvider {
                 
when(listSecretsPagedResponse.getPage()).thenReturn(currentPage);
                 mockedFirstPage = true;
             }
-            final List<Secret> values = new ArrayList<>();
-            values.addAll(group.getParameters().stream()
-                    .map(parameter -> mockSecret(secretManager, 
group.getGroupName(), parameter))
-                    .collect(Collectors.toList()));
+            final List<Secret> values = group.getParameters().stream()
+                    .map(parameter -> mockSecret(secretManager, 
group.getGroupName(), parameter)).collect(Collectors.toList());
             when(currentPage.getValues()).thenReturn(values);
             if (it.hasNext()) {
                 when(currentPage.hasNextPage()).thenReturn(true);
diff --git 
a/nifi-extension-bundles/nifi-kafka-bundle/nifi-kafka-processors/src/main/java/org/apache/nifi/kafka/processors/consumer/convert/CreateNewFlowFileGrouping.java
 
b/nifi-extension-bundles/nifi-kafka-bundle/nifi-kafka-processors/src/main/java/org/apache/nifi/kafka/processors/consumer/convert/CreateNewFlowFileGrouping.java
index adf470a0eb2..551e1f140d2 100644
--- 
a/nifi-extension-bundles/nifi-kafka-bundle/nifi-kafka-processors/src/main/java/org/apache/nifi/kafka/processors/consumer/convert/CreateNewFlowFileGrouping.java
+++ 
b/nifi-extension-bundles/nifi-kafka-bundle/nifi-kafka-processors/src/main/java/org/apache/nifi/kafka/processors/consumer/convert/CreateNewFlowFileGrouping.java
@@ -123,11 +123,11 @@ public class CreateNewFlowFileGrouping implements 
RecordGroupingStrategy {
             final RecordGroupCriteria criteria = e.getKey();
             final RecordGroup group = e.getValue();
 
-            final Map<String, String> resultAttrs = new HashMap<>();
+            final Map<String, String> resultAttrs;
             final int recordCount;
             try (final RecordSetWriter writer = group.writer()) {
                 final WriteResult writeResult = writer.finishRecordSet();
-                resultAttrs.putAll(writeResult.getAttributes());
+                resultAttrs = new HashMap<>(writeResult.getAttributes());
                 resultAttrs.put("record.count", 
String.valueOf(writeResult.getRecordCount()));
                 resultAttrs.put(KafkaFlowFileAttribute.KAFKA_COUNT, 
String.valueOf(writeResult.getRecordCount()));
                 resultAttrs.put(CoreAttributes.MIME_TYPE.key(), 
writer.getMimeType());
diff --git 
a/nifi-extension-bundles/nifi-mongodb-bundle/nifi-mongodb-services/src/test/java/org/apache/nifi/mongodb/MongoDBLookupServiceIT.java
 
b/nifi-extension-bundles/nifi-mongodb-bundle/nifi-mongodb-services/src/test/java/org/apache/nifi/mongodb/MongoDBLookupServiceIT.java
index da130308064..9eb47af8036 100644
--- 
a/nifi-extension-bundles/nifi-mongodb-bundle/nifi-mongodb-services/src/test/java/org/apache/nifi/mongodb/MongoDBLookupServiceIT.java
+++ 
b/nifi-extension-bundles/nifi-mongodb-bundle/nifi-mongodb-services/src/test/java/org/apache/nifi/mongodb/MongoDBLookupServiceIT.java
@@ -114,8 +114,7 @@ public class MongoDBLookupServiceIT extends AbstractMongoIT 
{
         assertNotNull(result.get(), "The value was null.");
         assertEquals("Hello, world", result.get(), "The value was wrong.");
 
-        Map<String, Object> clean = new HashMap<>();
-        clean.putAll(criteria);
+        Map<String, Object> clean = new HashMap<>(criteria);
         col.deleteOne(new Document(clean));
 
         try {
@@ -230,8 +229,7 @@ public class MongoDBLookupServiceIT extends AbstractMongoIT 
{
         assertEquals(Long.valueOf(1000), subRecord.getValue("nestedLong"));
         assertEquals(list, record.getValue("arrayField"));
 
-        Map<String, Object> clean = new HashMap<>();
-        clean.putAll(criteria);
+        Map<String, Object> clean = new HashMap<>(criteria);
         col.deleteOne(new Document(clean));
 
         try {
diff --git 
a/nifi-extension-bundles/nifi-scripting-bundle/nifi-scripting-processors/src/main/java/org/apache/nifi/lookup/script/BaseScriptedLookupService.java
 
b/nifi-extension-bundles/nifi-scripting-bundle/nifi-scripting-processors/src/main/java/org/apache/nifi/lookup/script/BaseScriptedLookupService.java
index 2e8a3c722aa..fd550372867 100644
--- 
a/nifi-extension-bundles/nifi-scripting-bundle/nifi-scripting-processors/src/main/java/org/apache/nifi/lookup/script/BaseScriptedLookupService.java
+++ 
b/nifi-extension-bundles/nifi-scripting-bundle/nifi-scripting-processors/src/main/java/org/apache/nifi/lookup/script/BaseScriptedLookupService.java
@@ -86,8 +86,7 @@ public class BaseScriptedLookupService extends 
AbstractScriptedControllerService
             }
         }
         List<PropertyDescriptor> supportedPropertyDescriptors = new 
ArrayList<>();
-        List<PropertyDescriptor> descriptors = new ArrayList<>();
-        descriptors.addAll(scriptingComponentHelper.getDescriptors());
+        List<PropertyDescriptor> descriptors = new 
ArrayList<>(scriptingComponentHelper.getDescriptors());
         descriptors.remove(scriptingComponentHelper.scriptEngine);
 
         PropertyDescriptor.Builder engineProp = new PropertyDescriptor
diff --git 
a/nifi-extension-bundles/nifi-standard-services/nifi-record-serialization-services-bundle/nifi-record-serialization-services/src/test/java/org/apache/nifi/cef/TestCEFRecordReader.java
 
b/nifi-extension-bundles/nifi-standard-services/nifi-record-serialization-services-bundle/nifi-record-serialization-services/src/test/java/org/apache/nifi/cef/TestCEFRecordReader.java
index 7c97c2e552c..a33205a64ac 100644
--- 
a/nifi-extension-bundles/nifi-standard-services/nifi-record-serialization-services-bundle/nifi-record-serialization-services/src/test/java/org/apache/nifi/cef/TestCEFRecordReader.java
+++ 
b/nifi-extension-bundles/nifi-standard-services/nifi-record-serialization-services-bundle/nifi-record-serialization-services/src/test/java/org/apache/nifi/cef/TestCEFRecordReader.java
@@ -352,8 +352,7 @@ public class TestCEFRecordReader {
         assertNumberOfResults(1);
         assertSchemaIsSet();
 
-        final Map<String, Object> expectedExtensionValues = new HashMap<>();
-        expectedExtensionValues.putAll(TestCEFUtil.EXPECTED_EXTENSION_VALUES);
+        final Map<String, Object> expectedExtensionValues = new 
HashMap<>(TestCEFUtil.EXPECTED_EXTENSION_VALUES);
         expectedExtensionValues.put("cn1", null);
         expectedExtensionValues.put("cn1Label", "");
 
diff --git 
a/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/controller/repository/StandardProcessSession.java
 
b/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/controller/repository/StandardProcessSession.java
index bb4a9ddf0a9..1eb60299dd0 100644
--- 
a/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/controller/repository/StandardProcessSession.java
+++ 
b/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/controller/repository/StandardProcessSession.java
@@ -903,8 +903,7 @@ public class StandardProcessSession implements 
ProcessSession, ProvenanceEventEn
             return first;
         }
 
-        final Map<String, Long> combined = new HashMap<>();
-        combined.putAll(first);
+        final Map<String, Long> combined = new HashMap<>(first);
         second.forEach((key, value) -> combined.merge(key, value, Long::sum));
         return combined;
     }
diff --git 
a/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/groups/StandardProcessGroup.java
 
b/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/groups/StandardProcessGroup.java
index db84fd220ff..649aac012de 100644
--- 
a/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/groups/StandardProcessGroup.java
+++ 
b/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/groups/StandardProcessGroup.java
@@ -2908,8 +2908,7 @@ public final class StandardProcessGroup implements 
ProcessGroup {
 
     @Override
     public Set<Positionable> findAllPositionables() {
-        final Set<Positionable> positionables = new HashSet<>();
-        positionables.addAll(findAllConnectables(this, true));
+        final Set<Positionable> positionables = new 
HashSet<>(findAllConnectables(this, true));
         List<ProcessGroup> allProcessGroups = findAllProcessGroups();
         positionables.addAll(allProcessGroups);
         positionables.addAll(findAllRemoteProcessGroups());
diff --git 
a/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/remote/StandardRemoteProcessGroup.java
 
b/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/remote/StandardRemoteProcessGroup.java
index 7d63e2b66b9..f534f1bb795 100644
--- 
a/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/remote/StandardRemoteProcessGroup.java
+++ 
b/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/remote/StandardRemoteProcessGroup.java
@@ -760,8 +760,7 @@ public class StandardRemoteProcessGroup implements 
RemoteProcessGroup {
     public Set<RemoteGroupPort> getInputPorts() {
         readLock.lock();
         try {
-            final Set<RemoteGroupPort> set = new HashSet<>();
-            set.addAll(inputPorts.values());
+            final Set<RemoteGroupPort> set = new 
HashSet<>(inputPorts.values());
             return set;
         } finally {
             readLock.unlock();
@@ -841,8 +840,7 @@ public class StandardRemoteProcessGroup implements 
RemoteProcessGroup {
     public Set<RemoteGroupPort> getOutputPorts() {
         readLock.lock();
         try {
-            final Set<RemoteGroupPort> set = new HashSet<>();
-            set.addAll(outputPorts.values());
+            final Set<RemoteGroupPort> set = new 
HashSet<>(outputPorts.values());
             return set;
         } finally {
             readLock.unlock();
diff --git 
a/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/FlowController.java
 
b/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/FlowController.java
index 4953965ff88..7bea91db241 100644
--- 
a/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/FlowController.java
+++ 
b/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/FlowController.java
@@ -2368,8 +2368,7 @@ public class FlowController implements 
ReportingTaskProvider, FlowAnalysisRulePr
             prioritizerClasses.add(name);
         }
 
-        final Set<VersionedConnection> allConns = new HashSet<>();
-        allConns.addAll(versionedFlow.getConnections());
+        final Set<VersionedConnection> allConns = new 
HashSet<>(versionedFlow.getConnections());
         for (final VersionedProcessGroup childGroup : 
versionedFlow.getProcessGroups()) {
             allConns.addAll(findAllConnections(childGroup));
         }
@@ -2787,10 +2786,9 @@ public class FlowController implements 
ReportingTaskProvider, FlowAnalysisRulePr
     // Counters
     //
     public List<Counter> getCounters() {
-        final List<Counter> counters = new ArrayList<>();
 
         final CounterRepository counterRepo = counterRepositoryRef.get();
-        counters.addAll(counterRepo.getCounters());
+        final List<Counter> counters = new 
ArrayList<>(counterRepo.getCounters());
 
         return counters;
     }
diff --git 
a/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardFlowSnippet.java
 
b/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardFlowSnippet.java
index 95c9d0f0bb8..34f6ad10892 100644
--- 
a/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardFlowSnippet.java
+++ 
b/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardFlowSnippet.java
@@ -136,8 +136,7 @@ public class StandardFlowSnippet implements FlowSnippet {
             prioritizerClasses.add(name);
         }
 
-        final Set<ConnectionDTO> allConns = new HashSet<>();
-        allConns.addAll(dto.getConnections());
+        final Set<ConnectionDTO> allConns = new 
HashSet<>(dto.getConnections());
         for (final ProcessGroupDTO childGroup : dto.getProcessGroups()) {
             allConns.addAll(findAllConnections(childGroup));
         }
@@ -166,8 +165,7 @@ public class StandardFlowSnippet implements FlowSnippet {
      * @return connection dtos
      */
     private Set<ConnectionDTO> findAllConnections(final ProcessGroupDTO group) 
{
-        final Set<ConnectionDTO> conns = new HashSet<>();
-        conns.addAll(group.getContents().getConnections());
+        final Set<ConnectionDTO> conns = new 
HashSet<>(group.getContents().getConnections());
 
         for (final ProcessGroupDTO childGroup : 
group.getContents().getProcessGroups()) {
             conns.addAll(findAllConnections(childGroup));
diff --git 
a/nifi-framework-bundle/nifi-framework/nifi-framework-nar-utils/src/main/java/org/apache/nifi/nar/NarThreadContextClassLoader.java
 
b/nifi-framework-bundle/nifi-framework/nifi-framework-nar-utils/src/main/java/org/apache/nifi/nar/NarThreadContextClassLoader.java
index fcca647799c..c4012dd0556 100644
--- 
a/nifi-framework-bundle/nifi-framework/nifi-framework-nar-utils/src/main/java/org/apache/nifi/nar/NarThreadContextClassLoader.java
+++ 
b/nifi-framework-bundle/nifi-framework/nifi-framework-nar-utils/src/main/java/org/apache/nifi/nar/NarThreadContextClassLoader.java
@@ -273,12 +273,11 @@ public class NarThreadContextClassLoader extends 
URLClassLoader {
             return bundleClassLoader;
         }
 
-        final Set<URL> instanceUrls = new LinkedHashSet<>();
         final Set<File> narNativeLibDirs = new LinkedHashSet<>();
 
         final NarClassLoader narBundleClassLoader = (NarClassLoader) 
bundleClassLoader;
         narNativeLibDirs.add(narBundleClassLoader.getNARNativeLibDir());
-        instanceUrls.addAll(Arrays.asList(narBundleClassLoader.getURLs()));
+        final Set<URL> instanceUrls = new 
LinkedHashSet<>(Arrays.asList(narBundleClassLoader.getURLs()));
 
         ClassLoader ancestorClassLoader = narBundleClassLoader.getParent();
 
diff --git 
a/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java
 
b/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java
index 61295122ea2..4b9e9b2ffac 100644
--- 
a/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java
+++ 
b/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java
@@ -1770,10 +1770,8 @@ public class StandardNiFiServiceFacade implements 
NiFiServiceFacade {
         }
 
         // Create AffectedComponentEntity for each affected component
-        final Set<AffectedComponentEntity> affectedComponentEntities = new 
HashSet<>();
-
         final Set<AffectedComponentEntity> individualComponents = 
dtoFactory.createAffectedComponentEntities(affectedComponents, revisionManager);
-        affectedComponentEntities.addAll(individualComponents);
+        final Set<AffectedComponentEntity> affectedComponentEntities = new 
HashSet<>(individualComponents);
 
         for (final ProcessGroup group : affectedStatelessGroups) {
             final ProcessGroupEntity groupEntity = 
createProcessGroupEntity(group);
@@ -4118,8 +4116,7 @@ public class StandardNiFiServiceFacade implements 
NiFiServiceFacade {
             throw new ResourceNotFoundException("Process Group with ID " + 
processGroupId + " was not found within Connector " + connectorId);
         }
 
-        final Set<ControllerServiceNode> serviceNodes = new HashSet<>();
-        
serviceNodes.addAll(targetProcessGroup.getControllerServices(includeAncestorGroups));
+        final Set<ControllerServiceNode> serviceNodes = new 
HashSet<>(targetProcessGroup.getControllerServices(includeAncestorGroups));
 
         if (includeDescendantGroups) {
             
serviceNodes.addAll(targetProcessGroup.findAllControllerServices());
@@ -5418,12 +5415,11 @@ public class StandardNiFiServiceFacade implements 
NiFiServiceFacade {
         final NiFiUser user = NiFiUserUtils.getNiFiUser();
         final ControllerBulletinsEntity controllerBulletinsEntity = new 
ControllerBulletinsEntity();
 
-        final List<BulletinEntity> controllerBulletinEntities = new 
ArrayList<>();
-
         final Authorizable controllerAuthorizable = 
authorizableLookup.getController();
         final boolean authorized = 
controllerAuthorizable.isAuthorized(authorizer, RequestAction.READ, user);
         final List<BulletinDTO> bulletins = 
dtoFactory.createBulletinDtos(bulletinRepository.findBulletinsForController());
-        controllerBulletinEntities.addAll(bulletins.stream().map(bulletin -> 
entityFactory.createBulletinEntity(bulletin, 
authorized)).collect(Collectors.toList()));
+        final List<BulletinEntity> controllerBulletinEntities = new 
ArrayList<>(bulletins.stream().map(bulletin ->
+                entityFactory.createBulletinEntity(bulletin, 
authorized)).collect(Collectors.toList()));
 
         // get the controller service bulletins
         final BulletinQuery controllerServiceQuery = new 
BulletinQuery.Builder().sourceType(ComponentType.CONTROLLER_SERVICE).build();
diff --git 
a/nifi-registry/nifi-registry-core/nifi-registry-bootstrap/src/main/java/org/apache/nifi/registry/bootstrap/RunNiFiRegistry.java
 
b/nifi-registry/nifi-registry-core/nifi-registry-bootstrap/src/main/java/org/apache/nifi/registry/bootstrap/RunNiFiRegistry.java
index 0568d0789ee..71da5c19830 100644
--- 
a/nifi-registry/nifi-registry-core/nifi-registry-bootstrap/src/main/java/org/apache/nifi/registry/bootstrap/RunNiFiRegistry.java
+++ 
b/nifi-registry/nifi-registry-core/nifi-registry-bootstrap/src/main/java/org/apache/nifi/registry/bootstrap/RunNiFiRegistry.java
@@ -796,8 +796,7 @@ public class RunNiFiRegistry {
             properties.load(fis);
         }
 
-        final Map<String, String> props = new HashMap<>();
-        props.putAll((Map) properties);
+        final Map<String, String> props = new HashMap<>((Map) properties);
 
         // Determine the working dir for launching the NiFi Registry process
         // The order of precedence is:
diff --git 
a/nifi-registry/nifi-registry-core/nifi-registry-framework/src/main/java/org/apache/nifi/registry/db/DatabaseMetadataService.java
 
b/nifi-registry/nifi-registry-core/nifi-registry-framework/src/main/java/org/apache/nifi/registry/db/DatabaseMetadataService.java
index 9c029028bc6..c6eea1dea34 100644
--- 
a/nifi-registry/nifi-registry-core/nifi-registry-framework/src/main/java/org/apache/nifi/registry/db/DatabaseMetadataService.java
+++ 
b/nifi-registry/nifi-registry-core/nifi-registry-framework/src/main/java/org/apache/nifi/registry/db/DatabaseMetadataService.java
@@ -974,12 +974,10 @@ public class DatabaseMetadataService implements 
MetadataService {
             return Collections.emptyList();
         }
 
-        final List<Object> args = new ArrayList<>();
-
         final StringBuilder sqlBuilder = new StringBuilder(BASE_EXTENSION_SQL);
         sqlBuilder.append(" AND ");
         addIdentifiersInClause(sqlBuilder, "eb.bucket_id", bucketIdentifiers);
-        args.addAll(bucketIdentifiers);
+        final List<Object> args = new ArrayList<>(bucketIdentifiers);
 
         if (filterParams != null) {
             final BundleType bundleType = filterParams.getBundleType();
@@ -1023,12 +1021,10 @@ public class DatabaseMetadataService implements 
MetadataService {
             return Collections.emptyList();
         }
 
-        final List<Object> args = new ArrayList<>();
-
         final StringBuilder sqlBuilder = new StringBuilder(BASE_EXTENSION_SQL);
         sqlBuilder.append(" AND ");
         addIdentifiersInClause(sqlBuilder, "eb.bucket_id", bucketIdentifiers);
-        args.addAll(bucketIdentifiers);
+        final List<Object> args = new ArrayList<>(bucketIdentifiers);
 
         sqlBuilder.append(" AND e.id IN (")
                 .append(" SELECT ep.extension_id FROM 
EXTENSION_PROVIDED_SERVICE_API ep")

Reply via email to