GeezerVison is showing github.com — [java] Fix False-positive UnnecessaryFullyQualifiedName when nested and non-nest… by OlegAndreych · Pull Request #4103 · pmd/pmd
Conversation
OlegAndreych
commented
Aug 25, 2022
•
edited by adangel
Loading
Uh oh!
There was an error while loading. Please reload this page.
…ed classes with the same name and in the same package are used together #4085
Describe the PR
Additional search and exclusion of inner classes/interfaces with the same simple name as fully qualified class usage is added.
Related issues
Ready?
- Added unit tests for fixed bug/feature
- Passing all unit tests
- Complete build
./mvnw clean verify passes (checked automatically by github actions)
- Added (in-code) documentation (if needed)
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
in order to support FileCollector.addFile with language
Fixes pmd#3970
…practices/ApexUnitTestClassShouldHaveAssertsRule.java
Co-authored-by: Andreas Dangel <[email protected]>
…/bestpractices/xml/ApexUnitTestClassShouldHaveAsserts.xml
Co-authored-by: Andreas Dangel <[email protected]>
…ed classes with the same name and in the same package are used together pmd#4085
[doc] Add MegaLinter in the list of integrations pmd#4104
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 the PR!
It seems your check "hasSameSimpleNameInScope" is too simple - we now get some false negatives, e.g. the following two unnecessary FQNs are not found anymore:
You can see the full regression report here: https://chunk.io/pmd/07f9b7da4d404e328741fa9da9340a3d/diff1/index.html
The removed violation all seem to have in common, that they don't have nested classes... only one main class - and this class is referenced via a FQN.
Can you please check these cases?
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
[core] CPD: Added begin and end token to XML reports pmd#4095
[core] Remember language when using FileCollector.addFile pmd#3971
Can you please check these cases?
Yes, sure.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Please help me to reproduce regressions.
I've ran pmdtester locally and haven't got any difference between upstream master and my branch.
The command I ran:
bin/pmdtester -b upstream/master -p master -r ~/devel/pmd
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
missing --file arg in "Example: ast-dump --format xml --language java --file MyFile.java" added
…atch-1
Update TreeExportCli.java
[core] Fix missing --file arg in TreeExport CLI example pmd#4116
…ed classes with the same name and in the same package are used together pmd#4085
…ed classes with the same name and in the same package are used together pmd#4085
* Regression fix;
adangel
added a commit
to adangel/pmd
that referenced
this pull request
Sep 29, 2022
[java] Fix False-positive UnnecessaryFullyQualifiedName when nested and non-nest… pmd#4103 pmd#4128
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.