src/share/classes/java/time/chrono/JapaneseEra.java

Print this page

        

*** 52,72 **** * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ ! package java.time.calendar; import java.io.DataInput; import java.io.DataOutput; import java.io.IOException; import java.io.InvalidObjectException; import java.io.ObjectStreamException; import java.io.Serializable; import java.time.DateTimeException; import java.time.LocalDate; - import java.time.temporal.Era; import java.util.Arrays; import sun.util.calendar.CalendarDate; /** --- 52,71 ---- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ ! package java.time.chrono; import java.io.DataInput; import java.io.DataOutput; import java.io.IOException; import java.io.InvalidObjectException; import java.io.ObjectStreamException; import java.io.Serializable; import java.time.DateTimeException; import java.time.LocalDate; import java.util.Arrays; import sun.util.calendar.CalendarDate; /**
*** 84,94 **** * This class is immutable and thread-safe. * * @since 1.8 */ final class JapaneseEra ! implements Era<JapaneseChrono>, Serializable { // The offset value to 0-based index from the era value. // i.e., getValue() + ERA_OFFSET == 0-based index; except that -999 is mapped to zero static final int ERA_OFFSET = 2; --- 83,93 ---- * This class is immutable and thread-safe. * * @since 1.8 */ final class JapaneseEra ! implements Era, Serializable { // The offset value to 0-based index from the era value. // i.e., getValue() + ERA_OFFSET == 0-based index; except that -999 is mapped to zero static final int ERA_OFFSET = 2;
*** 131,141 **** // array for the singleton JapaneseEra instances private static final JapaneseEra[] KNOWN_ERAS; static { ! sun.util.calendar.Era[] sunEras = JapaneseChrono.JCAL.getEras(); ERA_CONFIG = new sun.util.calendar.Era[sunEras.length + 1]; for (int i = 1; i < ERA_CONFIG.length; i++) { ERA_CONFIG[i] = sunEras[i - 1]; } KNOWN_ERAS = new JapaneseEra[ERA_CONFIG.length]; --- 130,140 ---- // array for the singleton JapaneseEra instances private static final JapaneseEra[] KNOWN_ERAS; static { ! sun.util.calendar.Era[] sunEras = JapaneseChronology.JCAL.getEras(); ERA_CONFIG = new sun.util.calendar.Era[sunEras.length + 1]; for (int i = 1; i < ERA_CONFIG.length; i++) { ERA_CONFIG[i] = sunEras[i - 1]; } KNOWN_ERAS = new JapaneseEra[ERA_CONFIG.length];
*** 290,301 **** public int getValue() { return eraValue; } @Override ! public JapaneseChrono getChrono() { ! return JapaneseChrono.INSTANCE; } //----------------------------------------------------------------------- String getAbbreviation() { int index = ordinal(getValue()); --- 289,300 ---- public int getValue() { return eraValue; } @Override ! public JapaneseChronology getChronology() { ! return JapaneseChronology.INSTANCE; } //----------------------------------------------------------------------- String getAbbreviation() { int index = ordinal(getValue());