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 3946f728534 NIFI-16122 Removed redundant type casts and added PMD rule 
UnnecessaryCast (#11440)
3946f728534 is described below

commit 3946f7285344196a3a83ea402b176190ea85bd85
Author: dan-s1 <[email protected]>
AuthorDate: Mon Jul 20 13:28:28 2026 -0400

    NIFI-16122 Removed redundant type casts and added PMD rule UnnecessaryCast 
(#11440)
    
    Signed-off-by: David Handermann <[email protected]>
---
 .../c2/protocol/api/AgentRepositoryStatus.java     |  4 +--
 .../nifi/c2/protocol/api/FlowQueueStatus.java      |  4 +--
 .../apache/nifi/sql/internal/NiFiTableScan.java    |  4 +--
 .../nifi/provenance/StandardLineageResult.java     |  2 +-
 .../nifi/provenance/StandardQueryResult.java       |  2 +-
 .../functions/AbstractDateArithmeticEvaluator.java |  4 +--
 .../AbstractInstantArithmeticEvaluator.java        |  3 +-
 .../language/evaluation/reduce/CountEvaluator.java |  2 +-
 .../org/apache/nifi/util/FlowFileUnpackagerV2.java |  1 +
 .../org/apache/nifi/util/FlowFileUnpackagerV3.java |  1 +
 .../nifi/record/path/filter/ContainsRegex.java     |  8 ++---
 .../apache/nifi/record/path/filter/IsBlank.java    |  2 +-
 .../apache/nifi/record/path/filter/IsEmpty.java    |  2 +-
 .../nifi/record/path/filter/MatchesRegex.java      |  8 ++---
 .../record/path/filter/StringComparisonFilter.java |  4 +--
 .../apache/nifi/record/path/functions/Concat.java  |  2 +-
 .../apache/nifi/record/path/functions/Hash.java    |  2 +-
 .../record/path/functions/NoArgStringFunction.java |  2 +-
 .../apache/nifi/record/path/functions/Padding.java |  2 +-
 .../apache/nifi/record/path/functions/Replace.java |  2 +-
 .../nifi/record/path/functions/ReplaceRegex.java   |  8 ++---
 .../nifi/record/path/functions/Substring.java      |  2 +-
 .../nifi/record/path/functions/SubstringAfter.java |  2 +-
 .../record/path/functions/SubstringAfterLast.java  |  2 +-
 .../record/path/functions/SubstringBefore.java     |  2 +-
 .../record/path/functions/SubstringBeforeLast.java |  2 +-
 .../nifi/record/path/functions/ToString.java       |  2 +-
 .../nifi/record/path/util/RecordPathUtils.java     |  2 +-
 .../apache/nifi/record/path/TestRecordPath.java    |  4 +--
 .../serialization/record/TestDataTypeUtils.java    | 10 +++---
 .../TestObjectLocalDateTimeFieldConverter.java     |  2 +-
 .../main/java/org/apache/nifi/util/StopWatch.java  |  2 +-
 .../TestAwsSecretsManagerParameterProvider.java    |  3 +-
 .../aws/dynamodb/RecordToItemConverter.java        |  4 +--
 .../TestAzureKeyVaultSecretsParameterProvider.java |  3 +-
 .../nifi/reporting/azure/loganalytics/Metric.java  |  2 +-
 .../evtx/parser/bxml/AttributeNodeTest.java        |  2 +-
 .../java/org/apache/nifi/avro/AvroTypeUtil.java    |  2 +-
 .../org/apache/nifi/avro/TestAvroTypeUtil.java     |  6 ++--
 .../gcp/TestGcpSecretManagerParameterProvider.java |  3 +-
 .../groovyx/flow/ProcessSessionWrap.java           |  2 +-
 .../FlowFileStreamUnpackerSequenceFileWriter.java  |  1 +
 .../processors/hadoop/util/MockFileSystem.java     |  2 +-
 .../nifi/processors/hl7/ExtractHL7Attributes.java  |  3 +-
 .../org/apache/nifi/processors/hl7/RouteHL7.java   |  2 +-
 .../nifi/mongodb/MongoDBControllerServiceIT.java   |  5 ++-
 .../processors/network/pcap/ByteBufferReader.java  |  1 +
 .../nifi/processors/standard/ControlRate.java      |  2 +-
 .../apache/nifi/processors/standard/CountText.java | 10 +++---
 .../nifi/processors/standard/DetectDuplicate.java  |  1 +
 .../apache/nifi/processors/standard/ListFile.java  |  2 +-
 .../nifi/processors/standard/LookupRecord.java     |  2 +-
 .../processors/standard/RenameRecordField.java     |  2 +-
 .../nifi/processors/standard/UpdateRecord.java     |  2 +-
 .../standard/calcite/RecordPathFunction.java       |  2 +-
 .../servlets/ContentAcknowledgmentServlet.java     |  4 +--
 .../processors/standard/PutDatabaseRecordIT.java   |  2 +-
 .../apache/nifi/controller/MonitorDiskUsage.java   |  4 +--
 .../org/apache/nifi/controller/MonitorMemory.java  |  2 +-
 .../StandardOauth2AccessTokenProviderTest.java     |  5 ++-
 .../avro/TestAvroReaderWithEmbeddedSchema.java     | 42 +++++++++++-----------
 .../serialization/EventFileCompressor.java         |  2 +-
 .../nifi/provenance/toc/StandardTocReader.java     |  1 +
 .../provenance/TestSchemaRecordReaderWriter.java   |  2 +-
 .../admin/service/EntityStoreAuditServiceTest.java |  2 +-
 .../http/endpoints/DropRequestEndpointMerger.java  |  2 +-
 .../apache/nifi/util/FlowDifferenceFilters.java    |  3 +-
 .../org/apache/nifi/controller/FlowController.java |  2 +-
 .../partition/CorrelationAttributePartitioner.java |  2 +-
 .../scheduling/StandardProcessScheduler.java       |  2 +-
 .../analytics/StatusAnalyticsModelMapFactory.java  |  4 +--
 .../repository/TestFileSystemRepository.java       |  2 +-
 .../apache/nifi/web/StandardNiFiServiceFacade.java |  2 +-
 .../nifi/web/StandardNiFiServiceFacadeTest.java    |  2 +-
 .../org/apache/nifi/registry/util/FormatUtils.java |  2 +-
 .../registry/web/api/IntegrationTestUtils.java     |  2 +-
 .../controller/reporting/LogComponentStatuses.java | 10 +++---
 pmd-ruleset.xml                                    |  1 +
 78 files changed, 134 insertions(+), 133 deletions(-)

diff --git 
a/c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/AgentRepositoryStatus.java
 
b/c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/AgentRepositoryStatus.java
index b4e8fa2460a..bb5065cbe64 100644
--- 
a/c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/AgentRepositoryStatus.java
+++ 
b/c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/AgentRepositoryStatus.java
@@ -75,7 +75,7 @@ public class AgentRepositoryStatus implements Serializable {
      */
     @Schema(hidden = true)
     public Double getSizeUtilization() {
-        return size != null && sizeMax != null && sizeMax > 0 ? (double) size 
/ (double) sizeMax : null;
+        return size != null && sizeMax != null && sizeMax > 0 ? (double) size 
/ sizeMax : null;
     }
 
     /**
@@ -86,6 +86,6 @@ public class AgentRepositoryStatus implements Serializable {
      */
     @Schema(hidden = true)
     public Double getDataSizeUtilization() {
-        return dataSize != null && dataSizeMax != null && dataSizeMax > 0 ? 
(double) dataSize / (double) dataSizeMax : null;
+        return dataSize != null && dataSizeMax != null && dataSizeMax > 0 ? 
(double) dataSize / dataSizeMax : null;
     }
 }
diff --git 
a/c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/FlowQueueStatus.java
 
b/c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/FlowQueueStatus.java
index 8b8ca9dfcf7..136aa8dc435 100644
--- 
a/c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/FlowQueueStatus.java
+++ 
b/c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/FlowQueueStatus.java
@@ -75,7 +75,7 @@ public class FlowQueueStatus implements Serializable {
      */
     @Schema(hidden = true)
     public Double getSizeUtilization() {
-        return size != null && sizeMax != null && sizeMax > 0 ? (double) size 
/ (double) sizeMax : null;
+        return size != null && sizeMax != null && sizeMax > 0 ? (double) size 
/ sizeMax : null;
     }
 
     /**
@@ -86,6 +86,6 @@ public class FlowQueueStatus implements Serializable {
      */
     @Schema(hidden = true)
     public Double getDataSizeUtilization() {
-        return dataSize != null && dataSizeMax != null && dataSizeMax > 0 ? 
(double) dataSize / (double) dataSizeMax : null;
+        return dataSize != null && dataSizeMax != null && dataSizeMax > 0 ? 
(double) dataSize / dataSizeMax : null;
     }
 }
diff --git 
a/nifi-commons/nifi-calcite-utils/src/main/java/org/apache/nifi/sql/internal/NiFiTableScan.java
 
b/nifi-commons/nifi-calcite-utils/src/main/java/org/apache/nifi/sql/internal/NiFiTableScan.java
index cab8db7e6d0..a876dba6592 100644
--- 
a/nifi-commons/nifi-calcite-utils/src/main/java/org/apache/nifi/sql/internal/NiFiTableScan.java
+++ 
b/nifi-commons/nifi-calcite-utils/src/main/java/org/apache/nifi/sql/internal/NiFiTableScan.java
@@ -86,8 +86,8 @@ class NiFiTableScan extends TableScan implements 
EnumerableRel {
         // For example, if table has 3 fields, project has 1 field,
         // then factor = (1 + 2) / (3 + 2) = 0.6
         return super.computeSelfCost(planner, mq)
-            .multiplyBy(((double) fields.length + 2D)
-                / ((double) table.getRowType().getFieldCount() + 2D));
+            .multiplyBy((fields.length + 2D)
+                / (table.getRowType().getFieldCount() + 2D));
     }
 
     @Override
diff --git 
a/nifi-commons/nifi-data-provenance-utils/src/main/java/org/apache/nifi/provenance/StandardLineageResult.java
 
b/nifi-commons/nifi-data-provenance-utils/src/main/java/org/apache/nifi/provenance/StandardLineageResult.java
index 718255768d7..83972f65300 100644
--- 
a/nifi-commons/nifi-data-provenance-utils/src/main/java/org/apache/nifi/provenance/StandardLineageResult.java
+++ 
b/nifi-commons/nifi-data-provenance-utils/src/main/java/org/apache/nifi/provenance/StandardLineageResult.java
@@ -126,7 +126,7 @@ public class StandardLineageResult implements 
ComputeLineageResult, ProgressiveR
     public int getPercentComplete() {
         readLock.lock();
         try {
-            return (numSteps < 1) ? 100 : (int) (((float) numCompletedSteps / 
(float) numSteps) * 100.0F);
+            return (numSteps < 1) ? 100 : (int) (((float) numCompletedSteps / 
numSteps) * 100.0F);
         } finally {
             readLock.unlock();
         }
diff --git 
a/nifi-commons/nifi-data-provenance-utils/src/main/java/org/apache/nifi/provenance/StandardQueryResult.java
 
b/nifi-commons/nifi-data-provenance-utils/src/main/java/org/apache/nifi/provenance/StandardQueryResult.java
index 6dfbc0fb998..2bb302fef29 100644
--- 
a/nifi-commons/nifi-data-provenance-utils/src/main/java/org/apache/nifi/provenance/StandardQueryResult.java
+++ 
b/nifi-commons/nifi-data-provenance-utils/src/main/java/org/apache/nifi/provenance/StandardQueryResult.java
@@ -116,7 +116,7 @@ public class StandardQueryResult implements QueryResult, 
ProgressiveResult {
     public int getPercentComplete() {
         readLock.lock();
         try {
-            return (numSteps < 1) ? 100 : (int) (((float) numCompletedSteps / 
(float) numSteps) * 100.0F);
+            return (numSteps < 1) ? 100 : (int) (((float) numCompletedSteps / 
numSteps) * 100.0F);
         } finally {
             readLock.unlock();
         }
diff --git 
a/nifi-commons/nifi-expression-language/src/main/java/org/apache/nifi/attribute/expression/language/evaluation/functions/AbstractDateArithmeticEvaluator.java
 
b/nifi-commons/nifi-expression-language/src/main/java/org/apache/nifi/attribute/expression/language/evaluation/functions/AbstractDateArithmeticEvaluator.java
index 187f3b940d8..8917c6126c2 100644
--- 
a/nifi-commons/nifi-expression-language/src/main/java/org/apache/nifi/attribute/expression/language/evaluation/functions/AbstractDateArithmeticEvaluator.java
+++ 
b/nifi-commons/nifi-expression-language/src/main/java/org/apache/nifi/attribute/expression/language/evaluation/functions/AbstractDateArithmeticEvaluator.java
@@ -61,11 +61,11 @@ abstract class AbstractDateArithmeticEvaluator extends 
DateEvaluator {
 
         if (amountEvaluator instanceof StringLiteralEvaluator) {
             DateAmountParser.validate(
-                    ((StringLiteralEvaluator) 
amountEvaluator).evaluate(null).getValue());
+                    amountEvaluator.evaluate(null).getValue());
         }
 
         if (timeZoneEvaluator instanceof StringLiteralEvaluator) {
-            final String tz = ((StringLiteralEvaluator) 
timeZoneEvaluator).evaluate(null).getValue();
+            final String tz = timeZoneEvaluator.evaluate(null).getValue();
             try {
                 ZoneId.of(tz);
             } catch (final DateTimeException e) {
diff --git 
a/nifi-commons/nifi-expression-language/src/main/java/org/apache/nifi/attribute/expression/language/evaluation/functions/AbstractInstantArithmeticEvaluator.java
 
b/nifi-commons/nifi-expression-language/src/main/java/org/apache/nifi/attribute/expression/language/evaluation/functions/AbstractInstantArithmeticEvaluator.java
index 1fb50f262b7..b48ef7f06e7 100644
--- 
a/nifi-commons/nifi-expression-language/src/main/java/org/apache/nifi/attribute/expression/language/evaluation/functions/AbstractInstantArithmeticEvaluator.java
+++ 
b/nifi-commons/nifi-expression-language/src/main/java/org/apache/nifi/attribute/expression/language/evaluation/functions/AbstractInstantArithmeticEvaluator.java
@@ -49,8 +49,7 @@ abstract class AbstractInstantArithmeticEvaluator extends 
InstantEvaluator {
         this.subject = subject;
         this.amountEvaluator = amountEvaluator;
         if (amountEvaluator instanceof StringLiteralEvaluator) {
-            DateAmountParser.validate(
-                    ((StringLiteralEvaluator) 
amountEvaluator).evaluate(null).getValue());
+            
DateAmountParser.validate(amountEvaluator.evaluate(null).getValue());
         }
     }
 
diff --git 
a/nifi-commons/nifi-expression-language/src/main/java/org/apache/nifi/attribute/expression/language/evaluation/reduce/CountEvaluator.java
 
b/nifi-commons/nifi-expression-language/src/main/java/org/apache/nifi/attribute/expression/language/evaluation/reduce/CountEvaluator.java
index 37a745108de..83ff78c166d 100644
--- 
a/nifi-commons/nifi-expression-language/src/main/java/org/apache/nifi/attribute/expression/language/evaluation/reduce/CountEvaluator.java
+++ 
b/nifi-commons/nifi-expression-language/src/main/java/org/apache/nifi/attribute/expression/language/evaluation/reduce/CountEvaluator.java
@@ -42,7 +42,7 @@ public class CountEvaluator extends WholeNumberEvaluator 
implements ReduceEvalua
             return new WholeNumberQueryResult(count);
         }
 
-        if (result.getResultType() == ResultType.BOOLEAN && ((Boolean) 
result.getValue()).equals(Boolean.FALSE)) {
+        if (result.getResultType() == ResultType.BOOLEAN && 
result.getValue().equals(Boolean.FALSE)) {
             return new WholeNumberQueryResult(count);
         }
 
diff --git 
a/nifi-commons/nifi-flowfile-packager/src/main/java/org/apache/nifi/util/FlowFileUnpackagerV2.java
 
b/nifi-commons/nifi-flowfile-packager/src/main/java/org/apache/nifi/util/FlowFileUnpackagerV2.java
index 380cf7420a9..673ff46f29c 100644
--- 
a/nifi-commons/nifi-flowfile-packager/src/main/java/org/apache/nifi/util/FlowFileUnpackagerV2.java
+++ 
b/nifi-commons/nifi-flowfile-packager/src/main/java/org/apache/nifi/util/FlowFileUnpackagerV2.java
@@ -107,6 +107,7 @@ public class FlowFileUnpackagerV2 implements 
FlowFileUnpackager {
         return totalBytesRead;
     }
 
+    @SuppressWarnings("PMD.UnnecessaryCast")
     protected long readLong(final InputStream in) throws IOException {
         fillBuffer(in, readBuffer, 8);
         return (((long) readBuffer[0] << 56)
diff --git 
a/nifi-commons/nifi-flowfile-packager/src/main/java/org/apache/nifi/util/FlowFileUnpackagerV3.java
 
b/nifi-commons/nifi-flowfile-packager/src/main/java/org/apache/nifi/util/FlowFileUnpackagerV3.java
index 2ada4432fcd..28561986fef 100644
--- 
a/nifi-commons/nifi-flowfile-packager/src/main/java/org/apache/nifi/util/FlowFileUnpackagerV3.java
+++ 
b/nifi-commons/nifi-flowfile-packager/src/main/java/org/apache/nifi/util/FlowFileUnpackagerV3.java
@@ -124,6 +124,7 @@ public class FlowFileUnpackagerV3 implements 
FlowFileUnpackager {
         return totalBytesRead;
     }
 
+    @SuppressWarnings("PMD.UnnecessaryCast")
     protected long readLong(final InputStream in) throws IOException {
         fillBuffer(in, readBuffer, 8);
         return (((long) readBuffer[0] << 56)
diff --git 
a/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/filter/ContainsRegex.java
 
b/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/filter/ContainsRegex.java
index fcdbed24952..c460e8623af 100644
--- 
a/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/filter/ContainsRegex.java
+++ 
b/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/filter/ContainsRegex.java
@@ -37,9 +37,9 @@ public class ContainsRegex extends FunctionFilter {
         this.regexPath = regexPath;
 
         if (regexPath instanceof LiteralValuePath) {
-            final FieldValue fieldValue = ((LiteralValuePath) 
regexPath).evaluate((RecordPathEvaluationContext) null).findFirst().get();
+            final FieldValue fieldValue = 
regexPath.evaluate((RecordPathEvaluationContext) null).findFirst().get();
             final Object value = fieldValue.getValue();
-            final String regex = DataTypeUtils.toString(value, (String) null);
+            final String regex = DataTypeUtils.toString(value, null);
             compiledPattern = Pattern.compile(regex);
         } else {
             compiledPattern = null;
@@ -60,13 +60,13 @@ public class ContainsRegex extends FunctionFilter {
                 return false;
             }
 
-            final String regex = DataTypeUtils.toString(value, (String) null);
+            final String regex = DataTypeUtils.toString(value, null);
             pattern = Pattern.compile(regex);
         } else {
             pattern = compiledPattern;
         }
 
-        final String searchString = 
DataTypeUtils.toString(fieldValue.getValue(), (String) null);
+        final String searchString = 
DataTypeUtils.toString(fieldValue.getValue(), null);
         if (searchString == null) {
             return false;
         }
diff --git 
a/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/filter/IsBlank.java
 
b/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/filter/IsBlank.java
index 1cd1b9f9ac2..271fdf4c1a3 100644
--- 
a/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/filter/IsBlank.java
+++ 
b/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/filter/IsBlank.java
@@ -30,7 +30,7 @@ public class IsBlank extends FunctionFilter {
 
     @Override
     protected boolean test(final FieldValue fieldValue, final 
RecordPathEvaluationContext context) {
-        final String fieldVal = DataTypeUtils.toString(fieldValue.getValue(), 
(String) null);
+        final String fieldVal = DataTypeUtils.toString(fieldValue.getValue(), 
null);
         if (fieldVal == null) {
             return true;
         }
diff --git 
a/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/filter/IsEmpty.java
 
b/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/filter/IsEmpty.java
index 823d2b3264f..fe39fb08c74 100644
--- 
a/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/filter/IsEmpty.java
+++ 
b/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/filter/IsEmpty.java
@@ -30,7 +30,7 @@ public class IsEmpty extends FunctionFilter {
 
     @Override
     protected boolean test(final FieldValue fieldValue, final 
RecordPathEvaluationContext context) {
-        final String fieldVal = DataTypeUtils.toString(fieldValue.getValue(), 
(String) null);
+        final String fieldVal = DataTypeUtils.toString(fieldValue.getValue(), 
null);
         if (fieldVal == null) {
             return true;
         }
diff --git 
a/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/filter/MatchesRegex.java
 
b/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/filter/MatchesRegex.java
index 5cb0196aae5..cb7475090db 100644
--- 
a/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/filter/MatchesRegex.java
+++ 
b/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/filter/MatchesRegex.java
@@ -37,9 +37,9 @@ public class MatchesRegex extends FunctionFilter {
         this.regexPath = regexPath;
 
         if (regexPath instanceof LiteralValuePath) {
-            final FieldValue fieldValue = ((LiteralValuePath) 
regexPath).evaluate((RecordPathEvaluationContext) null).findFirst().get();
+            final FieldValue fieldValue = 
regexPath.evaluate((RecordPathEvaluationContext) null).findFirst().get();
             final Object value = fieldValue.getValue();
-            final String regex = DataTypeUtils.toString(value, (String) null);
+            final String regex = DataTypeUtils.toString(value, null);
             compiledPattern = Pattern.compile(regex);
         } else {
             compiledPattern = null;
@@ -60,13 +60,13 @@ public class MatchesRegex extends FunctionFilter {
                 return false;
             }
 
-            final String regex = DataTypeUtils.toString(value, (String) null);
+            final String regex = DataTypeUtils.toString(value, null);
             pattern = Pattern.compile(regex);
         } else {
             pattern = compiledPattern;
         }
 
-        final String searchString = 
DataTypeUtils.toString(fieldValue.getValue(), (String) null);
+        final String searchString = 
DataTypeUtils.toString(fieldValue.getValue(), null);
         if (searchString == null) {
             return false;
         }
diff --git 
a/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/filter/StringComparisonFilter.java
 
b/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/filter/StringComparisonFilter.java
index 94558fc82b4..e7fd499a310 100644
--- 
a/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/filter/StringComparisonFilter.java
+++ 
b/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/filter/StringComparisonFilter.java
@@ -35,7 +35,7 @@ public abstract class StringComparisonFilter extends 
FunctionFilter {
 
     @Override
     protected boolean test(final FieldValue fieldValue, final 
RecordPathEvaluationContext context) {
-        final String fieldVal = DataTypeUtils.toString(fieldValue.getValue(), 
(String) null);
+        final String fieldVal = DataTypeUtils.toString(fieldValue.getValue(), 
null);
         if (fieldVal == null) {
             return false;
         }
@@ -45,7 +45,7 @@ public abstract class StringComparisonFilter extends 
FunctionFilter {
             return false;
         }
 
-        final String searchValue = 
DataTypeUtils.toString(firstValue.get().getValue(), (String) null);
+        final String searchValue = 
DataTypeUtils.toString(firstValue.get().getValue(), null);
         if (searchValue == null) {
             return false;
         }
diff --git 
a/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/functions/Concat.java
 
b/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/functions/Concat.java
index 1bea4f5c263..ab98c5e2a07 100644
--- 
a/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/functions/Concat.java
+++ 
b/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/functions/Concat.java
@@ -45,7 +45,7 @@ public class Concat extends RecordPathSegment {
         }
 
         final StringBuilder sb = new StringBuilder();
-        concatenated.forEach(fv -> 
sb.append(DataTypeUtils.toString(fv.getValue(), (String) null)));
+        concatenated.forEach(fv -> 
sb.append(DataTypeUtils.toString(fv.getValue(), null)));
 
         final RecordField field = new RecordField("concat", 
RecordFieldType.STRING.getDataType());
         final FieldValue responseValue = new StandardFieldValue(sb.toString(), 
field, null);
diff --git 
a/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/functions/Hash.java
 
b/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/functions/Hash.java
index 806367450c1..6457750bb2d 100644
--- 
a/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/functions/Hash.java
+++ 
b/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/functions/Hash.java
@@ -55,7 +55,7 @@ public class Hash extends RecordPathSegment {
                 }
 
                 final MessageDigest digest = getDigest(algorithmValue);
-                final String value = DataTypeUtils.toString(fv.getValue(), 
(String) null);
+                final String value = DataTypeUtils.toString(fv.getValue(), 
null);
                 String encoded = new DigestUtils(digest).digestAsHex(value);
                 return new StandardFieldValue(encoded, fv.getField(), 
fv.getParent().orElse(null));
             });
diff --git 
a/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/functions/NoArgStringFunction.java
 
b/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/functions/NoArgStringFunction.java
index 8cb801e1a54..83b645cd1ac 100644
--- 
a/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/functions/NoArgStringFunction.java
+++ 
b/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/functions/NoArgStringFunction.java
@@ -39,7 +39,7 @@ public abstract class NoArgStringFunction extends 
RecordPathSegment {
     @Override
     public Stream<FieldValue> evaluate(RecordPathEvaluationContext context) {
         return valuePath.evaluate(context).map(fv -> {
-            final String original = fv.getValue() == null ? "" : 
DataTypeUtils.toString(fv.getValue(), (String) null);
+            final String original = fv.getValue() == null ? "" : 
DataTypeUtils.toString(fv.getValue(), null);
             final String processed = apply(original);
             return new StandardFieldValue(processed, fv.getField(), 
fv.getParent().orElse(null));
         });
diff --git 
a/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/functions/Padding.java
 
b/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/functions/Padding.java
index d2a8321cf64..85dba9a4eeb 100644
--- 
a/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/functions/Padding.java
+++ 
b/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/functions/Padding.java
@@ -63,7 +63,7 @@ abstract class Padding extends RecordPathSegment {
             }
 
             int desiredLength = desiredLengthOpt.getAsInt();
-            final String value = DataTypeUtils.toString(fv.getValue(), 
(String) null);
+            final String value = DataTypeUtils.toString(fv.getValue(), null);
             return new StandardFieldValue(doPad(value, desiredLength, pad), 
fv.getField(), fv.getParent().orElse(null));
         });
     }
diff --git 
a/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/functions/Replace.java
 
b/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/functions/Replace.java
index 8b6017c3156..99060af6f3e 100644
--- 
a/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/functions/Replace.java
+++ 
b/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/functions/Replace.java
@@ -55,7 +55,7 @@ public class Replace extends RecordPathSegment {
                     return fv;
                 }
 
-                final String value = DataTypeUtils.toString(fv.getValue(), 
(String) null);
+                final String value = DataTypeUtils.toString(fv.getValue(), 
null);
                 final String replaced = value.replace(searchValue, 
replacementValue);
                 return new StandardFieldValue(replaced, fv.getField(), 
fv.getParent().orElse(null));
             });
diff --git 
a/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/functions/ReplaceRegex.java
 
b/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/functions/ReplaceRegex.java
index 0df055c2b69..0967be4a5d6 100644
--- 
a/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/functions/ReplaceRegex.java
+++ 
b/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/functions/ReplaceRegex.java
@@ -43,9 +43,9 @@ public class ReplaceRegex extends RecordPathSegment {
         this.recordPath = recordPath;
         this.searchValuePath = searchValue;
         if (searchValue instanceof LiteralValuePath) {
-            final FieldValue fieldValue = ((LiteralValuePath) 
searchValue).evaluate((RecordPathEvaluationContext) null).findFirst().get();
+            final FieldValue fieldValue = 
searchValue.evaluate((RecordPathEvaluationContext) null).findFirst().get();
             final Object value = fieldValue.getValue();
-            final String regex = DataTypeUtils.toString(value, (String) null);
+            final String regex = DataTypeUtils.toString(value, null);
             compiledPattern = Pattern.compile(regex);
         } else {
             compiledPattern = null;
@@ -59,7 +59,7 @@ public class ReplaceRegex extends RecordPathSegment {
         final Stream<FieldValue> fieldValues = recordPath.evaluate(context);
         return fieldValues.filter(fv -> fv.getValue() != null)
             .map(fv -> {
-                final String value = DataTypeUtils.toString(fv.getValue(), 
(String) null);
+                final String value = DataTypeUtils.toString(fv.getValue(), 
null);
 
                 // Determine the Replacement Value
                 final String replacementValue = 
RecordPathUtils.getFirstStringValue(replacementValuePath, context);
@@ -79,7 +79,7 @@ public class ReplaceRegex extends RecordPathSegment {
                         return fv;
                     }
 
-                    final String regex = DataTypeUtils.toString(fieldValue, 
(String) null);
+                    final String regex = DataTypeUtils.toString(fieldValue, 
null);
                     pattern = Pattern.compile(regex);
                 } else {
                     pattern = compiledPattern;
diff --git 
a/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/functions/Substring.java
 
b/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/functions/Substring.java
index 7dd82f76c7b..dc95919de24 100644
--- 
a/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/functions/Substring.java
+++ 
b/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/functions/Substring.java
@@ -59,7 +59,7 @@ public class Substring extends RecordPathSegment {
                 final int start = startIndex.getAsInt();
                 final int end = endIndex.getAsInt();
 
-                final String value = DataTypeUtils.toString(fv.getValue(), 
(String) null);
+                final String value = DataTypeUtils.toString(fv.getValue(), 
null);
 
                 // Allow for negative indices to be used to reference offset 
from string length. We add 1 here because we want -1 to refer
                 // to the actual length of the string.
diff --git 
a/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/functions/SubstringAfter.java
 
b/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/functions/SubstringAfter.java
index c1001dee3b7..da6771adbda 100644
--- 
a/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/functions/SubstringAfter.java
+++ 
b/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/functions/SubstringAfter.java
@@ -48,7 +48,7 @@ public class SubstringAfter extends RecordPathSegment {
                     return fv;
                 }
 
-                final String value = DataTypeUtils.toString(fv.getValue(), 
(String) null);
+                final String value = DataTypeUtils.toString(fv.getValue(), 
null);
                 final int index = value.indexOf(searchValue);
                 if (index < 0) {
                     return fv;
diff --git 
a/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/functions/SubstringAfterLast.java
 
b/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/functions/SubstringAfterLast.java
index ce7fcce41b0..86c99102297 100644
--- 
a/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/functions/SubstringAfterLast.java
+++ 
b/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/functions/SubstringAfterLast.java
@@ -48,7 +48,7 @@ public class SubstringAfterLast extends RecordPathSegment {
                     return fv;
                 }
 
-                final String value = DataTypeUtils.toString(fv.getValue(), 
(String) null);
+                final String value = DataTypeUtils.toString(fv.getValue(), 
null);
                 final int index = value.lastIndexOf(searchValue);
                 if (index < 0) {
                     return fv;
diff --git 
a/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/functions/SubstringBefore.java
 
b/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/functions/SubstringBefore.java
index aa460bc0d88..de2170826df 100644
--- 
a/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/functions/SubstringBefore.java
+++ 
b/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/functions/SubstringBefore.java
@@ -48,7 +48,7 @@ public class SubstringBefore extends RecordPathSegment {
                     return fv;
                 }
 
-                final String value = DataTypeUtils.toString(fv.getValue(), 
(String) null);
+                final String value = DataTypeUtils.toString(fv.getValue(), 
null);
                 final int index = value.indexOf(searchValue);
                 if (index < 0) {
                     return fv;
diff --git 
a/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/functions/SubstringBeforeLast.java
 
b/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/functions/SubstringBeforeLast.java
index 8edb5a47684..dee8249ab4b 100644
--- 
a/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/functions/SubstringBeforeLast.java
+++ 
b/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/functions/SubstringBeforeLast.java
@@ -48,7 +48,7 @@ public class SubstringBeforeLast extends RecordPathSegment {
                     return fv;
                 }
 
-                final String value = DataTypeUtils.toString(fv.getValue(), 
(String) null);
+                final String value = DataTypeUtils.toString(fv.getValue(), 
null);
                 final int index = value.lastIndexOf(searchValue);
                 if (index < 0) {
                     return fv;
diff --git 
a/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/functions/ToString.java
 
b/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/functions/ToString.java
index a3a57044d96..e9077a856c2 100644
--- 
a/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/functions/ToString.java
+++ 
b/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/functions/ToString.java
@@ -62,7 +62,7 @@ public class ToString extends RecordPathSegment {
                     } else if (!(fv.getValue() instanceof byte[])) {
                         stringValue = fv.getValue().toString();
                     } else {
-                        stringValue = DataTypeUtils.toString(fv.getValue(), 
(String) null, charset);
+                        stringValue = DataTypeUtils.toString(fv.getValue(), 
null, charset);
                     }
                     final RecordField originalField = fv.getField();
                     final RecordField stringField;
diff --git 
a/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/util/RecordPathUtils.java
 
b/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/util/RecordPathUtils.java
index 818dbafa1d6..e60061eeac4 100644
--- 
a/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/util/RecordPathUtils.java
+++ 
b/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/util/RecordPathUtils.java
@@ -32,7 +32,7 @@ public class RecordPathUtils {
             return null;
         }
 
-        final String stringValue = 
DataTypeUtils.toString(stringFieldValue.get().getValue(), (String) null);
+        final String stringValue = 
DataTypeUtils.toString(stringFieldValue.get().getValue(), null);
         if (stringValue == null) {
             return null;
         }
diff --git 
a/nifi-commons/nifi-record-path/src/test/java/org/apache/nifi/record/path/TestRecordPath.java
 
b/nifi-commons/nifi-record-path/src/test/java/org/apache/nifi/record/path/TestRecordPath.java
index 18a1d576ec8..785b24014d5 100644
--- 
a/nifi-commons/nifi-record-path/src/test/java/org/apache/nifi/record/path/TestRecordPath.java
+++ 
b/nifi-commons/nifi-record-path/src/test/java/org/apache/nifi/record/path/TestRecordPath.java
@@ -648,8 +648,8 @@ public class TestRecordPath {
                     List.of(
                             1234567890L,
                             0L,
-                            ((long) Integer.MAX_VALUE) + 1L,
-                            ((long) Integer.MIN_VALUE) - 1L,
+                            Integer.MAX_VALUE + 1L,
+                            Integer.MIN_VALUE - 1L,
                             Long.MIN_VALUE,
                             Long.MAX_VALUE
 
diff --git 
a/nifi-commons/nifi-record/src/test/java/org/apache/nifi/serialization/record/TestDataTypeUtils.java
 
b/nifi-commons/nifi-record/src/test/java/org/apache/nifi/serialization/record/TestDataTypeUtils.java
index e6cbc557faf..ab5624e392a 100644
--- 
a/nifi-commons/nifi-record/src/test/java/org/apache/nifi/serialization/record/TestDataTypeUtils.java
+++ 
b/nifi-commons/nifi-record/src/test/java/org/apache/nifi/serialization/record/TestDataTypeUtils.java
@@ -498,11 +498,11 @@ public class TestDataTypeUtils {
         assertInstanceOf(Byte[].class, bytes);
         assertNotNull(bytes);
         Byte[] b = (Byte[]) bytes;
-        assertEquals((long) 72, (long) b[0], "Conversion from String to byte[] 
failed");  // H
-        assertEquals((long) 101, (long) b[1], "Conversion from String to 
byte[] failed"); // e
-        assertEquals((long) 108, (long) b[2], "Conversion from String to 
byte[] failed"); // l
-        assertEquals((long) 108, (long) b[3], "Conversion from String to 
byte[] failed"); // l
-        assertEquals((long) 111, (long) b[4], "Conversion from String to 
byte[] failed"); // o
+        assertEquals(72, (long) b[0], "Conversion from String to byte[] 
failed");  // H
+        assertEquals(101, (long) b[1], "Conversion from String to byte[] 
failed"); // e
+        assertEquals(108, (long) b[2], "Conversion from String to byte[] 
failed"); // l
+        assertEquals(108, (long) b[3], "Conversion from String to byte[] 
failed"); // l
+        assertEquals(111, (long) b[4], "Conversion from String to byte[] 
failed"); // o
     }
 
     @Test
diff --git 
a/nifi-commons/nifi-record/src/test/java/org/apache/nifi/serialization/record/field/TestObjectLocalDateTimeFieldConverter.java
 
b/nifi-commons/nifi-record/src/test/java/org/apache/nifi/serialization/record/field/TestObjectLocalDateTimeFieldConverter.java
index b923c9d8771..00c206e7bcd 100644
--- 
a/nifi-commons/nifi-record/src/test/java/org/apache/nifi/serialization/record/field/TestObjectLocalDateTimeFieldConverter.java
+++ 
b/nifi-commons/nifi-record/src/test/java/org/apache/nifi/serialization/record/field/TestObjectLocalDateTimeFieldConverter.java
@@ -34,7 +34,7 @@ public class TestObjectLocalDateTimeFieldConverter {
     private static final long MILLIS_TIMESTAMP_LONG = 1707238288351L;
     private static final long MICROS_TIMESTAMP_LONG = 1707238288351567L;
     private static final String MICROS_TIMESTAMP_STRING = 
Long.toString(MICROS_TIMESTAMP_LONG);
-    private static final double MICROS_TIMESTAMP_DOUBLE = ((double) 
MICROS_TIMESTAMP_LONG) / 1000000D;
+    private static final double MICROS_TIMESTAMP_DOUBLE = 
MICROS_TIMESTAMP_LONG / 1000000D;
     private static final long NANOS_AFTER_SECOND = 351567000L;
     private static final Instant INSTANT_MILLIS_PRECISION = 
Instant.ofEpochMilli(MILLIS_TIMESTAMP_LONG);
     // Create an instant to represent the same time as the microsecond 
precision timestamp. We add nanoseconds after second but then have to subtract 
the milliseconds after the second that are already
diff --git 
a/nifi-commons/nifi-utils/src/main/java/org/apache/nifi/util/StopWatch.java 
b/nifi-commons/nifi-utils/src/main/java/org/apache/nifi/util/StopWatch.java
index cffe49ced72..07544f2b5e0 100644
--- a/nifi-commons/nifi-utils/src/main/java/org/apache/nifi/util/StopWatch.java
+++ b/nifi-commons/nifi-utils/src/main/java/org/apache/nifi/util/StopWatch.java
@@ -78,7 +78,7 @@ public final class StopWatch {
     }
 
     public String calculateDataRate(final long bytes) {
-        final double seconds = (double) duration / 1000000000.0D;
+        final double seconds = duration / 1000000000.0D;
         final long dataSize = (long) (bytes / seconds);
         return FormatUtils.formatDataSize(dataSize) + "/sec";
     }
diff --git 
a/nifi-extension-bundles/nifi-aws-bundle/nifi-aws-parameter-providers/src/test/java/org/apache/nifi/parameter/aws/TestAwsSecretsManagerParameterProvider.java
 
b/nifi-extension-bundles/nifi-aws-bundle/nifi-aws-parameter-providers/src/test/java/org/apache/nifi/parameter/aws/TestAwsSecretsManagerParameterProvider.java
index e5ffa279a8c..f5cc0c8cd37 100644
--- 
a/nifi-extension-bundles/nifi-aws-bundle/nifi-aws-parameter-providers/src/test/java/org/apache/nifi/parameter/aws/TestAwsSecretsManagerParameterProvider.java
+++ 
b/nifi-extension-bundles/nifi-aws-bundle/nifi-aws-parameter-providers/src/test/java/org/apache/nifi/parameter/aws/TestAwsSecretsManagerParameterProvider.java
@@ -23,7 +23,6 @@ import org.apache.nifi.components.PropertyDescriptor;
 import org.apache.nifi.parameter.Parameter;
 import org.apache.nifi.parameter.ParameterGroup;
 import org.apache.nifi.parameter.ParameterTag;
-import org.apache.nifi.parameter.VerifiableParameterProvider;
 import org.apache.nifi.reporting.InitializationException;
 import org.apache.nifi.util.MockComponentLog;
 import org.apache.nifi.util.MockConfigurationContext;
@@ -463,7 +462,7 @@ public class TestAwsSecretsManagerParameterProvider {
         }
 
         // Verify config verification
-        final List<ConfigVerificationResult> results = 
((VerifiableParameterProvider) 
parameterProvider).verify(mockConfigurationContext, initContext.getLogger());
+        final List<ConfigVerificationResult> results = 
parameterProvider.verify(mockConfigurationContext, initContext.getLogger());
 
         assertEquals(1, results.size());
         assertEquals(expectedOutcome, results.get(0).getOutcome());
diff --git 
a/nifi-extension-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/dynamodb/RecordToItemConverter.java
 
b/nifi-extension-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/dynamodb/RecordToItemConverter.java
index a76d7bc28e4..87ba47d24e1 100644
--- 
a/nifi-extension-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/dynamodb/RecordToItemConverter.java
+++ 
b/nifi-extension-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/dynamodb/RecordToItemConverter.java
@@ -64,7 +64,7 @@ final class RecordToItemConverter {
             case DOUBLE:
             case BIGINT:
             case DECIMAL:
-                builder.n(DataTypeUtils.toString(object, (String) null));
+                builder.n(DataTypeUtils.toString(object, null));
                 break;
             case ARRAY:
                 final List<AttributeValue> list = 
Arrays.stream(DataTypeUtils.toArray(object, null, null))
@@ -88,7 +88,7 @@ final class RecordToItemConverter {
             case STRING:
             case CHOICE: // No similar data type is supported by DynamoDB
             default:
-                builder.s(DataTypeUtils.toString(object, (String) null));
+                builder.s(DataTypeUtils.toString(object, null));
         }
         return builder.build();
     }
diff --git 
a/nifi-extension-bundles/nifi-azure-bundle/nifi-azure-parameter-providers/src/test/java/org/apache/nifi/parameter/azure/TestAzureKeyVaultSecretsParameterProvider.java
 
b/nifi-extension-bundles/nifi-azure-bundle/nifi-azure-parameter-providers/src/test/java/org/apache/nifi/parameter/azure/TestAzureKeyVaultSecretsParameterProvider.java
index 2acd3d3b5b3..f57878952f5 100644
--- 
a/nifi-extension-bundles/nifi-azure-bundle/nifi-azure-parameter-providers/src/test/java/org/apache/nifi/parameter/azure/TestAzureKeyVaultSecretsParameterProvider.java
+++ 
b/nifi-extension-bundles/nifi-azure-bundle/nifi-azure-parameter-providers/src/test/java/org/apache/nifi/parameter/azure/TestAzureKeyVaultSecretsParameterProvider.java
@@ -25,7 +25,6 @@ import org.apache.nifi.components.ConfigVerificationResult;
 import org.apache.nifi.components.PropertyDescriptor;
 import org.apache.nifi.parameter.Parameter;
 import org.apache.nifi.parameter.ParameterGroup;
-import org.apache.nifi.parameter.VerifiableParameterProvider;
 import org.apache.nifi.reporting.InitializationException;
 import org.apache.nifi.util.MockComponentLog;
 import org.apache.nifi.util.MockConfigurationContext;
@@ -206,7 +205,7 @@ public class TestAzureKeyVaultSecretsParameterProvider {
         }
 
         // Verify config verification
-        final List<ConfigVerificationResult> results = 
((VerifiableParameterProvider) 
parameterProvider).verify(mockConfigurationContext, initContext.getLogger());
+        final List<ConfigVerificationResult> results = 
parameterProvider.verify(mockConfigurationContext, initContext.getLogger());
 
         assertEquals(1, results.size());
         assertEquals(expectedOutcome, results.getFirst().getOutcome());
diff --git 
a/nifi-extension-bundles/nifi-azure-bundle/nifi-azure-reporting-task/src/main/java/org/apache/nifi/reporting/azure/loganalytics/Metric.java
 
b/nifi-extension-bundles/nifi-azure-bundle/nifi-azure-reporting-task/src/main/java/org/apache/nifi/reporting/azure/loganalytics/Metric.java
index 5ea2e54b1f7..17b6911ab50 100644
--- 
a/nifi-extension-bundles/nifi-azure-bundle/nifi-azure-reporting-task/src/main/java/org/apache/nifi/reporting/azure/loganalytics/Metric.java
+++ 
b/nifi-extension-bundles/nifi-azure-bundle/nifi-azure-reporting-task/src/main/java/org/apache/nifi/reporting/azure/loganalytics/Metric.java
@@ -41,7 +41,7 @@ public class Metric {
     }
 
     public void setCount(long value) {
-        this.count = (long) value;
+        this.count = value;
     }
     public void setCount(double value) {
         this.count = (long) value;
diff --git 
a/nifi-extension-bundles/nifi-evtx-bundle/nifi-evtx-processors/src/test/java/org/apache/nifi/processors/evtx/parser/bxml/AttributeNodeTest.java
 
b/nifi-extension-bundles/nifi-evtx-bundle/nifi-evtx-processors/src/test/java/org/apache/nifi/processors/evtx/parser/bxml/AttributeNodeTest.java
index 8876c671f67..db978bfbda4 100644
--- 
a/nifi-extension-bundles/nifi-evtx-bundle/nifi-evtx-processors/src/test/java/org/apache/nifi/processors/evtx/parser/bxml/AttributeNodeTest.java
+++ 
b/nifi-extension-bundles/nifi-evtx-bundle/nifi-evtx-processors/src/test/java/org/apache/nifi/processors/evtx/parser/bxml/AttributeNodeTest.java
@@ -59,7 +59,7 @@ public class AttributeNodeTest extends 
BxmlNodeWithTokenAndStringTestBase {
         assertEquals(ATTRIBUTE_NAME, attributeNode.getAttributeName());
         BxmlNode attributeNodeValue = attributeNode.getValue();
         assertInstanceOf(ValueNode.class, attributeNodeValue);
-        List<BxmlNode> children = ((ValueNode) 
attributeNodeValue).getChildren();
+        List<BxmlNode> children = attributeNodeValue.getChildren();
         assertEquals(1, children.size());
         assertInstanceOf(NullTypeNode.class, children.get(0));
     }
diff --git 
a/nifi-extension-bundles/nifi-extension-utils/nifi-record-utils/nifi-avro-record-utils/src/main/java/org/apache/nifi/avro/AvroTypeUtil.java
 
b/nifi-extension-bundles/nifi-extension-utils/nifi-record-utils/nifi-avro-record-utils/src/main/java/org/apache/nifi/avro/AvroTypeUtil.java
index 959c9862935..b877d3ac045 100644
--- 
a/nifi-extension-bundles/nifi-extension-utils/nifi-record-utils/nifi-avro-record-utils/src/main/java/org/apache/nifi/avro/AvroTypeUtil.java
+++ 
b/nifi-extension-bundles/nifi-extension-utils/nifi-record-utils/nifi-avro-record-utils/src/main/java/org/apache/nifi/avro/AvroTypeUtil.java
@@ -930,7 +930,7 @@ public class AvroTypeUtil {
                     return rawValue;
                 }
 
-                return DataTypeUtils.toString(rawValue, (String) null, 
charset);
+                return DataTypeUtils.toString(rawValue, null, charset);
         }
 
         return rawValue;
diff --git 
a/nifi-extension-bundles/nifi-extension-utils/nifi-record-utils/nifi-avro-record-utils/src/test/java/org/apache/nifi/avro/TestAvroTypeUtil.java
 
b/nifi-extension-bundles/nifi-extension-utils/nifi-record-utils/nifi-avro-record-utils/src/test/java/org/apache/nifi/avro/TestAvroTypeUtil.java
index 70658d59ee5..c340b5a9391 100644
--- 
a/nifi-extension-bundles/nifi-extension-utils/nifi-record-utils/nifi-avro-record-utils/src/test/java/org/apache/nifi/avro/TestAvroTypeUtil.java
+++ 
b/nifi-extension-bundles/nifi-extension-utils/nifi-record-utils/nifi-avro-record-utils/src/test/java/org/apache/nifi/avro/TestAvroTypeUtil.java
@@ -612,7 +612,7 @@ public class TestAvroTypeUtil {
         decimalType.addToSchema(fieldSchema);
 
         // Create a field named "amount" using the field schema above
-        final Schema.Field field = new Schema.Field("amount", fieldSchema, 
null, (Object) null);
+        final Schema.Field field = new Schema.Field("amount", fieldSchema, 
null, null);
 
         // Create an overall record schema with the amount field
         final Schema avroSchema = Schema.createRecord(null, null, null, false, 
Collections.singletonList(field));
@@ -634,7 +634,7 @@ public class TestAvroTypeUtil {
         decimalType.addToSchema(fieldSchema);
 
         // Create a field named "amount" using the field schema above
-        final Schema.Field field = new Schema.Field("amount", fieldSchema, 
null, (Object) null);
+        final Schema.Field field = new Schema.Field("amount", fieldSchema, 
null, null);
 
         // Create an overall record schema with the amount field
         final Schema avroSchema = Schema.createRecord(null, null, null, false, 
Collections.singletonList(field));
@@ -955,7 +955,7 @@ public class TestAvroTypeUtil {
         Schema avroRecordSchema = Schema.createRecord(
                 "record", "doc", "namespace", false,
                 Arrays.asList(
-                        new Field("nullableMapField", 
nullableMapFieldAvroSchema, "nullable map field", (Object) null)
+                        new Field("nullableMapField", 
nullableMapFieldAvroSchema, "nullable map field", null)
                 )
         );
 
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 7dc2894deea..57a06e423b1 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
@@ -29,7 +29,6 @@ import org.apache.nifi.components.ConfigVerificationResult;
 import org.apache.nifi.components.PropertyDescriptor;
 import org.apache.nifi.parameter.Parameter;
 import org.apache.nifi.parameter.ParameterGroup;
-import org.apache.nifi.parameter.VerifiableParameterProvider;
 import org.apache.nifi.reporting.InitializationException;
 import org.apache.nifi.util.MockComponentLog;
 import org.apache.nifi.util.MockConfigurationContext;
@@ -192,7 +191,7 @@ public class TestGcpSecretManagerParameterProvider {
         }
 
         // Verify config verification
-        final List<ConfigVerificationResult> results = 
((VerifiableParameterProvider) 
parameterProvider).verify(mockConfigurationContext, initContext.getLogger());
+        final List<ConfigVerificationResult> results = 
parameterProvider.verify(mockConfigurationContext, initContext.getLogger());
 
         assertEquals(1, results.size());
         assertEquals(expectedOutcome, results.get(0).getOutcome());
diff --git 
a/nifi-extension-bundles/nifi-groovyx-bundle/nifi-groovyx-processors/src/main/java/org/apache/nifi/processors/groovyx/flow/ProcessSessionWrap.java
 
b/nifi-extension-bundles/nifi-groovyx-bundle/nifi-groovyx-processors/src/main/java/org/apache/nifi/processors/groovyx/flow/ProcessSessionWrap.java
index 3685c0a2b8e..617a24d2f28 100644
--- 
a/nifi-extension-bundles/nifi-groovyx-bundle/nifi-groovyx-processors/src/main/java/org/apache/nifi/processors/groovyx/flow/ProcessSessionWrap.java
+++ 
b/nifi-extension-bundles/nifi-groovyx-bundle/nifi-groovyx-processors/src/main/java/org/apache/nifi/processors/groovyx/flow/ProcessSessionWrap.java
@@ -105,7 +105,7 @@ public abstract class ProcessSessionWrap implements 
ProcessSession {
             return null;
         }
         for (int i = 0; i < ff.size(); i++) {
-            ff.set(i, wrap((FlowFile) ff.get(i)));
+            ff.set(i, wrap(ff.get(i)));
         }
         return ff;
     }
diff --git 
a/nifi-extension-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/main/java/org/apache/nifi/processors/hadoop/FlowFileStreamUnpackerSequenceFileWriter.java
 
b/nifi-extension-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/main/java/org/apache/nifi/processors/hadoop/FlowFileStreamUnpackerSequenceFileWriter.java
index 9ef1b0ef53b..7f599168107 100644
--- 
a/nifi-extension-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/main/java/org/apache/nifi/processors/hadoop/FlowFileStreamUnpackerSequenceFileWriter.java
+++ 
b/nifi-extension-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/main/java/org/apache/nifi/processors/hadoop/FlowFileStreamUnpackerSequenceFileWriter.java
@@ -132,6 +132,7 @@ public class FlowFileStreamUnpackerSequenceFileWriter 
extends SequenceFileWriter
             }
         }
 
+        @SuppressWarnings("PMD.UnnecessaryCast")
         protected long readLong(final InputStream in) throws IOException {
             fillBuffer(in, readBuffer, 8);
             return (((long) readBuffer[0] << 56)
diff --git 
a/nifi-extension-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/test/java/org/apache/nifi/processors/hadoop/util/MockFileSystem.java
 
b/nifi-extension-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/test/java/org/apache/nifi/processors/hadoop/util/MockFileSystem.java
index 2be5492d720..7fd4faa9642 100644
--- 
a/nifi-extension-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/test/java/org/apache/nifi/processors/hadoop/util/MockFileSystem.java
+++ 
b/nifi-extension-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/test/java/org/apache/nifi/processors/hadoop/util/MockFileSystem.java
@@ -245,7 +245,7 @@ public class MockFileSystem extends FileSystem {
     }
 
     public FileStatus newDir(Path p) {
-        return new FileStatus(DIR_LENGTH, true, 3, 128 * 1024 * 1024, 
1523456000000L, 1523457000000L, perms(Integer.decode("0755").shortValue()), 
"owner", "group", (Path) null, p, true, false, false);
+        return new FileStatus(DIR_LENGTH, true, 3, 128 * 1024 * 1024, 
1523456000000L, 1523457000000L, perms(Integer.decode("0755").shortValue()), 
"owner", "group", null, p, true, false, false);
     }
 
     public FileStatus newFile(String p) {
diff --git 
a/nifi-extension-bundles/nifi-hl7-bundle/nifi-hl7-processors/src/main/java/org/apache/nifi/processors/hl7/ExtractHL7Attributes.java
 
b/nifi-extension-bundles/nifi-hl7-bundle/nifi-hl7-processors/src/main/java/org/apache/nifi/processors/hl7/ExtractHL7Attributes.java
index 4e79d1bd5b3..d8059456a76 100644
--- 
a/nifi-extension-bundles/nifi-hl7-bundle/nifi-hl7-processors/src/main/java/org/apache/nifi/processors/hl7/ExtractHL7Attributes.java
+++ 
b/nifi-extension-bundles/nifi-hl7-bundle/nifi-hl7-processors/src/main/java/org/apache/nifi/processors/hl7/ExtractHL7Attributes.java
@@ -31,7 +31,6 @@ import ca.uhn.hl7v2.parser.DefaultEscaping;
 import ca.uhn.hl7v2.parser.EncodingCharacters;
 import ca.uhn.hl7v2.parser.Escaping;
 import ca.uhn.hl7v2.parser.PipeParser;
-import ca.uhn.hl7v2.validation.ValidationContext;
 import ca.uhn.hl7v2.validation.impl.ValidationContextFactory;
 import org.apache.commons.beanutils.PropertyUtils;
 import org.apache.commons.lang3.StringUtils;
@@ -178,7 +177,7 @@ public class ExtractHL7Attributes extends AbstractProcessor 
{
             hapiContext.setModelClassFactory(new 
CanonicalModelClassFactory(inputVersion));
         }
         if (skipValidation) {
-            hapiContext.setValidationContext((ValidationContext) 
ValidationContextFactory.noValidation());
+            
hapiContext.setValidationContext(ValidationContextFactory.noValidation());
         }
 
         final PipeParser parser = hapiContext.getPipeParser();
diff --git 
a/nifi-extension-bundles/nifi-hl7-bundle/nifi-hl7-processors/src/main/java/org/apache/nifi/processors/hl7/RouteHL7.java
 
b/nifi-extension-bundles/nifi-hl7-bundle/nifi-hl7-processors/src/main/java/org/apache/nifi/processors/hl7/RouteHL7.java
index 332677f6abd..d9014a01dd1 100644
--- 
a/nifi-extension-bundles/nifi-hl7-bundle/nifi-hl7-processors/src/main/java/org/apache/nifi/processors/hl7/RouteHL7.java
+++ 
b/nifi-extension-bundles/nifi-hl7-bundle/nifi-hl7-processors/src/main/java/org/apache/nifi/processors/hl7/RouteHL7.java
@@ -156,7 +156,7 @@ public class RouteHL7 extends AbstractProcessor {
 
         @SuppressWarnings("resource")
         final HapiContext hapiContext = new DefaultHapiContext();
-        
hapiContext.setValidationContext((ca.uhn.hl7v2.validation.ValidationContext) 
ValidationContextFactory.noValidation());
+        
hapiContext.setValidationContext(ValidationContextFactory.noValidation());
 
         final PipeParser parser = hapiContext.getPipeParser();
         final String hl7Text = new String(buffer, charset);
diff --git 
a/nifi-extension-bundles/nifi-mongodb-bundle/nifi-mongodb-services/src/test/java/org/apache/nifi/mongodb/MongoDBControllerServiceIT.java
 
b/nifi-extension-bundles/nifi-mongodb-bundle/nifi-mongodb-services/src/test/java/org/apache/nifi/mongodb/MongoDBControllerServiceIT.java
index d19dbd49c5d..7f4b0d521c7 100644
--- 
a/nifi-extension-bundles/nifi-mongodb-bundle/nifi-mongodb-services/src/test/java/org/apache/nifi/mongodb/MongoDBControllerServiceIT.java
+++ 
b/nifi-extension-bundles/nifi-mongodb-bundle/nifi-mongodb-services/src/test/java/org/apache/nifi/mongodb/MongoDBControllerServiceIT.java
@@ -19,7 +19,6 @@ package org.apache.nifi.mongodb;
 
 import org.apache.nifi.components.ConfigVerificationResult;
 import org.apache.nifi.components.PropertyDescriptor;
-import org.apache.nifi.controller.VerifiableControllerService;
 import org.apache.nifi.util.MockConfigurationContext;
 import org.apache.nifi.util.MockControllerServiceLookup;
 import org.apache.nifi.util.NoOpProcessor;
@@ -68,7 +67,7 @@ public class MongoDBControllerServiceIT extends 
AbstractMongoIT {
 
     @Test
     public void testVerifyWithCorrectConnectionString() {
-        final List<ConfigVerificationResult> results = 
((VerifiableControllerService) service).verify(
+        final List<ConfigVerificationResult> results = service.verify(
                 new MockConfigurationContext(service, 
getClientServiceProperties(), 
runner.getProcessContext().getControllerServiceLookup(), null),
                 runner.getLogger(),
                 Collections.emptyMap()
@@ -82,7 +81,7 @@ public class MongoDBControllerServiceIT extends 
AbstractMongoIT {
     public void testVerifyWithIncorrectConnectionString() {
         runner.disableControllerService(service);
         runner.setProperty(service, MongoDBControllerService.URI, 
"mongodb://localhost:2701");
-        final List<ConfigVerificationResult> results = 
((VerifiableControllerService) service).verify(
+        final List<ConfigVerificationResult> results = service.verify(
                 new MockConfigurationContext(service, 
getClientServiceProperties(), 
runner.getProcessContext().getControllerServiceLookup(), null),
                 runner.getLogger(),
                 Collections.emptyMap()
diff --git 
a/nifi-extension-bundles/nifi-network-bundle/nifi-network-processors/src/main/java/org/apache/nifi/processors/network/pcap/ByteBufferReader.java
 
b/nifi-extension-bundles/nifi-network-bundle/nifi-network-processors/src/main/java/org/apache/nifi/processors/network/pcap/ByteBufferReader.java
index bc072128666..9b815cad40c 100644
--- 
a/nifi-extension-bundles/nifi-network-bundle/nifi-network-processors/src/main/java/org/apache/nifi/processors/network/pcap/ByteBufferReader.java
+++ 
b/nifi-extension-bundles/nifi-network-bundle/nifi-network-processors/src/main/java/org/apache/nifi/processors/network/pcap/ByteBufferReader.java
@@ -31,6 +31,7 @@ public class ByteBufferReader {
         return (buffer.getShort() & 0xffff);
     }
 
+    @SuppressWarnings("PMD.UnnecessaryCast")
     public long readU4() {
         return ((long) buffer.getInt() & 0xffffffffL);
     }
diff --git 
a/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ControlRate.java
 
b/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ControlRate.java
index 1b65bf4becf..c8c37287eb8 100644
--- 
a/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ControlRate.java
+++ 
b/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ControlRate.java
@@ -604,7 +604,7 @@ public class ControlRate extends AbstractProcessor {
             if (transferred > maxRateValue) {
                 final long amountOver = transferred - maxRateValue;
                 // determine how long it should take to transfer 'amountOver' 
and 'penalize' the Throttle for that long
-                final double pct = (double) amountOver / (double) maxRateValue;
+                final double pct = (double) amountOver / maxRateValue;
                 this.penalizationPeriod = (long) (timePeriodMillis * pct);
 
                 if (logger.isDebugEnabled()) {
diff --git 
a/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/CountText.java
 
b/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/CountText.java
index f588476c0d6..b919d52901c 100644
--- 
a/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/CountText.java
+++ 
b/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/CountText.java
@@ -256,10 +256,12 @@ public class CountText extends AbstractProcessor {
                 }
 
                 // Update session counters
-                processSession.adjustCounter("Lines Counted", (long) 
lineCount.get(), adjustImmediately);
-                processSession.adjustCounter("Lines (non-empty) Counted", 
(long) lineNonEmptyCount.get(), adjustImmediately);
-                processSession.adjustCounter("Words Counted", (long) 
wordCount.get(), adjustImmediately);
-                processSession.adjustCounter("Characters Counted", (long) 
characterCount.get(), adjustImmediately);
+                // NOTE: Casting is not necessary as the integer returned from 
an AtomicInteger gets
+                // promoted to a long based on the adjustCounter signature.
+                processSession.adjustCounter("Lines Counted", lineCount.get(), 
adjustImmediately);
+                processSession.adjustCounter("Lines (non-empty) Counted", 
lineNonEmptyCount.get(), adjustImmediately);
+                processSession.adjustCounter("Words Counted", wordCount.get(), 
adjustImmediately);
+                processSession.adjustCounter("Characters Counted", 
characterCount.get(), adjustImmediately);
             } catch (IOException e) {
                 error.set(true);
                 getLogger().error("Routing to failure.", e);
diff --git 
a/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/DetectDuplicate.java
 
b/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/DetectDuplicate.java
index 8d87786d743..475d136ba34 100644
--- 
a/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/DetectDuplicate.java
+++ 
b/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/DetectDuplicate.java
@@ -255,6 +255,7 @@ public class DetectDuplicate extends AbstractProcessor {
     private static class CacheValueDeserializer implements 
Deserializer<CacheValue> {
 
         @Override
+        @SuppressWarnings("PMD.UnnecessaryCast")
         public CacheValue deserialize(final byte[] input) throws 
DeserializationException, IOException {
             if (input.length == 0) {
                 return null;
diff --git 
a/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListFile.java
 
b/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListFile.java
index 90d0c4e2aa1..d27fa4ebfa4 100644
--- 
a/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListFile.java
+++ 
b/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListFile.java
@@ -991,7 +991,7 @@ public class ListFile extends 
AbstractListProcessor<FileInfo> {
                 return OperationStatistics.EMPTY;
             }
 
-            double average = (double) sum / (double) count;
+            double average = (double) sum / count;
 
             // Calculate Standard Deviation
             final double stdDeviation = calculateStdDev(average, count, 
operation);
diff --git 
a/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/LookupRecord.java
 
b/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/LookupRecord.java
index 86587208be5..964f2a43f77 100644
--- 
a/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/LookupRecord.java
+++ 
b/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/LookupRecord.java
@@ -643,7 +643,7 @@ public class LookupRecord extends AbstractProcessor {
             final Optional<?> lookupValueCacheOption;
 
             try {
-                lookupValueCacheOption = (Optional<?>) 
cache.get(lookupCoordinates, k -> null);
+                lookupValueCacheOption = cache.get(lookupCoordinates, k -> 
null);
                 if (lookupValueCacheOption == null) {
                     lookupValueOption = 
lookupService.lookup(lookupCoordinates, flowFile.getAttributes());
                 } else {
diff --git 
a/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/RenameRecordField.java
 
b/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/RenameRecordField.java
index d17a55105a7..405e0c9ad81 100644
--- 
a/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/RenameRecordField.java
+++ 
b/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/RenameRecordField.java
@@ -182,7 +182,7 @@ public class RenameRecordField extends 
AbstractRecordProcessor {
                 result.getSelectedFields().forEach(fieldVal -> {
                     fieldVariables.clear();
                     fieldVariables.put(FIELD_NAME, 
fieldVal.getField().getFieldName());
-                    fieldVariables.put(FIELD_VALUE, 
DataTypeUtils.toString(fieldVal.getValue(), (String) null));
+                    fieldVariables.put(FIELD_VALUE, 
DataTypeUtils.toString(fieldVal.getValue(), null));
                     fieldVariables.put(FIELD_TYPE, 
fieldVal.getField().getDataType().getFieldType().name());
                     fieldVariables.put(RECORD_INDEX, String.valueOf(count));
 
diff --git 
a/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/UpdateRecord.java
 
b/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/UpdateRecord.java
index bca81e0ae0a..14f43fc1968 100644
--- 
a/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/UpdateRecord.java
+++ 
b/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/UpdateRecord.java
@@ -246,7 +246,7 @@ public class UpdateRecord extends AbstractRecordProcessor {
                     result.getSelectedFields().forEach(fieldVal -> {
                         fieldVariables.clear();
                         fieldVariables.put(FIELD_NAME, 
fieldVal.getField().getFieldName());
-                        fieldVariables.put(FIELD_VALUE, 
DataTypeUtils.toString(fieldVal.getValue(), (String) null));
+                        fieldVariables.put(FIELD_VALUE, 
DataTypeUtils.toString(fieldVal.getValue(), null));
                         fieldVariables.put(FIELD_TYPE, 
fieldVal.getField().getDataType().getFieldType().name());
                         fieldVariables.put(RECORD_INDEX, 
String.valueOf(count));
 
diff --git 
a/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/calcite/RecordPathFunction.java
 
b/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/calcite/RecordPathFunction.java
index b35270fc747..93a3a95ef77 100644
--- 
a/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/calcite/RecordPathFunction.java
+++ 
b/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/calcite/RecordPathFunction.java
@@ -80,7 +80,7 @@ public class RecordPathFunction {
 
     private <T> T eval(final Record record, final String recordPath, final 
Function<Object, T> transform) {
         final RecordPath compiled = RECORD_PATH_CACHE.getCompiled(recordPath);
-        final RecordPathResult result = compiled.evaluate((Record) record);
+        final RecordPathResult result = compiled.evaluate(record);
 
         return evalResults(result.getSelectedFields(), transform,
             () -> "RecordPath " + recordPath + " evaluated against " + record 
+ " resulted in more than one return value. The RecordPath must be further 
constrained.");
diff --git 
a/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/servlets/ContentAcknowledgmentServlet.java
 
b/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/servlets/ContentAcknowledgmentServlet.java
index cbdf4635d82..93ed8cdd132 100644
--- 
a/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/servlets/ContentAcknowledgmentServlet.java
+++ 
b/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/servlets/ContentAcknowledgmentServlet.java
@@ -107,11 +107,11 @@ public class ContentAcknowledgmentServlet extends 
HttpServlet {
                 totalFlowFileSize += flowFile.getSize();
             }
 
-            double seconds = (double) transferTime / 1000D;
+            double seconds = transferTime / 1000D;
             if (seconds <= 0D) {
                 seconds = .00000001D;
             }
-            final double bytesPerSecond = ((double) totalFlowFileSize / 
seconds);
+            final double bytesPerSecond = (totalFlowFileSize / seconds);
             final String transferRate = 
FormatUtils.formatDataSize(bytesPerSecond) + "/sec";
 
             logger.info("received {} files/{} bytes from Remote Host: [{}] 
Port [{}] SubjectDN [{}] in {} milliseconds at a rate of {}; "
diff --git 
a/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/PutDatabaseRecordIT.java
 
b/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/PutDatabaseRecordIT.java
index efe8466b3d0..34520b1df1c 100644
--- 
a/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/PutDatabaseRecordIT.java
+++ 
b/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/PutDatabaseRecordIT.java
@@ -52,7 +52,7 @@ public class PutDatabaseRecordIT {
     private static final long MILLIS_TIMESTAMP_LONG = 1707238288351L;
     private static final long MICROS_TIMESTAMP_LONG = 1707238288351567L;
     private static final String MICROS_TIMESTAMP_FORMATTED = "2024-02-06 
11:51:28.351567";
-    private static final double MICROS_TIMESTAMP_DOUBLE = ((double) 
MICROS_TIMESTAMP_LONG) / 1000000D;
+    private static final double MICROS_TIMESTAMP_DOUBLE = 
(MICROS_TIMESTAMP_LONG) / 1000000D;
     private static final long NANOS_AFTER_SECOND = 351567000L;
     private static final Instant INSTANT_MICROS_PRECISION = 
Instant.ofEpochMilli(MILLIS_TIMESTAMP_LONG).plusNanos(NANOS_AFTER_SECOND).minusMillis(MILLIS_TIMESTAMP_LONG
 % 1000);
 
diff --git 
a/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-reporting-tasks/src/main/java/org/apache/nifi/controller/MonitorDiskUsage.java
 
b/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-reporting-tasks/src/main/java/org/apache/nifi/controller/MonitorDiskUsage.java
index cb4cc24e98a..e643a0505ab 100644
--- 
a/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-reporting-tasks/src/main/java/org/apache/nifi/controller/MonitorDiskUsage.java
+++ 
b/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-reporting-tasks/src/main/java/org/apache/nifi/controller/MonitorDiskUsage.java
@@ -93,14 +93,14 @@ public class MonitorDiskUsage extends AbstractReportingTask 
{
         final long freeBytes = file.getFreeSpace();
         final long usedBytes = totalBytes - freeBytes;
 
-        final double usedPercent = (double) usedBytes / (double) totalBytes * 
100D;
+        final double usedPercent = (double) usedBytes / totalBytes * 100D;
 
         if (usedPercent >= threshold) {
             final String usedSpace = FormatUtils.formatDataSize(usedBytes);
             final String totalSpace = FormatUtils.formatDataSize(totalBytes);
             final String freeSpace = FormatUtils.formatDataSize(freeBytes);
 
-            final double freePercent = (double) freeBytes / (double) 
totalBytes * 100D;
+            final double freePercent = (double) freeBytes / totalBytes * 100D;
 
             final String message = String.format("%1$s exceeds configured 
threshold of %2$s%%, having %3$s / %4$s (%5$.2f%%) used and %6$s (%7$.2f%%) 
free",
                     pathName, threshold, usedSpace, totalSpace, usedPercent, 
freeSpace, freePercent);
diff --git 
a/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-reporting-tasks/src/main/java/org/apache/nifi/controller/MonitorMemory.java
 
b/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-reporting-tasks/src/main/java/org/apache/nifi/controller/MonitorMemory.java
index 011db622650..d13ad2c8db2 100644
--- 
a/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-reporting-tasks/src/main/java/org/apache/nifi/controller/MonitorMemory.java
+++ 
b/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-reporting-tasks/src/main/java/org/apache/nifi/controller/MonitorMemory.java
@@ -212,7 +212,7 @@ public class MonitorMemory extends AbstractReportingTask {
             return;
         }
 
-        final double percentageUsed = (double) usage.getUsed() / (double) 
usage.getMax() * 100D;
+        final double percentageUsed = (double) usage.getUsed() / 
usage.getMax() * 100D;
         // In certain scenarios in the monitored memory bean the gcSensor can 
get stuck in 'on' state before the usage would reach the threshold
         // and this will cause false exceeded state until the next garbage 
collection. To eliminate this we are adding a condition with the calculated 
usage threshold.
         if (bean.isCollectionUsageThresholdSupported() && 
bean.isCollectionUsageThresholdExceeded() && usage.getUsed() > 
calculatedThreshold) {
diff --git 
a/nifi-extension-bundles/nifi-standard-services/nifi-oauth2-provider-bundle/nifi-oauth2-provider-service/src/test/java/org/apache/nifi/oauth2/StandardOauth2AccessTokenProviderTest.java
 
b/nifi-extension-bundles/nifi-standard-services/nifi-oauth2-provider-bundle/nifi-oauth2-provider-service/src/test/java/org/apache/nifi/oauth2/StandardOauth2AccessTokenProviderTest.java
index 336eb3a6a28..d3fadaff3a9 100644
--- 
a/nifi-extension-bundles/nifi-standard-services/nifi-oauth2-provider-bundle/nifi-oauth2-provider-service/src/test/java/org/apache/nifi/oauth2/StandardOauth2AccessTokenProviderTest.java
+++ 
b/nifi-extension-bundles/nifi-standard-services/nifi-oauth2-provider-bundle/nifi-oauth2-provider-service/src/test/java/org/apache/nifi/oauth2/StandardOauth2AccessTokenProviderTest.java
@@ -27,7 +27,6 @@ import okio.Buffer;
 import org.apache.nifi.components.ConfigVerificationResult;
 import org.apache.nifi.components.PropertyDescriptor;
 import org.apache.nifi.controller.ConfigurationContext;
-import org.apache.nifi.controller.VerifiableControllerService;
 import org.apache.nifi.expression.ExpressionLanguageScope;
 import org.apache.nifi.logging.ComponentLog;
 import org.apache.nifi.processor.Processor;
@@ -648,7 +647,7 @@ public class StandardOauth2AccessTokenProviderTest {
 
         
when(mockHttpClient.newCall(any(Request.class)).execute()).thenReturn(response);
 
-        final List<ConfigVerificationResult> results = 
((VerifiableControllerService) testSubject).verify(
+        final List<ConfigVerificationResult> results = testSubject.verify(
             mockContext,
             runner.getLogger(),
             Collections.emptyMap()
@@ -666,7 +665,7 @@ public class StandardOauth2AccessTokenProviderTest {
         TestRunner runner = TestRunners.newTestRunner(processor);
         
when(mockHttpClient.newCall(any(Request.class)).execute()).thenThrow(new 
IOException());
 
-        final List<ConfigVerificationResult> results = 
((VerifiableControllerService) testSubject).verify(
+        final List<ConfigVerificationResult> results = testSubject.verify(
             mockContext,
             runner.getLogger(),
             Collections.emptyMap()
diff --git 
a/nifi-extension-bundles/nifi-standard-services/nifi-record-serialization-services-bundle/nifi-record-serialization-services/src/test/java/org/apache/nifi/avro/TestAvroReaderWithEmbeddedSchema.java
 
b/nifi-extension-bundles/nifi-standard-services/nifi-record-serialization-services-bundle/nifi-record-serialization-services/src/test/java/org/apache/nifi/avro/TestAvroReaderWithEmbeddedSchema.java
index d2bbff31ad0..450cad14aba 100644
--- 
a/nifi-extension-bundles/nifi-standard-services/nifi-record-serialization-services-bundle/nifi-record-serialization-services/src/test/java/org/apache/nifi/avro/TestAvroReaderWithEmbeddedSchema.java
+++ 
b/nifi-extension-bundles/nifi-standard-services/nifi-record-serialization-services-bundle/nifi-record-serialization-services/src/test/java/org/apache/nifi/avro/TestAvroReaderWithEmbeddedSchema.java
@@ -123,43 +123,43 @@ public class TestAvroReaderWithEmbeddedSchema {
     @Test
     public void testDataTypes() throws IOException, MalformedRecordException {
         final List<Field> accountFields = new ArrayList<>();
-        accountFields.add(new Field("accountId", Schema.create(Type.LONG), 
null, (Object) null));
-        accountFields.add(new Field("accountName", Schema.create(Type.STRING), 
null, (Object) null));
+        accountFields.add(new Field("accountId", Schema.create(Type.LONG), 
null, null));
+        accountFields.add(new Field("accountName", Schema.create(Type.STRING), 
null, null));
         final Schema accountSchema = Schema.createRecord("account", null, 
null, false);
         accountSchema.setFields(accountFields);
 
         final List<Field> catFields = new ArrayList<>();
-        catFields.add(new Field("catTailLength", Schema.create(Type.INT), 
null, (Object) null));
-        catFields.add(new Field("catName", Schema.create(Type.STRING), null, 
(Object) null));
+        catFields.add(new Field("catTailLength", Schema.create(Type.INT), 
null, null));
+        catFields.add(new Field("catName", Schema.create(Type.STRING), null, 
null));
         final Schema catSchema = Schema.createRecord("cat", null, null, false);
         catSchema.setFields(catFields);
 
         final List<Field> dogFields = new ArrayList<>();
-        dogFields.add(new Field("dogTailLength", Schema.create(Type.INT), 
null, (Object) null));
-        dogFields.add(new Field("dogName", Schema.create(Type.STRING), null, 
(Object) null));
+        dogFields.add(new Field("dogTailLength", Schema.create(Type.INT), 
null, null));
+        dogFields.add(new Field("dogName", Schema.create(Type.STRING), null, 
null));
         final Schema dogSchema = Schema.createRecord("dog", null, null, false);
         dogSchema.setFields(dogFields);
 
         final List<Field> fields = new ArrayList<>();
-        fields.add(new Field("name", Schema.create(Type.STRING), null, 
(Object) null));
-        fields.add(new Field("age", Schema.create(Type.INT), null, (Object) 
null));
-        fields.add(new Field("balance", Schema.create(Type.DOUBLE), null, 
(Object) null));
-        fields.add(new Field("rate", Schema.create(Type.FLOAT), null, (Object) 
null));
-        fields.add(new Field("debt", Schema.create(Type.BOOLEAN), null, 
(Object) null));
-        fields.add(new Field("nickname", Schema.create(Type.NULL), null, 
(Object) null));
-        fields.add(new Field("binary", Schema.create(Type.BYTES), null, 
(Object) null));
-        fields.add(new Field("fixed", Schema.createFixed("fixed", null, null, 
5), null, (Object) null));
-        fields.add(new Field("map", 
Schema.createMap(Schema.create(Type.STRING)), null, (Object) null));
-        fields.add(new Field("array", 
Schema.createArray(Schema.create(Type.LONG)), null, (Object) null));
-        fields.add(new Field("account", accountSchema, null, (Object) null));
+        fields.add(new Field("name", Schema.create(Type.STRING), null, null));
+        fields.add(new Field("age", Schema.create(Type.INT), null, null));
+        fields.add(new Field("balance", Schema.create(Type.DOUBLE), null, 
null));
+        fields.add(new Field("rate", Schema.create(Type.FLOAT), null, null));
+        fields.add(new Field("debt", Schema.create(Type.BOOLEAN), null, null));
+        fields.add(new Field("nickname", Schema.create(Type.NULL), null, 
null));
+        fields.add(new Field("binary", Schema.create(Type.BYTES), null, null));
+        fields.add(new Field("fixed", Schema.createFixed("fixed", null, null, 
5), null, null));
+        fields.add(new Field("map", 
Schema.createMap(Schema.create(Type.STRING)), null, null));
+        fields.add(new Field("array", 
Schema.createArray(Schema.create(Type.LONG)), null, null));
+        fields.add(new Field("account", accountSchema, null, null));
         fields.add(new Field("desiredbalance", Schema.createUnion(// test 
union of NULL and other type with no value
             Arrays.asList(Schema.create(Type.NULL), 
Schema.create(Type.DOUBLE))),
-            null, (Object) null));
+            null, null));
         fields.add(new Field("dreambalance", Schema.createUnion(// test union 
of NULL and other type with a value
             Arrays.asList(Schema.create(Type.NULL), 
Schema.create(Type.DOUBLE))),
-            null, (Object) null));
-        fields.add(new Field("favAnimal", 
Schema.createUnion(Arrays.asList(catSchema, dogSchema)), null, (Object) null));
-        fields.add(new Field("otherFavAnimal", 
Schema.createUnion(Arrays.asList(catSchema, dogSchema)), null, (Object) null));
+            null, null));
+        fields.add(new Field("favAnimal", 
Schema.createUnion(Arrays.asList(catSchema, dogSchema)), null, null));
+        fields.add(new Field("otherFavAnimal", 
Schema.createUnion(Arrays.asList(catSchema, dogSchema)), null, null));
 
         final Schema schema = Schema.createRecord("record", null, null, false);
         schema.setFields(fields);
diff --git 
a/nifi-framework-bundle/nifi-framework-extensions/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/main/java/org/apache/nifi/provenance/serialization/EventFileCompressor.java
 
b/nifi-framework-bundle/nifi-framework-extensions/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/main/java/org/apache/nifi/provenance/serialization/EventFileCompressor.java
index 6836392071d..b459e7ba11d 100644
--- 
a/nifi-framework-bundle/nifi-framework-extensions/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/main/java/org/apache/nifi/provenance/serialization/EventFileCompressor.java
+++ 
b/nifi-framework-bundle/nifi-framework-extensions/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/main/java/org/apache/nifi/provenance/serialization/EventFileCompressor.java
@@ -147,7 +147,7 @@ public class EventFileCompressor implements Runnable {
 
                 final long millis = 
TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - start);
                 final long bytesAfter = outputFile.length();
-                final double reduction = 100 * (1 - (double) bytesAfter / 
(double) bytesBefore);
+                final double reduction = 100 * (1 - (double) bytesAfter / 
bytesBefore);
                 final String reductionTwoDecimals = String.format("%.2f", 
reduction);
                 logger.debug("Successfully compressed Provenance Event File {} 
in {} millis from {} to {}, a reduction of {}%",
                     uncompressedEventFile, millis, 
FormatUtils.formatDataSize(bytesBefore), 
FormatUtils.formatDataSize(bytesAfter), reductionTwoDecimals);
diff --git 
a/nifi-framework-bundle/nifi-framework-extensions/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/main/java/org/apache/nifi/provenance/toc/StandardTocReader.java
 
b/nifi-framework-bundle/nifi-framework-extensions/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/main/java/org/apache/nifi/provenance/toc/StandardTocReader.java
index 81b1dec7f8c..3b3985fc0d8 100644
--- 
a/nifi-framework-bundle/nifi-framework-extensions/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/main/java/org/apache/nifi/provenance/toc/StandardTocReader.java
+++ 
b/nifi-framework-bundle/nifi-framework-extensions/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/main/java/org/apache/nifi/provenance/toc/StandardTocReader.java
@@ -96,6 +96,7 @@ public class StandardTocReader implements TocReader {
         }
     }
 
+    @SuppressWarnings("PMD.UnnecessaryCast")
     private long readLong(final byte[] buffer, final int offset) {
         return ((long) buffer[offset] << 56) +
             ((long) (buffer[offset + 1] & 0xFF) << 48) +
diff --git 
a/nifi-framework-bundle/nifi-framework-extensions/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/test/java/org/apache/nifi/provenance/TestSchemaRecordReaderWriter.java
 
b/nifi-framework-bundle/nifi-framework-extensions/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/test/java/org/apache/nifi/provenance/TestSchemaRecordReaderWriter.java
index 68e33521153..f45243650cc 100644
--- 
a/nifi-framework-bundle/nifi-framework-extensions/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/test/java/org/apache/nifi/provenance/TestSchemaRecordReaderWriter.java
+++ 
b/nifi-framework-bundle/nifi-framework-extensions/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/test/java/org/apache/nifi/provenance/TestSchemaRecordReaderWriter.java
@@ -343,7 +343,7 @@ public class TestSchemaRecordReaderWriter extends 
AbstractTestRecordReaderWriter
 
         final int numEvents = 10_000_000;
         final int recordBytes = serializedRecord.length;
-        final long totalRecordBytes = (long) recordBytes * (long) numEvents;
+        final long totalRecordBytes = (long) recordBytes * numEvents;
 
         final long startNanos = System.nanoTime();
         try (final InputStream in = new LoopingInputStream(header, 
serializedRecord);
diff --git 
a/nifi-framework-bundle/nifi-framework/nifi-administration/src/test/java/org/apache/nifi/admin/service/EntityStoreAuditServiceTest.java
 
b/nifi-framework-bundle/nifi-framework/nifi-administration/src/test/java/org/apache/nifi/admin/service/EntityStoreAuditServiceTest.java
index da1018a70ad..c1b2c4f5b40 100644
--- 
a/nifi-framework-bundle/nifi-framework/nifi-administration/src/test/java/org/apache/nifi/admin/service/EntityStoreAuditServiceTest.java
+++ 
b/nifi-framework-bundle/nifi-framework/nifi-administration/src/test/java/org/apache/nifi/admin/service/EntityStoreAuditServiceTest.java
@@ -107,7 +107,7 @@ class EntityStoreAuditServiceTest {
 
     private static final String SORT_ASCENDING = "ASC";
 
-    private static final ActionConverter actionConverter = action -> 
(FlowAction) Map::of;
+    private static final ActionConverter actionConverter = action -> Map::of;
 
     @TempDir
     File directory;
diff --git 
a/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/http/endpoints/DropRequestEndpointMerger.java
 
b/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/http/endpoints/DropRequestEndpointMerger.java
index de989541d73..51ceeb20405 100644
--- 
a/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/http/endpoints/DropRequestEndpointMerger.java
+++ 
b/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/http/endpoints/DropRequestEndpointMerger.java
@@ -108,7 +108,7 @@ public class DropRequestEndpointMerger extends 
AbstractSingleDTOEndpoint<DropReq
         if (originalCount == 0) {
             clientDto.setPercentCompleted(allFinished ? 100 : 0);
         } else {
-            clientDto.setPercentCompleted((int) ((double) droppedCount / 
(double) originalCount * 100D));
+            clientDto.setPercentCompleted((int) ((double) droppedCount / 
originalCount * 100D));
         }
 
         if (!nodeWaiting) {
diff --git 
a/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/util/FlowDifferenceFilters.java
 
b/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/util/FlowDifferenceFilters.java
index 7d22dc6af57..1da9653ae50 100644
--- 
a/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/util/FlowDifferenceFilters.java
+++ 
b/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/util/FlowDifferenceFilters.java
@@ -449,8 +449,7 @@ public class FlowDifferenceFilters {
             return false;
         }
 
-        final InstantiatedVersionedProcessor instantiatedVersionedProcessor = 
(InstantiatedVersionedProcessor) processorB;
-        final ProcessorNode processorNode = 
flowManager.getProcessorNode(instantiatedVersionedProcessor.getInstanceIdentifier());
+        final ProcessorNode processorNode = 
flowManager.getProcessorNode(processorB.getInstanceIdentifier());
         if (processorNode == null) {
             return false;
         }
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 674e2464307..a02f92b0b4c 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
@@ -938,7 +938,7 @@ public class FlowController implements 
ReportingTaskProvider, FlowAnalysisRulePr
             final ConnectorRepository created = 
NarThreadContextClassLoader.createInstance(extensionManager, 
implementationClassName, ConnectorRepository.class, properties);
 
             final String syncTimeoutValue = 
properties.getProperty(NiFiProperties.CONNECTOR_SYNC_TIMEOUT, 
NiFiProperties.DEFAULT_CONNECTOR_SYNC_TIMEOUT);
-            final long syncTimeoutMillis = (long) 
FormatUtils.getTimeDuration(syncTimeoutValue, TimeUnit.MILLISECONDS);
+            final long syncTimeoutMillis = 
FormatUtils.getTimeDuration(syncTimeoutValue, TimeUnit.MILLISECONDS);
             final Duration connectorSyncTimeout = 
Duration.ofMillis(syncTimeoutMillis);
 
             final ConnectorRepositoryInitializationContext 
initializationContext = new StandardConnectorRepoInitializationContext(
diff --git 
a/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/queue/clustered/partition/CorrelationAttributePartitioner.java
 
b/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/queue/clustered/partition/CorrelationAttributePartitioner.java
index 894b60e0439..2f98af58b21 100644
--- 
a/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/queue/clustered/partition/CorrelationAttributePartitioner.java
+++ 
b/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/queue/clustered/partition/CorrelationAttributePartitioner.java
@@ -103,7 +103,7 @@ public class CorrelationAttributePartitioner implements 
FlowFilePartitioner {
 
         private double nextDouble() {
             state = LCG_MULTIPLIER * state + INDEX_OFFSET;
-            return ((double) ((int) (state >>> 33) + 1)) / 0x1.0p31;
+            return ((int) (state >>> 33) + 1) / 0x1.0p31;
         }
     }
 }
diff --git 
a/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/scheduling/StandardProcessScheduler.java
 
b/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/scheduling/StandardProcessScheduler.java
index 76c2fc09cde..a99f7284ab7 100644
--- 
a/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/scheduling/StandardProcessScheduler.java
+++ 
b/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/scheduling/StandardProcessScheduler.java
@@ -812,7 +812,7 @@ public final class StandardProcessScheduler implements 
ProcessScheduler {
             throw new IllegalArgumentException();
         }
 
-        ((AbstractPort) port).disable();
+        port.disable();
     }
 
     @Override
diff --git 
a/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/status/analytics/StatusAnalyticsModelMapFactory.java
 
b/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/status/analytics/StatusAnalyticsModelMapFactory.java
index 89755e054a0..b2963548e13 100644
--- 
a/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/status/analytics/StatusAnalyticsModelMapFactory.java
+++ 
b/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/status/analytics/StatusAnalyticsModelMapFactory.java
@@ -109,13 +109,13 @@ public class StatusAnalyticsModelMapFactory {
 
                     Long inputCount = 
snap.getStatusMetrics().get(INPUT_COUNT_METRIC);
                     Long outputCount = 
snap.getStatusMetrics().get(OUTPUT_COUNT_METRIC);
-                    Double inOutRatio = ((double) outputCount / (double) 
inputCount) + randomError;
+                    Double inOutRatio = ((double) outputCount / inputCount) + 
randomError;
                     featureArray.add(Double.isNaN(inOutRatio) ? randomError : 
inOutRatio);
 
                 } else {
                     Long inputBytes = 
snap.getStatusMetrics().get(INPUT_BYTES_METRIC);
                     Long outputBytes = 
snap.getStatusMetrics().get(OUTPUT_BYTES_METRIC);
-                    Double inOutRatio = ((double) outputBytes / (double) 
inputBytes) + randomError;
+                    Double inOutRatio = ((double) outputBytes / inputBytes) + 
randomError;
                     featureArray.add(Double.isNaN(inOutRatio) ? randomError : 
inOutRatio);
                 }
 
diff --git 
a/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/repository/TestFileSystemRepository.java
 
b/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/repository/TestFileSystemRepository.java
index b174d4249b7..b6384236499 100644
--- 
a/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/repository/TestFileSystemRepository.java
+++ 
b/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/repository/TestFileSystemRepository.java
@@ -135,7 +135,7 @@ public class TestFileSystemRepository {
 
         final long mb = bytesToWrite / (1024 * 1024);
         final long seconds = millis / 1000L;
-        final double mbps = (double) mb / (double) seconds;
+        final double mbps = (double) mb / seconds;
         logger.info("Took {} millis to write {} bytes {} times (total of {} 
bytes) for a write rate of {} MB/s",
                 millis, contentSize, iterations, 
NumberFormat.getNumberInstance(Locale.US).format(bytesToWrite), mbps);
     }
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 be5f17459e7..638c33002a7 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
@@ -6940,7 +6940,7 @@ public class StandardNiFiServiceFacade implements 
NiFiServiceFacade {
 
             // If any Process Group is removed, consider all components below 
that Process Group as an affected component
             if (difference.getDifferenceType() == 
DifferenceType.COMPONENT_REMOVED && localComponent.getComponentType() == 
org.apache.nifi.flow.ComponentType.PROCESS_GROUP) {
-                final String localGroupId = 
((InstantiatedVersionedProcessGroup) localComponent).getInstanceIdentifier();
+                final String localGroupId = 
localComponent.getInstanceIdentifier();
                 final ProcessGroup localGroup = 
processGroupDAO.getProcessGroup(localGroupId);
 
                 localGroup.findAllProcessors().stream()
diff --git 
a/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/web/StandardNiFiServiceFacadeTest.java
 
b/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/web/StandardNiFiServiceFacadeTest.java
index 4cfce89af71..731efede402 100644
--- 
a/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/web/StandardNiFiServiceFacadeTest.java
+++ 
b/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/web/StandardNiFiServiceFacadeTest.java
@@ -2474,7 +2474,7 @@ public class StandardNiFiServiceFacadeTest {
 
         verify(registryClient).getFlowContents(any(), 
any(FlowVersionLocation.class), eq(false));
         verify(processGroup).setVersionControlInformation(argThat(vci -> vci 
instanceof StandardVersionControlInformation
-                && ((StandardVersionControlInformation) vci).getFlowSnapshot() 
== registrySnapshot), eq(Collections.emptyMap()));
+                && vci.getFlowSnapshot() == registrySnapshot), 
eq(Collections.emptyMap()));
         verify(processGroup).synchronizeWithFlowRegistry(branchFlowManager);
     }
 
diff --git 
a/nifi-registry/nifi-registry-core/nifi-registry-utils/src/main/java/org/apache/nifi/registry/util/FormatUtils.java
 
b/nifi-registry/nifi-registry-core/nifi-registry-utils/src/main/java/org/apache/nifi/registry/util/FormatUtils.java
index e57d7f99bfa..cbbbf90b48d 100644
--- 
a/nifi-registry/nifi-registry-core/nifi-registry-utils/src/main/java/org/apache/nifi/registry/util/FormatUtils.java
+++ 
b/nifi-registry/nifi-registry-core/nifi-registry-utils/src/main/java/org/apache/nifi/registry/util/FormatUtils.java
@@ -276,7 +276,7 @@ public class FormatUtils {
             int newOrd = newTimeUnit.ordinal();
 
             List<Long> unitMultipliers = TIME_UNIT_MULTIPLIERS.subList(newOrd, 
originalOrd);
-            return unitMultipliers.stream().reduce(1L, (a, b) -> (long) a * b);
+            return unitMultipliers.stream().reduce(1L, (a, b) -> a * b);
         }
     }
 
diff --git 
a/nifi-registry/nifi-registry-core/nifi-registry-web-api/src/test/java/org/apache/nifi/registry/web/api/IntegrationTestUtils.java
 
b/nifi-registry/nifi-registry-core/nifi-registry-web-api/src/test/java/org/apache/nifi/registry/web/api/IntegrationTestUtils.java
index b8f047c93e2..2887fcce056 100644
--- 
a/nifi-registry/nifi-registry-core/nifi-registry-web-api/src/test/java/org/apache/nifi/registry/web/api/IntegrationTestUtils.java
+++ 
b/nifi-registry/nifi-registry-core/nifi-registry-web-api/src/test/java/org/apache/nifi/registry/web/api/IntegrationTestUtils.java
@@ -93,7 +93,7 @@ class IntegrationTestUtils {
     private static void 
assertVersionedProcessGroupsEqual(VersionedProcessGroup expected, 
VersionedProcessGroup actual) {
         assertNotNull(actual);
 
-        assertEquals(((VersionedComponent) expected), ((VersionedComponent) 
actual));
+        assertEquals(expected, actual);
 
         // Poor man's set equality assertion as we are only checking the base 
type and not doing a recursive check
         // TODO, this would be a stronger assertion by replacing this with a 
true VersionedProcessGroup.equals() method that does a deep equality check
diff --git 
a/nifi-stateless/nifi-stateless-bundle/nifi-stateless-engine/src/main/java/org/apache/nifi/controller/reporting/LogComponentStatuses.java
 
b/nifi-stateless/nifi-stateless-bundle/nifi-stateless-engine/src/main/java/org/apache/nifi/controller/reporting/LogComponentStatuses.java
index 6247d8d1274..df2c503bc22 100644
--- 
a/nifi-stateless/nifi-stateless-bundle/nifi-stateless-engine/src/main/java/org/apache/nifi/controller/reporting/LogComponentStatuses.java
+++ 
b/nifi-stateless/nifi-stateless-bundle/nifi-stateless-engine/src/main/java/org/apache/nifi/controller/reporting/LogComponentStatuses.java
@@ -130,10 +130,10 @@ public class LogComponentStatuses implements Runnable {
 
         final long bytesReadPerSecond = flowFileEvent.getBytesRead() / 
secondsInEvent;
         final long bytesWrittenPerSecond = flowFileEvent.getBytesWritten() / 
secondsInEvent;
-        final double invocations = (double) flowFileEvent.getInvocations() / 
(double) secondsInEvent;
+        final double invocations = (double) flowFileEvent.getInvocations() / 
secondsInEvent;
         final long nanos = flowFileEvent.getProcessingNanoseconds();
-        final double nanosPer = (double) nanos / invocations;
-        final double nanosRatio = (double) nanos / (double) totalNanos;
+        final double nanosPer = nanos / invocations;
+        final double nanosRatio = (double) nanos / totalNanos;
         final double processingPercent = nanosRatio * 100D;
         final String processingPercentTwoDecimals = String.format("%.2f %%", 
processingPercent);
 
@@ -164,7 +164,7 @@ public class LogComponentStatuses implements Runnable {
 
         final long now = System.currentTimeMillis();
         final long millisSinceLastTrigger = now - lastTriggerTime;
-        final double secondsSinceLastTrigger = (double) millisSinceLastTrigger 
/ 1000D;
+        final double secondsSinceLastTrigger = millisSinceLastTrigger / 1000D;
         lastTriggerTime = now;
 
         final List<Counter> counters = counterRepository.getCounters();
@@ -175,7 +175,7 @@ public class LogComponentStatuses implements Runnable {
             final long lastValue = 
previousCounterValues.getOrDefault(counterId, 0L);
             previousCounterValues.put(counterId, counter.getValue());
             final long increaseSinceLast = counter.getValue() - lastValue;
-            final double increasePerSecond = (double) increaseSinceLast / 
secondsSinceLastTrigger;
+            final double increasePerSecond = increaseSinceLast / 
secondsSinceLastTrigger;
             final String increase = String.format("%.2f", increasePerSecond);
 
             builder.append(String.format(COUNTER_LINE_FORMAT, 
counter.getContext(), counter.getName(), counter.getValue(), increase));
diff --git a/pmd-ruleset.xml b/pmd-ruleset.xml
index c8d6e32d51b..cf41a52a493 100644
--- a/pmd-ruleset.xml
+++ b/pmd-ruleset.xml
@@ -70,6 +70,7 @@ under the License.
     <rule ref="category/java/codestyle.xml/ExtendsObject" />
     <rule ref="category/java/codestyle.xml/IdenticalCatchBranches" />
     <rule ref="category/java/codestyle.xml/ForLoopShouldBeWhileLoop" />
+    <rule ref="category/java/codestyle.xml/UnnecessaryCast" />
     <rule ref="category/java/codestyle.xml/UnnecessaryConstructor" />
     <rule ref="category/java/codestyle.xml/UnnecessaryImport" />
     <rule ref="category/java/codestyle.xml/UnnecessaryModifier">

Reply via email to