Class SolarModel

All Implemented Interfaces:
Plugin

public class SolarModel extends AnalysisModelPlugin
Implementation of Solar, a powerful static reflection analysis. The technique was presented in paper: Yue Li, Tian Tan, and Jingling Xue. Understanding and Analyzing Java Reflection. In TOSEM 2019.
  • Field Details

    • helper

      protected final pascal.taie.analysis.pta.plugin.reflection.MetaObjHelper helper
    • invokesWithLog

      protected final Set<Invoke> invokesWithLog
  • Method Details

    • classForName

      @InvokeHandler(signature={"<java.lang.Class: java.lang.Class forName(java.lang.String)>","<java.lang.Class: java.lang.Class forName(java.lang.String,boolean,java.lang.ClassLoader)>"}, argIndexes=0) public void classForName(Context context, Invoke invoke, PointsToSet nameObjs)
    • classGetConstructor

      @InvokeHandler(signature={"<java.lang.Class: java.lang.reflect.Constructor getConstructor(java.lang.Class[])>","<java.lang.Class: java.lang.reflect.Constructor getDeclaredConstructor(java.lang.Class[])>"}, argIndexes=-1) public void classGetConstructor(Context context, Invoke invoke, PointsToSet classObjs)
    • classGetMethod

      @InvokeHandler(signature={"<java.lang.Class: java.lang.reflect.Method getMethod(java.lang.String,java.lang.Class[])>","<java.lang.Class: java.lang.reflect.Method getDeclaredMethod(java.lang.String,java.lang.Class[])>"}, argIndexes={-1,0}) public void classGetMethod(Context context, Invoke invoke, PointsToSet classObjs, PointsToSet nameObjs)
    • classGetMethods

      @InvokeHandler(signature={"<java.lang.Class: java.lang.reflect.Method[] getMethods()>","<java.lang.Class: java.lang.reflect.Method[] getDeclaredMethods()>"}, argIndexes=-1) public void classGetMethods(Context context, Invoke invoke, PointsToSet classObjs)
    • methodInvoke

      @InvokeHandler(signature="<java.lang.reflect.Method: java.lang.Object invoke(java.lang.Object,java.lang.Object[])>", argIndexes={-1,0}) public void methodInvoke(Context context, Invoke invoke, PointsToSet mtdObjs, PointsToSet recvObjs)
    • classNewInstance

      @InvokeHandler(signature="<java.lang.Class: java.lang.Object newInstance()>", argIndexes=-1) public void classNewInstance(Context context, Invoke invoke, PointsToSet classObjs)
    • onNewStmt

      public void onNewStmt(Stmt stmt, JMethod container)
      Description copied from interface: Plugin
      Invoked when a new reachable stmt is discovered.
      Specified by:
      onNewStmt in interface Plugin
      Overrides:
      onNewStmt in class AnalysisModelPlugin
      Parameters:
      stmt - new reachable stmt
      container - container method of stmt
    • onNewPointsToSet

      public void onNewPointsToSet(CSVar csVar, PointsToSet pts)
      Description copied from interface: Plugin
      Invoked when set of new objects flow to a context-sensitive variable.
      Specified by:
      onNewPointsToSet in interface Plugin
      Overrides:
      onNewPointsToSet in class AnalysisModelPlugin
      Parameters:
      csVar - variable whose points-to set changes
      pts - set of new objects
    • collectUnsoundArrayNewInstance

      @InvokeHandler(signature="<java.lang.reflect.Array: java.lang.Object newInstance(java.lang.Class,int)>", argIndexes=0) public void collectUnsoundArrayNewInstance(Context __, Invoke invoke, PointsToSet classObjs)
    • onFinish

      public void onFinish()
      Description copied from interface: Plugin
      Invoked when pointer analysis finishes. Pointer analysis is supposed to have been finished at this stage, thus this call back should NOT modify pointer analysis results.
    • classForNameKnown

      protected void classForNameKnown(Context context, Invoke forName, @Nullable String className)
    • classGetConstructorKnown

      protected void classGetConstructorKnown(Context context, Invoke invoke, @Nullable JClass clazz)
    • classGetMethodKnown

      protected void classGetMethodKnown(Context context, Invoke invoke, @Nullable JClass clazz, @Nullable String name)
    • registerHandlers

      protected void registerHandlers()