mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8210142: java.util.Calendar.clone() doesn't respect sharedZone flag
Reviewed-by: rriggs
This commit is contained in:
parent
9d6230fe4e
commit
d1958eeed1
2 changed files with 31 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -3326,7 +3326,9 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable<Ca
|
|||
other.stamp[i] = stamp[i];
|
||||
other.isSet[i] = isSet[i];
|
||||
}
|
||||
other.zone = (TimeZone) zone.clone();
|
||||
if (!sharedZone) {
|
||||
other.zone = (TimeZone) zone.clone();
|
||||
}
|
||||
return other;
|
||||
}
|
||||
catch (CloneNotSupportedException e) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue