Commons JEXL
  1. Commons JEXL
  2. JEXL-3

[JEXL] Static method resolution and changes to context

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0
    • Fix Version/s: 2.0
    • Labels:
      None
    • Environment:

      Operating System: other
      Platform: Other

      Description

      From: Guido Anzuoni <ganzuoni@gmail.com>

      Here I will try to explain may changes to see if you agree to include in the trunk.
      1. UberspectImpl
      I need to include static methods resolution in expressions (e.g.
      System.currentTimeMillis()). I patched the class to allow it.

      2. JexlContext
      Resolving vars using a Map is not enough flexible for my needs. I have modified
      it to have a single method
      public Object resolveVariable(String var);

      This allows me for better flexibility in the resolution process.
      I have implemented a JextContext based on a java.util.Map, an extensible
      JexlContext and a delegating JexlContext.
      The extensible resolver is abstract and has a "parent" context to which
      delegates in the case local resolution failes.
      Delegating implementation extends the extensible context and uses another
      JexlContext for local resolution.

      More, I have removed any reference to JexlContex.getVars() in the code.

      If you wish I can send the modified classes to better evaluate my changes.

        Activity

        Hide
        dion gillard added a comment -

        Created an attachment (id=18022)
        Changes as per description

        Show
        dion gillard added a comment - Created an attachment (id=18022) Changes as per description
        Hide
        dion gillard added a comment -

        I've implemented the static method resolution of this bug, but the rework of
        context I think should happen in Jexl 2.x

        Show
        dion gillard added a comment - I've implemented the static method resolution of this bug, but the rework of context I think should happen in Jexl 2.x
        Hide
        Rahul Akolkar added a comment -

        I agree that the VariableResolver style API is much better than get/set vars. This has to be moved to a major release (if this change is to be made). Therefore, updating fix version to 2.0.

        Show
        Rahul Akolkar added a comment - I agree that the VariableResolver style API is much better than get/set vars. This has to be moved to a major release (if this change is to be made). Therefore, updating fix version to 2.0.
        Hide
        Fyodor Kupolov added a comment -

        Scriptella open source ETL tool actively use JEXL as an expression engine. Thank you for such a great library, but I see one critical limitation of JEXL - it's impossible to instantiate objects and invoke static methods without object instance.

        Could you please tell me when 2.0 is going to be released?

        Show
        Fyodor Kupolov added a comment - Scriptella open source ETL tool actively use JEXL as an expression engine. Thank you for such a great library, but I see one critical limitation of JEXL - it's impossible to instantiate objects and invoke static methods without object instance. Could you please tell me when 2.0 is going to be released?
        Hide
        Joydeep Sen Sarma added a comment -

        +1 - we are considering using JEXL in Hive - a query engine over hadoop.

        Show
        Joydeep Sen Sarma added a comment - +1 - we are considering using JEXL in Hive - a query engine over hadoop.
        Hide
        Henri Biestro added a comment - - edited

        Static method resolution is fixed in 2.0.

        Show
        Henri Biestro added a comment - - edited Static method resolution is fixed in 2.0.
        Hide
        Rahul Akolkar added a comment -

        This should be fixed in the 2.0 branch in SVN. Please try it out (by building the branch) and if further work is needed, reopen this issue with a complete JUnit test that fails.

        Show
        Rahul Akolkar added a comment - This should be fixed in the 2.0 branch in SVN. Please try it out (by building the branch) and if further work is needed, reopen this issue with a complete JUnit test that fails.
        Hide
        Henri Biestro added a comment -

        Bulk closing issues resolved in JEXL 2.0.

        Show
        Henri Biestro added a comment - Bulk closing issues resolved in JEXL 2.0.

          People

          • Assignee:
            Unassigned
            Reporter:
            dion gillard
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development