/** * Gets the colloquial type name and human form of the type of the * given constant, when used as an encoded value. * * @param cst {@code non-null;} the constant * @return {@code non-null;} its type name and human form */ public static String constantToHuman(Constant cst) { int type = constantToValueType(cst); if (type == VALUE_NULL) { return "null"; } StringBuilder sb = new StringBuilder(); sb.append(cst.typeName()); sb.append(' '); sb.append(cst.toHuman()); return sb.toString(); }
/** * Gets the colloquial type name and human form of the type of the * given constant, when used as an encoded value. * * @param cst {@code non-null;} the constant * @return {@code non-null;} its type name and human form */ public static String constantToHuman(Constant cst) { int type = constantToValueType(cst); if (type == VALUE_NULL) { return "null"; } StringBuilder sb = new StringBuilder(); sb.append(cst.typeName()); sb.append(' '); sb.append(cst.toHuman()); return sb.toString(); }
private void checkConstMethodHandleSupported(Constant cst) throws SimException { if (!dexOptions.apiIsSupported(DexFormat.API_CONST_METHOD_HANDLE)) { fail(String.format("invalid constant type %s requires --min-sdk-version >= %d " + "(currently %d)", cst.typeName(), DexFormat.API_CONST_METHOD_HANDLE, dexOptions.minSdkVersion)); } }
/** * Gets the colloquial type name and human form of the type of the * given constant, when used as an encoded value. * * @param cst {@code non-null;} the constant * @return {@code non-null;} its type name and human form */ public static String constantToHuman(Constant cst) { int type = constantToValueType(cst); if (type == VALUE_NULL) { return "null"; } StringBuilder sb = new StringBuilder(); sb.append(cst.typeName()); sb.append(' '); sb.append(cst.toHuman()); return sb.toString(); }
/** * Gets the colloquial type name and human form of the type of the * given constant, when used as an encoded value. * * @param cst {@code non-null;} the constant * @return {@code non-null;} its type name and human form */ public static String constantToHuman(Constant cst) { int type = constantToValueType(cst); if (type == VALUE_NULL) { return "null"; } StringBuilder sb = new StringBuilder(); sb.append(cst.typeName()); sb.append(' '); sb.append(cst.toHuman()); return sb.toString(); }
/** * Gets the colloquial type name and human form of the type of the * given constant, when used as an encoded value. * * @param cst {@code non-null;} the constant * @return {@code non-null;} its type name and human form */ public static String constantToHuman(Constant cst) { int type = constantToValueType(cst); if (type == VALUE_NULL) { return "null"; } StringBuilder sb = new StringBuilder(); sb.append(cst.typeName()); sb.append(' '); sb.append(cst.toHuman()); return sb.toString(); }
/** * Gets the colloquial type name and human form of the type of the * given constant, when used as an encoded value. * * @param cst {@code non-null;} the constant * @return {@code non-null;} its type name and human form */ public static String constantToHuman(Constant cst) { int type = constantToValueType(cst); if (type == VALUE_NULL) { return "null"; } StringBuilder sb = new StringBuilder(); sb.append(cst.typeName()); sb.append(' '); sb.append(cst.toHuman()); return sb.toString(); }
/** * Gets the colloquial type name and human form of the type of the * given constant, when used as an encoded value. * * @param cst {@code non-null;} the constant * @return {@code non-null;} its type name and human form */ public static String constantToHuman(Constant cst) { int type = constantToValueType(cst); if (type == VALUE_NULL) { return "null"; } StringBuilder sb = new StringBuilder(); sb.append(cst.typeName()); sb.append(' '); sb.append(cst.toHuman()); return sb.toString(); }
/** * Gets the colloquial type name and human form of the type of the * given constant, when used as an encoded value. * * @param cst {@code non-null;} the constant * @return {@code non-null;} its type name and human form */ public static String constantToHuman(Constant cst) { int type = constantToValueType(cst); if (type == VALUE_NULL) { return "null"; } StringBuilder sb = new StringBuilder(); sb.append(cst.typeName()); sb.append(' '); sb.append(cst.toHuman()); return sb.toString(); }
/** {@inheritDoc} */ @Override public String cstComment() { if (!hasIndex()) { return ""; } StringBuilder sb = new StringBuilder(20); sb.append(getConstant().typeName()); sb.append('@'); if (index < 65536) { sb.append(Hex.u2(index)); } else { sb.append(Hex.u4(index)); } return sb.toString(); } }
/** {@inheritDoc} */ @Override public String cstComment() { if (!hasIndex()) { return ""; } StringBuilder sb = new StringBuilder(20); sb.append(getConstant().typeName()); sb.append('@'); if (index < 65536) { sb.append(Hex.u2(index)); } else { sb.append(Hex.u4(index)); } return sb.toString(); } }
/** {@inheritDoc} */ @Override public String cstComment() { StringBuilder sb = new StringBuilder(); for (int i = 0; i < constants.length; ++i) { if (!hasIndex(i)) { return ""; } if (i > 0) { sb.append(", "); } sb.append(getConstant(i).typeName()); sb.append('@'); final int currentIndex = getIndex(i); if (currentIndex < 65536) { sb.append(Hex.u2(currentIndex)); } else { sb.append(Hex.u4(currentIndex)); } } return sb.toString(); } }
/** {@inheritDoc} */ @Override public String cstComment() { StringBuilder sb = new StringBuilder(); for (int i = 0; i < constants.length; ++i) { if (!hasIndex(i)) { return ""; } if (i > 0) { sb.append(", "); } sb.append(getConstant(i).typeName()); sb.append('@'); final int currentIndex = getIndex(i); if (currentIndex < 65536) { sb.append(Hex.u2(currentIndex)); } else { sb.append(Hex.u4(currentIndex)); } } return sb.toString(); } }
/** * Helper method to return an instruction comment for a constant. * * @param insn {@code non-null;} a constant-bearing instruction * @return {@code non-null;} comment string representing the constant */ protected static String cstComment(DalvInsn insn) { CstInsn ci = (CstInsn) insn; if (! ci.hasIndex()) { return ""; } StringBuilder sb = new StringBuilder(20); int index = ci.getIndex(); sb.append(ci.getConstant().typeName()); sb.append('@'); if (index < 65536) { sb.append(Hex.u2(index)); } else { sb.append(Hex.u4(index)); } return sb.toString(); }
/** * Helper method to return an instruction comment for a constant. * * @param insn {@code non-null;} a constant-bearing instruction * @return {@code non-null;} comment string representing the constant */ protected static String cstComment(DalvInsn insn) { CstInsn ci = (CstInsn) insn; if (! ci.hasIndex()) { return ""; } StringBuilder sb = new StringBuilder(20); int index = ci.getIndex(); sb.append(ci.getConstant().typeName()); sb.append('@'); if (index < 65536) { sb.append(Hex.u2(index)); } else { sb.append(Hex.u4(index)); } return sb.toString(); }
/** * Helper method to return an instruction comment for a constant. * * @param insn {@code non-null;} a constant-bearing instruction * @return {@code non-null;} comment string representing the constant */ protected static String cstComment(DalvInsn insn) { CstInsn ci = (CstInsn) insn; if (! ci.hasIndex()) { return ""; } StringBuilder sb = new StringBuilder(20); int index = ci.getIndex(); sb.append(ci.getConstant().typeName()); sb.append('@'); if (index < 65536) { sb.append(Hex.u2(index)); } else { sb.append(Hex.u4(index)); } return sb.toString(); }
/** * Helper method to return an instruction comment for a constant. * * @param insn {@code non-null;} a constant-bearing instruction * @return {@code non-null;} comment string representing the constant */ protected static String cstComment(DalvInsn insn) { CstInsn ci = (CstInsn) insn; if (! ci.hasIndex()) { return ""; } StringBuilder sb = new StringBuilder(20); int index = ci.getIndex(); sb.append(ci.getConstant().typeName()); sb.append('@'); if (index < 65536) { sb.append(Hex.u2(index)); } else { sb.append(Hex.u4(index)); } return sb.toString(); }
/** * Helper method to return an instruction comment for a constant. * * @param insn {@code non-null;} a constant-bearing instruction * @return {@code non-null;} comment string representing the constant */ protected static String cstComment(DalvInsn insn) { CstInsn ci = (CstInsn) insn; if (! ci.hasIndex()) { return ""; } StringBuilder sb = new StringBuilder(20); int index = ci.getIndex(); sb.append(ci.getConstant().typeName()); sb.append('@'); if (index < 65536) { sb.append(Hex.u2(index)); } else { sb.append(Hex.u4(index)); } return sb.toString(); }
/** * Helper method to return an instruction comment for a constant. * * @param insn {@code non-null;} a constant-bearing instruction * @return {@code non-null;} comment string representing the constant */ protected static String cstComment(DalvInsn insn) { CstInsn ci = (CstInsn) insn; if (! ci.hasIndex()) { return ""; } StringBuilder sb = new StringBuilder(20); int index = ci.getIndex(); sb.append(ci.getConstant().typeName()); sb.append('@'); if (index < 65536) { sb.append(Hex.u2(index)); } else { sb.append(Hex.u4(index)); } return sb.toString(); }