MCPcopy Index your code
hub / github.com/beanshell/beanshell / loadSourceClass

Method loadSourceClass

src/bsh/BshClassManager.java:192–212  ·  view source on GitHub ↗
( final String name )

Source from the content-addressed store, hash-verified

190
191 // Move me to classpath/ClassManagerImpl???
192 protected Class<?> loadSourceClass( final String name ) {
193 final String fileName = "/" + name.replace('.', '/') + ".java";
194 final InputStream in = getResourceAsStream( fileName );
195 if ( in == null ) {
196 return null;
197 }
198 try {
199 Interpreter.debug("Loading class from source file: " + fileName);
200 declaringInterpreter.eval( new InputStreamReader(in) );
201 } catch ( EvalError e ) {
202 if (Interpreter.DEBUG) {
203 e.printStackTrace();
204 }
205 }
206 try {
207 return plainClassForName( name );
208 } catch ( final ClassNotFoundException e ) {
209 Interpreter.debug("Class not found in source file: " + name);
210 return null;
211 }
212 }
213
214 /**
215 Perform a plain Class.forName() or call the externally provided

Callers 1

classForNameMethod · 0.95

Calls 6

getResourceAsStreamMethod · 0.95
debugMethod · 0.95
plainClassForNameMethod · 0.95
replaceMethod · 0.80
printStackTraceMethod · 0.80
evalMethod · 0.65

Tested by

no test coverage detected