Repository navigation
Conversation
[Low impact] The PR appears safe to merge. SummaryReplaces nine
Reviews (1) · Last reviewed commit: "Use pattern variables in the client SDK" · Reviewed by Greptile |
AddressSpace, OpcUaClient, PublishingManager and SessionFsmFactory check a type with instanceof and then cast the same value again in nine 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. These are the last such sites in sdk-client. No behaviour change. I compared the bytecode of every method in the four classes and their inner classes. The 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. The one exception is notifyFaultListeners, where ex.getCause() is now called once instead of twice, since the pattern variable keeps the result. Signed-off-by: alxkm <alexanderklmn@gmail.com>
alxkm
force-pushed
the
improve/sdk-client-pattern-variables
branch
from
October 22, 2026 09:31
fa0358b to
151d7a3
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Same change as #2092, #2102, #2110 and #2128, for the client SDK.
AddressSpace,OpcUaClient,PublishingManagerandSessionFsmFactorycheck a type withinstanceofand then cast the same value again in nine places, the form the #1440 inspection skipped. Each now binds a pattern variable. 4 files, 18 lines. These are the last such sites in sdk-client.No behaviour change. I compared the bytecode of every method in the four classes and their inner classes: the 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. One thing worth naming: in
OpcUaClient.notifyFaultListenersthe pattern variable keeps the result ofex.getCause(), so it is called once instead of twice. mvn verify passes for sdk-client and the integration tests.