@Override public String getDesc() { return org.objectweb.asm.Type.getType(target).toString(); }
@Override public String getDesc() { return org.objectweb.asm.Type.getType(target).toString(); }
private static Type addFiberType(Type type) { String typeDesc = type.toString().replace(")", D_FIBER_LAST_ARG); return Type.getType(typeDesc); }
public OutputCoverageGoal(String className, String methodName, Type type, String valueDescriptor, Number numericValue) { if (className == null || methodName == null) throw new IllegalArgumentException("null given"); this.className = className; this.methodName = methodName; this.type = type.toString(); this.valueDescriptor = valueDescriptor; this.numericValue = numericValue; }
public InputCoverageGoal(String className, String methodName, int argIndex, Type type, String valueDescriptor, Number numericValue) { if (className == null || methodName == null) throw new IllegalArgumentException("null given"); this.className = className; this.methodName = methodName; this.argIndex = argIndex; this.type = type.toString(); this.valueDescriptor = valueDescriptor; this.numericValue = numericValue; }
static String typeArrayToStringArgDescriptor(Type[] argTypes) { StringBuilder descriptor = new StringBuilder(); for (Type t : argTypes) { descriptor.append(t.toString()); } return descriptor.toString(); }
static String typeArrayToStringArgDescriptor(Type[] argTypes) { StringBuilder descriptor = new StringBuilder(); for (Type t : argTypes) { descriptor.append(t.toString()); } return descriptor.toString(); }
private void writeObject ( ObjectOutputStream oos ) throws IOException { oos.defaultWriteObject(); oos.writeInt(this.returnTypes.size()); for ( Entry<MethodReference, Type> entry : this.returnTypes.entrySet() ) { oos.writeObject(entry.getKey()); oos.writeUTF(entry.getValue().toString()); } }
private void writeObject ( ObjectOutputStream oos ) throws IOException { oos.defaultWriteObject(); oos.writeBoolean(this.targetType != null); if ( this.targetType != null ) { oos.writeUTF(this.targetType.toString()); } if ( this.argumentTypes != null ) { oos.writeBoolean(true); oos.writeInt(this.argumentTypes != null ? this.argumentTypes.length : 0); for ( Type t : this.argumentTypes ) { oos.writeUTF(t != null ? t.toString() : null); } } else { oos.writeBoolean(false); } }
public static WrapperType valueOf(Type type) { for (WrapperType wrapperType : TYPES) { if (wrapperType.getWrapperType().equals(type)) { return wrapperType; } } throw new IllegalArgumentException(type.toString()); }
public static void visitTypeSignature(TypeToken<?> type, SignatureVisitor visitor) { Class<?> rawType = type.getRawType(); if (rawType.isPrimitive()) { visitor.visitBaseType(Type.getType(rawType).toString().charAt(0)); return; } else if (rawType.isArray()) { visitTypeSignature(type.getComponentType(), visitor.visitArrayType()); return; } else { visitor.visitClassType(Type.getInternalName(rawType)); } java.lang.reflect.Type visitType = type.getType(); if (visitType instanceof ParameterizedType) { for (java.lang.reflect.Type argType : ((ParameterizedType) visitType).getActualTypeArguments()) { visitTypeSignature(TypeToken.of(argType), visitor.visitTypeArgument(SignatureVisitor.INSTANCEOF)); } } visitor.visitEnd(); }
public static void visitTypeSignature(TypeToken<?> type, SignatureVisitor visitor) { Class<?> rawType = type.getRawType(); if (rawType.isPrimitive()) { visitor.visitBaseType(Type.getType(rawType).toString().charAt(0)); return; } else if (rawType.isArray()) { visitTypeSignature(type.getComponentType(), visitor.visitArrayType()); return; } else { visitor.visitClassType(Type.getInternalName(rawType)); } java.lang.reflect.Type visitType = type.getType(); if (visitType instanceof ParameterizedType) { for (java.lang.reflect.Type argType : ((ParameterizedType) visitType).getActualTypeArguments()) { visitTypeSignature(TypeToken.of(argType), visitor.visitTypeArgument(SignatureVisitor.INSTANCEOF)); } } visitor.visitEnd(); }
private void backportLambda(String invokedName, Type invokedType, Handle bsm, Object[] bsmArgs) { Type[] argumentTypes= Type.getArgumentTypes(invokedType.toString()); Type returnType= Type.getReturnType(invokedType.toString()); String returnTypeName= returnType.getClassName(); int length= argumentTypes.length; createArrayWithParameters(length, argumentTypes); this.visitLdcInsn(myClassName); this.visitLdcInsn(invokedName); this.visitLdcInsn(returnTypeName); this.visitLdcInsn(invokedType.toString()); this.visitLdcInsn(bsmArgs[1].toString()); this.visitVarInsn(Opcodes.ALOAD, 20); this.visitLdcInsn(bsm.getTag() == 5 ? "virtual" : "static"); String runnableSignature= "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object;"; this.visitMethodInsn(INVOKESTATIC, "com/dragome/utils/DragomeCallsiteFactory", "create", runnableSignature, false); }
private Class<?> primitiveClassType(Type t) { if (t.equals(Type.BOOLEAN_TYPE)) return boolean[].class; if (t.equals(Type.CHAR_TYPE)) return char[].class; if (t.equals(Type.SHORT_TYPE)) return short[].class; if (t.equals(Type.BYTE_TYPE)) return byte[].class; if (t.equals(Type.INT_TYPE)) return int[].class; if (t.equals(Type.LONG_TYPE)) return long[].class; if (t.equals(Type.FLOAT_TYPE)) return float[].class; if (t.equals(Type.DOUBLE_TYPE)) return double[].class; throw new EvosuiteError(t.toString() + " is not a primitive value class!"); }
private void pushValue(Type argType, Expression<?> symb_expr) { if (isBv32(argType)) { IntegerValue booleanExpr = (IntegerValue) symb_expr; env.topFrame().operandStack.pushBv32(booleanExpr); } else if (isBv64(argType)) { IntegerValue longExpr = (IntegerValue) symb_expr; env.topFrame().operandStack.pushBv64(longExpr); } else if (isFp32(argType)) { RealValue realExpr = (RealValue) symb_expr; env.topFrame().operandStack.pushFp32(realExpr); } else if (isFp64(argType)) { RealValue realExpr = (RealValue) symb_expr; env.topFrame().operandStack.pushFp64(realExpr); } else { throw new EvosuiteError(argType.toString() + " is not a value type!"); } }
private void pushDummyValue(Type argType) { if (isBv32(argType)) { IntegerValue integerExpr = ExpressionFactory.buildNewIntegerConstant(0); env.topFrame().operandStack.pushBv32(integerExpr); } else if (isBv64(argType)) { IntegerValue integerExpr = ExpressionFactory.buildNewIntegerConstant(0); env.topFrame().operandStack.pushBv64(integerExpr); } else if (isFp32(argType)) { RealValue realExpr = ExpressionFactory.buildNewRealConstant(0); env.topFrame().operandStack.pushFp32(realExpr); } else if (isFp64(argType)) { RealValue realExpr = ExpressionFactory.buildNewRealConstant(0); env.topFrame().operandStack.pushFp64(realExpr); } else { throw new EvosuiteError(argType.toString() + " is not a value type!"); } }