Here you can find the source of toRuntimeException(Throwable throwable)
public static RuntimeException toRuntimeException(Throwable throwable)
//package com.java2s; //License from project: Apache License public class Main { public static RuntimeException toRuntimeException(Throwable throwable) { return throwable instanceof RuntimeException ? (RuntimeException) throwable : new RuntimeException(throwable); }/*from ww w. j a va2 s . c o m*/ public static RuntimeException toRuntimeException(String message, Throwable throwable) { return message == null ? toRuntimeException(throwable) : new RuntimeException(message, throwable); } }