-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Replace use of java.util.Properties in Bindings #6401
Copy link
Copy link
Open
Labels
Type: Feature RequestIdentifies requests for new features or enhancements. These involve proposing new improvements.Identifies requests for new features or enhancements. These involve proposing new improvements.grelThe default expression language, GREL, could be improved in many ways!The default expression language, GREL, could be improved in many ways!refactoring
Metadata
Metadata
Assignees
Labels
Type: Feature RequestIdentifies requests for new features or enhancements. These involve proposing new improvements.Identifies requests for new features or enhancements. These involve proposing new improvements.grelThe default expression language, GREL, could be improved in many ways!The default expression language, GREL, could be improved in many ways!refactoring
Currently our variable storage, called "bindings", uses the
java.util.Propertiesclass for its implementation and its interface. It also pre-populates a variety of standard variables with newly instantiated objectsWrappedCell,WrappedRow, andCellTuplewhich are rarely ever used, causing the object creation overhead to be wastedAlthough it's strongly discouraged, the current code bypasses the
setPropertyandgetPropertymethods to useHashtable'sget()andput()directly, allowing it to support an effective contract ofMap<String, Object>(but without support fornullvalues sinceHashtabledoesn't support them).Proposed solution
HashMap<String, Object>which does lazy creation of all wrapped objects only when they are needed.PropertieslikeEvaluable,HasFields,HasFieldsList,Function, andControlto use the new Bindings class with default implementations for backward compatibility.Binder2interface which implements the new protocol variable lookup protocolnew Properties()to useExpressionUtils.getBindings(Project)like the main code does. Most occurrences of this pattern are scattered throughout the test code.Alternatives considered
Additional context