From 6f5ff83d3c26f8af0c8024dd94f870ece8a1e158 Mon Sep 17 00:00:00 2001 From: Rafael Winterhalter Date: Sat, 28 Mar 2020 21:22:38 +0100 Subject: [PATCH] Extend javadoc. --- .../net/bytebuddy/dynamic/loading/ClassLoadingStrategy.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/loading/ClassLoadingStrategy.java b/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/loading/ClassLoadingStrategy.java index 7de3a7fe4ae..beb9cbeac12 100644 --- a/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/loading/ClassLoadingStrategy.java +++ b/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/loading/ClassLoadingStrategy.java @@ -463,7 +463,10 @@ public static ClassLoadingStrategy of(Object lookup) { /** * Resolves a class loading strategy using a lookup if available on the current JVM. If the current JVM supports method handles * lookups, a lookup instance will be used. Alternatively, unsafe class definition is used, if supported. If neither strategy is - * supported, an exception is thrown. + * supported, an exception is thrown. A common use case would be calling this method as in + * {@code ClassLoadingStrategy.UsingLookup.withFallback(MethodHandles::lookup)}. Note that the invocation of + * {@code MethodHandles.lookup()} is call site sensitive such that it cannot be invoked within Byte Buddy what requires this + * external invocation. * * @param lookup A resolver for a lookup instance if the current JVM allows for lookup-based class injection. * @return An appropriate class loading strategy for the current JVM that uses a method handles lookup if available.