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 2021/07/24 15:11:18 UTC

[commons-text] 03/03: Use final.

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-text.git

commit e6426d22f429cad692325be8f670f321df064b72
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Jul 24 11:09:51 2021 -0400

    Use final.
---
 src/main/java/org/apache/commons/text/numbers/DoubleFormat.java   | 4 ++--
 src/main/java/org/apache/commons/text/numbers/ParsedDecimal.java  | 2 +-
 src/test/java/org/apache/commons/text/StrBuilderTest.java         | 2 +-
 src/test/java/org/apache/commons/text/TextStringBuilderTest.java  | 2 +-
 .../java/org/apache/commons/text/numbers/DoubleFormatTest.java    | 8 ++++----
 .../java/org/apache/commons/text/numbers/ParsedDecimalTest.java   | 2 +-
 6 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/main/java/org/apache/commons/text/numbers/DoubleFormat.java b/src/main/java/org/apache/commons/text/numbers/DoubleFormat.java
index 2a15452..5269a90 100644
--- a/src/main/java/org/apache/commons/text/numbers/DoubleFormat.java
+++ b/src/main/java/org/apache/commons/text/numbers/DoubleFormat.java
@@ -680,7 +680,7 @@ public enum DoubleFormat {
      */
     private static class PlainDoubleFormat extends AbstractDoubleFormat {
 
-        /** 
+        /**
          * Constructs a new instance.
          * @param builder builder instance containing configuration values
          */
@@ -689,7 +689,7 @@ public enum DoubleFormat {
         }
 
         /**
-         * {@inheritDoc} 
+         * {@inheritDoc}
          */
         @Override
         protected String applyFiniteInternal(final ParsedDecimal val) {
diff --git a/src/main/java/org/apache/commons/text/numbers/ParsedDecimal.java b/src/main/java/org/apache/commons/text/numbers/ParsedDecimal.java
index c01b78b..05060e6 100644
--- a/src/main/java/org/apache/commons/text/numbers/ParsedDecimal.java
+++ b/src/main/java/org/apache/commons/text/numbers/ParsedDecimal.java
@@ -738,7 +738,7 @@ final class ParsedDecimal {
      */
     private static int parseExponent(final char[] chars, final int start) {
         int i = start;
-        boolean neg = chars[i] == MINUS_CHAR;
+        final boolean neg = chars[i] == MINUS_CHAR;
         if (neg) {
             ++i;
         }
diff --git a/src/test/java/org/apache/commons/text/StrBuilderTest.java b/src/test/java/org/apache/commons/text/StrBuilderTest.java
index eb07f59..a6cbc6f 100644
--- a/src/test/java/org/apache/commons/text/StrBuilderTest.java
+++ b/src/test/java/org/apache/commons/text/StrBuilderTest.java
@@ -217,7 +217,7 @@ public class StrBuilderTest {
     @Test
     public void testAppendToStringBuffer() throws Exception {
         final StrBuilder sb = new StrBuilder("1234567890");
-        final StringBuffer buffer = new StringBuffer("Test ");
+        final StringBuilder buffer = new StringBuilder("Test ");
 
         sb.appendTo(buffer);
 
diff --git a/src/test/java/org/apache/commons/text/TextStringBuilderTest.java b/src/test/java/org/apache/commons/text/TextStringBuilderTest.java
index b15acef..db169a8 100644
--- a/src/test/java/org/apache/commons/text/TextStringBuilderTest.java
+++ b/src/test/java/org/apache/commons/text/TextStringBuilderTest.java
@@ -242,7 +242,7 @@ public class TextStringBuilderTest {
     @Test
     public void testAppendToStringBuffer() throws Exception {
         final TextStringBuilder sb = new TextStringBuilder("1234567890");
-        final StringBuffer buffer = new StringBuffer("Test ");
+        final StringBuilder buffer = new StringBuilder("Test ");
 
         sb.appendTo(buffer);
 
diff --git a/src/test/java/org/apache/commons/text/numbers/DoubleFormatTest.java b/src/test/java/org/apache/commons/text/numbers/DoubleFormatTest.java
index f144725..3df3e1b 100644
--- a/src/test/java/org/apache/commons/text/numbers/DoubleFormatTest.java
+++ b/src/test/java/org/apache/commons/text/numbers/DoubleFormatTest.java
@@ -56,7 +56,7 @@ class DoubleFormatTest {
     @Test
     void testPlain_defaults() {
         // arrange
-        DoubleFunction<String> fmt = DoubleFormat.PLAIN.builder()
+        final DoubleFunction<String> fmt = DoubleFormat.PLAIN.builder()
             .build();
 
         // act/assert
@@ -93,7 +93,7 @@ class DoubleFormatTest {
     @Test
     void testPlain_custom() {
         // arrange
-        DoubleFunction<String> fmt = DoubleFormat.PLAIN.builder()
+        final DoubleFunction<String> fmt = DoubleFormat.PLAIN.builder()
             .maxPrecision(3)
             .minDecimalExponent(-3)
             .allowSignedZero(false)
@@ -549,8 +549,8 @@ class DoubleFormatTest {
         // JDK 16 adds directionality characters to strings for certain locales, such as Arabic, whereas
         // previous JDKs do not. We will match the behavior of the previous versions here and ignore formatting
         // for test purposes.
-        String dfStr = trimFormatChars(df.format(d));
-        String fmtStr = trimFormatChars(fmt.apply(d));
+        final String dfStr = trimFormatChars(df.format(d));
+        final String fmtStr = trimFormatChars(fmt.apply(d));
 
         Assertions.assertEquals(dfStr, fmtStr,
                 () -> "Unexpected output for locale [" + loc.toLanguageTag() + "] and double value " + d);
diff --git a/src/test/java/org/apache/commons/text/numbers/ParsedDecimalTest.java b/src/test/java/org/apache/commons/text/numbers/ParsedDecimalTest.java
index 3bd7ca8..89d1f60 100644
--- a/src/test/java/org/apache/commons/text/numbers/ParsedDecimalTest.java
+++ b/src/test/java/org/apache/commons/text/numbers/ParsedDecimalTest.java
@@ -605,7 +605,7 @@ class ParsedDecimalTest {
 
     private static void assertThrowsWithMessage(final Executable fn, final Class<? extends Throwable> type,
             final String msg) {
-        Throwable exc = Assertions.assertThrows(type, fn);
+        final Throwable exc = Assertions.assertThrows(type, fn);
         Assertions.assertEquals(msg, exc.getMessage());
     }