Repository: commons-text Updated Branches: refs/heads/master 46cc64c14 -> cb1897416
Fix checkstyle errors. Project: http://git-wip-us.apache.org/repos/asf/commons-text/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-text/commit/cb189741 Tree: http://git-wip-us.apache.org/repos/asf/commons-text/tree/cb189741 Diff: http://git-wip-us.apache.org/repos/asf/commons-text/diff/cb189741 Branch: refs/heads/master Commit: cb18974164074db50979a4b9d7127d090def5104 Parents: 46cc64c Author: Gary Gregory <garydgreg...@gmail.com> Authored: Mon Feb 12 12:02:23 2018 -0700 Committer: Gary Gregory <garydgreg...@gmail.com> Committed: Mon Feb 12 12:02:23 2018 -0700 ---------------------------------------------------------------------- .../commons/text/StringTokenizerTest.java | 32 ++++++++++---------- .../commons/text/TextStringBuilderTest.java | 10 +++--- 2 files changed, 21 insertions(+), 21 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-text/blob/cb189741/src/test/java/org/apache/commons/text/StringTokenizerTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/text/StringTokenizerTest.java b/src/test/java/org/apache/commons/text/StringTokenizerTest.java index 79a61db..397954a 100644 --- a/src/test/java/org/apache/commons/text/StringTokenizerTest.java +++ b/src/test/java/org/apache/commons/text/StringTokenizerTest.java @@ -58,7 +58,7 @@ public class StringTokenizerTest { tok.setIgnoreEmptyTokens(false); final String[] tokens = tok.getTokenArray(); - final String[] expected = { "a", "b", "c", "d;\"e", "f", "", "", "" }; + final String[] expected = {"a", "b", "c", "d;\"e", "f", "", "", "" }; assertEquals(Arrays.toString(tokens), expected.length, tokens.length); for (int i = 0; i < expected.length; i++) { @@ -79,7 +79,7 @@ public class StringTokenizerTest { tok.setIgnoreEmptyTokens(false); final String[] tokens = tok.getTokenArray(); - final String[] expected = { "a", "b", "c ", "d;\"e", "f", " ", " ", "" }; + final String[] expected = {"a", "b", "c ", "d;\"e", "f", " ", " ", "" }; assertEquals(Arrays.toString(tokens), expected.length, tokens.length); for (int i = 0; i < expected.length; i++) { @@ -100,7 +100,7 @@ public class StringTokenizerTest { tok.setIgnoreEmptyTokens(false); final String[] tokens = tok.getTokenArray(); - final String[] expected = { "a", "b", " c", "d;\"e", "f", " ", " ", "" }; + final String[] expected = {"a", "b", " c", "d;\"e", "f", " ", " ", "" }; assertEquals(Arrays.toString(tokens), expected.length, tokens.length); for (int i = 0; i < expected.length; i++) { @@ -121,7 +121,7 @@ public class StringTokenizerTest { tok.setIgnoreEmptyTokens(true); final String[] tokens = tok.getTokenArray(); - final String[] expected = { "a", "b", "c", "d;\"e", "f" }; + final String[] expected = {"a", "b", "c", "d;\"e", "f" }; assertEquals(Arrays.toString(tokens), expected.length, tokens.length); for (int i = 0; i < expected.length; i++) { @@ -143,7 +143,7 @@ public class StringTokenizerTest { tok.setEmptyTokenAsNull(true); final String[] tokens = tok.getTokenArray(); - final String[] expected = { "a", "b", "c", "d;\"e", "f", null, null, null }; + final String[] expected = {"a", "b", "c", "d;\"e", "f", null, null, null }; assertEquals(Arrays.toString(tokens), expected.length, tokens.length); for (int i = 0; i < expected.length; i++) { @@ -165,7 +165,7 @@ public class StringTokenizerTest { // tok.setTreatingEmptyAsNull(true); final String[] tokens = tok.getTokenArray(); - final String[] expected = { "a", "b", " c", "d;\"e", "f", null, null, null }; + final String[] expected = {"a", "b", " c", "d;\"e", "f", null, null, null }; int nextCount = 0; while (tok.hasNext()) { @@ -200,7 +200,7 @@ public class StringTokenizerTest { tok.setIgnoreEmptyTokens(false); final String[] tokens = tok.getTokenArray(); - final String[] expected = { "a", "", "", "b", "c", "d e", "f", "" }; + final String[] expected = {"a", "", "", "b", "c", "d e", "f", "" }; assertEquals(Arrays.toString(tokens), expected.length, tokens.length); for (int i = 0; i < expected.length; i++) { @@ -221,7 +221,7 @@ public class StringTokenizerTest { tok.setIgnoreEmptyTokens(true); final String[] tokens = tok.getTokenArray(); - final String[] expected = { "a", "b", "c", "d e", "f" }; + final String[] expected = {"a", "b", "c", "d e", "f" }; assertEquals(Arrays.toString(tokens), expected.length, tokens.length); for (int i = 0; i < expected.length; i++) { @@ -313,7 +313,7 @@ public class StringTokenizerTest { @Test public void testDelimMatcher() { final String input = "a/b\\c"; - final StringMatcher delimMatcher = StringMatcherFactory.INSTANCE.charSetMatcher(new char[] { '/', '\\' }); + final StringMatcher delimMatcher = StringMatcherFactory.INSTANCE.charSetMatcher(new char[] {'/', '\\' }); final StringTokenizer tok = new StringTokenizer(input, delimMatcher); assertEquals("a", tok.next()); @@ -325,8 +325,8 @@ public class StringTokenizerTest { @Test public void testDelimMatcherQuoteMatcher() { final String input = "`a`;`b`;`c`"; - final StringMatcher delimMatcher = StringMatcherFactory.INSTANCE.charSetMatcher(new char[] { ';' }); - final StringMatcher quoteMatcher = StringMatcherFactory.INSTANCE.charSetMatcher(new char[] { '`' }); + final StringMatcher delimMatcher = StringMatcherFactory.INSTANCE.charSetMatcher(new char[] {';' }); + final StringMatcher quoteMatcher = StringMatcherFactory.INSTANCE.charSetMatcher(new char[] {'`' }); final StringTokenizer tok = new StringTokenizer(input, delimMatcher, quoteMatcher); assertEquals("a", tok.next()); @@ -647,7 +647,7 @@ public class StringTokenizerTest { @Test public void testCloneReset() { - final char[] input = new char[] { 'a' }; + final char[] input = new char[] {'a' }; final StringTokenizer tokenizer = new StringTokenizer(input); // Start sanity check assertEquals("a", tokenizer.nextToken()); @@ -791,7 +791,7 @@ public class StringTokenizerTest { public void testReset_charArray() { final StringTokenizer tok = new StringTokenizer("x x x"); - final char[] array = new char[] { 'a', 'b', 'c' }; + final char[] array = new char[] {'a', 'b', 'c' }; tok.reset(array); assertEquals("abc", tok.next()); assertFalse(tok.hasNext()); @@ -928,7 +928,7 @@ public class StringTokenizerTest { // ----------------------------------------------------------------------- @Test public void testStringTokenizerStringMatcher() { - final char[] chars = { 'a', 'b', 'c', 'd' }; + final char[] chars = {'a', 'b', 'c', 'd' }; final StringTokenizer tokens = new StringTokenizer(chars, "bc"); assertEquals("a", tokens.next()); assertEquals("d", tokens.next()); @@ -937,7 +937,7 @@ public class StringTokenizerTest { // ----------------------------------------------------------------------- @Test public void testStringTokenizerStrMatcher() { - final char[] chars = { 'a', ',', 'c' }; + final char[] chars = {'a', ',', 'c' }; final StringTokenizer tokens = new StringTokenizer(chars, StringMatcherFactory.INSTANCE.commaMatcher()); assertEquals("a", tokens.next()); assertEquals("c", tokens.next()); @@ -946,7 +946,7 @@ public class StringTokenizerTest { // ----------------------------------------------------------------------- @Test public void testStringTokenizerQuoteMatcher() { - final char[] chars = { '\'', 'a', 'c', '\'', 'd' }; + final char[] chars = {'\'', 'a', 'c', '\'', 'd' }; final StringTokenizer tokens = new StringTokenizer(chars, StringMatcherFactory.INSTANCE.commaMatcher(), StringMatcherFactory.INSTANCE.quoteMatcher()); assertEquals("acd", tokens.next()); http://git-wip-us.apache.org/repos/asf/commons-text/blob/cb189741/src/test/java/org/apache/commons/text/TextStringBuilderTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/text/TextStringBuilderTest.java b/src/test/java/org/apache/commons/text/TextStringBuilderTest.java index dec5d02..8a58f8d 100644 --- a/src/test/java/org/apache/commons/text/TextStringBuilderTest.java +++ b/src/test/java/org/apache/commons/text/TextStringBuilderTest.java @@ -536,7 +536,7 @@ public class TextStringBuilderTest { sb.append("junit"); a = sb.getChars(input); assertSame(input, a); - assertTrue(Arrays.equals(new char[] { 'j', 'u', 'n', 'i', 't', 0, 0, 0, 0, 0 }, a)); + assertTrue(Arrays.equals(new char[] {'j', 'u', 'n', 'i', 't', 0, 0, 0, 0, 0 }, a)); a = sb.getChars(null); assertNotSame(input, a); @@ -559,11 +559,11 @@ public class TextStringBuilderTest { sb.append("junit"); char[] a = new char[5]; sb.getChars(0, 5, a, 0); - assertTrue(Arrays.equals(new char[] { 'j', 'u', 'n', 'i', 't' }, a)); + assertTrue(Arrays.equals(new char[] {'j', 'u', 'n', 'i', 't' }, a)); a = new char[5]; sb.getChars(0, 2, a, 3); - assertTrue(Arrays.equals(new char[] { 0, 0, 0, 'j', 'u' }, a)); + assertTrue(Arrays.equals(new char[] {0, 0, 0, 'j', 'u' }, a)); try { sb.getChars(-1, 0, a, 0); @@ -1810,10 +1810,10 @@ public class TextStringBuilderTest { writer.write('l'); assertEquals("basel", sb.toString()); - writer.write(new char[] { 'i', 'n' }); + writer.write(new char[] {'i', 'n' }); assertEquals("baselin", sb.toString()); - writer.write(new char[] { 'n', 'e', 'r' }, 1, 2); + writer.write(new char[] {'n', 'e', 'r' }, 1, 2); assertEquals("baseliner", sb.toString()); writer.write(" rout");