Add AttributeFilterChain.remove() method#1699
Conversation
Co-authored-by: kevinherron <340273+kevinherron@users.noreply.github.com>
Co-authored-by: kevinherron <340273+kevinherron@users.noreply.github.com>
.../src/test/java/org/eclipse/milo/opcua/sdk/server/nodes/filters/AttributeFilterChainTest.java
Outdated
Show resolved
Hide resolved
kevinherron
left a comment
There was a problem hiding this comment.
See comment about assertThrows
Co-authored-by: kevinherron <340273+kevinherron@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Already addressed in commit 1800900 - the test now uses assertThrows instead of try-catch. |
There was a problem hiding this comment.
Pull request overview
Adds support for removing an AttributeFilter from an AttributeFilterChain, addressing the inability to remove filters once added (per issue #1697/#1698).
Changes:
- Added
AttributeFilterChain.remove(AttributeFilter)with null validation and safe no-op behavior for empty chains. - Added a comprehensive JUnit 5 test suite for
remove()covering empty chains, first/middle/last removal, non-existent filter removal, and null handling.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| opc-ua-sdk/sdk-server/src/main/java/org/eclipse/milo/opcua/sdk/server/nodes/filters/AttributeFilterChain.java | Introduces remove(AttributeFilter) to delete a filter instance from the chain while preserving fluent chaining semantics. |
| opc-ua-sdk/sdk-server/src/test/java/org/eclipse/milo/opcua/sdk/server/nodes/filters/AttributeFilterChainTest.java | Adds focused unit tests validating correctness and post-removal behavior of the filter chain. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Implementation Plan for AttributeFilterChain.remove()
remove(AttributeFilter filter)method to AttributeFilterChain classImplementation Summary
Successfully implemented
AttributeFilterChain.remove()method as requested in issue #1697.Key Features:
this)Testing:
All 8 test cases pass successfully, using JUnit 5's assertThrows for clean exception testing.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.