Skip to content

Issue #19755: Added checks for OpenJDK Style §4.3 - Method Names#19762

Merged
romani merged 1 commit into
checkstyle:masterfrom
Anushreebasics:methodname
Apr 30, 2026
Merged

Issue #19755: Added checks for OpenJDK Style §4.3 - Method Names#19762
romani merged 1 commit into
checkstyle:masterfrom
Anushreebasics:methodname

Conversation

@Anushreebasics

Copy link
Copy Markdown
Contributor

closes #19755

Changes

[openjdk_checks.xml]: Added MethodName module with format pattern ^[a-z]{2,}[a-zA-Z0-9]*$
Integration Tests: Created new test class MethodNameTest.java with:
Valid cases: is(), go(), getName(), doSomething()
Invalid cases: a() (single char), _do() (underscore prefix), BadName() (uppercase start), bad_name() (underscores)
Documentation: Updated openjdk_style.xml coverage table and added OpenJDK links to MethodName check documentation

Pattern Details

✅ Allowed: Method names starting with 2+ lowercase letters, followed by any letters/digits
❌ Not Allowed: Single-letter names, uppercase start, underscores, starting digits

@Anushreebasics

Copy link
Copy Markdown
Contributor Author

@vivek-0509 @romani please review

@Anushreebasics

Copy link
Copy Markdown
Contributor Author

@romani please review

@romani romani left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Items

<td>???</td>
<td/>
<td>
<span class="wrapper inline">

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ply mention here that Method names should typically be verbs or other descriptions of actions. can not be covered as checkstyle do not have English vocabular to make sure it is verb or verb starting name.

Coverage should be blue color, as coverage is not complete.

@Anushreebasics

Copy link
Copy Markdown
Contributor Author

@romani please review the changes

@romani romani left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot

@romani romani merged commit 04a55f7 into checkstyle:master Apr 30, 2026
123 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add checks for OpenJDK Style §4.3 - Method Names

2 participants