drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DRILL-6106) Use valueOf method instead of constructor since valueOf has a higher performance by caching frequently requested values.
Date Fri, 26 Jan 2018 17:02:00 GMT

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

ASF GitHub Bot commented on DRILL-6106:
---------------------------------------

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

    https://github.com/apache/drill/pull/1099#discussion_r164165401
  
    --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/ssl/SSLConfigClient.java
---
    @@ -94,7 +94,7 @@ private String getStringProperty(String name, String defaultValue) {
       private int getIntProperty(String name, int defaultValue) {
         int value = defaultValue;
         if ( (properties != null) && (properties.containsKey(name))) {
    -      value = new Integer(properties.getProperty(name)).intValue();
    +      value = Integer.valueOf(properties.getProperty(name)).intValue();
    --- End diff --
    
    Do not always trust Java doc :). Here is the actual implementation:
    
    ```
        public static Double valueOf(double d) {
            return new Double(d);
        }
    ```


> Use valueOf method instead of constructor since valueOf has a higher performance by caching
frequently requested values.
> ------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DRILL-6106
>                 URL: https://issues.apache.org/jira/browse/DRILL-6106
>             Project: Apache Drill
>          Issue Type: Improvement
>            Reporter: Reudismam Rolim de Sousa
>            Priority: Minor
>
> Use valueOf method instead of constructor since valueOf has a higher performance by
caching frequently requested values.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message