Github user vvysotskyi commented on a diff in the pull request:

    https://github.com/apache/drill/pull/818#discussion_r117708028
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/expr/ClassGenerator.java ---
    @@ -77,10 +81,43 @@
       private final CodeGenerator<T> codeGenerator;
     
       public final JDefinedClass clazz;
    -  private final LinkedList<SizedJBlock>[] blocks;
    +
       private final JCodeModel model;
       private final OptionSet optionManager;
     
    +  private ClassGenerator<T> innerClassGenerator;
    +  private LinkedList<SizedJBlock>[] blocks;
    +  private LinkedList<SizedJBlock>[] oldBlocks;
    +
    +  /**
    +   * Assumed that field has 3 indexes within the constant pull: index of 
the CONSTANT_Fieldref_info +
    --- End diff --
    
    In this calculation is taken into account that 
CONSTANT_NameAndType_info.descriptor has limited range of its values, so it was 
taken 3 entries for the each class field and method.
    
    In this formula supposed that each class field and local variable use 
different literal values that have two entries. I am agree with you that there 
may be cases that have not been covered by this formula.
    
    The formula is needed for at least to consider the number of generated 
methods, difference between entries count for class fields and local variables. 
The 'magic' number 1000 was used in this formula to reserve constant pool for 
class references and unaccounted cases.
     


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to