code: public static <T> T getConstantLDC(InstructionHandle h, ConstantPoolGen cpg, Class<T> clazz) {
          Instruction prevIns = h.getInstruction();
          if (prevIns instanceof LDC) {
              LDC ldcInst = (LDC) prevIns;
              Object val = ldcInst.getValue(cpg);
              if (val.getClass().equals(clazz)) {
                  return clazz.cast(val);
              }
          }
          else if(clazz.equals(String.class) && prevIns instanceof INVOKESPECIAL) {
              //This additionnal call allow the support of hardcoded value passed to String constructor
              //new String("HARDCODE")
              INVOKESPECIAL invoke = (INVOKESPECIAL) prevIns;
              if(invoke.getMethodName(cpg).equals("<init>") && invoke.getClassName(cpg).equals("java.lang.String") &&
                      invoke.getSignature(cpg).equals("(Ljava/lang/String;)V")) {
                  return getConstantLDC(h.getPrev(), cpg, clazz);
              }
          }
  
          return null;
      }
docs: Get the constant value of the given instruction.
  (The instruction must refer to the Constant Pool otherwise null is return)
  
  &lt;T&gt; is the Type of the constant value return
  
  
  This utility method should be used only when the taint analysis is not needed.
  For example, to detect api where the value will typically be hardcoded.
  (Call such as setConfig("valueHardcoded"), setActivateStuff(true) )
  
  @param h Instruction Handle
  @param cpg Constant Pool
  @param clazz Type of the constant being read
  @return The constant value if any is found