--- old/src/java.base/share/classes/sun/text/normalizer/NormalizerImpl.java 2019-05-22 15:33:14.000000000 -0700 +++ new/src/java.base/share/classes/sun/text/normalizer/NormalizerImpl.java 2019-05-22 15:33:14.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 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 @@ -61,7 +61,7 @@ return 0<=c && c(nextOffset-offset)) { throw new InternalError("Normalizer2 data: not enough bytes for normTrie"); } @@ -398,13 +407,8 @@ offset=nextOffset; nextOffset=inIndexes[IX_SMALL_FCD_OFFSET]; int numChars=(nextOffset-offset)/2; - char[] chars; if(numChars!=0) { - chars=new char[numChars]; - for(int i=0; i>OFFSET_SHIFT); } @@ -422,8 +426,12 @@ return load(ICUBinary.getRequiredData(name)); } - - public int getNorm16(int c) { return normTrie.get(c); } + // The trie stores values for lead surrogate code *units*. + // Surrogate code *points* are inert. + public int getNorm16(int c) { + return UTF16Plus.isLeadSurrogate(c) ? INERT : normTrie.get(c); + } + public int getRawNorm16(int c) { return normTrie.get(c); } public boolean isAlgorithmicNoNo(int norm16) { return limitNoNo<=norm16 && norm16