Mercurial > hg > openjdk > jdk8u > jdk
changeset 13435:00475cd329f7
8216396: Support new Japanese era and new currency code points in java.lang.Character for Java SE 8
Reviewed-by: chegar, naoto, rriggs, coffeys
Contributed-by: deepak.kejriwal@oracle.com
author | coffeys |
---|---|
date | Tue, 29 Jan 2019 22:37:37 +0000 |
parents | db7a698be165 |
children | c35f231af17a |
files | src/share/classes/java/lang/Character.java |
diffstat | 1 files changed, 54 insertions(+), 22 deletions(-) [+] |
line wrap: on
line diff
--- a/src/share/classes/java/lang/Character.java Thu Jan 03 17:39:39 2019 +0800 +++ b/src/share/classes/java/lang/Character.java Tue Jan 29 22:37:37 2019 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2019, 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 @@ -32,27 +32,41 @@ /** * The {@code Character} class wraps a value of the primitive - * type {@code char} in an object. An object of type + * type {@code char} in an object. An object of class * {@code Character} contains a single field whose type is * {@code char}. * <p> - * In addition, this class provides several methods for determining - * a character's category (lowercase letter, digit, etc.) and for converting - * characters from uppercase to lowercase and vice versa. + * In addition, this class provides a large number of static methods for + * determining a character's category (lowercase letter, digit, etc.) + * and for converting characters from uppercase to lowercase and vice + * versa. + * + * <h3><a id="conformance">Unicode Conformance</a></h3> * <p> - * Character information is based on the Unicode Standard, version 6.2.0. + * The fields and methods of class {@code Character} are defined in terms + * of character information from the Unicode Standard, specifically the + * <i>UnicodeData</i> file that is part of the Unicode Character Database. + * This file specifies properties including name and category for every + * assigned Unicode code point or character range. The file is available + * from the Unicode Consortium at + * <a href="http://www.unicode.org">http://www.unicode.org</a>. * <p> - * The methods and data of class {@code Character} are defined by - * the information in the <i>UnicodeData</i> file that is part of the - * Unicode Character Database maintained by the Unicode - * Consortium. This file specifies various properties including name - * and general category for every defined Unicode code point or - * character range. - * <p> - * The file and its description are available from the Unicode Consortium at: - * <ul> - * <li><a href="http://www.unicode.org">http://www.unicode.org</a> - * </ul> + * The Java SE 8 Platform uses character information from version 6.2 + * of the Unicode Standard, with two extensions. First, the Java SE 8 Platform + * allows an implementation of class {@code Character} to use the Japanese Era + * code point, {@code U+32FF}, from the first version of the Unicode Standard + * after 6.2 that assigns the code point. Second, in recognition of the fact + * that new currencies appear frequently, the Java SE 8 Platform allows an + * implementation of class {@code Character} to use the Currency Symbols + * block from version 10.0 of the Unicode Standard. Consequently, the + * behavior of fields and methods of class {@code Character} may vary across + * implementations of the Java SE 8 Platform when processing the aforementioned + * code points ( outside of version 6.2 ), except for the following methods + * that define Java identifiers: + * {@link #isJavaIdentifierStart(int)}, {@link #isJavaIdentifierStart(char)}, + * {@link #isJavaIdentifierPart(int)}, and {@link #isJavaIdentifierPart(char)}. + * Code points in Java identifiers must be drawn from version 6.2 of + * the Unicode Standard. * * <h3><a name="unicode">Unicode Character Representations</a></h3> * @@ -5859,7 +5873,7 @@ * character in a Java identifier. * <p> * A character may start a Java identifier if and only if - * one of the following is true: + * one of the following conditions is true: * <ul> * <li> {@link #isLetter(char) isLetter(ch)} returns {@code true} * <li> {@link #getType(char) getType(ch)} returns {@code LETTER_NUMBER} @@ -5867,6 +5881,9 @@ * <li> {@code ch} is a connecting punctuation character (such as {@code '_'}). * </ul> * + * These conditions are tested against the character information from version + * 6.2 of the Unicode Standard. + * * @param ch the character to be tested. * @return {@code true} if the character may start a Java * identifier; {@code false} otherwise. @@ -5889,7 +5906,7 @@ * identifier as other than the first character. * <p> * A character may be part of a Java identifier if and only if any - * of the following are true: + * of the following conditions are true: * <ul> * <li> it is a letter * <li> it is a currency symbol (such as {@code '$'}) @@ -5902,6 +5919,9 @@ * {@code true} for the character. * </ul> * + * These conditions are tested against the character information from version + * 6.2 of the Unicode Standard. + * * @param ch the character to be tested. * @return {@code true} if the character may be part of a * Java identifier; {@code false} otherwise. @@ -5979,6 +5999,9 @@ * <li> {@code ch} is a connecting punctuation character (such as {@code '_'}). * </ul> * + * These conditions are tested against the character information from version + * 6.2 of the Unicode Standard. + * * <p><b>Note:</b> This method cannot handle <a * href="#supplementary"> supplementary characters</a>. To support * all Unicode characters, including supplementary characters, use @@ -6013,6 +6036,9 @@ * (such as {@code '_'}). * </ul> * + * These conditions are tested against the character information from version + * 6.2 of the Unicode Standard. + * * @param codePoint the character (Unicode code point) to be tested. * @return {@code true} if the character may start a Java identifier; * {@code false} otherwise. @@ -6031,7 +6057,7 @@ * identifier as other than the first character. * <p> * A character may be part of a Java identifier if any of the following - * are true: + * conditions are true: * <ul> * <li> it is a letter * <li> it is a currency symbol (such as {@code '$'}) @@ -6044,6 +6070,9 @@ * {@code true} for the character * </ul> * + * These conditions are tested against the character information from version + * 6.2 of the Unicode Standard. + * * <p><b>Note:</b> This method cannot handle <a * href="#supplementary"> supplementary characters</a>. To support * all Unicode characters, including supplementary characters, use @@ -6068,7 +6097,7 @@ * identifier as other than the first character. * <p> * A character may be part of a Java identifier if any of the following - * are true: + * conditions are true: * <ul> * <li> it is a letter * <li> it is a currency symbol (such as {@code '$'}) @@ -6079,9 +6108,12 @@ * <li> it is a non-spacing mark * <li> {@link #isIdentifierIgnorable(int) * isIdentifierIgnorable(codePoint)} returns {@code true} for - * the character + * the code point * </ul> * + * These conditions are tested against the character information from version + * 6.2 of the Unicode Standard. + * * @param codePoint the character (Unicode code point) to be tested. * @return {@code true} if the character may be part of a * Java identifier; {@code false} otherwise.