diff options
Diffstat (limited to 'sanitizers/src/test/java/com/example/ClassLoaderLoadClass.java')
-rw-r--r-- | sanitizers/src/test/java/com/example/ClassLoaderLoadClass.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sanitizers/src/test/java/com/example/ClassLoaderLoadClass.java b/sanitizers/src/test/java/com/example/ClassLoaderLoadClass.java index c3fa47ac..207f29cd 100644 --- a/sanitizers/src/test/java/com/example/ClassLoaderLoadClass.java +++ b/sanitizers/src/test/java/com/example/ClassLoaderLoadClass.java @@ -22,9 +22,11 @@ public class ClassLoaderLoadClass { String input = data.consumeRemainingAsAsciiString(); try { // create an instance to trigger class initialization - ClassLoaderLoadClass.class.getClassLoader().loadClass(input).getConstructor().newInstance(); - } catch (ClassNotFoundException | InvocationTargetException | InstantiationException - | IllegalAccessException | NoSuchMethodException ignored) { + ClassLoaderLoadClass.class.getClassLoader().loadClass(input).newInstance(); + // TODO(khaled): this fails to reproduce the finding. It seems that this is related to not + // throwing a hard-to-catch error when not running in the fuzzing mode. + // ClassLoaderLoadClass.class.getClassLoader().loadClass(input).getConstructor().newInstance(); + } catch (ClassNotFoundException | InstantiationException | IllegalAccessException ignored) { } } } |