Class StringReflectionExecutor

java.lang.Object
proguard.evaluation.executor.ReflectionExecutor
proguard.evaluation.executor.StringReflectionExecutor
All Implemented Interfaces:
Executor

public class StringReflectionExecutor extends ReflectionExecutor
This ReflectionExecutor supports methods of the classes String, StringBuilder and StringBuffer.
  • Constructor Details

    • StringReflectionExecutor

      public StringReflectionExecutor(ClassPool libraryClassPool)
  • Method Details

    • getInstanceOrCopyIfMutable

      public Optional<ReflectionExecutor.InstanceCopyResult> getInstanceOrCopyIfMutable(ReferenceValue instanceValue)
      Description copied from class: ReflectionExecutor
      Get an object which will act as the calling instance. If we know that executing the method does not modify the instance this can just be the same value. Otherwise, a copy should be returned in order to not change the reference whose state may be of interest at the end of an analysis.
      Specified by:
      getInstanceOrCopyIfMutable in class ReflectionExecutor
      Parameters:
      instanceValue - The ReferenceValue of the instance.
      Returns:
      The new calling instance.
    • getDefaultInstanceHandler

      public ExecutorInstanceHandler getDefaultInstanceHandler()
      Description copied from class: ReflectionExecutor
      Provides a default instance handler used by the executor in case the reflective execution fails.

      The handler carries information on whether a method returns the same object as its instance.

      Specified by:
      getDefaultInstanceHandler in class ReflectionExecutor
      Returns:
      the default instance handler.
    • getSupportedMethodSignatures

      public Set<MethodSignature> getSupportedMethodSignatures()
      Description copied from interface: Executor
      Get a list of method signatures that indicate which methods are supported by this executor.

      The returned methods should be exactly the ones that the executor is expected to be able to handle. The invocation unit does not make any additional assumption on the executors available to execute a method and will match them iff the signature of the target method matches exactly.

      Only full method signatures should be returned, the invocation unit does not support wildcards.

      Returns:
      a set of methods the executor can handle.