Bug #93153 mysql-connector-j v5: TimeZone.getDefault() also return a clone result.
Submitted: 11 Nov 2018 4:57 Modified: 3 Sep 2021 11:19
Reporter: asdfas dfawef Email Updates:
Status: Can't repeat 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.
[3 Sep 2021 11:19] Alexander Soklakov
Posted by developer:
 
This bug does not exist in the latest Connector/J 8.0.

Connector/J 5.1 series came to EOL on Feb 9th, 2021, see https://www.mysql.com/support/eol-notice.html, so this bug will not be fixed there.