Skip to content

Commit 05c193c

Browse files
puredangerstuarthalloway
authored andcommitted
CLJ-2492 Fix use of deprecated Class.newInstance() method
Signed-off-by: Stuart Halloway <[email protected]>
1 parent 3b6c31b commit 05c193c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/jvm/clojure/lang/Compiler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4997,7 +4997,7 @@ public Object eval() {
49974997
return null;
49984998
try
49994999
{
5000-
return getCompiledClass().newInstance();
5000+
return getCompiledClass().getDeclaredConstructor().newInstance();
50015001
}
50025002
catch(Exception e)
50035003
{

src/jvm/clojure/lang/FnLoaderThunk.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ private void load() {
5151
{
5252
try
5353
{
54-
fn = (IFn) Class.forName(fnClassName,true,loader).newInstance();
54+
fn = (IFn) Class.forName(fnClassName,true,loader).getDeclaredConstructor().newInstance();
5555
}
5656
catch(Exception e)
5757
{

0 commit comments

Comments
 (0)