1 package com.sun.org.apache.bcel.internal.verifier.exc; 2 3 56 57 64 public final class AssertionViolatedException extends RuntimeException { 65 66 private String detailMessage; 67 68 public AssertionViolatedException(){ 69 super(); 70 } 71 75 public AssertionViolatedException(String message){ 76 super(message = "INTERNAL ERROR: "+message); detailMessage=message; 78 } 79 84 public void extendMessage(String pre, String post){ 85 if (pre == null) pre=""; 86 if (detailMessage == null) detailMessage=""; 87 if (post == null) post=""; 88 detailMessage = pre+detailMessage+post; 89 } 90 94 public String getMessage(){ 95 return detailMessage; 96 } 97 98 101 public static void _main(String [] args){ 102 AssertionViolatedException ave = new AssertionViolatedException("Oops!"); 103 ave.extendMessage("\nFOUND:\n\t","\nExiting!!\n"); 104 throw ave; 105 } 106 107 111 public String getStackTraceAsStr(){ 112 return Utility.getStackTrace(this); 113 } 114 115 } 116 | Popular Tags |