Class BaseExceptionHandler

java.lang.Object
org.jf.dexlib2.base.BaseExceptionHandler
All Implemented Interfaces:
Comparable<ExceptionHandler>, ExceptionHandler
Direct Known Subclasses:
BuilderExceptionHandler, BuilderExceptionHandler, DexBackedExceptionHandler, ExceptionHandlerRewriter.RewrittenExceptionHandler, ImmutableExceptionHandler

public abstract class BaseExceptionHandler extends Object implements ExceptionHandler
  • Field Details

  • Constructor Details

    • BaseExceptionHandler

      public BaseExceptionHandler()
  • Method Details

    • getExceptionTypeReference

      @Nullable public TypeReference getExceptionTypeReference()
      Description copied from interface: ExceptionHandler
      Gets the type of exception that is handled by this handler.
      Specified by:
      getExceptionTypeReference in interface ExceptionHandler
      Returns:
      A TypeReference to the type of exception that is handled by this handler, or null if this is a catch-all handler.
    • hashCode

      public int hashCode()
      Description copied from interface: ExceptionHandler
      Returns a hashcode for this ExceptionHandler. This hashCode is defined to be the following:
       
       String exceptionType = getExceptionType();
       int hashCode = exceptionType==null?0:exceptionType.hashCode();
       return hashCode*31 + getHandlerCodeAddress();
       
      Specified by:
      hashCode in interface ExceptionHandler
      Overrides:
      hashCode in class Object
      Returns:
      The hash code value for this ExceptionHandler
    • equals

      public boolean equals(@Nullable Object o)
      Description copied from interface: ExceptionHandler
      Compares this ExceptionHandler to another ExceptionHandler for equality. This ExceptionHandler is equal to another ExceptionHandler if all of it's "fields" are equal. That is, if the return values of getExceptionType() and getHandlerCodeAddress() are both equal.
      Specified by:
      equals in interface ExceptionHandler
      Overrides:
      equals in class Object
      Parameters:
      o - The object to be compared for equality with this ExceptionHandler
      Returns:
      true if the specified object is equal to this ExceptionHandler
    • compareTo

      public int compareTo(@Nonnull ExceptionHandler o)
      Description copied from interface: ExceptionHandler
      Compare this ExceptionHandler to another ExceptionHandler. The comparison is based on the comparison of the return values of getExceptionType() and getHandlerCodeAddress() in that order. A null value for getExceptionType() compares after a non-null value.
      Specified by:
      compareTo in interface Comparable<ExceptionHandler>
      Specified by:
      compareTo in interface ExceptionHandler
      Parameters:
      o - The ExceptionHandler to compare with this ExceptionHandler
      Returns:
      An integer representing the result of the comparison