Skip to content

[java] Update rule UseArraysAsList#3187

Merged
oowekyala merged 1 commit into
pmd:pmd/7.0.xfrom
adangel:pmd7-update-UseArraysAsList
Apr 8, 2021
Merged

[java] Update rule UseArraysAsList#3187
oowekyala merged 1 commit into
pmd:pmd/7.0.xfrom
adangel:pmd7-update-UseArraysAsList

Conversation

@adangel

@adangel adangel commented Apr 1, 2021

Copy link
Copy Markdown
Member

Part of #2701

Ready?

  • Added unit tests for fixed bug/feature
  • Passing all unit tests
  • Complete build ./mvnw clean verify passes (checked automatically by travis)
  • Added (in-code) documentation (if needed)

@adangel adangel added this to the 7.0.0 milestone Apr 1, 2021
@ghost

ghost commented Apr 1, 2021

Copy link
Copy Markdown
2 Messages
📖 Compared to pmd/7.0.x:
This changeset changes 0 violations,
introduces 0 new violations, 0 new errors and 0 new configuration errors,
removes 0 violations, 0 errors and 0 configuration errors.
Full report
📖 Compared to master:
This changeset changes 2902 violations,
introduces 6000 new violations, 1 new errors and 0 new configuration errors,
removes 15546 violations, 10 errors and 2 configuration errors.
Full report
Compared to pmd/7.0.x:
This changeset changes 0 violations,
introduces 0 new violations, 376 new errors and 0 new configuration errors,
removes 134 violations, 0 errors and 0 configuration errors.
Full report
Compared to master:
This changeset changes 0 violations,
introduces 164 new violations, 377 new errors and 0 new configuration errors,
removes 288247 violations, 10 errors and 2 configuration errors.
Full report

Generated by 🚫 Danger

@adangel adangel marked this pull request as ready for review April 1, 2021 09:17
@adangel

adangel commented Apr 1, 2021

Copy link
Copy Markdown
Member Author

Not sure, why InsufficientStringBufferDeclaration rule is executed. It is not converted yet and seems to be the cause for most errors:

java.lang.NullPointerException
	at net.sourceforge.pmd.lang.java.rule.performance.InsufficientStringBufferDeclarationRule.getInitialLength(InsufficientStringBufferDeclarationRule.java:311)
	at net.sourceforge.pmd.lang.java.rule.performance.InsufficientStringBufferDeclarationRule.visit(InsufficientStringBufferDeclarationRule.java:72)
	at net.sourceforge.pmd.lang.java.ast.ASTVariableDeclaratorId.acceptVisitor(ASTVariableDeclaratorId.java:64)
	at net.sourceforge.pmd.lang.java.ast.AbstractJavaNode.acceptVisitor(AbstractJavaNode.java:50)
	at net.sourceforge.pmd.lang.java.rule.AbstractJavaRule.apply(AbstractJavaRule.java:38)
	at net.sourceforge.pmd.lang.rule.AbstractDelegateRule.apply(AbstractDelegateRule.java:237)
	at net.sourceforge.pmd.lang.rule.internal.RuleApplicator.applyOnIndex(RuleApplicator.java:62)
	at net.sourceforge.pmd.lang.rule.internal.RuleApplicator.apply(RuleApplicator.java:48)
	at net.sourceforge.pmd.RuleSets.apply(RuleSets.java:150)

@oowekyala

Copy link
Copy Markdown
Member

Not sure, why InsufficientStringBufferDeclaration rule is executed. It is not converted yet and seems to be the cause for most errors:

The patch config seems to be performance.xml:

https://chunk.io/pmd/0d6caceb7f7948edb80b68f56f22c215/diff1/patch_config.xml

@adangel

adangel commented Apr 2, 2021

Copy link
Copy Markdown
Member Author

Not sure, why InsufficientStringBufferDeclaration rule is executed. It is not converted yet and seems to be the cause for most errors:

The patch config seems to be performance.xml:

https://chunk.io/pmd/0d6caceb7f7948edb80b68f56f22c215/diff1/patch_config.xml

Ah, that explains it. Right, for XPath rules, we run the complete category....

oowekyala added a commit that referenced this pull request Apr 2, 2021
This is to avoid errors in CI, like in #3187.
This is just a hack, we should fix pmd-regression-tester,
or live with it until we have ported all rules.
This may not be enough, maybe another rule
will take its place and crash everything.
@oowekyala

This comment has been minimized.

@adangel

adangel commented Apr 6, 2021

Copy link
Copy Markdown
Member Author

From the tests, the rule appears to work fine, although it's not in the diff report (no violation on our tested projects)...

Yes, there seem no violations reported on checkstyle or spring-framework. So all we know is - it works the same as before: no additional violations. All unit tests work fine.

The only change is to make it work with the new java grammar....

@oowekyala oowekyala self-assigned this Apr 8, 2021
oowekyala added a commit that referenced this pull request Apr 8, 2021
@oowekyala oowekyala merged commit fd9ee37 into pmd:pmd/7.0.x Apr 8, 2021
@adangel adangel deleted the pmd7-update-UseArraysAsList branch April 10, 2021 09:05
@adangel adangel mentioned this pull request Jan 23, 2023
55 tasks
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