MCPcopy Index your code
hub / github.com/apache/tomcat / isPackage

Method isPackage

java/org/apache/jasper/compiler/JDTCompiler.java:225–243  ·  view source on GitHub ↗
(String result)

Source from the content-addressed store, hash-verified

223 }
224
225 private boolean isPackage(String result) {
226 if (result.equals(targetClassName) || result.startsWith(targetClassName + '$')) {
227 return false;
228 }
229 /*
230 * This might look heavy-weight but, with only the ClassLoader API available, trying to load the
231 * resource as a class is the only reliable way found so far to differentiate between a class and a
232 * package. Other options, such as getResource(), fail for some edge cases on case insensitive file
233 * systems. As this code is only called at compile time, the performance impact is not a significant
234 * concern.
235 */
236 try {
237 classLoader.loadClass(result);
238 } catch (Throwable t) {
239 ExceptionUtils.handleThrowable(t);
240 return true;
241 }
242 return false;
243 }
244
245 @Override
246 public boolean isPackage(char[][] parentPackageName, char[] packageName) {

Callers

nothing calls this directly

Calls 6

handleThrowableMethod · 0.95
equalsMethod · 0.65
toStringMethod · 0.65
startsWithMethod · 0.45
loadClassMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected