/** * Get the <i>i</i>th argument passed to given method invocation. * * @param ins * the method invocation instruction * @param cpg * the ConstantPoolGen for the class containing the method * @param i * index of the argument; 0 for the first argument, etc. * @param numArguments * total number of arguments to the method * @return the <i>i</i>th argument * @throws DataflowAnalysisException */ @Deprecated public ValueType getArgument(InvokeInstruction ins, ConstantPoolGen cpg, int i, int numArguments) throws DataflowAnalysisException { SignatureParser sigParser = new SignatureParser(ins.getSignature(cpg)); return getArgument(ins, cpg, i, sigParser); }
/** * Get set of arguments passed to a method invocation which match given * predicate. * * @param invokeInstruction * the InvokeInstruction * @param cpg * the ConstantPoolGen * @param chooser * predicate to choose which argument values should be in the * returned set * @return BitSet specifying which arguments match the predicate, indexed by * argument number (starting from 0) * @throws DataflowAnalysisException */ public BitSet getArgumentSet(InvokeInstruction invokeInstruction, ConstantPoolGen cpg, DataflowValueChooser<ValueType> chooser) throws DataflowAnalysisException { BitSet chosenArgSet = new BitSet(); SignatureParser sigParser = new SignatureParser(invokeInstruction.getSignature(cpg)); for (int i = 0; i < sigParser.getNumParameters(); ++i) { ValueType value = getArgument(invokeInstruction, cpg, i, sigParser); if (chooser.choose(value)) { chosenArgSet.set(i); } } return chosenArgSet; }
/** * Get the <i>i</i>th argument passed to given method invocation. * * @param ins * the method invocation instruction * @param cpg * the ConstantPoolGen for the class containing the method * @param i * index of the argument; 0 for the first argument, etc. * @param numArguments * total number of arguments to the method * @return the <i>i</i>th argument * @throws DataflowAnalysisException */ @Deprecated public ValueType getArgument(InvokeInstruction ins, ConstantPoolGen cpg, int i, int numArguments) throws DataflowAnalysisException { SignatureParser sigParser = new SignatureParser(ins.getSignature(cpg)); return getArgument(ins, cpg, i, sigParser); }
/** * Get set of arguments passed to a method invocation which match given * predicate. * * @param invokeInstruction * the InvokeInstruction * @param cpg * the ConstantPoolGen * @param chooser * predicate to choose which argument values should be in the * returned set * @return BitSet specifying which arguments match the predicate, indexed by * argument number (starting from 0) * @throws DataflowAnalysisException */ public BitSet getArgumentSet(InvokeInstruction invokeInstruction, ConstantPoolGen cpg, DataflowValueChooser<ValueType> chooser) throws DataflowAnalysisException { BitSet chosenArgSet = new BitSet(); SignatureParser sigParser = new SignatureParser(invokeInstruction.getSignature(cpg)); for (int i = 0; i < sigParser.getNumParameters(); ++i) { ValueType value = getArgument(invokeInstruction, cpg, i, sigParser); if (chooser.choose(value)) { chosenArgSet.set(i); } } return chosenArgSet; }