You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "NarekDW (via GitHub)" <gi...@apache.org> on 2023/03/14 18:08:06 UTC

[GitHub] [spark] NarekDW opened a new pull request, #40422: [MINOR] Use getParameterCount function instead of getParameterTypes.length

NarekDW opened a new pull request, #40422:
URL: https://github.com/apache/spark/pull/40422

   ### What changes were proposed in this pull request?
   
   Since jdk1.8 there is an additional function in reflection API `getParameterCount`, it is better to use that function instead of `getParameterTypes.length` because `getParameterTypes` function makes a copy of the parameter types array every invocation:
   ```java
       public Class<?>[] getParameterTypes() {
           return parameterTypes.clone();
       }
   ```
   `getParameterCount` returns amount of parameters directly:
   ```java
       public int getParameterCount() { return parameterTypes.length; }
   ``` 
   
   
   ### Why are the changes needed?
   To avoid redundant arrays creation.
   
   
   ### Does this PR introduce _any_ user-facing change?
   No
   
   
   ### How was this patch tested?
   By existing unit tests
   


-- 
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: reviews-unsubscribe@spark.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] srowen commented on pull request #40422: [SPARK-42803][CORE][SQL][ML] Use getParameterCount function instead of getParameterTypes.length

Posted by "srowen (via GitHub)" <gi...@apache.org>.
srowen commented on PR #40422:
URL: https://github.com/apache/spark/pull/40422#issuecomment-1474628142

   Merged to master


-- 
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: reviews-unsubscribe@spark.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] LuciferYang commented on pull request #40422: [SPARK-42803] Use getParameterCount function instead of getParameterTypes.length

Posted by "LuciferYang (via GitHub)" <gi...@apache.org>.
LuciferYang commented on PR #40422:
URL: https://github.com/apache/spark/pull/40422#issuecomment-1469893777

   The pr title should be `[SPARK-42803][CORE][SQL][ML] Use ... `


-- 
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: reviews-unsubscribe@spark.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] srowen closed pull request #40422: [SPARK-42803][CORE][SQL][ML] Use getParameterCount function instead of getParameterTypes.length

Posted by "srowen (via GitHub)" <gi...@apache.org>.
srowen closed pull request #40422: [SPARK-42803][CORE][SQL][ML] Use getParameterCount function instead of getParameterTypes.length
URL: https://github.com/apache/spark/pull/40422


-- 
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: reviews-unsubscribe@spark.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] LuciferYang commented on pull request #40422: [MINOR] Use getParameterCount function instead of getParameterTypes.length

Posted by "LuciferYang (via GitHub)" <gi...@apache.org>.
LuciferYang commented on PR #40422:
URL: https://github.com/apache/spark/pull/40422#issuecomment-1469206611

   I think we should file a jira to record this 


-- 
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: reviews-unsubscribe@spark.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] NarekDW commented on pull request #40422: [SPARK-42803] Use getParameterCount function instead of getParameterTypes.length

Posted by "NarekDW (via GitHub)" <gi...@apache.org>.
NarekDW commented on PR #40422:
URL: https://github.com/apache/spark/pull/40422#issuecomment-1469468855

   > I think we should file a jira to tracking this
   
   Done, pls check - https://issues.apache.org/jira/browse/SPARK-42803


-- 
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: reviews-unsubscribe@spark.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] NarekDW commented on pull request #40422: [SPARK-42803][CORE][SQL][ML] Use getParameterCount function instead of getParameterTypes.length

Posted by "NarekDW (via GitHub)" <gi...@apache.org>.
NarekDW commented on PR #40422:
URL: https://github.com/apache/spark/pull/40422#issuecomment-1470557942

   > @NarekDW Are there any more similar cases?
   > 
   > cc @srowen FYI
   
   @LuciferYang  no, these are all


-- 
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: reviews-unsubscribe@spark.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] LuciferYang commented on pull request #40422: [SPARK-42803] Use getParameterCount function instead of getParameterTypes.length

Posted by "LuciferYang (via GitHub)" <gi...@apache.org>.
LuciferYang commented on PR #40422:
URL: https://github.com/apache/spark/pull/40422#issuecomment-1469894625

   @NarekDW Are there any more similar cases?
   
   cc @srowen FYI
   


-- 
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: reviews-unsubscribe@spark.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org