Ref<ClassLoader> () { final Processor delegate = getWrapperDelegate(); if (delegate != null) { final Thread currentThread = Thread.currentThread(); final ClassLoader processorLoader = delegate.getClass().getClassLoader(); final ClassLoader currentCtxLoader = currentThread.getContextClassLoader(); if (processorLoader != currentCtxLoader) { currentThread.setContextClassLoader(processorLoader); return Ref.create(currentCtxLoader); } } return null; }