Branch: refs/heads/main
  Home:   https://github.com/pmd/pmd
  Commit: 8a90370ce651b3eb802924cacc857fb415394bdf
      https://github.com/pmd/pmd/commit/8a90370ce651b3eb802924cacc857fb415394bdf
  Author: fudian <[email protected]>
  Date:   2026-08-11 (Tue, 11 Aug 2026)

  Changed paths:
    M docs/pages/release_notes.md
    M 
pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonSerializableClassRule.java
    M 
pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/NonSerializableClass.xml

  Log Message:
  -----------
  [java] Fix #6547: NonSerializableClass checks collection/map generic element 
types (#6942)

* [java] Fix #6547: NonSerializableClass checks collection/map generic element 
types

Signed-off-by: 付典 <[email protected]>

* [java] Use Collection instead of Iterable for NonSerializableClass element 
check

Per review feedback (#6942): a bare Iterable<NotSerializable> does not
guarantee that it actually holds the instances — Iterable only promises
an iterator, whose elements need not be the container's stored values
(e.g. generators, adapters). Collection is the contract for a container
that holds its elements, which is what serialization actually traverses.

Switch the container type guard from Iterable to Collection (Map is
already handled separately and is unaffected, since Map does not extend
Collection). Add a regression test asserting that a bare
Iterable<NotSerializable> field is not reported.

Signed-off-by: 付典 <[email protected]>

* inline javadoc links

* sort release noes by #id

---------

Signed-off-by: 付典 <[email protected]>
Co-authored-by: Zbynek Konecny <[email protected]>
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