Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.4
    • Fix Version/s: 5.5, 6.0
    • Component/s: modules/expressions
    • Labels:
      None
    • Lucene Fields:
      New, Patch Available

      Description

      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

        Activity

        Hide
        Uwe Schindler added a comment -

        Patch.

        Show
        Uwe Schindler added a comment - Patch.
        Hide
        Ryan Ernst added a comment -

        +1

        Show
        Ryan Ernst added a comment - +1
        Hide
        ASF subversion and git services added a comment -

        Commit 1723636 from Uwe Schindler in branch 'dev/trunk'
        [ https://svn.apache.org/r1723636 ]

        LUCENE-6964: String-based signatures in JavascriptCompiler replaced with better compile-time-checked MethodType; generated class files are no longer marked as synthetic

        Show
        ASF subversion and git services added a comment - Commit 1723636 from Uwe Schindler in branch 'dev/trunk' [ https://svn.apache.org/r1723636 ] LUCENE-6964 : String-based signatures in JavascriptCompiler replaced with better compile-time-checked MethodType; generated class files are no longer marked as synthetic
        Hide
        ASF subversion and git services added a comment -

        Commit 1723637 from Uwe Schindler in branch 'dev/branches/branch_5x'
        [ https://svn.apache.org/r1723637 ]

        Merged revision(s) 1723636 from lucene/dev/trunk:
        LUCENE-6964: String-based signatures in JavascriptCompiler replaced with better compile-time-checked MethodType; generated class files are no longer marked as synthetic

        Show
        ASF subversion and git services added a comment - Commit 1723637 from Uwe Schindler in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1723637 ] Merged revision(s) 1723636 from lucene/dev/trunk: LUCENE-6964 : String-based signatures in JavascriptCompiler replaced with better compile-time-checked MethodType; generated class files are no longer marked as synthetic

          People

          • Assignee:
            Uwe Schindler
            Reporter:
            Uwe Schindler
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development