Bug #93153 mysql-connector-j v5: TimeZone.getDefault() also return a clone result.
Submitted: 11 Nov 2018 4:57 Modified: 23 Nov 2018 16:08
Reporter: asdfas dfawef Email Updates:
Status: Verified Impact on me:
None 
Category:Connector / J Severity:S5 (Performance)
Version:5.1.47 OS:Any
Assigned to: Filipe Silva CPU Architecture:Any

[11 Nov 2018 4:57] asdfas dfawef
Description:
https://github.com/mysql/mysql-connector-j/blob/release/5.1/src/com/mysql/jdbc/TimeUtil.ja...

com.mysql.jdbc.TimeUtil#getDefaultTimeZone(boolean) 

   public static final TimeZone getDefaultTimeZone(boolean useCache) {
        return (TimeZone) (useCache ? DEFAULT_TIMEZONE.clone() : TimeZone.getDefault().clone());
    }

How to repeat:
   public static final TimeZone getDefaultTimeZone(boolean useCache) {
        return useCache ? DEFAULT_TIMEZONE.clone() : TimeZone.getDefault();
    }
[23 Nov 2018 16:05] Filipe Silva
Good point, thanks for the notice.