-
Notifications
You must be signed in to change notification settings - Fork 10.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecate pattern-related methods in Predicates. There is a better alternative since JDK 1.8. #6483
Conversation
…ternative since JDK 1.8. RELNOTES=n/a PiperOrigin-RevId: 531052335
While there, configure `StaticImport` to not require static importing of `com.google.common.base.Predicates.contains`. See google/guava#6483.
* @deprecated Use {@link java.util.regex.Pattern#asPredicate} | ||
*/ | ||
@J2ktIncompatible | ||
@GwtIncompatible // Only used by other GWT-incompatible code. | ||
@Deprecated | ||
public static Predicate<CharSequence> containsPattern(String pattern) { | ||
return new ContainsPatternFromStringPredicate(pattern); | ||
} |
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.
CC @cushon: Error Prone CompilationTestHelper
and DiagnosticTestHelper
users are nudged to using this API, and because expectErrorMessage
expects a com.google.common.base.Predicate
rather than a java.util.function.Predicate
, the suggested alternative won't readily work. (The workaround is to use s -> Pattern.compile(pattern).find(s)
, though that doesn't make for as nice an API. 🤔)
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.
Good call, I will look at updating those APIs
google/guava#6483 (comment) PiperOrigin-RevId: 531307672
…va.util.function.Predicate`s google/guava#6483 (comment) PiperOrigin-RevId: 531307672
…va.util.function.Predicate`s google/guava#6483 (comment) Startblock: * unknown commit is submitted PiperOrigin-RevId: 531307672
…va.util.function.Predicate`s google/guava#6483 (comment) Startblock: * unknown commit is submitted PiperOrigin-RevId: 531307672
…va.util.function.Predicate`s google/guava#6483 (comment) Startblock: * unknown commit is submitted PiperOrigin-RevId: 531307672
…va.util.function.Predicate`s google/guava#6483 (comment) Startblock: * unknown commit is submitted PiperOrigin-RevId: 531307672
…va.util.function.Predicate`s google/guava#6483 (comment) Startblock: * unknown commit is submitted PiperOrigin-RevId: 532114794
While there, configure `StaticImport` to not require static importing of `com.google.common.base.Predicates.contains`. See google/guava#6483.
While there, configure `StaticImport` to not require static importing of `com.google.common.base.Predicates.contains`. The new rules triggered cleanup of some `CompilationTestHelper` usages. See google/guava#6483.
While there, configure `StaticImport` to not require static importing of `com.google.common.base.Predicates.contains`. The new rules triggered cleanup of some `CompilationTestHelper` usages. See google/guava#6483.
While there, configure `StaticImport` to not require static importing of `com.google.common.base.Predicates.contains`. The new rules triggered cleanup of some `CompilationTestHelper` usages. See google/guava#6483.
While there, configure `StaticImport` to not require static importing of `com.google.common.base.Predicates.contains`. The new rules triggered cleanup of some `CompilationTestHelper` usages. See google/guava#6483.
While there, configure `StaticImport` to not require static importing of `com.google.common.base.Predicates.contains`. The new rules triggered cleanup of some `CompilationTestHelper` usages. See google/guava#6483.
While there, configure `StaticImport` to not require static importing of `com.google.common.base.Predicates.contains`. The new rules triggered cleanup of some `CompilationTestHelper` usages. See google/guava#6483.
While there, configure `StaticImport` to not require static importing of `com.google.common.base.Predicates.contains`. The new rules triggered cleanup of some `CompilationTestHelper` usages. See google/guava#6483.
Deprecate pattern-related methods in Predicates. There is a better alternative since JDK 1.8.
RELNOTES=n/a