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 )
| 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 |
no test coverage detected