Andy Schlaikjer created PIG-3451: ------------------------------------ Summary: EvalFunc<T> ctor reflection to determine value of type param T is brittle Key: PIG-3451 URL: https://issues.apache.org/jira/browse/PIG-3451 Project: Pig Issue Type: Bug Components: impl Affects Versions: 0.13.0 Reporter: Andy Schlaikjer
The {{EvalFunc<T>}} base class has logic in its default ctor to attempt to determine the runtime type of its type parameter {{T}}. This logic is brittle when the derived class has type parameters of its own. For instance: {code} public static abstract EvalFunc1<T> extends EvalFunc<T> {} public static abstract EvalFunc2<X, T> extends EvalFunc1<T> {} public static EvalFunc3<X> extends EvalFunc1<X, DataBag> { ... } {code} Here, {{EvalFunc3<X>}} does specify a concrete type for {{T}} of {{EvalFunc<T>}}, but the existing login in the default ctor fails to identify it. Here's a unit test which reproduces this failure: https://github.com/sagemintblue/pig/compare/apache:trunk...hazen/repro_eval_func_reflection_bug Here's the test with an update to {{EvalFunc}}'s logic which fixes the issue: https://github.com/sagemintblue/pig/compare/apache:trunk...hazen/fix_eval_func_reflection -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira