GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — chore: Remove unnecessary casts by UncleOwen · Pull Request #6944 · pmd/pmd

Conversation

@UncleOwen

@UncleOwen UncleOwen commented Aug 6, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Describe the PR

This PR removes all unnecessary casts from PMD.

In 2 cases, I had to add "PMD.UnnecessaryCast" to an already existing @SuppressWarning(). Currently, this triggers the "UnnecessarySuppression" rule, so we can only merge this at the same time we merge the corresponding build-tools update.

Related issues

  • See [java] UnnecessaryCast: False positives related to generics #6943
  • See Add UnnecessaryCast to dogfood build-tools#184

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.

All reactions
UncleOwen added 2 commits August 6, 2026 04:58
@UncleOwen
Remove unnecessary casts
0c9e67b
@UncleOwen
Add @SuppressWarning to false positives for UnncessaryCast
c5e60a1
See pmd#6943
lukasgraef
lukasgraef approved these changes Aug 7, 2026
View reviewed changes

@lukasgraef lukasgraef left a comment

Copy link
Copy Markdown
Member

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 cleanup!

Just one optional suggestion.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pmd-core/src/main/java/net/sourceforge/pmd/properties/AbstractPropertySource.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@UncleOwen
Refactor duplicate code into function
3145817
@adangel adangel changed the title Remove unnecessary casts chore: Remove unnecessary casts Aug 14, 2026
@adangel adangel added this to the 7.27.0 milestone Aug 15, 2026
@adangel adangel mentioned this pull request Aug 15, 2026
chore(deps): bump build-tools from 39 to 40 #6979
Merged
4 tasks
@adangel
adangel merged commit fcc6b2f into pmd:main Aug 15, 2026
7 of 9 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@arimu1 arimu1 mentioned this pull request Aug 21, 2026
[java] Fix #6943: UnnecessaryCast: false positives related to generics #6982
Merged
3 of 4 tasks
@UncleOwen
UncleOwen deleted the remove-unnecessary-casts branch August 28, 2026 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@lukasgraef lukasgraef lukasgraef approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

7.27.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@UncleOwen @lukasgraef @adangel
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.