Class Merger

java.lang.Object
com.android.dx.cf.code.Merger

public final class Merger extends Object
Utility methods to merge various frame information.
  • Method Details

    • mergeLocals

      public static OneLocalsArray mergeLocals(OneLocalsArray locals1, OneLocalsArray locals2)
      Merges two locals arrays. If the merged result is the same as the first argument, then return the first argument (not a copy).
      Parameters:
      locals1 - non-null; a locals array
      locals2 - non-null; another locals array
      Returns:
      non-null; the result of merging the two locals arrays
    • mergeStack

      public static ExecutionStack mergeStack(ExecutionStack stack1, ExecutionStack stack2)
      Merges two stacks. If the merged result is the same as the first argument, then return the first argument (not a copy).
      Parameters:
      stack1 - non-null; a stack
      stack2 - non-null; another stack
      Returns:
      non-null; the result of merging the two stacks
    • mergeType

      public static TypeBearer mergeType(TypeBearer ft1, TypeBearer ft2)
      Merges two frame types.
      Parameters:
      ft1 - non-null; a frame type
      ft2 - non-null; another frame type
      Returns:
      non-null; the result of merging the two types
    • isPossiblyAssignableFrom

      public static boolean isPossiblyAssignableFrom(TypeBearer supertypeBearer, TypeBearer subtypeBearer)
      Returns whether the given supertype is possibly assignable from the given subtype. This takes into account primitiveness, int-likeness, known-nullness, and array dimensions, but does not assume anything about class hierarchy other than that the type Object is the supertype of all reference types and all arrays are assignable to Serializable and Cloneable.
      Parameters:
      supertypeBearer - non-null; the supertype
      subtypeBearer - non-null; the subtype