Copilot commented on code in PR #7620:
URL: https://github.com/apache/ignite-3/pull/7620#discussion_r2822027827
##########
modules/api/src/main/java/org/apache/ignite/lang/ErrorGroups.java:
##########
@@ -35,6 +35,9 @@
public class ErrorGroups {
/** Additional prefix that is used in a human-readable format of ignite
errors. */
public static final String IGNITE_ERR_PREFIX = "IGN";
+
Review Comment:
The constant ERROR_GROUP_UNKNOWN is missing a Javadoc comment. For
consistency with the existing IGNITE_ERR_PREFIX constant above (line 36-37),
consider adding a documentation comment such as: `/** Name prefix for unknown
error groups from newer Ignite versions. */`
```suggestion
/** Name prefix for unknown error groups from newer Ignite versions. */
```
##########
modules/core/src/test/java/org/apache/ignite/internal/lang/IgniteExceptionTest.java:
##########
@@ -262,6 +263,45 @@ public void testIgniteInternalCheckedExceptionProperties()
{
assertTrue(ex.toString().contains("IGN-CMN-65535"), ex.toString());
}
+ @Test
+ public void testUnknownErrorCode() {
+ int unknownCode = (999 << 16) | 1;
+ UUID traceId = UUID.randomUUID();
+ String message = "Error from unknown group";
+
+ IgniteException ex = new IgniteException(traceId, unknownCode,
message);
+
+ assertEquals(unknownCode, ex.code());
+ assertEquals((short) 999, ex.groupCode());
Review Comment:
Redundant assertion: Line 281 already verifies that `ex.groupCode()` equals
999. The cast to short in this assertion is unnecessary since the method
returns a short, and integer comparison works correctly with automatic
widening. Consider removing this duplicate assertion for consistency with other
test methods in this file (e.g., lines 215, 230, 245).
```suggestion
```
--
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]