changeset 8365:4253e2ac200b

Style
author henryjen
date Thu, 25 Apr 2013 14:39:57 -0700
parents 4c67fc5c66ce
children d5dcc7969a32
files src/share/classes/java/lang/CharSequence.java
diffstat 1 files changed, 18 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/lang/CharSequence.java	Thu Apr 25 12:15:33 2013 -0700
+++ b/src/share/classes/java/lang/CharSequence.java	Thu Apr 25 14:39:57 2013 -0700
@@ -136,21 +136,27 @@
             }
 
             public int nextInt() {
-                if (hasNext())
+                if (hasNext()) {
                     return charAt(cur++);
-                else
+                } else {
                     throw new NoSuchElementException();
+                }
             }
 
             @Override
             public void forEachRemaining(IntConsumer block) {
-                for (; cur < length(); cur++)
+                for (; cur < length(); cur++) {
                     block.accept(charAt(cur));
+                }
             }
         }
 
-        return StreamSupport.intStream(() -> Spliterators.spliterator(new CharIterator(), length(), Spliterator.ORDERED),
-                                       Spliterator.SUBSIZED | Spliterator.SIZED | Spliterator.ORDERED);
+        return StreamSupport.intStream(() ->
+                Spliterators.spliterator(
+                        new CharIterator(),
+                        length(),
+                        Spliterator.ORDERED),
+                Spliterator.SUBSIZED | Spliterator.SIZED | Spliterator.ORDERED);
     }
 
     /**
@@ -185,17 +191,19 @@
             }
 
             public int nextInt() {
-                if (!hasNext())
+                if (!hasNext()) {
                     throw new NoSuchElementException();
-                // TODO: It probably would be faster if the logic from
-                // the following two methods were inlined and simplified.
+                }
                 int cp = Character.codePointAt(CharSequence.this, cur);
                 cur += Character.charCount(cp);
                 return cp;
             }
         }
 
-        return StreamSupport.intStream(() -> Spliterators.spliteratorUnknownSize(new CodePointIterator(), Spliterator.ORDERED),
-                                       Spliterator.SUBSIZED | Spliterator.SIZED | Spliterator.ORDERED);
+        return StreamSupport.intStream(() ->
+                Spliterators.spliteratorUnknownSize(
+                        new CodePointIterator(),
+                        Spliterator.ORDERED),
+                Spliterator.SUBSIZED | Spliterator.SIZED | Spliterator.ORDERED);
     }
 }