JAVA-083 / Advanced
Input-driven class loading through reflection
Why is this a problem?
Arbitrary class constructors or methods are invoked.
How to fix it
java
Map<String, Supplier<Handler>> REG = Map.of("pdf", PdfHandler::new);
Handler h = Optional.ofNullable(REG.get(type)).orElseThrow().get();