You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[java] new "ReplaceJavaUtilDate" and "ReplaceJavaUtilCalendar" trigger for SQL classes #6025
Yes, I am fully aware of #5966 and I read the rationale there.
Java 24 (latest release) and Java 25 (upcoming LTS) both ship with JDBC 4.3. The cited "JPA 3.2" package is an additional part of JEE which most users will not have (and it is not even clear that database drivers will support this).
Jakarta Persistence is not the JDBC spec. Skimming release notes for keywords makes no sense. So a consumer of the JDBC spec, JPA no longer supports java.sql.Date. That does not mean that it is no longer supported by the JDBC spec or that there is a replacement in the JDBC spec (there is not).
Unconditionally claiming that "users need to update" but in case of the java.sql classes, there is no replacement available within the JDK. The whole argument is based on a misread what JPA actually is.
I can see the case for java.util.* as java.time has been around since JDK 8 but I would like to either have a switch that turns off the warning for java.sql or ignore java.sql altogether. The current state simply makes me turn off the rule completely.
changed the title [-]new "ReplaceJavaUtilDate" and "ReplaceJavaUtilCalendar" trigger for SQL classes[/-][+][java] new "ReplaceJavaUtilDate" and "ReplaceJavaUtilCalendar" trigger for SQL classes[/+]on Sep 1, 2025
I see the case for java.sql.* being a valid exception to the rule. For the time being, something like this could be used as a workaround.
<ruleref="category/java/errorprone.xml/ReplaceJavaUtilDate">
<properties>
<propertyname="violationSuppressXPath"value=".[pmd-java:typeIs('java.sql.Date') or pmd-java:typeIs('java.sql.Time') or pmd-java:typeIs('java.sql.Timestamp')]"/>
</properties>
</rule>
<ruleref="category/java/errorprone.xml/ReplaceJavaUtilDate">
<properties>
<propertyname="violationSuppressXPath"value=".[ClassType[pmd-java:typeIs('java.sql.Date')] or ClassType[pmd-java:typeIs('java.sql.Time')] or ClassType[pmd-java:typeIs('java.sql.Timestamp')]]"/>
</properties>
</rule>
Activity
[-]new "ReplaceJavaUtilDate" and "ReplaceJavaUtilCalendar" trigger for SQL classes[/-][+][java] new "ReplaceJavaUtilDate" and "ReplaceJavaUtilCalendar" trigger for SQL classes[/+]mrclmh commentedon Nov 21, 2025
I see the case for java.sql.* being a valid exception to the rule. For the time being, something like this could be used as a workaround.
rturner-edjuster commentedon Jan 8, 2026
Corrected rule:
[java] Report record components in ReplaceJavaUtilDate/Calendar
[java] Fix #7009: ReplaceJavaUtilDate/Calendar miss pattern variables (…