This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-imaging.git


The following commit(s) were added to refs/heads/master by this push:
     new 62c62e9f Update test to match InterruptedException guidelines
62c62e9f is described below

commit 62c62e9f1d2e4d064dc7109e7f8f72843fd62c0d
Author: Gary Gregory <[email protected]>
AuthorDate: Wed Jan 28 07:00:42 2026 -0500

    Update test to match InterruptedException guidelines
---
 .../imaging/examples/ApacheImagingSpeedAndMemoryTest.java        | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git 
a/src/test/java/org/apache/commons/imaging/examples/ApacheImagingSpeedAndMemoryTest.java
 
b/src/test/java/org/apache/commons/imaging/examples/ApacheImagingSpeedAndMemoryTest.java
index 1de4980c..b4e906be 100644
--- 
a/src/test/java/org/apache/commons/imaging/examples/ApacheImagingSpeedAndMemoryTest.java
+++ 
b/src/test/java/org/apache/commons/imaging/examples/ApacheImagingSpeedAndMemoryTest.java
@@ -243,8 +243,8 @@ class ApacheImagingSpeedAndMemoryTest {
                 byteSource = null;
                 params = null;
                 tiffImageParser = null;
-            } catch (final IOException ioex) {
-                ioex.printStackTrace();
+            } catch (final IOException e) {
+                e.printStackTrace();
                 System.exit(-1);
             }
             try {
@@ -255,9 +255,10 @@ class ApacheImagingSpeedAndMemoryTest {
                 // suggesting that the code should be modified
                 Runtime.getRuntime().gc();
                 Thread.sleep(1000);
-            } catch (final InterruptedException iex) {
+            } catch (final InterruptedException e) {
                 // this isn't fatal, but shouldn't happen
-                iex.printStackTrace();
+                Thread.currentThread().interrupt();
+                e.printStackTrace();
             }
         }
     }

Reply via email to