Merge branch 'master' of https://gitbox.apache.org/repos/asf/commons-lang.git
This commit is contained in:
commit
4a8aa9e724
4
pom.xml
4
pom.xml
|
@ -223,7 +223,7 @@
|
|||
<notimestamp>true</notimestamp>
|
||||
<links>
|
||||
<link>https://commons.apache.org/proper/commons-text/apidocs</link>
|
||||
<link>https://docs.oracle.com/javaee/6/api</link>
|
||||
<link>${commons.javadoc.javaee.link}</link>
|
||||
</links>
|
||||
<validateLinks>true</validateLinks>
|
||||
<archive>
|
||||
|
@ -328,7 +328,7 @@
|
|||
<notimestamp>true</notimestamp>
|
||||
<links>
|
||||
<link>https://commons.apache.org/proper/commons-text/apidocs</link>
|
||||
<link>https://docs.oracle.com/javaee/6/api</link>
|
||||
<link>${commons.javadoc.javaee.link}</link>
|
||||
</links>
|
||||
<validateLinks>true</validateLinks>
|
||||
<archive>
|
||||
|
|
|
@ -46,6 +46,13 @@ public abstract class Strings {
|
|||
*/
|
||||
private boolean nullIsLess;
|
||||
|
||||
/**
|
||||
* Constructs a new instance.
|
||||
*/
|
||||
private Builder() {
|
||||
// empty
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a new {@link Strings} instance.
|
||||
*/
|
||||
|
|
|
@ -146,7 +146,7 @@ public class StrBuilderTest extends AbstractLangTest {
|
|||
@Test
|
||||
public void testAsReader() throws Exception {
|
||||
final StrBuilder sb = new StrBuilder("some text");
|
||||
Reader reader = sb.asReader();
|
||||
try (Reader reader = sb.asReader()) {
|
||||
assertTrue(reader.ready());
|
||||
final char[] buf = new char[40];
|
||||
assertEquals(9, reader.read(buf));
|
||||
|
@ -158,10 +158,11 @@ public class StrBuilderTest extends AbstractLangTest {
|
|||
assertEquals(0, reader.skip(-1));
|
||||
|
||||
assertTrue(reader.markSupported());
|
||||
reader = sb.asReader();
|
||||
}
|
||||
char[] array = new char[3];
|
||||
try (Reader reader = sb.asReader()) {
|
||||
assertEquals('s', reader.read());
|
||||
reader.mark(-1);
|
||||
char[] array = new char[3];
|
||||
assertEquals(3, reader.read(array, 0, 3));
|
||||
assertEquals('o', array[0]);
|
||||
assertEquals('m', array[1]);
|
||||
|
@ -177,7 +178,7 @@ public class StrBuilderTest extends AbstractLangTest {
|
|||
assertTrue(reader.ready());
|
||||
reader.close();
|
||||
assertTrue(reader.ready());
|
||||
|
||||
}
|
||||
try (Reader r = sb.asReader()) {
|
||||
final char[] arr = new char[3];
|
||||
assertThrows(IndexOutOfBoundsException.class, () -> r.read(arr, -1, 0));
|
||||
|
|
Loading…
Reference in New Issue