Skip to content

Pattern: use PolyRegex for receiver and return of pattern and toString#132

Open
wmdietl wants to merge 1 commit intomasterfrom
pattern-regexes
Open

Pattern: use PolyRegex for receiver and return of pattern and toString#132
wmdietl wants to merge 1 commit intomasterfrom
pattern-regexes

Conversation

@wmdietl
Copy link
Copy Markdown
Member

@wmdietl wmdietl commented Mar 13, 2026

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates java.util.regex.Pattern’s API annotations to better express Regex Checker qualifier polymorphism, so callers can preserve regex-qualification through pattern() and toString() based on the receiver’s qualifier.

Changes:

  • Annotate Pattern.pattern() with @PolyRegex on both receiver and return type.
  • Annotate Pattern.toString() with @PolyRegex on both receiver and return type (while preserving @GuardSatisfied).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -1132,7 +1132,7 @@ public String pattern() {
* @since 1.5
*/
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