Copilot commented on code in PR #2673:
URL: https://github.com/apache/plc4x/pull/2673#discussion_r3746998592


##########
plc4j/drivers/eip/src/main/java/org/apache/plc4x/java/eip/base/EipTcpConnection.java:
##########
@@ -93,7 +91,7 @@ public class EipTcpConnection extends 
PollingSubscriptionConnectionBase<EIPConfi
     private final NullAddressItem nullAddressItem = new NullAddressItem();
     private final List<PathSegment> routingAddress = new ArrayList<>();
     private short connectionPathSize = 0;
-    private final int connectionSerialNumber = 
ThreadLocalRandom.current().nextInt();
+    private final int connectionSerialNumber = 
ThreadLocalRandom.current().nextInt(1, 0xFFFF);

Review Comment:
   `ThreadLocalRandom.nextInt(origin, bound)` uses an exclusive upper bound, so 
`nextInt(1, 0xFFFF)` will never produce `0xFFFF` (65535). If the intent is the 
full 16-bit unsigned range (or 1..65535), use an exclusive bound of `0x1_0000` 
to avoid an off-by-one and make the range explicit.



-- 
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]

Reply via email to