Branch: refs/heads/main
Home: https://github.com/pmd/pmd
Commit: 9c1fe8ff8efbc96f7e100cac03b006e7bb01c086
https://github.com/pmd/pmd/commit/9c1fe8ff8efbc96f7e100cac03b006e7bb01c086
Author: renechoi <[email protected]>
Date: 2026-08-30 (Sun, 30 Aug 2026)
Changed paths:
M docs/pages/release_notes.md
M pmd-java/src/main/resources/category/java/errorprone.xml
M
pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/ReplaceJavaUtilCalendar.xml
M
pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/ReplaceJavaUtilDate.xml
Log Message:
-----------
[java] Fix #7009: ReplaceJavaUtilDate/Calendar miss pattern variables (#7010)
* [java] Fix #7009: ReplaceJavaUtilDate/Calendar miss pattern variables
Both rules matched only LocalVariableDeclaration, FormalParameter,
FieldDeclaration and ConstructorCall, so a variable introduced by a
pattern was never reported. Add TypePattern to both XPath expressions,
which covers instanceof patterns, switch case labels and the component
patterns of a record deconstruction.
* [java] Report record components in ReplaceJavaUtilDate/Calendar
Follow-up to the review on #7010.
Add RecordComponent to both XPath expressions, so a record component
declared as java.util.Date or java.util.Calendar is reported. Varargs
components parse as an array type and stay unreported, which matches
how Date[] parameters behave today.
Replace the java.sql.Timestamp test case with a fully qualified
java.util.Date one, so nothing added here depends on the java.sql
behaviour discussed in #6025.
Let the record deconstruction test declare record Box(Object value),
so it keeps covering only the nested type pattern now that the record
component itself is reported too.
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