-
Notifications
You must be signed in to change notification settings - Fork 2.9k
NIFI-14051 Replaced type arguments with diamonds #9562
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
exceptionfactory
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on these improvements @dan-s1. The changes are helpful in general, but the scope makes it rather difficult to review since it includes different types of changes that cover a number of vital classes.
The initial removal of unnecessary generic types is straightforward, but replacing anonymous classes with lambdas impacts a large number of lines. For this reason, it would be helpful to break these changes into separate pull requests. One way to do this would be to back out changes in the nifi-framework-bundle from the current PR and handle them separately. Another way to do it would be to limit the types of changes. However, I think separating framework changes into a separate PR would help ensure sufficient review of more important components.
These types of stylistic improvements are useful, and we should look at formalizing some of these changes using static analysis tools like PMD. However, for future reference, having a more narrow scope would help the review process and reduce the potential for missing important changes.
...-smb-bundle/nifi-smb-processors/src/main/java/org/apache/nifi/processors/smb/PutSmbFile.java
Outdated
Show resolved
Hide resolved
I will separate the changes into two tickets. Initially I thought they were somewhat related but I am perfectly fine making two tickets for these changes. |
|
@exceptionfactory You were right it is much easier to see the changes when the changes are focused only where the explicit type arguments are replaced by diamonds. I also noticed though I made a lot of non related changes to unit tests per Intellij suggestions in those unit tests where I had to replace explicit type arguments with diamonds. I know on a previous PR you were okay with me cleaning up the unit tests so I took the liberty to do so when touching these unit tests. Please let me know if that is okay. Thanks! |
…classes with lambdas and replaced certain assertions with more specific assertions.
…he map needs to be modified.
|
Odd that |
exceptionfactory
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for narrowing the scope of changes @dan-s1, the latest round was much easier to go through. Great to have this code cleanup in a number of places! +1 merging
Summary
NIFI-14051
This PR aims to replace explicit type arguments with diamonds. In addition various improvements to the related unit tests were made such as specific assertions, removal of exceptions from method signatures which are not thrown, the use of later Java features such as
getFirston a list and the use ofMap.ofinstead of instantiatedHashMapwith anonymous population.Tracking
Please complete the following tracking steps prior to pull request creation.
Issue Tracking
Pull Request Tracking
NIFI-00000NIFI-00000Pull Request Formatting
mainbranchVerification
Please indicate the verification steps performed prior to pull request creation.
Build
mvn clean install -P contrib-checkLicensing
LICENSEandNOTICEfilesDocumentation