-
Notifications
You must be signed in to change notification settings - Fork 11.2k
refactor(Joiner): rename internal toString helper to toCharSequence - #8519
refactor(Joiner): rename internal toString helper to toCharSequence #8519Derylfabiensyah wants to merge 3 commits into
Conversation
@ricardoofnl
ricardoofnl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice mechanical rename. I checked all call sites in both trees and nothing was missed. There is one small leftover, which I flagged inline in both files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment block further down in this method (around line 524) still references the old name:
Its implementation avoids calling this
toString(Object)method in the first place.
Since this PR renames the method, it would be good to update that mention to toCharSequence(Object) as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as in the JRE flavor: the comment block further down in this method (around line 488) still says toString(Object) and should be updated to toCharSequence(Object) as part of this rename.
Derylfabiensyah
commented
Aug 1, 2026
Hi @ricardoofnl, thanks for pointing that out! I've updated the comment block references in both guava/src/com/google/common/base/Joiner.java and android/guava/src/com/google/common/base/Joiner.java from toString(Object) to toCharSequence(Object).
Renamed the package-private helper method
toString(Object)totoCharSequence(Object)inJoiner.javato resolve cpovirk's TODO.This clarifies the return type (
CharSequence) and avoids shadowing the standardObject.toString()signature for internal calls. Both the standard and Android version source trees have been updated.