Skip to content

platform: cleanup redundant casts - #9824

Merged
BradWalker merged 1 commit into
apache:masterfrom
BradWalker:cleanup_redundant_cast
Nov 24, 2026
Merged

BradWalker merged 1 commit into
apache:masterfrom
BradWalker:cleanup_redundant_cast

Conversation

@BradWalker

@BradWalker BradWalker commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

platform: cleanup redundant casts

As a result of cleaning up many of the warnings, a bunch of redundant cast crops up. It's time to reduce many of the warnings. This code review fixes the redundant warnings in the platform code.

For example,

[repeat] /home/bwalker/src/netbeans/platform/options.api/src/org/netbeans/modules/options/Utils.java:38: warning: [cast] redundant cast to FileObject
[repeat] FileObject r = (FileObject) filesCache.get (name + '.' + ext);
[repeat] ^ [repeat] /home/bwalker/src/netbeans/platform/options.api/src/org/netbeans/modules/options/Utils.java:38: warning:

As a result of cleaning up many of the warnings, a bunch of redundant cast crops up. It's time to reduce many of the warnings.
This code review fixes the redundant warnings in the platform code.

For example,

   [repeat] /home/bwalker/src/netbeans/platform/options.api/src/org/netbeans/modules/options/Utils.java:38: warning: [cast] redundant cast to FileObject
   [repeat]         FileObject r = (FileObject) filesCache.get (name + '.' + ext);
   [repeat]                        ^   [repeat] /home/bwalker/src/netbeans/platform/options.api/src/org/netbeans/modules/options/Utils.java:38: warning:
@BradWalker BradWalker added this to the NB33 milestone Nov 23, 2026
@BradWalker BradWalker self-assigned this Nov 23, 2026
@BradWalker BradWalker added Code cleanup Label for cleanup done on the Netbeans IDE Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) labels Nov 23, 2026
@BradWalker

Copy link
Copy Markdown
Member Author

Hey @mbien & @matthiasblaesing , do I need a review for something as simple as this?

@mbien

mbien commented Nov 23, 2026

Copy link
Copy Markdown
Member

yes we should review cleanup PRs.

my first small request is the same as mentioned on other PRs already: If possible, PR title and commit should inform about the scope of the cleanup to avoid having N titles saying the exact same. This appears to focus on the platform cluster, if this is correct please mention it in the title + first line of the commit.

Something like "platform: cleanup redundant casts" would be perfect.

@BradWalker BradWalker changed the title Cleanup redundant casts. platform: cleanup redundant casts Nov 23, 2026
@BradWalker

Copy link
Copy Markdown
Member Author

my first small request is the same as mentioned on other PRs already: If possible, PR title and commit should inform about the scope of the cleanup to avoid having N titles saying the exact same. This appears to focus on the platform cluster, if this is correct please mention it in the title + first line of the commit.

Something like "platform: cleanup redundant casts" would be perfect.

Done..

And this makes sense as it aligns w/ how I do things in my professional life.

Thanks for the eyes on this!

@mbien mbien added Platform [ci] enable platform tests (platform/*) and removed Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) labels Nov 23, 2026
@mbien

mbien commented Nov 23, 2026

Copy link
Copy Markdown
Member

thanks! the commit title too if possible. I updated the labels to "platform" so that the platform tests run next time its updated.

@matthiasblaesing

Copy link
Copy Markdown
Contributor

Hey @mbien & @matthiasblaesing , do I need a review for something as simple as this?

Formally we work in CTR (commit-then-review) mode. So strictly speaking you can merge without review, but then the commit might need to be backed out later (when the review part is invoked). I make use of this mode to get things in at some point.

Practically I think there is an informal agreement to give people time to review and and if noone speaks up in a sane timeframe potentially merge without review if noone steps up to look at the change.

@matthiasblaesing matthiasblaesing left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Eyeballed this and looks sane to me. You might want to reformat the changed locations as there were multiple occurrences of multiple spaces.

@BradWalker

Copy link
Copy Markdown
Member Author

Thanks for the feedback about the commit "procedures". I wanted to ask as I was hoping to keep the resource demand at a minimum. Especially for something as simple as this.

@BradWalker
BradWalker merged commit b8b201d into apache:master Nov 24, 2026
66 of 68 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Code cleanup Label for cleanup done on the Netbeans IDE Platform [ci] enable platform tests (platform/*)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants