Skip to content

Commit

Permalink
Restore CharSequences.newAsciiString(String) (#1503)
Browse files Browse the repository at this point in the history
Motivation:
In ServiceTalk 0.39.0 the method
`CharSequences.newAsciiString(CharSequence)` was introduced which
replaced `CharSequences.newAsciiString(String)`. This was a source
compatible, but binary incompatible change. All existing uses of the
`String` overload could be recompiled to use the `CharSequence`
overload. Existing binary code expected the `String` overload to exist
and fails with `NoSuchMethodError` at runtime.
Modifications:
For cases where the libraries and applications using ServiceTalk cannot
be recompiled conveniently the `CharSequences.newAsciiString(String)`
overload is restored.
Result:
Binary compatibility with libraries and applications which use
`CharSequences.newAsciiString(String)` and are compiled against
versions of ServiceTalk before 0.39.0 is restored.
  • Loading branch information
bondolo authored and idelpivnitskiy committed Apr 20, 2021
1 parent 70ac774 commit 284cd7c
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,17 @@ private CharSequences() {
// No instances
}

/**
* Create a new {@link CharSequence} from the specified {@code input}, supporting only 8-bit ASCII characters, and
* with a case-insensitive {@code hashCode}.
*
* @param input a character sequence containing only 8-bit ASCII characters.
* @return a {@link CharSequence}
*/
public static CharSequence newAsciiString(final String input) {
return newAsciiString((CharSequence) input);
}

/**
* Create a new {@link CharSequence} from the specified {@code input}, supporting only 8-bit ASCII characters, and
* with a case-insensitive {@code hashCode}.
Expand Down

0 comments on commit 284cd7c

Please sign in to comment.