container/src/main/java/com/streamsets/datacollector/util/LambdaUtil.java
private static <T> T withClassLoaderInternal(
      ClassLoader classLoader,
      ExceptionSupplier<T> supplier
  ) throws Exception {
    ClassLoader previousClassLoader = Thread.currentThread().getContextClassLoader();
    try {
      Thread.currentThread().setContextClassLoader(classLoader);
      return supplier.get();
    } finally {
      Thread.currentThread().setContextClassLoader(previousClassLoader);
    }
  }
private static <T> T withClassLoaderInternal(
      ClassLoader classLoader,
      ExceptionSupplier<T> supplier
  ) throws Exception {
    ClassLoader previousClassLoader = Thread.currentThread().getContextClassLoader();
    try {
      Thread.currentThread().setContextClassLoader(classLoader);
      return supplier.get();
    } finally {
      Thread.currentThread().setContextClassLoader(previousClassLoader);
    }
  }
private static < T > T withClassLoaderInternal ( ClassLoader classLoader , ExceptionSupplier < T > supplier ) throws Exception { ClassLoader previousClassLoader = Thread . currentThread ( ) . getContextClassLoader ( ) ; try { Thread . currentThread ( ) . setContextClassLoader ( classLoader ) ; return supplier . get ( ) ; } finally { Thread . currentThread ( ) . setContextClassLoader ( previousClassLoader ) ; } }
Internal version of the wrapping function that will simply propagate all exceptions up.
Internal version of the wrapping function that will simply propagate all exceptions up .