Repository navigation
Description
From comment : #17259 (comment)
During the JDK 17 upgrade (#17168), we've identified multiple classes that can be converted to Java records. To keep the initial migration focused and manageable, we're temporarily disabling these inspections. This follow-up issue tracks the conversion of these classes to leverage JDK 17's record feature for cleaner, more maintainable code.
Any classes in "api" package should not be changed!!!
<problems is_local_tool="true">
<problem>
<file>file://$PROJECT_DIR$/src/main/java/com/puppycrawl/tools/checkstyle/TreeWalkerAuditEvent.java</file>
<line>30</line>
<module>project</module>
<package>com.puppycrawl.tools.checkstyle</package>
<entry_point TYPE="class" FQNAME="com.puppycrawl.tools.checkstyle.TreeWalkerAuditEvent"/>
<problem_class id="ClassCanBeRecord" severity="WEAK WARNING" attribute_key="INFO_ATTRIBUTES">Class can be a record</problem_class>
<description>Class can be a record</description>
<highlighted_element>TreeWalkerAuditEvent</highlighted_element>
<language>JAVA</language>
<offset>13</offset>
<length>20</length>
</problem>
<problem>
<file>file://$PROJECT_DIR$/src/main/java/com/puppycrawl/tools/checkstyle/api/LineColumn.java</file>
<line>28</line>
<module>project</module>
<package>com.puppycrawl.tools.checkstyle.api</package>
<entry_point TYPE="class" FQNAME="com.puppycrawl.tools.checkstyle.api.LineColumn"/>
<problem_class id="ClassCanBeRecord" severity="WEAK WARNING" attribute_key="INFO_ATTRIBUTES">Class can be a record</problem_class>
<description>Class can be a record</description>
<highlighted_element>LineColumn</highlighted_element>
<language>JAVA</language>
<offset>13</offset>
<length>10</length>
</problem>
<problem>
<file>file://$PROJECT_DIR$/src/main/java/com/puppycrawl/tools/checkstyle/site/AllCheckSummaries.java</file>
<line>839</line>
<module>project</module>
<package>com.puppycrawl.tools.checkstyle.site</package>
<entry_point TYPE="class" FQNAME="com.puppycrawl.tools.checkstyle.site.AllCheckSummaries.CheckInfo"/>
<problem_class id="ClassCanBeRecord" severity="WEAK WARNING" attribute_key="INFO_ATTRIBUTES">Class can be a record</problem_class>
<description>Class can be a record</description>
<highlighted_element>CheckInfo</highlighted_element>
<language>JAVA</language>
<offset>31</offset>
<length>9</length>
</problem>
</problems>
Action Plan:
-
Re-enable ClassCanBeRecord inspections in IDE/config
-
Convert each listed class to Java record syntax
-
Migrate validation logic to compact constructors
-
Update getter references to record accessors
-
Verify behavior with existing test cases
LineColumn - please send PR to put a suppression comment, to avoid problems with compatibility on user side.
AllCheckSummaries.CheckInfo - must be changed, east fix.
TreeWalkerAuditEvent - we can change, as we doing jdk21 update, for 13.0.0 version will be good version to point user to breaking changes.
Activity
romani commentedon Jun 30, 2025
We will make decision later on to follow this inspection or not.
Some of them are API, we should not break.
old scope of work:
AbstractXpathTestSupport.ViolationPositionThreadModeSettingsPropertyCacheFile.ExternalResourceTreeWalkerAuditEventLineColumnSuppressWarningsHolder.EntryRightCurlyCheck.DetailsMultiFileRegexpHeaderCheck.MatchResultMultiFileRegexpHeaderCheck.HeaderFileMetadataCustomImportOrderCheck.ImportDetailsTagParser.PointInvalidJavadocTagTagInfoTestInputViolationBlockCommentPositionTest.BlockCommentPositionTestMetadataCommitValidationTest.OmitMergeCommitsIteratorMessageLevelPairIssue checkstyle#17299: Convert eligible classes to records
Issue checkstyle#17299: Convert eligible classes to records
Issue checkstyle#17299: Convert eligible classes to records One
Issue checkstyle#17299: Convert eligible classes to records One
Issue checkstyle#17299: Convert eligible classes to records One
Issue checkstyle#17299: Convert eligible classes to records One
Issue #17299: Convert eligible classes to records One
57 remaining items
smita1078 commentedon Jan 4, 2026
Suppression comment can be there for such api packages
Issue checkstyle#17299: Convert eligible classes to records
Issue checkstyle#17299: Convert eligible classes to records
Issue checkstyle#17299: Convert eligible classes to records
Issue checkstyle#17299: Convert eligible classes to records
Issue #17299: Convert eligible classes to records
Issue #17299: Enable ClassCanBeRecord inspection to see latest state
Issue #17299: Enable ClassCanBeRecord inspection to see latest state
Issue #17299: Enable ClassCanBeRecord inspection to see latest state
romani commentedon Jan 4, 2026
fix is merged
Issue checkstyle#17299: Convert eligible classes to records
Issue checkstyle#17299: Enable ClassCanBeRecord inspection to see lat…