public static BshClassManager createClassManager(Interpreter interpreter){
  BshClassManager manager;
  if (Capabilities.classExists("java.lang.ref.WeakReference") && Capabilities.classExists("java.util.HashMap") && Capabilities.classExists("bsh.classpath.ClassManagerImpl"))   try {
    Class clas=Class.forName("bsh.classpath.ClassManagerImpl");
    manager=(BshClassManager)clas.newInstance();
  }
 catch (  Exception e) {
    throw new InterpreterError("Error loading classmanager: " + e);
  }
 else   manager=new BshClassManager();
  if (interpreter == null)   interpreter=new Interpreter();
  manager.declaringInterpreter=interpreter;
  return manager;
}

public static BshClassManager createClassManager ( Interpreter interpreter ) { BshClassManager manager ; if ( Capabilities . classExists ( "java.lang.ref.WeakReference" ) && Capabilities . classExists ( "java.util.HashMap" ) && Capabilities . classExists ( "bsh.classpath.ClassManagerImpl" ) ) try { Class clas = Class . forName ( "bsh.classpath.ClassManagerImpl" ) ; manager = ( BshClassManager ) clas . newInstance ( ) ; } catch ( Exception e ) { throw new InterpreterError ( "Error loading classmanager: " + e ) ; } else manager = new BshClassManager ( ) ; if ( interpreter == null ) interpreter = new Interpreter ( ) ; manager . declaringInterpreter = interpreter ; return manager ; }
create a new instance of the class manager . class manager instnaces are now associated with the interpreter .
