chrisdutz commented on code in PR #2674:
URL: https://github.com/apache/plc4x/pull/2674#discussion_r3750285261
##########
plc4j/drivers/eip/src/main/java/org/apache/plc4x/java/eip/base/EipTcpConnection.java:
##########
@@ -278,11 +278,21 @@ private CompletableFuture<Void> probeAttributes() {
});
}
- private CompletableFuture<Void> checkAttributesSingle() {
+ private CipService getCipService(EipPacket response) {
Review Comment:
What do you think about this? As I mentioned ... I'm not very fond of these
cast variables outside of the code block that creates it? (And yes ... I know
you didn't introduce this pattern ;-)
```
return switch (getCipService(response)) {
case GetAttributeAllResponse gar
when gar.getStatus() ==
CIPStatus.ServiceNotSupported.getValue() ->
probeAttributesUsingSingleAttributeRequest();
case GetAttributeAllResponse gar -> {
recordSupportedClasses(gar.getAttributes());
yield CompletableFuture.completedFuture(null);
}
case null, default -> CompletableFuture.completedFuture(null);
};
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]