From 348be14244b4a0204ba76f975408320c7b4341c6 Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Wed, 21 Aug 2024 16:15:22 +0200 Subject: [PATCH] Catching Error is not recommended Signed-off-by: Sven Strickroth --- java8-shim/src/main/java/org/owasp/shim/Java8Shim.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java8-shim/src/main/java/org/owasp/shim/Java8Shim.java b/java8-shim/src/main/java/org/owasp/shim/Java8Shim.java index abc5c1c5..35a2863b 100644 --- a/java8-shim/src/main/java/org/owasp/shim/Java8Shim.java +++ b/java8-shim/src/main/java/org/owasp/shim/Java8Shim.java @@ -19,7 +19,7 @@ public abstract class Java8Shim { try { // This is compiled with -release 1.9 in a separate project. _instance = Class.forName("org.owasp.shim.ForJava9AndLater").newInstance(); - } catch (Error e) { + } catch (Throwable e) { // This is co-located with this project and is a fall-back. _instance = Class.forName("org.owasp.shim.ForJava8").newInstance(); }