Java RuntimeException Create toRuntimeException(Exception ex)

Here you can find the source of toRuntimeException(Exception ex)

Description

to Runtime Exception

License

Open Source License

Declaration

public static RuntimeException toRuntimeException(Exception ex) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static RuntimeException toRuntimeException(Exception ex) {
        if (ex instanceof RuntimeException) {
            return (RuntimeException) ex;
        } else {/*from  w  ww .ja va  2  s .c o m*/
            return new RuntimeException(ex);
        }
    }
}

Related

  1. toRuntimeException(Exception e)
  2. toRuntimeException(Exception e)
  3. toRuntimeException(final Throwable e)
  4. toRuntimeException(Throwable e)
  5. toRuntimeException(Throwable t)
  6. toRuntimeException(Throwable t)