You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2018/02/12 18:54:18 UTC

[text] Fix checkstyle errors.

Repository: commons-text
Updated Branches:
  refs/heads/master e8b7eb9d3 -> 46cc64c14


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/46cc64c1
Tree: http://git-wip-us.apache.org/repos/asf/commons-text/tree/46cc64c1
Diff: http://git-wip-us.apache.org/repos/asf/commons-text/diff/46cc64c1

Branch: refs/heads/master
Commit: 46cc64c14e7a38b0fa9bd08cf6c142e975982f72
Parents: e8b7eb9
Author: Gary Gregory <ga...@gmail.com>
Authored: Mon Feb 12 11:54:16 2018 -0700
Committer: Gary Gregory <ga...@gmail.com>
Committed: Mon Feb 12 11:54:16 2018 -0700

----------------------------------------------------------------------
 .../commons/text/RandomStringGenerator.java     |   4 +-
 .../text/translate/SinglePassTranslator.java    | 116 +++++++++----------
 2 files changed, 60 insertions(+), 60 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-text/blob/46cc64c1/src/main/java/org/apache/commons/text/RandomStringGenerator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/text/RandomStringGenerator.java b/src/main/java/org/apache/commons/text/RandomStringGenerator.java
index 66a6ec6..c1affc0 100644
--- a/src/main/java/org/apache/commons/text/RandomStringGenerator.java
+++ b/src/main/java/org/apache/commons/text/RandomStringGenerator.java
@@ -341,7 +341,7 @@ public final class RandomStringGenerator {
          * @param pairs array of characters array, expected is to pass min, max pairs through this arg.
          * @return {@code this}, to allow method chaining.
          */
-        public Builder withinRange(final char[] ... pairs) {
+        public Builder withinRange(final char[]... pairs) {
             characterList = new ArrayList<>();
             for (final char[] pair :  pairs) {
                 Validate.isTrue(pair.length == 2,
@@ -445,7 +445,7 @@ public final class RandomStringGenerator {
          * @return {@code this}, to allow method chaining
          * @since 1.2
          */
-        public Builder selectFrom(final char ... chars) {
+        public Builder selectFrom(final char... chars) {
             characterList = new ArrayList<>();
             for (final char c : chars) {
                 characterList.add(c);

http://git-wip-us.apache.org/repos/asf/commons-text/blob/46cc64c1/src/main/java/org/apache/commons/text/translate/SinglePassTranslator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/text/translate/SinglePassTranslator.java b/src/main/java/org/apache/commons/text/translate/SinglePassTranslator.java
index 63bdde1..1375344 100644
--- a/src/main/java/org/apache/commons/text/translate/SinglePassTranslator.java
+++ b/src/main/java/org/apache/commons/text/translate/SinglePassTranslator.java
@@ -1,58 +1,58 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.text.translate;
-
-import java.io.IOException;
-import java.io.Writer;
-
-/**
- * Abstract translator for processing whole input in single pass.
- * Handles initial index checking and counting of returned code points.
- */
-abstract class SinglePassTranslator extends CharSequenceTranslator {
-
-    @Override
-    public int translate(final CharSequence input, final int index, final Writer out) throws IOException {
-        if (index != 0) {
-            throw new IllegalArgumentException(getClassName() + ".translate(final CharSequence input, final int "
-                    + "index, final Writer out) can not handle a non-zero index.");
-        }
-
-        translateWhole(input, out);
-
-        return Character.codePointCount(input, index, input.length());
-    }
-
-    /**
-     * A utility method to be used in the {@link #translate(CharSequence, int, Writer)} method.
-     *
-     * @return the name of this or the extending class.
-     */
-    private String getClassName() {
-        final Class<? extends SinglePassTranslator> clazz = this.getClass();
-        return clazz.isAnonymousClass() ?  clazz.getName() : clazz.getSimpleName();
-    }
-
-    /**
-     * Translate whole set of code points passed in input.
-     *
-     * @param input CharSequence that is being translated
-     * @param out Writer to translate the text to
-     * @throws IOException if and only if the Writer produces an IOException
-     */
-    abstract void translateWhole(final CharSequence input, final Writer out) throws IOException;
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.text.translate;
+
+import java.io.IOException;
+import java.io.Writer;
+
+/**
+ * Abstract translator for processing whole input in single pass.
+ * Handles initial index checking and counting of returned code points.
+ */
+abstract class SinglePassTranslator extends CharSequenceTranslator {
+
+    @Override
+    public int translate(final CharSequence input, final int index, final Writer out) throws IOException {
+        if (index != 0) {
+            throw new IllegalArgumentException(getClassName() + ".translate(final CharSequence input, final int "
+                    + "index, final Writer out) can not handle a non-zero index.");
+        }
+
+        translateWhole(input, out);
+
+        return Character.codePointCount(input, index, input.length());
+    }
+
+    /**
+     * A utility method to be used in the {@link #translate(CharSequence, int, Writer)} method.
+     *
+     * @return the name of this or the extending class.
+     */
+    private String getClassName() {
+        final Class<? extends SinglePassTranslator> clazz = this.getClass();
+        return clazz.isAnonymousClass() ?  clazz.getName() : clazz.getSimpleName();
+    }
+
+    /**
+     * Translate whole set of code points passed in input.
+     *
+     * @param input CharSequence that is being translated
+     * @param out Writer to translate the text to
+     * @throws IOException if and only if the Writer produces an IOException
+     */
+    abstract void translateWhole(CharSequence input, Writer out) throws IOException;
+}