title: Java: Displaying all Strings used in method invocations
body: <p>I am trying to display all the strings used in a method invocation using SOOT program analysis framework. I am able to check for <strong>StringConstant</strong> but how do I get values for <strong>RefType</strong> ? Here is the sample code :</p>
  
  <pre><code>for (Value va : iv.getInvokeExpr().getArgs()) {
      System.out.println("[ARGS : TYPE] " + va.getType() + " with ");
  
      if (va instanceof StringConstant) {
          System.out.print(va + " ");
      } else if (va instanceof JimpleLocal) {
          JimpleLocal jl = (JimpleLocal) va;
          if (jl.getType() instanceof RefType) {
              RefType rt = (RefType) jl.getType();
              SootClass cls = rt.getSootClass();
              String clsName = cls.getName();
              // recursion possible - backward analysis ?
              if(clsName.equals("java.lang.String")){
                    System.out.print("GOT STRING CLASS - HOW TO GET THE VALUE ?");
               }
           }
      }
  }
  </code></pre>
  
  <p>I am new to the program analysis domain, any pointers will be of great help.</p>
  
  <p>Thanks</p>