gates
Wed, 16 Apr 2008 11:32:56 -0700
Author: gates Date: Wed Apr 16 11:32:30 2008 New Revision: 648789 URL: http://svn.apache.org/viewvc?rev=648789&view=rev Log: PIG-183: Catch when a UDF has been compiled with the wrong version of java and give a RuntimeException. Modified: incubator/pig/trunk/CHANGES.txt incubator/pig/trunk/src/org/apache/pig/impl/PigContext.java Modified: incubator/pig/trunk/CHANGES.txt URL: http://svn.apache.org/viewvc/incubator/pig/trunk/CHANGES.txt?rev=648789&r1=648788&r2=648789&view=diff ============================================================================== --- incubator/pig/trunk/CHANGES.txt (original) +++ incubator/pig/trunk/CHANGES.txt Wed Apr 16 11:32:30 2008 @@ -234,3 +234,6 @@ PIG-149, PIG-150: Fix doc target so that ant can generate docs (xuzh via gates). + + PIG-183: Catch when a UDF has been compiled with the wrong version of + java and give a RuntimeException (pi_song via gates). Modified: incubator/pig/trunk/src/org/apache/pig/impl/PigContext.java URL: http://svn.apache.org/viewvc/incubator/pig/trunk/src/org/apache/pig/impl/PigContext.java?rev=648789&r1=648788&r2=648789&view=diff ============================================================================== --- incubator/pig/trunk/src/org/apache/pig/impl/PigContext.java (original) +++ incubator/pig/trunk/src/org/apache/pig/impl/PigContext.java Wed Apr 16 11:32:30 2008 @@ -444,11 +444,16 @@ public static Class resolveClassName(String name) throws IOException{ for(String prefix: packageImportList) { Class c; - try { - c = Class.forName(prefix+name,true, LogicalPlanBuilder.classloader); - return c; - } catch (ClassNotFoundException e) { - } catch (LinkageError e) {} + try { + c = Class.forName(prefix+name,true, LogicalPlanBuilder.classloader); + return c; + } + catch (ClassNotFoundException e) { + // do nothing + } + catch (UnsupportedClassVersionError e) { + throw new RuntimeException(e) ; + } } // create ClassNotFoundException exception and attach to IOException