Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

copybara-service[bot]
Copy link
Contributor

Deprecate pattern-related methods in Predicates. There is a better alternative since JDK 1.8.

RELNOTES=n/a

…ternative since JDK 1.8.

RELNOTES=n/a
PiperOrigin-RevId: 531052335
Stephan202 added a commit to PicnicSupermarket/error-prone-support that referenced this pull request May 11, 2023
Stephan202 added a commit to PicnicSupermarket/error-prone-support that referenced this pull request May 11, 2023
While there, configure `StaticImport` to not require static importing of
`com.google.common.base.Predicates.contains`.

See google/guava#6483.
Comment on lines +237 to 244
* @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);
}
Copy link
Contributor

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. 🤔)

Copy link
Contributor

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

copybara-service bot pushed a commit to google/error-prone that referenced this pull request May 11, 2023
copybara-service bot pushed a commit to google/error-prone that referenced this pull request May 12, 2023
copybara-service bot pushed a commit to google/error-prone that referenced this pull request May 13, 2023
…va.util.function.Predicate`s

google/guava#6483 (comment)

Startblock:
  * unknown commit is submitted
PiperOrigin-RevId: 531307672
copybara-service bot pushed a commit to google/error-prone that referenced this pull request May 13, 2023
…va.util.function.Predicate`s

google/guava#6483 (comment)

Startblock:
  * unknown commit is submitted
PiperOrigin-RevId: 531307672
copybara-service bot pushed a commit to google/error-prone that referenced this pull request May 13, 2023
…va.util.function.Predicate`s

google/guava#6483 (comment)

Startblock:
  * unknown commit is submitted
PiperOrigin-RevId: 531307672
copybara-service bot pushed a commit to google/error-prone that referenced this pull request May 15, 2023
…va.util.function.Predicate`s

google/guava#6483 (comment)

Startblock:
  * unknown commit is submitted
PiperOrigin-RevId: 531307672
copybara-service bot pushed a commit to google/error-prone that referenced this pull request May 15, 2023
…va.util.function.Predicate`s

google/guava#6483 (comment)

Startblock:
  * unknown commit is submitted
PiperOrigin-RevId: 532114794
Stephan202 added a commit to PicnicSupermarket/error-prone-support that referenced this pull request Aug 29, 2023
While there, configure `StaticImport` to not require static importing of
`com.google.common.base.Predicates.contains`.

See google/guava#6483.
Stephan202 added a commit to PicnicSupermarket/error-prone-support that referenced this pull request Aug 30, 2023
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.
rickie pushed a commit to PicnicSupermarket/error-prone-support that referenced this pull request Sep 1, 2023
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.
Stephan202 added a commit to PicnicSupermarket/error-prone-support that referenced this pull request Oct 9, 2023
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.
rickie pushed a commit to PicnicSupermarket/error-prone-support that referenced this pull request Oct 10, 2023
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.
rickie pushed a commit to PicnicSupermarket/error-prone-support that referenced this pull request Oct 10, 2023
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.
rickie pushed a commit to PicnicSupermarket/error-prone-support that referenced this pull request Oct 11, 2023
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.
rickie pushed a commit to PicnicSupermarket/error-prone-support that referenced this pull request Oct 11, 2023
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.
@cpovirk cpovirk closed this Jun 21, 2024
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.

4 participants