From the docs:  If you call detach() on a CtClass object, then that CtClass object is removed from the ClassPool.