< prev index next >

src/java.base/share/classes/sun/text/normalizer/Normalizer2.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018 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

@@ -133,13 +133,15 @@
             // and is already normalized.
             int spanLength=spanQuickCheckYes(src);
             if(spanLength==src.length()) {
                 return (String)src;
             }
+            if (spanLength != 0) {
             StringBuilder sb=new StringBuilder(src.length()).append(src, 0, spanLength);
             return normalizeSecondAndAppend(sb, src.subSequence(spanLength, src.length())).toString();
         }
+        }
         return normalize(src, new StringBuilder(src.length())).toString();
     }
 
     /**
      * Writes the normalized form of the source string to the destination string
< prev index next >