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

Method classExists

src/bsh/Capabilities.java:102–121  ·  view source on GitHub ↗

Use direct Class.forName() to test for the existence of a class. We should not use BshClassManager here because: a) the systems using these tests would probably not load the classes through it anyway. b) bshclassmanager is heavy and touches other class files. this capabilities code m

( String name )

Source from the content-addressed store, hash-verified

100 system **including the remote applet**.
101 */
102 public static boolean classExists( String name )
103 {
104 Object c = classes.get( name );
105
106 if ( c == null ) {
107 try {
108 /*
109 Note: do *not* change this to
110 BshClassManager plainClassForName() or equivalent.
111 This class must not touch any other bsh classes.
112 */
113 c = Class.forName( name );
114 } catch ( ClassNotFoundException e ) { }
115
116 if ( c != null )
117 classes.put(c,"unused");
118 }
119
120 return c != null;
121 }
122
123 /**
124 An attempt was made to use an unavailable capability supported by

Callers 3

haveSwingMethod · 0.95
createClassManagerMethod · 0.95
mainMethod · 0.95

Calls 2

getMethod · 0.65
putMethod · 0.65

Tested by

no test coverage detected