update for support of modern JDKs #113
@@ -479,7 +479,7 @@ public class FuncState extends Constants {
|
|||||||
return ((Integer) h.get(v)).intValue();
|
return ((Integer) h.get(v)).intValue();
|
||||||
}
|
}
|
||||||
final int idx = this.nk;
|
final int idx = this.nk;
|
||||||
this.h.put(v, new Integer(idx));
|
this.h.put(v, Integer.valueOf(idx));
|
||||||
final Prototype f = this.f;
|
final Prototype f = this.f;
|
||||||
if (f.k == null || nk + 1 >= f.k.length)
|
if (f.k == null || nk + 1 >= f.k.length)
|
||||||
f.k = realloc( f.k, nk*2 + 1 );
|
f.k = realloc( f.k, nk*2 + 1 );
|
||||||
|
|||||||
@@ -170,7 +170,7 @@ public class LexState extends Constants {
|
|||||||
static {
|
static {
|
||||||
for ( int i=0; i<NUM_RESERVED; i++ ) {
|
for ( int i=0; i<NUM_RESERVED; i++ ) {
|
||||||
LuaString ts = (LuaString) LuaValue.valueOf( luaX_tokens[i] );
|
LuaString ts = (LuaString) LuaValue.valueOf( luaX_tokens[i] );
|
||||||
RESERVED.put(ts, new Integer(FIRST_RESERVED+i));
|
RESERVED.put(ts, Integer.valueOf(FIRST_RESERVED+i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -174,13 +174,13 @@ public class CoerceLuaToJava {
|
|||||||
|
|
||||||
public Object coerce(LuaValue value) {
|
public Object coerce(LuaValue value) {
|
||||||
switch ( targetType ) {
|
switch ( targetType ) {
|
||||||
case TARGET_TYPE_BYTE: return new Byte( (byte) value.toint() );
|
case TARGET_TYPE_BYTE: return Byte.valueOf( (byte) value.toint() );
|
||||||
case TARGET_TYPE_CHAR: return new Character( (char) value.toint() );
|
case TARGET_TYPE_CHAR: return Character.valueOf( (char) value.toint() );
|
||||||
case TARGET_TYPE_SHORT: return new Short( (short) value.toint() );
|
case TARGET_TYPE_SHORT: return Short.valueOf( (short) value.toint() );
|
||||||
case TARGET_TYPE_INT: return new Integer( (int) value.toint() );
|
case TARGET_TYPE_INT: return Integer.valueOf( (int) value.toint() );
|
||||||
case TARGET_TYPE_LONG: return new Long( (long) value.todouble() );
|
case TARGET_TYPE_LONG: return Long.valueOf( (long) value.todouble() );
|
||||||
case TARGET_TYPE_FLOAT: return new Float( (float) value.todouble() );
|
case TARGET_TYPE_FLOAT: return Float.valueOf( (float) value.todouble() );
|
||||||
case TARGET_TYPE_DOUBLE: return new Double( (double) value.todouble() );
|
case TARGET_TYPE_DOUBLE: return Double.valueOf( (double) value.todouble() );
|
||||||
default: return null;
|
default: return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -308,7 +308,7 @@ public class CoerceLuaToJava {
|
|||||||
public Object coerce(LuaValue value) {
|
public Object coerce(LuaValue value) {
|
||||||
switch ( value.type() ) {
|
switch ( value.type() ) {
|
||||||
case LuaValue.TNUMBER:
|
case LuaValue.TNUMBER:
|
||||||
return value.isint()? (Object)new Integer(value.toint()): (Object)new Double(value.todouble());
|
return value.isint()? (Object) Integer.valueOf(value.toint()): (Object) Double.valueOf(value.todouble());
|
||||||
case LuaValue.TBOOLEAN:
|
case LuaValue.TBOOLEAN:
|
||||||
return value.toboolean()? Boolean.TRUE: Boolean.FALSE;
|
return value.toboolean()? Boolean.TRUE: Boolean.FALSE;
|
||||||
case LuaValue.TSTRING:
|
case LuaValue.TSTRING:
|
||||||
|
|||||||
@@ -244,8 +244,8 @@ public class LuaScriptEngine extends AbstractScriptEngine implements ScriptEngin
|
|||||||
case LuaValue.TSTRING: return luajValue.tojstring();
|
case LuaValue.TSTRING: return luajValue.tojstring();
|
||||||
case LuaValue.TUSERDATA: return luajValue.checkuserdata(Object.class);
|
case LuaValue.TUSERDATA: return luajValue.checkuserdata(Object.class);
|
||||||
case LuaValue.TNUMBER: return luajValue.isinttype()?
|
case LuaValue.TNUMBER: return luajValue.isinttype()?
|
||||||
(Object) new Integer(luajValue.toint()):
|
(Object) Integer.valueOf(luajValue.toint()):
|
||||||
(Object) new Double(luajValue.todouble());
|
(Object) Double.valueOf(luajValue.todouble());
|
||||||
default: return luajValue;
|
default: return luajValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user