1 // Copyright 2021 Code Intelligence GmbH 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 package com.code_intelligence.jazzer.runtime; 16 17 import java.io.PrintStream; 18 import java.io.PrintWriter; 19 20 /** 21 * An Error that rethrows itself when any of its getters is invoked. 22 */ 23 public class HardToCatchError extends Error { HardToCatchError()24 public HardToCatchError() { 25 super(); 26 } 27 28 @Override getMessage()29 public String getMessage() { 30 throw this; 31 } 32 33 @Override getLocalizedMessage()34 public String getLocalizedMessage() { 35 throw this; 36 } 37 38 @Override initCause(Throwable cause)39 public synchronized Throwable initCause(Throwable cause) { 40 throw this; 41 } 42 43 @Override toString()44 public String toString() { 45 throw this; 46 } 47 48 @Override printStackTrace()49 public void printStackTrace() { 50 throw this; 51 } 52 53 @Override printStackTrace(PrintStream s)54 public void printStackTrace(PrintStream s) { 55 throw this; 56 } 57 58 @Override printStackTrace(PrintWriter s)59 public void printStackTrace(PrintWriter s) { 60 throw this; 61 } 62 63 @Override getStackTrace()64 public StackTraceElement[] getStackTrace() { 65 throw this; 66 } 67 68 @Override hashCode()69 public int hashCode() { 70 throw this; 71 } 72 73 @Override equals(Object obj)74 public boolean equals(Object obj) { 75 throw this; 76 } 77 78 @Override clone()79 public Object clone() { 80 throw this; 81 } 82 } 83