This is an automated email from the ASF dual-hosted git repository. robertlazarski pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/axis-axis2-java-core.git
commit 39d7cc2b784d27cb1d3e80167bb8f898682c5428 Author: Robert Lazarski <[email protected]> AuthorDate: Mon Apr 20 19:48:00 2026 -1000 Use ReflectiveOperationException in WideRecord test helper Narrow catch blocks from generic Exception to ReflectiveOperationException and throw AssertionError for clearer test failure diagnostics. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> --- .../json/streaming/FieldFilteringMessageFormatterTest.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/json/test/org/apache/axis2/json/streaming/FieldFilteringMessageFormatterTest.java b/modules/json/test/org/apache/axis2/json/streaming/FieldFilteringMessageFormatterTest.java index 77dadfb298..a0a39455bc 100644 --- a/modules/json/test/org/apache/axis2/json/streaming/FieldFilteringMessageFormatterTest.java +++ b/modules/json/test/org/apache/axis2/json/streaming/FieldFilteringMessageFormatterTest.java @@ -481,27 +481,27 @@ public class FieldFilteringMessageFormatterTest { for (int n = 0; n < 30; n++) { try { r.getClass().getField("s" + n).set(r, "val_" + n); - } catch (Exception e) { throw new RuntimeException(e); } + } catch (ReflectiveOperationException e) { throw new AssertionError("Field setup failed", e); } } for (int n = 0; n < 40; n++) { try { r.getClass().getField("d" + n).setDouble(r, n * 1.1); - } catch (Exception e) { throw new RuntimeException(e); } + } catch (ReflectiveOperationException e) { throw new AssertionError("Field setup failed", e); } } for (int n = 0; n < 25; n++) { try { r.getClass().getField("i" + n).setInt(r, n * 100); - } catch (Exception e) { throw new RuntimeException(e); } + } catch (ReflectiveOperationException e) { throw new AssertionError("Field setup failed", e); } } for (int n = 0; n < 20; n++) { try { r.getClass().getField("l" + n).setLong(r, n * 1000000L); - } catch (Exception e) { throw new RuntimeException(e); } + } catch (ReflectiveOperationException e) { throw new AssertionError("Field setup failed", e); } } for (int n = 0; n < 12; n++) { try { r.getClass().getField("b" + n).setBoolean(r, n % 2 == 0); - } catch (Exception e) { throw new RuntimeException(e); } + } catch (ReflectiveOperationException e) { throw new AssertionError("Field setup failed", e); } } return r; }
