if (type == int.class)
{
// Create a new instance of the wrapper
LocalVariableGen i = methodGen.addLocalVariable("i", Type.INT, null, null);
i.setStart(implementation.append(factory.createStore(Type.INT, i.getIndex())));
implementation.append(factory.createNew(new ObjectType(Integer.class.getName())));
implementation.append(InstructionConstants.DUP);
implementation.append(factory.createLoad(Type.INT, i.getIndex()));
i.setEnd(implementation.append(factory.createInvoke(Integer.class.getName(), "<init>", Type.VOID, new Type[]{Type.INT}, Constants.INVOKESPECIAL)));
}
else if (type == boolean.class)
{
// Create a new instance of the wrapper
LocalVariableGen b = methodGen.addLocalVariable("b", Type.BOOLEAN, null, null);
b.setStart(implementation.append(factory.createStore(Type.BOOLEAN, b.getIndex())));
implementation.append(factory.createNew(new ObjectType(Boolean.class.getName())));
implementation.append(InstructionConstants.DUP);
implementation.append(factory.createLoad(Type.BOOLEAN, b.getIndex()));
b.setEnd(implementation.append(factory.createInvoke(Boolean.class.getName(), "<init>", Type.VOID, new Type[]{Type.BOOLEAN}, Constants.INVOKESPECIAL)));
}
else if (type == long.class)
{
// Create a new instance of the wrapper
LocalVariableGen l = methodGen.addLocalVariable("l", Type.LONG, null, null);
l.setStart(implementation.append(factory.createStore(Type.LONG, l.getIndex())));
implementation.append(factory.createNew(new ObjectType(Long.class.getName())));
implementation.append(InstructionConstants.DUP);
implementation.append(factory.createLoad(Type.LONG, l.getIndex()));
l.setEnd(implementation.append(factory.createInvoke(Long.class.getName(), "<init>", Type.VOID, new Type[]{Type.LONG}, Constants.INVOKESPECIAL)));
}
else if (type == byte.class)
{
// Create a new instance of the wrapper
LocalVariableGen b = methodGen.addLocalVariable("b", Type.BYTE, null, null);
b.setStart(implementation.append(factory.createStore(Type.BYTE, b.getIndex())));
implementation.append(factory.createNew(new ObjectType(Byte.class.getName())));
implementation.append(InstructionConstants.DUP);
implementation.append(factory.createLoad(Type.BYTE, b.getIndex()));
b.setEnd(implementation.append(factory.createInvoke(Byte.class.getName(), "<init>", Type.VOID, new Type[]{Type.BYTE}, Constants.INVOKESPECIAL)));
}
else if (type == char.class)
{
// Create a new instance of the wrapper
LocalVariableGen c = methodGen.addLocalVariable("c", Type.CHAR, null, null);
c.setStart(implementation.append(factory.createStore(Type.CHAR, c.getIndex())));
implementation.append(factory.createNew(new ObjectType(Character.class.getName())));
implementation.append(InstructionConstants.DUP);
implementation.append(factory.createLoad(Type.CHAR, c.getIndex()));
c.setEnd(implementation.append(factory.createInvoke(Character.class.getName(), "<init>", Type.VOID, new Type[]{Type.CHAR}, Constants.INVOKESPECIAL)));
}
else if (type == short.class)
{
// Create a new instance of the wrapper
LocalVariableGen s = methodGen.addLocalVariable("s", Type.SHORT, null, null);
s.setStart(implementation.append(factory.createStore(Type.SHORT, s.getIndex())));
implementation.append(factory.createNew(new ObjectType(Short.class.getName())));
implementation.append(InstructionConstants.DUP);
implementation.append(factory.createLoad(Type.SHORT, s.getIndex()));
s.setEnd(implementation.append(factory.createInvoke(Short.class.getName(), "<init>", Type.VOID, new Type[]{Type.SHORT}, Constants.INVOKESPECIAL)));
}
else if (type == float.class)
{
// Create a new instance of the wrapper
LocalVariableGen f = methodGen.addLocalVariable("f", Type.FLOAT, null, null);
f.setStart(implementation.append(factory.createStore(Type.FLOAT, f.getIndex())));
implementation.append(factory.createNew(new ObjectType(Float.class.getName())));
implementation.append(InstructionConstants.DUP);
implementation.append(factory.createLoad(Type.FLOAT, f.getIndex()));
f.setEnd(implementation.append(factory.createInvoke(Float.class.getName(), "<init>", Type.VOID, new Type[]{Type.FLOAT}, Constants.INVOKESPECIAL)));
}
else
{
// Create a new instance of the wrapper
LocalVariableGen d = methodGen.addLocalVariable("d", Type.DOUBLE, null, null);
d.setStart(implementation.append(factory.createStore(Type.DOUBLE, d.getIndex())));
implementation.append(factory.createNew(new ObjectType(Double.class.getName())));
implementation.append(InstructionConstants.DUP);
implementation.append(factory.createLoad(Type.DOUBLE, d.getIndex()));
d.setEnd(implementation.append(factory.createInvoke(Double.class.getName(), "<init>", Type.VOID, new Type[]{Type.DOUBLE}, Constants.INVOKESPECIAL)));
}
}