< prev index next >

src/java.base/share/classes/jdk/internal/loader/AbstractClassLoaderValue.java

Print this page




 329                                 mappingFunction.apply(cl, clv));
 330                         } catch (Throwable x) {
 331                             this.t = t = x;
 332                         } finally {
 333                             inCall = false;
 334                         }
 335                     }
 336                 }
 337             }
 338             if (v != null) return v;
 339             if (t instanceof Error) {
 340                 throw (Error) t;
 341             } else if (t instanceof RuntimeException) {
 342                 throw (RuntimeException) t;
 343             } else {
 344                 throw new UndeclaredThrowableException(t);
 345             }
 346         }
 347 
 348         static class RecursiveInvocationException extends IllegalStateException {

 349             private static final long serialVersionUID = 1L;
 350 
 351             RecursiveInvocationException() {
 352                 super("Recursive call");
 353             }
 354         }
 355     }
 356 
 357     /**
 358      * sub-ClassLoaderValue is an inner class of {@link AbstractClassLoaderValue}
 359      * and also a subclass of it. It can therefore be instantiated as an inner
 360      * class of either an instance of root-{@link ClassLoaderValue} or another
 361      * instance of itself. This enables composing type-safe compound keys of
 362      * arbitrary length:
 363      * <pre>{@code
 364      * ClassLoaderValue<V> clv = new ClassLoaderValue<>();
 365      * ClassLoaderValue<V>.Sub<K1>.Sub<K2>.Sub<K3> clv_k123 =
 366      *     clv.sub(k1).sub(k2).sub(k3);
 367      * }</pre>
 368      * From which individual components are accessible in a type-safe way:




 329                                 mappingFunction.apply(cl, clv));
 330                         } catch (Throwable x) {
 331                             this.t = t = x;
 332                         } finally {
 333                             inCall = false;
 334                         }
 335                     }
 336                 }
 337             }
 338             if (v != null) return v;
 339             if (t instanceof Error) {
 340                 throw (Error) t;
 341             } else if (t instanceof RuntimeException) {
 342                 throw (RuntimeException) t;
 343             } else {
 344                 throw new UndeclaredThrowableException(t);
 345             }
 346         }
 347 
 348         static class RecursiveInvocationException extends IllegalStateException {
 349             @java.io.Serial
 350             private static final long serialVersionUID = 1L;
 351 
 352             RecursiveInvocationException() {
 353                 super("Recursive call");
 354             }
 355         }
 356     }
 357 
 358     /**
 359      * sub-ClassLoaderValue is an inner class of {@link AbstractClassLoaderValue}
 360      * and also a subclass of it. It can therefore be instantiated as an inner
 361      * class of either an instance of root-{@link ClassLoaderValue} or another
 362      * instance of itself. This enables composing type-safe compound keys of
 363      * arbitrary length:
 364      * <pre>{@code
 365      * ClassLoaderValue<V> clv = new ClassLoaderValue<>();
 366      * ClassLoaderValue<V>.Sub<K1>.Sub<K2>.Sub<K3> clv_k123 =
 367      *     clv.sub(k1).sub(k2).sub(k3);
 368      * }</pre>
 369      * From which individual components are accessible in a type-safe way:


< prev index next >