[ 
https://issues.apache.org/jira/browse/GEODE-3909?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16220863#comment-16220863
 ] 

ASF GitHub Bot commented on GEODE-3909:
---------------------------------------

upthewaterspout closed pull request #979: GEODE-3909: Use varargs for 
Query.execute
URL: https://github.com/apache/geode/pull/979
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/geode-core/src/main/java/org/apache/geode/cache/query/Query.java 
b/geode-core/src/main/java/org/apache/geode/cache/query/Query.java
index 8a7b4a5efb..cfb59fd72e 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/query/Query.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/query/Query.java
@@ -125,7 +125,7 @@ public Object execute() throws FunctionDomainException, 
TypeMismatchException,
    *         region referred to in the query.
    * 
    */
-  public Object execute(Object[] params) throws FunctionDomainException, 
TypeMismatchException,
+  public Object execute(Object... params) throws FunctionDomainException, 
TypeMismatchException,
       NameResolutionException, QueryInvocationTargetException;
 
   /**


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Query.execute method should use varargs instead of Object[]
> -----------------------------------------------------------
>
>                 Key: GEODE-3909
>                 URL: https://issues.apache.org/jira/browse/GEODE-3909
>             Project: Geode
>          Issue Type: Bug
>          Components: querying
>            Reporter: Dan Smith
>            Assignee: Dan Smith
>             Fix For: 1.4.0
>
>
> Currently in order to execute a query with bind parameters, the user has to 
> manually construct and array:
> {code}
> queryService.newQuery("select * from /region where name=$1").execute(new 
> Object[] {"joe"});
> {code}
> Java supports varags that allow the user to call this same method without 
> having to construct an array themselves:
> {code}
> queryService.newQuery("select * from /region where name=$1").execute("joe");
> {code}
> We just need to change the definition of execute to use Object... instead of 
> Object[].



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to