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

Method eval

src/bsh/BSHImportDeclaration.java:37–71  ·  view source on GitHub ↗
( CallStack callstack, Interpreter interpreter)

Source from the content-addressed store, hash-verified

35 BSHImportDeclaration(int id) { super(id); }
36
37 public Object eval( CallStack callstack, Interpreter interpreter)
38 throws EvalError
39 {
40 NameSpace namespace = callstack.top();
41 if ( superImport )
42 try {
43 namespace.doSuperImport();
44 } catch ( UtilEvalError e ) {
45 throw e.toEvalError( this, callstack );
46 }
47 else
48 {
49 if ( staticImport )
50 {
51 if ( importPackage )
52 {
53 Class clas = ((BSHAmbiguousName)jjtGetChild(0)).toClass(
54 callstack, interpreter );
55 namespace.importStatic( clas );
56 } else
57 throw new EvalError(
58 "static field imports not supported yet",
59 this, callstack );
60 } else
61 {
62 String name = ((BSHAmbiguousName)jjtGetChild(0)).text;
63 if ( importPackage )
64 namespace.importPackage(name);
65 else
66 namespace.importClass(name);
67 }
68 }
69
70 return Primitive.VOID;
71 }
72}
73

Callers

nothing calls this directly

Calls 8

doSuperImportMethod · 0.95
importStaticMethod · 0.95
importPackageMethod · 0.95
importClassMethod · 0.95
topMethod · 0.80
jjtGetChildMethod · 0.65
toEvalErrorMethod · 0.45
toClassMethod · 0.45

Tested by

no test coverage detected