Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-6964

Small changes in expressions module



    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 5.4
    • 5.5, 6.0
    • modules/expressions
    • None
    • New, Patch Available


      This patch is not really worth an issue, but it has 2 small changes in expression's JavaScriptCompiler:

      • On the OpenJDK mailinglists from time to time people want to have "nice stack traces" (this got worse with Lambda expressions). Since Java 8u60 they now hide some stack frames automatically. Under discussion was to use the "synthetic" bytecode attribute for that. They did not do that; instead they have a new annotation (@LambdaForm.Hidden). In any case, I will remove the synthetic annotation from the generated class file, because it is not really applicable (and also brings nothing): "A class member that does not appear in the source code must be marked using a Synthetic attribute, or else it must have its ACC_SYNTHETIC flag set. The only exceptions to this requirement are compiler-generated methods which are not considered implementation artifacts, namely the instance initialization method representing a default constructor of the Java programming language (§2.9), the class initialization method (§2.9), and the Enum.values() and Enum.valueOf() methods.". In our case the expressions class has source code (just not Java), so we should not make it synthetic. So there is also no risk that the stack frames get hidden in future (if OpenJDK thinks different).
      • The code has currently some string-based method signatures. They tend to get broken because we have no compile-time checks. I replaced those with compile-time class constants using Java 7's MethodType to create the descriptor. For me the code is more readable. The change is a no-op as its constants only.


        1. LUCENE-6964.patch
          3 kB
          Uwe Schindler



            uschindler Uwe Schindler
            uschindler Uwe Schindler
            0 Vote for this issue
            2 Start watching this issue