[ https://issues.apache.org/jira/browse/PIG-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13792923#comment-13792923 ]
Aniket Mokashi commented on PIG-3451: ------------------------------------- committed to trunk. Thanks [~hazen] for your contribution! > 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.11.1 > Reporter: Andy Schlaikjer > Assignee: Andy Schlaikjer > Fix For: 0.13.0 > > Attachments: PIG-3451-3.patch > > > 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 concrete type {{DataBag}} for {{T}} of > {{EvalFunc<T>}}, but the existing logic 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 was sent by Atlassian JIRA (v6.1#6144)