Allows to save around 0.5M of RSS memory by avoiding to make those classes reachable:

org.springframework.cglib.core.Block
org.springframework.cglib.core.ClassEmitter
org.springframework.cglib.core.ClassEmitter$1
org.springframework.cglib.core.ClassEmitter$2
org.springframework.cglib.core.ClassEmitter$3
org.springframework.cglib.core.ClassEmitter$FieldInfo
org.springframework.cglib.core.ClassInfo
org.springframework.cglib.core.ClassNameReader
org.springframework.cglib.core.ClassNameReader$1
org.springframework.cglib.core.ClassTransformer
org.springframework.cglib.core.CodeEmitter
org.springframework.cglib.core.CodeEmitter$State
org.springframework.cglib.core.DebuggingClassWriter
org.springframework.cglib.core.DefaultGeneratorStrategy
org.springframework.cglib.core.DuplicatesPredicate
org.springframework.cglib.core.EmitUtils
org.springframework.cglib.core.EmitUtils$1
org.springframework.cglib.core.EmitUtils$10
org.springframework.cglib.core.EmitUtils$11
org.springframework.cglib.core.EmitUtils$12
org.springframework.cglib.core.EmitUtils$13
org.springframework.cglib.core.EmitUtils$14
org.springframework.cglib.core.EmitUtils$15
org.springframework.cglib.core.EmitUtils$16
org.springframework.cglib.core.EmitUtils$2
org.springframework.cglib.core.EmitUtils$3
org.springframework.cglib.core.EmitUtils$4
org.springframework.cglib.core.EmitUtils$5
org.springframework.cglib.core.EmitUtils$6
org.springframework.cglib.core.EmitUtils$ArrayDelimiters
org.springframework.cglib.core.Local
org.springframework.cglib.core.LocalVariablesSorter
org.springframework.cglib.core.LocalVariablesSorter$State
org.springframework.cglib.core.MethodInfo
org.springframework.cglib.core.MethodInfoTransformer
org.springframework.cglib.core.MethodWrapper
org.springframework.cglib.core.MethodWrapper$MethodWrapperKey
org.springframework.cglib.core.ReflectUtils$1
org.springframework.cglib.core.ReflectUtils$2
org.springframework.cglib.core.ReflectUtils$3
org.springframework.cglib.core.RejectModifierPredicate
org.springframework.cglib.core.VisibilityPredicate
org.springframework.cglib.proxy.BridgeMethodResolver
org.springframework.cglib.proxy.BridgeMethodResolver$BridgedFinder
org.springframework.cglib.proxy.BridgeMethodResolver$BridgedFinder$1
org.springframework.cglib.proxy.Enhancer$1
org.springframework.cglib.proxy.Enhancer$2
org.springframework.cglib.proxy.Enhancer$3
org.springframework.cglib.proxy.Enhancer$4
org.springframework.cglib.proxy.Enhancer$5
org.springframework.cglib.proxy.Enhancer$6
org.springframework.cglib.proxy.MethodInterceptorGenerator$1
org.springframework.cglib.proxy.MethodInterceptorGenerator$2
org.springframework.cglib.proxy.NoOpGenerator
org.springframework.cglib.reflect.FastClassEmitter
org.springframework.cglib.reflect.FastClassEmitter$1
org.springframework.cglib.reflect.FastClassEmitter$2
org.springframework.cglib.reflect.FastClassEmitter$3
org.springframework.cglib.reflect.FastClassEmitter$4
org.springframework.cglib.reflect.FastClassEmitter$GetIndexCallback
org.springframework.cglib.transform.TransformingClassGenerator
org.springframework.context.annotation.ConfigurationClassEnhancer$BeanFactoryAwareGeneratorStrategy
org.springframework.context.annotation.ConfigurationClassEnhancer$BeanFactoryAwareGeneratorStrategy$1

Comment From: sdeleuze

As discussed, I updated the PR to throw a more useful error message, removed the NativeDetector usage and kept the location of the check because otherwise we are forced to update the if statement as well to achieve code removal at build time.