vvysotskyi commented on a change in pull request #1945: DRILL-7502: Invalid codegen for typeof() with UNION URL: https://github.com/apache/drill/pull/1945#discussion_r362594843
########## File path: exec/java-exec/src/main/java/org/apache/drill/exec/expr/ClassGenerator.java ########## @@ -97,31 +98,37 @@ private JVar innerClassField; /** - * Assumed that field has 3 indexes within the constant pull: index of the CONSTANT_Fieldref_info + - * CONSTANT_Fieldref_info.name_and_type_index + CONSTANT_NameAndType_info.name_index. - * CONSTANT_NameAndType_info.descriptor_index has limited range of values, CONSTANT_Fieldref_info.class_index is - * the same for a single class, they will be taken into account later. + * Assumed that field has 3 indexes within the constant pull: index of the + * CONSTANT_Fieldref_info + CONSTANT_Fieldref_info.name_and_type_index + + * CONSTANT_NameAndType_info.name_index. + * CONSTANT_NameAndType_info.descriptor_index has limited range of values, + * CONSTANT_Fieldref_info.class_index is the same for a single class, they + * will be taken into account later. * <p> * Local variable has 1 index within the constant pool. * {@link org.objectweb.asm.MethodWriter#visitLocalVariable(String, String, String, Label, Label, int)} * <p> - * For upper estimation of max index value, suppose that each field and local variable uses different literal - * values that have two indexes, then the number of occupied indexes within the constant pull is - * fieldCount * 3 + fieldCount * 2 + (index - fieldCount) * 3 => fieldCount * 2 + index * 3 + * For upper estimation of max index value, suppose that each field and local + * variable uses different literal values that have two indexes, then the + * number of occupied indexes within the constant pull is fieldCount * 3 + + * fieldCount * 2 + (index - fieldCount) * 3 => fieldCount * 2 + index * 3 * <p> - * Assumed that method has 3 indexes within the constant pull: index of the CONSTANT_Methodref_info + - * CONSTANT_Methodref_info.name_and_type_index + CONSTANT_NameAndType_info.name_index. + * Assumed that method has 3 indexes within the constant pull: index of the + * CONSTANT_Methodref_info + CONSTANT_Methodref_info.name_and_type_index + + * CONSTANT_NameAndType_info.name_index. * <p> - * For the upper estimation of number of split methods suppose that each expression in the method uses single variable. - * Suppose that the max number of indexes within the constant pull occupied by fields and local variables is M, - * the number of split methods is N, number of abstract methods in the template is A, then splitted methods count is - * N = (M - A * N * 3) / 50 => N = M / (50 + A * 3) + * For the upper estimation of number of split methods suppose that each + * expression in the method uses single variable. Suppose that the max number + * of indexes within the constant pull occupied by fields and local variables + * is M, the number of split methods is N, number of abstract methods in the + * template is A, then splitted methods count is N = (M - A * N * 3) / 50 => N Review comment: Please leave formulas to start from the new line. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to 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