Skip to content

NIFI-16147 Removed unnecessary fully qualified names and implemented PMD rule UnnecessaryFullyQualifiedName - #11486

Merged
exceptionfactory merged 4 commits into
apache:mainfrom
dan-s1:NIFI-16147
Jul 29, 2026
Merged

NIFI-16147 Removed unnecessary fully qualified names and implemented PMD rule UnnecessaryFullyQualifiedName#11486
exceptionfactory merged 4 commits into
apache:mainfrom
dan-s1:NIFI-16147

Conversation

@dan-s1

@dan-s1 dan-s1 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

NIFI-16147

This PR first addressed the use of fully qualified names discovered by Intellij and those uncovered by the PMD rule UnnecessaryFullyQualifiedName. The UnnecessaryFullyQualifiedName aims to address four categories:

  • Already imported types: Using a fully qualified class name when an explicit import statement for that class already exists in the file.
  • Same-package classes: Referencing a class with its full package prefix when the referencing class resides in the exact same package.
  • Implicitly imported scope: Using full package paths for classes in java.lang or types already in scope via wildcard * imports.
  • Enclosing and local scopes: Qualifying elements (such as static fields, methods, or inner classes) that are already directly in scope because they are declared in an enclosing type or current context.

This PR as a result of fixing the aforementioned cases also fixed the seemingly in-congruent use of importing a class while also having static imports of variables in that class.

  1. e.g. importing AzureStorageUtils and statically importing some of its members in classes
    AbstractAzureDataLakeStorageProcessor, AzureDataLakeStorageFileResourceService, AzureStorageCredentialsControllerService_v12, FetchAzureBlobStorage_v12, FetchAzureDataLakeStorage, ListAzureBlobStorage_v12, ListAzureDataLakeStorage and PutAzureBlobStorage_v12
  2. Importing Assertions, Mockito or ArgumentMatchers and statically importing some of their methods.

In the case of Assertions, Mockito or ArgumentMatchers, this PR made only static imports of the methods in these classes while for AzureStorageUtils it dropped all the static imports.

Tracking

Please complete the following tracking steps prior to pull request creation.

Issue Tracking

Pull Request Tracking

  • Pull Request title starts with Apache NiFi Jira issue number, such as NIFI-00000
  • Pull Request commit message starts with Apache NiFi Jira issue number, as such NIFI-00000
  • Pull request contains commits signed with a registered key indicating Verified status

Pull Request Formatting

  • Pull Request based on current revision of the main branch
  • Pull Request refers to a feature branch with one commit containing changes

Verification

Please indicate the verification steps performed prior to pull request creation.

Build

  • Build completed using ./mvnw clean install -P contrib-check
    • JDK 21
    • JDK 25

Licensing

  • New dependencies are compatible with the Apache License 2.0 according to the License Policy
  • New dependencies are documented in applicable LICENSE and NOTICE files

Documentation

  • Documentation formatting appears as expected in rendered files

@exceptionfactory exceptionfactory left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @dan-s1, this covers a lot of files, but provides a helpful consistency across the project. +1 merging

@exceptionfactory
exceptionfactory merged commit 3a70cca into apache:main Jul 29, 2026
17 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants