Skip to content

Comments

Clean up interface method declarations by removing redundant public modifiers#2944

Merged
eamonnmcmanus merged 2 commits intogoogle:mainfrom
ThirdGoddess:master
Nov 22, 2025
Merged

Clean up interface method declarations by removing redundant public modifiers#2944
eamonnmcmanus merged 2 commits intogoogle:mainfrom
ThirdGoddess:master

Conversation

@ThirdGoddess
Copy link
Contributor

Purpose

This pull request makes a small stylistic cleanup of nested interface method declarations.
Some methods currently include the public modifier while others rely on Java’s implicit visibility.
This inconsistency is purely visual and does not affect functionality.
Removing the redundant modifiers improves readability and enforces a consistent code style.


Description

In Java, interface methods are implicitly public, so explicitly declaring public is unnecessary.
This PR removes the redundant public keywords from nested interface methods throughout the codebase.

No behavior or public API changes are introduced.
The change is intended solely to make the code easier to read, review, and maintain.


Checklist

  • New code follows the Google Java Style Guide
    This is automatically checked by mvn verify, but can also be checked on its own using mvn spotless:check.
    Style violations can be fixed using mvn spotless:apply; this can be done in a separate commit to verify that it did not cause undesired changes.
  • No API behavior or signature changes
  • No new tests required
  • mvn clean verify javadoc:jar passes without errors
    

* @return a JsonElement corresponding to the specified object.
*/
public JsonElement serialize(T src, Type typeOfSrc, JsonSerializationContext context);
JsonElement serialize(T src, Type typeOfSrc, JsonSerializationContext context);

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'typeOfSrc' is never used.
@eamonnmcmanus
Copy link
Member

This makes sense. Google's internal "Java Practices" guide calls for omitting redundant modifiers like these.

@eamonnmcmanus eamonnmcmanus merged commit 2a213c5 into google:main Nov 22, 2025
15 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.

2 participants