Return the source of the specified class which may lie in component path.
( String className )
| 159 | path. |
| 160 | */ |
| 161 | synchronized public ClassSource getClassSource( String className ) |
| 162 | { |
| 163 | // Before triggering classpath mapping (initialization) check for |
| 164 | // explicitly set class sources (e.g. generated classes). These would |
| 165 | // take priority over any found in the classpath anyway. |
| 166 | ClassSource cs = (ClassSource)classSource.get( className ); |
| 167 | if ( cs != null ) |
| 168 | return cs; |
| 169 | |
| 170 | insureInitialized(); // trigger possible mapping |
| 171 | |
| 172 | cs = (ClassSource)classSource.get( className ); |
| 173 | if ( cs == null && compPaths != null ) |
| 174 | for (int i=0; i<compPaths.size() && cs==null; i++) |
| 175 | cs = ((BshClassPath)compPaths.get(i)).getClassSource(className); |
| 176 | return cs; |
| 177 | } |
| 178 | |
| 179 | /** |
| 180 | Explicitly set a class source. This is used for generated classes, but |
no test coverage detected