Home | History | Annotate | Download | only in system
      1 /*
      2  * Copyright (C) 2015 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 package dalvik.system;
     18 
     19 /**
     20  * An exception only used by the compiler to abort a transaction.
     21  *
     22  * @hide
     23  */
     24 final class TransactionAbortError extends InternalError {
     25   /**
     26    * Constructs a new {@code TransactionAbortError} with its stack trace filled in.
     27    */
     28   private TransactionAbortError() {
     29   }
     30 
     31   /**
     32    * Constructs a new {@code TransactionAbortError} with its stack trace and detail
     33    * message filled in.
     34    *
     35    * @param detailMessage the detail message for the exception.
     36    */
     37   private TransactionAbortError(String detailMessage) {
     38       super(detailMessage);
     39   }
     40 
     41   /**
     42    * Constructs a new {@code TransactionAbortError} with detail message and cause
     43    * filled in.
     44    *
     45    * @param message the detail message for the exception.
     46    * @param cause the detail cause for the exception.
     47    */
     48   private TransactionAbortError(String message, Throwable cause) {
     49       super(message);
     50       initCause(cause);
     51   }
     52 
     53   /**
     54    * Constructs a new {@code TransactionAbortError} with its detail cause filled in.
     55    *
     56    * @param cause the detail cause for the exception.
     57    */
     58   private TransactionAbortError(Throwable cause) {
     59       this(cause == null ? null : cause.toString(), cause);
     60   }
     61 
     62 }
     63