seregamorph opened a new pull request, #2139:
URL: https://github.com/apache/groovy/pull/2139

   `groovy.sql.Sql` declares several methods with SQL statement and parameters 
like this
   ```java
   public boolean execute(String sql, List<Object> params) throws SLQException {
   ```
   
   This declaration has one major drawback: it's not possible to pass as an 
argument the List which is not exactly `List<Object>`, e.g. `List.of(1)`.
   
   This List is only iterated, hence using wildcard here is safe. Also changing 
the type to wildcard as receiving argument should be binary compatible.
   
   Suggested method signature (example; address all such methods of Sql class):
   ```java
   public boolean execute(String sql, List<?> params) throws SLQException {
   ```
   
   Additional notes:
   * there are few methods that return `List<Object>`, e.g. 
`SqlWithParams.getParams()` - in this case the Object generic should be 
preserved.
   * For reference: pretty similar problem solved for cassandra-java-driver 
https://github.com/apache/cassandra-java-driver/commit/be07a77e4f80435a52b1347a07fd566448d9f4ef


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@groovy.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to