Skip to content

Pull #18530: Fix PMD violations #18470#18530

Closed
Pankraz76 wants to merge 1 commit into
checkstyle:masterfrom
Pankraz76:fix-pmd-fix-code
Closed

Pull #18530: Fix PMD violations #18470#18530
Pankraz76 wants to merge 1 commit into
checkstyle:masterfrom
Pankraz76:fix-pmd-fix-code

Conversation

@Pankraz76

@Pankraz76 Pankraz76 commented Jan 6, 2026

Copy link
Copy Markdown

@Pankraz76

Copy link
Copy Markdown
Author

@Pankraz76 Pankraz76 changed the title Issue #18470: Fix PMD violations Issue #18470: Fix PMD violations #18470 Jan 6, 2026
@Pankraz76

Copy link
Copy Markdown
Author
[INFO] 
[INFO] --- pmd:3.28.0:check (default-cli) @ checkstyle ---
[WARNING] PMD Failure: com.puppycrawl.tools.checkstyle.AbstractAutomaticBean:243 Rule:ExceptionAsFlowControl Priority:3 Exception thrown at line 237 is caught in this block..
[WARNING] PMD Failure: com.puppycrawl.tools.checkstyle.DetailNodeTreeStringPrinter:80 Rule:UnusedPrivateMethod Priority:3 Avoid unused private methods such as 'parseJavadocAsDetailNode(String)'..
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:17 min
[INFO] Finished at: 2025-12-31T11:27:50Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-pmd-plugin:3.28.0:check (default-cli) on project checkstyle: PMD 7.20.0 has found 2 violations. For more details see: /home/circleci/project/target/pmd.xml -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-pmd-plugin:3.28.0:check (default-cli) on project checkstyle: PMD 7.20.0 has found 2 violations. For more details see: /home/circleci/project/target/pmd.xml
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:333)
    at org.apache.maven.lifecycle.inte

@Pankraz76 Pankraz76 marked this pull request as ready for review January 7, 2026 11:25
Comment thread src/main/java/com/puppycrawl/tools/checkstyle/AbstractAutomaticBean.java Outdated
@Pankraz76 Pankraz76 force-pushed the fix-pmd-fix-code branch 4 times, most recently from dfdf6c8 to 011a8ba Compare January 7, 2026 12:52
@Pankraz76 Pankraz76 changed the title Issue #18470: Fix PMD violations #18470 Pull #18530: Fix PMD violations #18470 Jan 8, 2026
Pankraz76 pushed a commit to Pankraz76/checkstyle that referenced this pull request Jan 8, 2026

@romani romani left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Items

Comment thread src/main/java/com/puppycrawl/tools/checkstyle/DetailNodeTreeStringPrinter.java Outdated
Pankraz76 pushed a commit to Pankraz76/checkstyle that referenced this pull request Jan 9, 2026
Comment thread src/main/java/com/puppycrawl/tools/checkstyle/DetailNodeTreeStringPrinter.java Outdated
Pankraz76 pushed a commit to Pankraz76/checkstyle that referenced this pull request Jan 9, 2026
Pankraz76 pushed a commit to Pankraz76/checkstyle that referenced this pull request Jan 9, 2026
@Pankraz76 Pankraz76 requested a review from romani January 9, 2026 12:25
@Pankraz76

Copy link
Copy Markdown
Author

Too long with no output (exceeded 10m0s): context deadline exceeded

@Pankraz76

Copy link
Copy Markdown
Author

waiting for enabler:

Pankraz76 pushed a commit to Pankraz76/checkstyle that referenced this pull request Jan 9, 2026

@romani romani left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

iems:

Comment thread src/main/java/com/puppycrawl/tools/checkstyle/DetailNodeTreeStringPrinter.java Outdated
Pankraz76 pushed a commit to Pankraz76/checkstyle that referenced this pull request Jan 10, 2026
Pankraz76 pushed a commit to Pankraz76/checkstyle that referenced this pull request Jan 10, 2026
@Pankraz76 Pankraz76 requested a review from romani January 10, 2026 10:12
final FileText text = new FileText(file, System.getProperty("file.encoding"));
return parseJavadocAsDetailNode(text.getFullText().toString());
final FileText fileText = new FileText(file, Charset.defaultCharset().name());
return (DetailNode) ParserUtil.createBlockCommentNode(fileText.getFullText().toString());

@Pankraz76 Pankraz76 Jan 10, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

we just inlined so casting is kind of a smell, as was not needed before.

Pankraz76 pushed a commit to Pankraz76/checkstyle that referenced this pull request Jan 10, 2026
Pankraz76 pushed a commit to Pankraz76/checkstyle that referenced this pull request Jan 10, 2026
Pankraz76 pushed a commit to Pankraz76/checkstyle that referenced this pull request Jan 10, 2026
Pankraz76 pushed a commit to Pankraz76/checkstyle that referenced this pull request Jan 10, 2026
Pankraz76 pushed a commit to Pankraz76/checkstyle that referenced this pull request Jan 10, 2026
final FileText text = new FileText(file, System.getProperty("file.encoding"));
return parseJavadocAsDetailNode(text.getFullText().toString());
final FileText fileText = new FileText(file, Charset.defaultCharset().name());
return (DetailNode) ParserUtil.createBlockCommentNode(fileText.getFullText().toString());

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

even causing issue.

[ERROR] DetailNodeTreeStringPrinterTest.testHtmlTagCloseBeforeTagOpen:102 » ClassCast class com.puppycrawl.tools.checkstyle.DetailAstImpl cannot be cast to class com.puppycrawl.tools.checkstyle.api.DetailNode (com.puppycrawl.tools.checkstyle.DetailAstImpl and com.puppycrawl.tools.checkstyle.api.DetailNode are in unnamed module of loader 'app')

private static DetailNode parseFile(File file) throws IOException {
final FileText text = new FileText(file, System.getProperty("file.encoding"));
return parseJavadocAsDetailNode(text.getFullText().toString());
return parseJavadocAsDetailNode(getBlockCommentNode(file));

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

not its pure functional which is the highest form of coding.

just the pure functionality, boiled down all the obsolete non-sense away.

* @throws IOException if the file could not be read.
*/
private static DetailAST getBlockCommentNode(final File file) throws IOException {
return ParserUtil.createBlockCommentNode(

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

return new

thats the story we need to know. understanding the whole context after 2 words on dedicated abstraction layer without any obsolete coupling.

if desired then reader can continue going into details.

direct simple stupid story telling is highest form of read<bility you always demanding we i also. We both sitting in the same boat.

@romani

romani commented Jan 11, 2026

Copy link
Copy Markdown
Member

No idea what is going on here, no reason to my mind

@Pankraz76

Pankraz76 commented Jan 11, 2026

Copy link
Copy Markdown
Author

this codebase is broken considering PMD !!!!!!!

we not passing pmd

@Pankraz76

Copy link
Copy Markdown
Author

please consider you own CI to consider your own project.

Caused by: org.apache.maven.plugin.MojoFailureException: PMD 7.20.0 has found 2 violations. For more details see: /home/circleci/project/target/pmd.xml

@Pankraz76

Copy link
Copy Markdown
Author

i does not feel like im talking to the maintainer and team lead of this product but to some random bystander.

Please try to do what we are doing here its not complicated...

@Pankraz76

Copy link
Copy Markdown
Author

#18529

@Pankraz76 Pankraz76 closed this Jan 12, 2026
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