Uses of deprecated Class.newInstance() method

Description

As of Java 9, Class.newInstance() has been deprecated (see https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/Class.html#newInstance() ). These calls can be replaced with a call to clazz.getDeclaredConstructor().newInstance(). The reason for the deprecation is that that path bypasses compile-time exception checking. Not a big deal, but better to fix this in case it's removed in the future.

There are two cases of this in Clojure - one in Compiler and one in FnLoaderThunk (no longer used). Patch changes both.

Patch: clj-2492.patch

Environment

None
Completed

Assignee

Unassigned

Reporter

Alex Miller

Labels

None

Approval

Ok

Patch

Code

Fix versions

Affects versions

Priority

Major
Configure