MCPcopy Create free account
hub / github.com/apache/pig / resolveClassName

Method resolveClassName

src/org/apache/pig/impl/PigContext.java:645–677  ·  view source on GitHub ↗
(String name)

Source from the content-addressed store, hash-verified

643 }
644
645 @SuppressWarnings("rawtypes")
646 public static Class resolveClassName(String name) throws IOException{
647 Map<String,Class<?>> cache = getClassCache();
648
649 Class c = cache.get(name);
650 if (c != null) {
651 return c;
652 }
653
654 for(String prefix: getPackageImportList()) {
655 try {
656 c = Class.forName(prefix+name,true, PigContext.classloader);
657 cache.put(name, c);
658
659 return c;
660 }
661 catch (ClassNotFoundException e) {
662 // do nothing
663 }
664 catch (UnsupportedClassVersionError e) {
665 int errCode = 1069;
666 String msg = "Problem resolving class version numbers for class " + name;
667 throw new ExecException(msg, errCode, PigException.INPUT, e) ;
668 }
669
670 }
671
672 // create ClassNotFoundException exception and attach to IOException
673 // so that we don't need to buble interface changes throughout the code
674 int errCode = 1070;
675 String msg = "Could not resolve " + name + " using imports: " + packageImportList.get();
676 throw new ExecException(msg, errCode, PigException.INPUT);
677 }
678
679 /**
680 * A common Pig pattern for initializing objects via system properties is to support passing

Callers 15

testClassCacheMethod · 0.95
isDeterministicMethod · 0.95
getPartitionMethod · 0.95
getJobMethod · 0.95
setCustomPartitionerMethod · 0.95
checkMethod · 0.95
validateFuncSpecMethod · 0.95
getClassForAliasMethod · 0.95
InvokerMethod · 0.95

Calls 4

getClassCacheMethod · 0.95
getPackageImportListMethod · 0.95
getMethod · 0.65
putMethod · 0.45

Tested by 2

testClassCacheMethod · 0.76