private List<Instruction> transformSetterInvocation(InvokeInstruction insn, String property) { ValueType type = insn.getMethod().getDescriptor().parameterType(0); List<Instruction> instructions = new ArrayList<>(); if (type instanceof ValueType.Primitive) { switch (((ValueType.Primitive) type).getKind()) { case BOOLEAN: castAndSetProperty(insn, property, instructions, boolean.class); return instructions; case BYTE: castAndSetProperty(insn, property, instructions, byte.class); return instructions; case SHORT: castAndSetProperty(insn, property, instructions, short.class); return instructions; case INTEGER: castAndSetProperty(insn, property, instructions, int.class); return instructions; case FLOAT: castAndSetProperty(insn, property, instructions, float.class); return instructions; case DOUBLE: castAndSetProperty(insn, property, instructions, double.class); return instructions; case CHARACTER: case LONG: break; } } else if (type instanceof ValueType.Object) { switch (((ValueType.Object) type).getClassName()) { case "java.lang.String": { Variable castVar = insn.getProgram().createVariable(); InvokeInstruction castInvoke = new InvokeInstruction(); castInvoke.setType(InvocationType.SPECIAL); castInvoke.setMethod( new MethodReference( ResourceAccessor.class, "castFromString", String.class, Object.class)); castInvoke.getArguments().add(insn.getArguments().get(0)); castInvoke.setReceiver(castVar); instructions.add(castInvoke); setProperty(insn, property, instructions, castVar); return instructions; } default: { setProperty(insn, property, instructions, insn.getArguments().get(0)); return instructions; } } } return null; }