lushuifeng commented on issue #1481: DRILL-6763: Codegen optimization of SQL functions with constant values URL: https://github.com/apache/drill/pull/1481#issuecomment-429264607 In order to collect setter methods of nested class, some changes will be made: 1. `public void setConstant4(IntHolder constant4)` will be changed to `public void setConstant4(IntHolder constant4, String name)`, the second param `name` is to store the name of the first param, here is the string "constant4", unfortunately the second param is useless unless there is a nested class. 2. methods will be collected during `__DRILL_INIT__`, Lambda is not supported in JCodeModel 2.6, it seems that anonymousClass in JCodeModel 2.6 can't be narrowed, the <ValueHolder, String> is missing. some casts have to be added > Map<String, BiConsumer<ValueHolder, String>> nestedClassFunctions = new HashMap(); > this.nestedClassFunctions.put("constant355", new BiConsumer<ValueHolder, String>() { > @Override > public void accept(ValueHolder constant355, String name) { > (innerClassField).setConstant355(((IntHolder) constant355), "constant355"); > } > }); 3. InnerClassField is referenced in anonymousClass, keyword FINAL should be added to its mods, so it should be initialized in constructor not in `__DRILL_INIT__` What is your suggestions? @vvysotskyi thanks.
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services