MCPcopy Create free account
hub / github.com/apache/tomcat / importPackage

Method importPackage

java/jakarta/el/ImportHandler.java:403–411  ·  view source on GitHub ↗

Imports all classes from a package so they can be referenced by their simple names in EL expressions. Classes from the imported package are resolved during expression evaluation. If a simple name is ambiguous across multiple imported packages, an ELException is thrown at resolution time. @p

(String name)

Source from the content-addressed store, hash-verified

401 * @param name the package name to import
402 */
403 public void importPackage(String name) {
404 // Import ambiguity is handled at resolution, not at import
405 // Whether the package exists is not checked,
406 // a) for sake of performance when used in JSPs (BZ 57142),
407 // b) java.lang.Package.getPackage(name) is not reliable (BZ 57574),
408 // c) such check is not required by specification.
409 Set<String> preloaded = standardPackages.get(name);
410 packageNames.put(name, Objects.requireNonNullElse(preloaded, Collections.emptySet()));
411 }
412
413
414 /**

Callers 9

testResolveClass03Method · 0.95
testResolveClass04Method · 0.95
testResolveClass05Method · 0.95
testResolveClass06Method · 0.95
testBug57135Method · 0.95
testBug62453Method · 0.95
getELContextMethod · 0.95
ImportHandlerMethod · 0.95

Calls 2

getMethod · 0.65
putMethod · 0.65

Tested by 7

testResolveClass03Method · 0.76
testResolveClass04Method · 0.76
testResolveClass05Method · 0.76
testResolveClass06Method · 0.76
testBug57135Method · 0.76
testBug62453Method · 0.76