Skip to content

Use pattern variables in the server event filter - #2128

Merged
kevinherron merged 1 commit into
eclipse-milo:mainfrom
alxkm:improve/server-events-pattern-variables
Oct 16, 2026
Merged

kevinherron merged 1 commit into
eclipse-milo:mainfrom
alxkm:improve/server-events-pattern-variables

Conversation

@alxkm

@alxkm alxkm commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Same change as #2092, #2102 and #2110, for the server event filter. EventContentFilter and MonitoredEventItem check a type with instanceof and then cast the same value again in six places, the form the #1440 inspection skipped. Each now binds a pattern variable, next to the ElementOperand branch that already does. 2 files, 12 lines.

No behaviour change. I compared the bytecode of every method in both classes and their inner classes: the five changed methods differ only by the store and load of the new locals. With that undone they match, and every other method is byte for byte identical. mvn verify passes for sdk-server and the integration tests.

EventContentFilter and MonitoredEventItem check a type with instanceof
and then cast the same value again in six places, the form the "pattern
variable can be used" cleanup in eclipse-milo#1440 did not pick up. Bind a pattern
variable in the instanceof instead, next to the ElementOperand branch
that already does.

No behaviour change. I compared the bytecode of every method in both
classes and their inner classes. The five changed methods differ only
by the store and load of the new locals. With that undone they are the
same, and all other methods are byte for byte identical.

Signed-off-by: alxkm <alexanderklmn@gmail.com>
@greptile-apps

greptile-apps Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Low impact] This PR appears safe to merge; the six replacements preserve existing behavior.

Summary

Replaces six guarded casts with pattern variables in the server event filter.

  • Server event filters use checked values without casting them again.

Reviews (1) · Last reviewed commit: "Use pattern variables in the server even..." · Reviewed by Greptile

@kevinherron
kevinherron changed the base branch from integration/1.2 to main October 13, 2026 17:56
@kevinherron

Copy link
Copy Markdown
Contributor

@alxkm I changed the base, we're back to targeting main.

@kevinherron
kevinherron merged commit 6f500a0 into eclipse-milo:main Oct 16, 2026
4 checks passed
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