< prev index next >
jdk/src/java.base/share/classes/sun/text/normalizer/ReplaceableString.java
Print this page
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
@@ -23,17 +23,12 @@
* questions.
*/
/*
*******************************************************************************
- * (C) Copyright IBM Corp. 1996-2005 - All Rights Reserved *
- * *
- * The original version of this source code and documentation is copyrighted *
- * and owned by IBM, These materials are provided under terms of a License *
- * Agreement between IBM and Sun. This technology is protected by multiple *
- * US and International patents. This notice and attribution to IBM may not *
- * to removed. *
+ * Copyright (C) 1996-2009, International Business Machines Corporation and *
+ * others. All Rights Reserved. *
*******************************************************************************
*/
package sun.text.normalizer;
@@ -49,11 +44,11 @@
*
* @see Replaceable
* @author Alan Liu
* @stable ICU 2.0
*/
-public class ReplaceableString implements Replaceable {
+class ReplaceableString implements Replaceable {
private StringBuffer buf;
/**
* Construct a new object with the given initial contents.
@@ -62,11 +57,10 @@
*/
public ReplaceableString(String str) {
buf = new StringBuffer(str);
}
- //// for StringPrep
/**
* Construct a new object using <code>buf</code> for internal
* storage. The contents of <code>buf</code> at the time of
* construction are used as the initial contents. <em>Note!
* Modifications to <code>buf</code> will modify this object, and
@@ -96,11 +90,10 @@
*/
public char charAt(int offset) {
return buf.charAt(offset);
}
- //// for StringPrep
/**
* Copies characters from this object into the destination
* character array. The first character to be copied is at index
* <code>srcStart</code>; the last character to be copied is at
* index <code>srcLimit-1</code> (thus the total number of
@@ -116,8 +109,10 @@
* @param dst the destination array.
* @param dstStart the start offset in the destination array.
* @stable ICU 2.0
*/
public void getChars(int srcStart, int srcLimit, char dst[], int dstStart) {
- Utility.getChars(buf, srcStart, srcLimit, dst, dstStart);
+ if (srcStart != srcLimit) {
+ buf.getChars(srcStart, srcLimit, dst, dstStart);
+ }
}
}
< prev index next >