java.lang.Object
com.ibm.wala.dalvik.ipa.callgraph.androidModel.parameters.ReuseParameters

public class ReuseParameters extends Object
Helper for building the Descriptor of a model.

Parameters used in a model can be either marked as CREATE or REUSE. This information is derived from the IInstantiationBehavior.

This class only handles parameters marked as REUSE: These will be parameters to the function representing the model itself. On all uses of a variable named REUSE the same Instance (optionally altered using Phi) will be used.

ReuseParameters collects all those parameters and builds the Descriptor of the later model.

Also ReuseParameters may be queried how to access these parameters the use of ParameterAccessor is the better way to get them.

Since:
2013-11-02
Author:
Tobias Blaschke <code@tobiasblaschke.de>
See Also:
  • Constructor Details

    • ReuseParameters

      public ReuseParameters(IInstantiationBehavior instanceBehavior, AndroidModel forModel)
      Parameters:
      instanceBehavior - The Behavior to query if the parameter is REUSE
      forModel - The AndroidModel in which context the status is to be determined
  • Method Details

    • collectParameters

      public void collectParameters(Iterable<? extends Entrypoint> entrypoints)
      Searches the given entrypoints for those parameters.

      A call to this function resets the internal knowledge of REUSE-Parameters. So in order to get a union of these parameters a union of the given entrypoints has to be built.

      Parameters:
      entrypoints - The entrypoints to consider in the search.
    • isReuse

      public boolean isReuse(TypeName param, IMethod inCallTo)
      Is the parameter REUSE in a call from forModel to inCallTo.

      The 'forModel' was set in the constructor. Even so a parameter occurs in the descriptor it does not have to be REUSE for all calls.

      The result of this method may vary over time :/

      Parameters:
      param - The parameter in question of being reuse
      inCallTo - The callee to query the REUSEness for
    • toMethodReference

      public MethodReference toMethodReference(AndroidModelParameterManager pm)