From 9e1a62662ab8a5b51d7e1e5b0ef56bfda6fef7e0 Mon Sep 17 00:00:00 2001 From: Fabrice Ducos Date: Tue, 14 Jun 2022 22:25:20 +0200 Subject: [PATCH] Removed deprecated wrapper class constructors (new Byte, ..., new Integer, new Double...) Replaced with valueOf() in order to silence many warnings from modern versions of the JDK --- src/core/org/luaj/vm2/compiler/FuncState.java | 2 +- src/core/org/luaj/vm2/compiler/LexState.java | 2 +- .../org/luaj/vm2/lib/jse/CoerceLuaToJava.java | 16 ++++++++-------- src/jse/org/luaj/vm2/script/LuaScriptEngine.java | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/core/org/luaj/vm2/compiler/FuncState.java b/src/core/org/luaj/vm2/compiler/FuncState.java index 70e0f885..98534d50 100644 --- a/src/core/org/luaj/vm2/compiler/FuncState.java +++ b/src/core/org/luaj/vm2/compiler/FuncState.java @@ -479,7 +479,7 @@ public class FuncState extends Constants { return ((Integer) h.get(v)).intValue(); } final int idx = this.nk; - this.h.put(v, new Integer(idx)); + this.h.put(v, Integer.valueOf(idx)); final Prototype f = this.f; if (f.k == null || nk + 1 >= f.k.length) f.k = realloc( f.k, nk*2 + 1 ); diff --git a/src/core/org/luaj/vm2/compiler/LexState.java b/src/core/org/luaj/vm2/compiler/LexState.java index 0192de05..c3a64b16 100644 --- a/src/core/org/luaj/vm2/compiler/LexState.java +++ b/src/core/org/luaj/vm2/compiler/LexState.java @@ -170,7 +170,7 @@ public class LexState extends Constants { static { for ( int i=0; i