1 22 23 24 package com.mchange.v2.util; 25 26 import com.mchange.v2.lang.VersionUtils; 27 28 public class ResourceClosedException extends RuntimeException 29 { 30 32 35 38 Throwable rootCause; 39 40 public ResourceClosedException(String msg, Throwable t) 41 { 42 super( msg ); 43 setRootCause( t ); 44 } 45 46 public ResourceClosedException(Throwable t) 47 { 48 super(); 49 setRootCause( t ); 50 } 51 52 public ResourceClosedException(String msg) 53 { super( msg ); } 54 55 public ResourceClosedException() 56 { super(); } 57 58 public Throwable getCause() 59 { return rootCause; } 60 61 private void setRootCause( Throwable t ) 62 { 63 this.rootCause = t; 64 if ( VersionUtils.isAtLeastJavaVersion14() ) 65 this.initCause( t ); 66 } 67 } 68 | Popular Tags |