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

    https://github.com/apache/geode/pull/589#discussion_r123553740
  
    --- Diff: 
geode-core/src/main/java/org/apache/geode/internal/cache/execute/FunctionContextImpl.java
 ---
    @@ -37,20 +38,25 @@
     
       private String functionId = null;
     
    +  private Cache cache = null;
    +
       private ResultSender resultSender = null;
     
       private final boolean isPossDup;
     
       public FunctionContextImpl(final String functionId, final Object args,
           ResultSender resultSender) {
    -    this.functionId = functionId;
    -    this.args = args;
    -    this.resultSender = resultSender;
    -    this.isPossDup = false;
    +    this(null, functionId, args, resultSender, false);
    +  }
    +
    +  public FunctionContextImpl(final Cache cache, final String functionId, 
final Object args,
    +      ResultSender resultSender) {
    +    this(cache, functionId, args, resultSender, false);
       }
     
    -  public FunctionContextImpl(final String functionId, final Object args, 
ResultSender resultSender,
    -      boolean isPossibleDuplicate) {
    +  public FunctionContextImpl(final Cache cache, final String functionId, 
final Object args,
    +      ResultSender resultSender, boolean isPossibleDuplicate) {
    --- End diff --
    
    I think the goal is to remove static calls altogether at some point.  I 
think some benefits would be it makes it easier to write test code for 
functions (for customers) and our own functions.  Client code could already use 
GemFireCacheImpl.getInstance() but I think the goal was to remove this call one 
day in the far future.


---
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