# Deprecated API

## Contents

- Methods
- Constructors

Deprecated Methods
Method
Description
javassist.ClassPool.makePackage(ClassLoader, String)
javassist.ClassPool.recordInvalidClassName(String)
javassist.ClassPool.toClass(CtClass, ClassLoader)
Replaced by `ClassPool.toClass(CtClass,Class,ClassLoader,ProtectionDomain)`. A subclass of `ClassPool` that has been overriding this method should be modified. It should override `ClassPool.toClass(CtClass,Class,ClassLoader,ProtectionDomain)`.
javassist.ClassPool.toClass(CtClass, ClassLoader, ProtectionDomain)
Replaced by `ClassPool.toClass(CtClass,Class,ClassLoader,ProtectionDomain)`.
javassist.CtClass.getEnclosingMethod()
The enclosing method might be a constructor. Use `CtClass.getEnclosingBehavior()`.
javassist.CtClass.toClass(ClassLoader)
Replaced by `CtClass.toClass(ClassLoader,ProtectionDomain)`
javassist.util.proxy.FactoryHelper.toClass(ClassFile, ClassLoader)
javassist.util.proxy.FactoryHelper.toClass(ClassFile, ClassLoader, ProtectionDomain)
javassist.util.proxy.ProxyFactory.setHandler(MethodHandler)
since 3.12 use of this method is incompatible with proxy class caching. instead clients should call method `Proxy.setHandler(MethodHandler)` to set the handler for each newly created proxy instance. calling this method will automatically disable caching of classes created by the proxy factory.
javassist.util.proxy.RuntimeSupport.find2Methods(Object, String, String, int, String, Method[])
replaced by `RuntimeSupport.find2Methods(Class, String, String, int, String, Method[])`
javassist.util.proxy.RuntimeSupport.findMethod(Object, String, String)
replaced by `RuntimeSupport.findMethod(Class, String, String)`

Deprecated Constructors
Constructor
Description
javassist.bytecode.LocalVariableAttribute(ConstPool, String)