mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 22:34:27 +02:00
8283782: Redundant verification of year in LocalDate::ofEpochDay
Reviewed-by: rriggs, naoto
This commit is contained in:
parent
2fef5d4a33
commit
072f2c461e
2 changed files with 37 additions and 5 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2022, 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
|
||||
|
@ -367,9 +367,7 @@ public final class LocalDate
|
|||
int dom = marchDoy0 - (marchMonth0 * 306 + 5) / 10 + 1;
|
||||
yearEst += marchMonth0 / 10;
|
||||
|
||||
// check year now we are certain it is correct
|
||||
int year = YEAR.checkValidIntValue(yearEst);
|
||||
return new LocalDate(year, month, dom);
|
||||
return new LocalDate((int)yearEst, month, dom);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue