ICU-1085 incorporate Ram's review comments; sync to C
X-SVN-Rev: 12321
This commit is contained in:
parent
67796b222d
commit
f3381350ac
@ -3258,10 +3258,15 @@ public abstract class Calendar implements Serializable, Cloneable {
|
|||||||
*/
|
*/
|
||||||
public void setMinimalDaysInFirstWeek(int value)
|
public void setMinimalDaysInFirstWeek(int value)
|
||||||
{
|
{
|
||||||
if (minimalDaysInFirstWeek != value) {
|
// Values less than 1 have the same effect as 1; values greater
|
||||||
if (value < 1 || value > 7) {
|
// than 7 have the same effect as 7. However, we normalize values
|
||||||
throw new IllegalArgumentException("Invalid days in first week");
|
// so operator== and so forth work.
|
||||||
|
if (value < 1) {
|
||||||
|
value = 1;
|
||||||
|
} else if (value > 7) {
|
||||||
|
value = 7;
|
||||||
}
|
}
|
||||||
|
if (minimalDaysInFirstWeek != value) {
|
||||||
minimalDaysInFirstWeek = value;
|
minimalDaysInFirstWeek = value;
|
||||||
areFieldsSet = false;
|
areFieldsSet = false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user