Skip to content
Permalink
Browse files

8174270: Consolidate ICU sources in one location

Reviewed-by: srl, joehw
  • Loading branch information
Naoto Sato
Naoto Sato committed Jan 13, 2020
1 parent 91bb1d3 commit 1b24cf800f45c65b3812e932747a0c6dd481e566
Showing with 251 additions and 178 deletions.
  1. +5 −5 src/java.base/share/classes/java/net/IDN.java
  2. +2 −2 src/java.base/share/classes/java/text/Bidi.java
  3. +2 −2 src/java.base/share/classes/java/text/CollationElementIterator.java
  4. +2 −2 src/java.base/share/classes/java/text/Normalizer.java
  5. +2 −3 src/java.base/share/classes/java/text/RBTableBuilder.java
  6. +5 −4 src/java.base/share/classes/{sun/text/normalizer → jdk/internal/icu/impl}/BMPSet.java
  7. +4 −2 src/java.base/share/classes/{sun/text/normalizer → jdk/internal/icu/impl}/CharTrie.java
  8. +5 −3 ...va.base/share/classes/{sun/text/normalizer → jdk/internal/icu/impl}/CharacterIteratorWrapper.java
  9. +4 −3 src/java.base/share/classes/{sun/text/normalizer → jdk/internal/icu/impl}/ICUBinary.java
  10. +9 −4 src/java.base/share/classes/{sun/text/normalizer → jdk/internal/icu/impl}/Norm2AllModes.java
  11. +8 −3 src/java.base/share/classes/{sun/text/normalizer → jdk/internal/icu/impl}/NormalizerImpl.java
  12. +4 −3 src/java.base/share/classes/{sun/net/idn → jdk/internal/icu/impl}/Punycode.java
  13. +7 −3 ...se/share/classes/{sun/text/normalizer → jdk/internal/icu/impl}/ReplaceableUCharacterIterator.java
  14. +4 −3 src/java.base/share/classes/{sun/net/idn → jdk/internal/icu/impl}/StringPrepDataReader.java
  15. +5 −2 src/java.base/share/classes/{sun/text/normalizer → jdk/internal/icu/impl}/Trie.java
  16. +2 −2 src/java.base/share/classes/{sun/text/normalizer → jdk/internal/icu/impl}/Trie2.java
  17. +2 −2 src/java.base/share/classes/{sun/text/normalizer → jdk/internal/icu/impl}/Trie2_16.java
  18. +10 −3 src/java.base/share/classes/{sun/text/normalizer → jdk/internal/icu/impl}/UBiDiProps.java
  19. +13 −6 src/java.base/share/classes/{sun/text/normalizer → jdk/internal/icu/impl}/UCharacterProperty.java
  20. +7 −4 src/java.base/share/classes/{sun/text/normalizer → jdk/internal/icu/impl}/UnicodeSetStringSpan.java
  21. +6 −3 src/java.base/share/classes/{sun/text/normalizer → jdk/internal/icu/impl}/Utility.java
  22. BIN src/java.base/share/classes/{sun/text/resources → jdk/internal/icu/impl/data/icudt64b}/nfc.nrm
  23. BIN src/java.base/share/classes/{sun/text/resources → jdk/internal/icu/impl/data/icudt64b}/nfkc.nrm
  24. BIN src/java.base/share/classes/{sun/text/resources → jdk/internal/icu/impl/data/icudt64b}/ubidi.icu
  25. BIN src/java.base/share/classes/{sun/text/resources → jdk/internal/icu/impl/data/icudt64b}/uprops.icu
  26. +8 −2 src/java.base/share/classes/{sun/text/normalizer → jdk/internal/icu/lang}/UCharacter.java
  27. +3 −2 src/java.base/share/classes/{sun/net/idn → jdk/internal/icu/lang}/UCharacterDirection.java
  28. +2 −1 src/java.base/share/classes/{sun/net/idn → jdk/internal/icu/lang}/UCharacterEnums.java
  29. +5 −5 src/java.base/share/classes/{sun/text/bidi → jdk/internal/icu/text}/BidiBase.java
  30. +2 −2 src/java.base/share/classes/{sun/text/bidi → jdk/internal/icu/text}/BidiLine.java
  31. +2 −2 src/java.base/share/classes/{sun/text/bidi → jdk/internal/icu/text}/BidiRun.java
  32. +3 −4 src/java.base/share/classes/{sun/text/bidi → jdk/internal/icu/text}/BidiWriter.java
  33. +2 −2 src/java.base/share/classes/{sun/text/normalizer → jdk/internal/icu/text}/FilteredNormalizer2.java
  34. +5 −3 src/java.base/share/classes/{sun/text/normalizer → jdk/internal/icu/text}/Normalizer2.java
  35. +4 −2 src/java.base/share/classes/{sun/text/normalizer → jdk/internal/icu/text}/NormalizerBase.java
  36. +3 −3 src/java.base/share/classes/{sun/text/normalizer → jdk/internal/icu/text}/Replaceable.java
  37. +3 −3 src/java.base/share/classes/{sun/text/normalizer → jdk/internal/icu/text}/ReplaceableString.java
  38. +8 −9 src/java.base/share/classes/{sun/net/idn → jdk/internal/icu/text}/StringPrep.java
  39. +6 −2 src/java.base/share/classes/{sun/text/normalizer → jdk/internal/icu/text}/UCharacterIterator.java
  40. +4 −2 src/java.base/share/classes/{sun/text/normalizer → jdk/internal/icu/text}/UTF16.java
  41. +11 −4 src/java.base/share/classes/{sun/text/normalizer → jdk/internal/icu/text}/UnicodeSet.java
  42. +2 −2 src/java.base/share/classes/{sun/text/normalizer → jdk/internal/icu/util}/CodePointMap.java
  43. +5 −3 src/java.base/share/classes/{sun/text/normalizer → jdk/internal/icu/util}/CodePointTrie.java
  44. +3 −3 src/java.base/share/classes/{sun/text/normalizer → jdk/internal/icu/util}/OutputInt.java
  45. +12 −2 src/java.base/share/classes/{sun/text/normalizer → jdk/internal/icu/util}/VersionInfo.java
  46. +2 −2 src/java.base/share/classes/sun/text/CollatorUtilities.java
  47. +3 −3 src/java.base/share/classes/sun/text/ComposedCharIter.java
  48. +3 −3 src/java.base/share/classes/sun/text/Normalizer.java
  49. +4 −4 test/jdk/java/text/Bidi/Bug6850113.java
  50. +4 −4 test/jdk/java/text/Bidi/Bug7051769.java
  51. +4 −6 test/jdk/java/text/Normalizer/ConformanceTest.java
  52. +4 −6 test/jdk/java/text/Normalizer/ICUBasicTest.java
  53. +7 −7 test/jdk/java/text/Normalizer/NormalizerAPITest.java
  54. +5 −5 test/jdk/java/text/Normalizer/ThreadSafeTest.java
  55. +3 −3 test/jdk/sun/net/idn/NFS4StringPrep.java
  56. +5 −6 test/jdk/sun/net/idn/PunycodeTest.java
  57. +6 −7 test/jdk/sun/net/idn/TestStringPrep.java
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2020, 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
@@ -29,9 +29,9 @@
import java.security.AccessController;
import java.security.PrivilegedAction;

import sun.net.idn.StringPrep;
import sun.net.idn.Punycode;
import sun.text.normalizer.UCharacterIterator;
import jdk.internal.icu.impl.Punycode;
import jdk.internal.icu.text.StringPrep;
import jdk.internal.icu.text.UCharacterIterator;

/**
* Provides methods to convert internationalized domain names (IDNs) between
@@ -226,7 +226,7 @@ public static String toUnicode(String input) {
InputStream stream = null;

try {
final String IDN_PROFILE = "uidna.spp";
final String IDN_PROFILE = "/sun/net/idn/uidna.spp";
if (System.getSecurityManager() != null) {
stream = AccessController.doPrivileged(new PrivilegedAction<>() {
public InputStream run() {
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2020, 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
@@ -35,7 +35,7 @@

package java.text;

import sun.text.bidi.BidiBase;
import jdk.internal.icu.text.BidiBase;

/**
* This class implements the Unicode Bidirectional Algorithm.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2020, 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
@@ -41,7 +41,7 @@
import java.lang.Character;
import java.util.Vector;
import sun.text.CollatorUtilities;
import sun.text.normalizer.NormalizerBase;
import jdk.internal.icu.text.NormalizerBase;

/**
* The {@code CollationElementIterator} class is used as an iterator
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2020, 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
@@ -37,7 +37,7 @@

package java.text;

import sun.text.normalizer.NormalizerBase;
import jdk.internal.icu.text.NormalizerBase;

/**
* This class provides the method {@code normalize} which transforms Unicode
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2020, 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
@@ -42,8 +42,7 @@
import sun.text.UCompactIntArray;
import sun.text.IntHashtable;
import sun.text.ComposedCharIter;
import sun.text.CollatorUtilities;
import sun.text.normalizer.NormalizerImpl;
import jdk.internal.icu.impl.NormalizerImpl;

/**
* This class contains all the code to parse a RuleBasedCollator pattern
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2020, 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,9 +32,10 @@
******************************************************************************
*/

package sun.text.normalizer;
package jdk.internal.icu.impl;

import sun.text.normalizer.UnicodeSet.SpanCondition;
import jdk.internal.icu.text.UnicodeSet.SpanCondition;
import jdk.internal.icu.util.OutputInt;

/**
* Helper class for frozen UnicodeSets, implements contains() and span() optimized for BMP code points.
@@ -44,7 +45,7 @@
* 3-byte characters: Use zero/one/mixed data per 64-block in U+0000..U+FFFF, with mixed for illegal ranges.
* Supplementary characters: Call contains() on the parent set.
*/
final class BMPSet {
public final class BMPSet {

/**
* One boolean ('true' or 'false') per Latin-1 character.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2020, 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
@@ -30,7 +30,9 @@
******************************************************************************
*/

package sun.text.normalizer;
package jdk.internal.icu.impl;

import jdk.internal.icu.text.UTF16;

import java.io.DataInputStream;
import java.io.InputStream;
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2020, 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
@@ -35,17 +35,19 @@
*******************************************************************************
*/

package sun.text.normalizer;
package jdk.internal.icu.impl;

import java.text.CharacterIterator;

import jdk.internal.icu.text.UCharacterIterator;

/**
* This class is a wrapper around CharacterIterator and implements the
* UCharacterIterator protocol
* @author ram
*/

class CharacterIteratorWrapper extends UCharacterIterator {
public class CharacterIteratorWrapper extends UCharacterIterator {

private CharacterIterator iterator;

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2020, 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
@@ -30,9 +30,8 @@
*******************************************************************************
*/

package sun.text.normalizer;
package jdk.internal.icu.impl;

import java.io.BufferedInputStream;
import java.io.DataInputStream;
import java.io.InputStream;
import java.io.IOException;
@@ -43,6 +42,8 @@
import java.security.AccessController;
import java.security.PrivilegedAction;

import jdk.internal.icu.util.VersionInfo;

public final class ICUBinary {

private static final class IsAcceptable implements Authenticate {
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2020, 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
@@ -30,11 +30,14 @@
*******************************************************************************
*/

package sun.text.normalizer;
package jdk.internal.icu.impl;

import java.io.IOException;

final class Norm2AllModes {
import jdk.internal.icu.text.Normalizer2;
import jdk.internal.icu.util.VersionInfo;

public final class Norm2AllModes {
// Public API dispatch via Normalizer2 subclasses -------------------------- ***

// Normalizer2 implementation for the old UNORM_NONE.
@@ -265,7 +268,9 @@ public static Norm2AllModes getNFKCInstance() {
private static final class Norm2AllModesSingleton {
private Norm2AllModesSingleton(String name) {
try {
String DATA_FILE_NAME = "/sun/text/resources/" + name + ".nrm";
@SuppressWarnings("deprecation")
String DATA_FILE_NAME = "/jdk/internal/icu/impl/data/icudt" +
VersionInfo.ICU_DATA_VERSION_PATH + "/" + name + ".nrm";
NormalizerImpl impl=new NormalizerImpl().load(DATA_FILE_NAME);
allModes=new Norm2AllModes(impl);
} catch (RuntimeException e) {
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009, 2020, 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
@@ -29,11 +29,16 @@
* Corporation and others. All Rights Reserved.
*******************************************************************************
*/
package sun.text.normalizer;
package jdk.internal.icu.impl;

import java.io.IOException;
import java.nio.ByteBuffer;
import java.text.Normalizer;

import jdk.internal.icu.lang.UCharacter;
import jdk.internal.icu.text.Normalizer2;
import jdk.internal.icu.text.UTF16;
import jdk.internal.icu.util.CodePointTrie;
import jdk.internal.icu.util.VersionInfo;

// Original filename in ICU4J: Normalizer2Impl.java
public final class NormalizerImpl {
@@ -1,4 +1,5 @@
/*
* Copyright (c) 2005, 2020, 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
@@ -36,11 +37,11 @@
// 2007-08-14 Martin Buchholz
// - remove redundant casts
//
package sun.net.idn;
package jdk.internal.icu.impl;

import java.text.ParseException;
import sun.text.normalizer.UCharacter;
import sun.text.normalizer.UTF16;
import jdk.internal.icu.lang.UCharacter;
import jdk.internal.icu.text.UTF16;

/**
* Ported code from ICU punycode.c
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2020, 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
@@ -35,7 +35,11 @@
*******************************************************************************
*/

package sun.text.normalizer;
package jdk.internal.icu.impl;

import jdk.internal.icu.text.Replaceable;
import jdk.internal.icu.text.ReplaceableString;
import jdk.internal.icu.text.UCharacterIterator;

/**
* DLF docs must define behavior when Replaceable is mutated underneath
@@ -47,7 +51,7 @@
*
* What are first, last, and getBeginIndex doing here?!?!?!
*/
class ReplaceableUCharacterIterator extends UCharacterIterator {
public class ReplaceableUCharacterIterator extends UCharacterIterator {

// public constructor ------------------------------------------------------

@@ -1,4 +1,5 @@
/*
* Copyright (c) 2005, 2020, 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
@@ -38,13 +39,13 @@
// - copy this file from icu4jsrc_3_2/src/com/ibm/icu/impl/StringPrepDataReader.java
// - move from package com.ibm.icu.impl to package sun.net.idn
//
package sun.net.idn;
package jdk.internal.icu.impl;

import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStream;

import sun.text.normalizer.ICUBinary;
import jdk.internal.icu.impl.ICUBinary;


/**
@@ -53,7 +54,7 @@
* To change the template for this generated type comment go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
final class StringPrepDataReader implements ICUBinary.Authenticate {
public final class StringPrepDataReader implements ICUBinary.Authenticate {

/**
* <p>private constructor.</p>
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2020, 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
@@ -30,7 +30,10 @@
******************************************************************************
*/

package sun.text.normalizer;
package jdk.internal.icu.impl;

import jdk.internal.icu.lang.UCharacter;
import jdk.internal.icu.text.UTF16;

import java.io.DataInputStream;
import java.io.InputStream;
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2020, 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
@@ -30,7 +30,7 @@
*******************************************************************************
*/

package sun.text.normalizer;
package jdk.internal.icu.impl;

import java.io.IOException;
import java.nio.ByteBuffer;
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2020, 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
@@ -30,7 +30,7 @@
*******************************************************************************
*/

package sun.text.normalizer;
package jdk.internal.icu.impl;

import java.io.IOException;
import java.nio.ByteBuffer;

0 comments on commit 1b24cf8

Please sign in to comment.
You can’t perform that action at this time.