-
Bug
-
Resolution: Fixed
-
P3
-
8
-
b110
-
Verified
Method
http://download.java.net/jdk8/docs/api/java/util/regex/Pattern.html#splitAsStream%28java.lang.CharSequence%29
returns a stream with an empty string as the last element if we use an example from
http://download.java.net/jdk8/docs/api/java/util/regex/Pattern.html#split%28java.lang.CharSequence%29
Consider the following code:
-------------------
Pattern pattern = Pattern.compile("o");
System.out.println("splitAsStream(..) = " + Arrays.toString(pattern.splitAsStream("boo:and:foo").toArray()));
System.out.println("split(..) = " + Arrays.toString(pattern.split("boo:and:foo")));
-------------------
The output will be
splitAsStream(..) = [b, , :and:f, ]
split(..) = [b, , :and:f]
The following JCK test will fail due to this
api/java_util/regex/Pattern/index.html#SplitAsStream
http://download.java.net/jdk8/docs/api/java/util/regex/Pattern.html#splitAsStream%28java.lang.CharSequence%29
returns a stream with an empty string as the last element if we use an example from
http://download.java.net/jdk8/docs/api/java/util/regex/Pattern.html#split%28java.lang.CharSequence%29
Consider the following code:
-------------------
Pattern pattern = Pattern.compile("o");
System.out.println("splitAsStream(..) = " + Arrays.toString(pattern.splitAsStream("boo:and:foo").toArray()));
System.out.println("split(..) = " + Arrays.toString(pattern.split("boo:and:foo")));
-------------------
The output will be
splitAsStream(..) = [b, , :and:f, ]
split(..) = [b, , :and:f]
The following JCK test will fail due to this
api/java_util/regex/Pattern/index.html#SplitAsStream