ICU-21219 Fix for Java version number overflow problem
authorYoshito Umaoka <yumaoka@users.noreply.github.com>
Wed, 19 Aug 2020 19:08:25 +0000 (15:08 -0400)
committerYoshito Umaoka <yumaoka@users.noreply.github.com>
Wed, 19 Aug 2020 20:04:45 +0000 (16:04 -0400)
commit9a6a64ce05b7257a85f8d04125428e4a081105b7
tree38008412395c684351e3e6750457501d14d09f29
parent5a714ae8f71f8b302ccc9604c4b192817b239b27
ICU-21219 Fix for Java version number overflow problem

Internal API VersionInfo.javaVersion() maps Java version number to  4 integer fields. Each field must be up to 255. However, recent OpenJDK 8 update exceed this range.

Luckily, we have only one reference in our code base for checking Java version. CharsetUTF16 uses maxBytePerChar = 4 for Java 5 and older, maxBytePerChar = 2 for newer Java version. Because we no longer support Java 5 runtime, we don't need this conditional check.

We don't have any other uses of VersionInfo.javaVersion(). Java's version range is not what we can control, so I decided to delete the internal use only API completely.
icu4j/main/classes/charset/src/com/ibm/icu/charset/CharsetUTF16.java
icu4j/main/classes/core/src/com/ibm/icu/util/VersionInfo.java