Branch: refs/heads/main
  Home:   https://github.com/pmd/pmd
  Commit: 4b366e0c246f23a7f68a5b958c9a562a21102e58
      https://github.com/pmd/pmd/commit/4b366e0c246f23a7f68a5b958c9a562a21102e58
  Author: Tanvir Alam <[email protected]>
  Date:   2026-08-30 (Sun, 30 Aug 2026)

  Changed paths:
    M docs/pages/release_notes.md
    M 
pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryCastRule.java
    A 
pmd-java/src/test/java-resources/net/sourceforge/pmd/lang/java/rule/codestyle/unnecessarycast/PackagePrivateSuper.java
    A 
pmd-java/src/test/java-resources/net/sourceforge/pmd/lang/java/rule/codestyle/unnecessarycast/other/PackagePrivateSub.java
    M 
pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryCast.xml

  Log Message:
  -----------
  [java] Fix #5732: UnnecessaryCast false positive for package-private members 
(#6993)

* [java] Fix #5732: UnnecessaryCast false positive for package-private members

Package-private methods and fields are not inherited by subclasses in another 
package, so a cast to the declaring type is required to access them.

* [java] Fix #5732: Clarify package-private visibility in UnnecessaryCast

Package-private members are inherited; the cast is required because they
are not accessible on a subtype in a different package. Also drop
redundant unresolved/null checks already handled in visit().

* Put the issue title in release notes

---------

Co-authored-by: Sören Glimm <[email protected]>



To unsubscribe from these emails, change your notification settings at 
https://github.com/pmd/pmd/settings/notifications


_______________________________________________
Pmd-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pmd-commits

Reply via email to