commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brit...@apache.org
Subject [33/48] [lang] Prevent redundant modifiers
Date Thu, 08 Jun 2017 08:16:07 GMT
http://git-wip-us.apache.org/repos/asf/commons-lang/blob/3a818ed6/src/test/java/org/apache/commons/lang3/reflect/MethodUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/lang3/reflect/MethodUtilsTest.java b/src/test/java/org/apache/commons/lang3/reflect/MethodUtilsTest.java
index 15d7cd7..5c1989b 100644
--- a/src/test/java/org/apache/commons/lang3/reflect/MethodUtilsTest.java
+++ b/src/test/java/org/apache/commons/lang3/reflect/MethodUtilsTest.java
@@ -59,7 +59,7 @@ import org.junit.Test;
  */
 public class MethodUtilsTest {
 
-    private static interface PrivateInterface {}
+    private interface PrivateInterface {}
 
     static class TestBeanWithInterfaces implements PrivateInterface {
         public String foo() {

http://git-wip-us.apache.org/repos/asf/commons-lang/blob/3a818ed6/src/test/java/org/apache/commons/lang3/reflect/TypeUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/lang3/reflect/TypeUtilsTest.java b/src/test/java/org/apache/commons/lang3/reflect/TypeUtilsTest.java
index b3cef7a..1b88147 100644
--- a/src/test/java/org/apache/commons/lang3/reflect/TypeUtilsTest.java
+++ b/src/test/java/org/apache/commons/lang3/reflect/TypeUtilsTest.java
@@ -811,7 +811,7 @@ class AAAClass extends AAClass<String> {
 //raw types, where used, are used purposely
 class AClass extends AAClass<String>.BBClass<Number> {
 
-    public AClass(final AAClass<String> enclosingInstance) {
+    AClass(final AAClass<String> enclosingInstance) {
         enclosingInstance.super();
     }
 

http://git-wip-us.apache.org/repos/asf/commons-lang/blob/3a818ed6/src/test/java/org/apache/commons/lang3/reflect/testbed/Bar.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/lang3/reflect/testbed/Bar.java b/src/test/java/org/apache/commons/lang3/reflect/testbed/Bar.java
index 105dd1d..8ac873d 100644
--- a/src/test/java/org/apache/commons/lang3/reflect/testbed/Bar.java
+++ b/src/test/java/org/apache/commons/lang3/reflect/testbed/Bar.java
@@ -19,7 +19,7 @@ package org.apache.commons.lang3.reflect.testbed;
 /**
  */
 public interface Bar {
-    public static final String VALUE = "bar";
+    String VALUE = "bar";
 
     void doIt();
 }

http://git-wip-us.apache.org/repos/asf/commons-lang/blob/3a818ed6/src/test/java/org/apache/commons/lang3/reflect/testbed/Foo.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/lang3/reflect/testbed/Foo.java b/src/test/java/org/apache/commons/lang3/reflect/testbed/Foo.java
index be24ac6..f07a433 100644
--- a/src/test/java/org/apache/commons/lang3/reflect/testbed/Foo.java
+++ b/src/test/java/org/apache/commons/lang3/reflect/testbed/Foo.java
@@ -19,7 +19,7 @@ package org.apache.commons.lang3.reflect.testbed;
 /**
  */
 public interface Foo {
-    public static final String VALUE = "foo";
+    String VALUE = "foo";
 
     @Annotated
     void doIt();

http://git-wip-us.apache.org/repos/asf/commons-lang/blob/3a818ed6/src/test/java/org/apache/commons/lang3/text/ExtendedMessageFormatTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/lang3/text/ExtendedMessageFormatTest.java b/src/test/java/org/apache/commons/lang3/text/ExtendedMessageFormatTest.java
index 41468a9..cdc53f7 100644
--- a/src/test/java/org/apache/commons/lang3/text/ExtendedMessageFormatTest.java
+++ b/src/test/java/org/apache/commons/lang3/text/ExtendedMessageFormatTest.java
@@ -467,7 +467,7 @@ public class ExtendedMessageFormatTest {
     private static class OtherExtendedMessageFormat extends ExtendedMessageFormat {
         private static final long serialVersionUID = 1L;
 
-        public OtherExtendedMessageFormat(final String pattern, final Locale locale,
+        OtherExtendedMessageFormat(final String pattern, final Locale locale,
                 final Map<String, ? extends FormatFactory> registry) {
             super(pattern, locale, registry);
         }

http://git-wip-us.apache.org/repos/asf/commons-lang/blob/3a818ed6/src/test/java/org/apache/commons/lang3/text/StrBuilderAppendInsertTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/lang3/text/StrBuilderAppendInsertTest.java b/src/test/java/org/apache/commons/lang3/text/StrBuilderAppendInsertTest.java
index ed86721..60d9937 100644
--- a/src/test/java/org/apache/commons/lang3/text/StrBuilderAppendInsertTest.java
+++ b/src/test/java/org/apache/commons/lang3/text/StrBuilderAppendInsertTest.java
@@ -1061,11 +1061,11 @@ public class StrBuilderAppendInsertTest {
         assertEquals("", sb.toString());
 
         sb.clear();
-        sb.appendAll(new Object[0]);
+        sb.appendAll();
         assertEquals("", sb.toString());
 
         sb.clear();
-        sb.appendAll(new Object[]{"foo", "bar", "baz"});
+        sb.appendAll("foo", "bar", "baz");
         assertEquals("foobarbaz", sb.toString());
 
         sb.clear();

http://git-wip-us.apache.org/repos/asf/commons-lang/blob/3a818ed6/src/test/java/org/apache/commons/lang3/text/StrBuilderTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/lang3/text/StrBuilderTest.java b/src/test/java/org/apache/commons/lang3/text/StrBuilderTest.java
index ea684b6..09486ef 100644
--- a/src/test/java/org/apache/commons/lang3/text/StrBuilderTest.java
+++ b/src/test/java/org/apache/commons/lang3/text/StrBuilderTest.java
@@ -170,7 +170,7 @@ public class StrBuilderTest {
 
         private final CharBuffer src;
 
-        public MockReadable(final String src) {
+        MockReadable(final String src) {
             this.src = CharBuffer.wrap(src);
         }
 

http://git-wip-us.apache.org/repos/asf/commons-lang/blob/3a818ed6/src/test/java/org/apache/commons/lang3/text/StrMatcherTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/lang3/text/StrMatcherTest.java b/src/test/java/org/apache/commons/lang3/text/StrMatcherTest.java
index c26f22e..24dd953 100644
--- a/src/test/java/org/apache/commons/lang3/text/StrMatcherTest.java
+++ b/src/test/java/org/apache/commons/lang3/text/StrMatcherTest.java
@@ -182,7 +182,7 @@ public class StrMatcherTest  {
         assertEquals(0, matcher.isMatch(BUFFER2, 3));
         assertEquals(1, matcher.isMatch(BUFFER2, 4));
         assertEquals(0, matcher.isMatch(BUFFER2, 5));
-        assertSame(StrMatcher.noneMatcher(), StrMatcher.charSetMatcher(new char[0]));
+        assertSame(StrMatcher.noneMatcher(), StrMatcher.charSetMatcher());
         assertSame(StrMatcher.noneMatcher(), StrMatcher.charSetMatcher((char[]) null));
         assertTrue(StrMatcher.charSetMatcher("a".toCharArray()) instanceof StrMatcher.CharMatcher);
     }

http://git-wip-us.apache.org/repos/asf/commons-lang/blob/3a818ed6/src/test/java/org/apache/commons/lang3/time/DateFormatUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/lang3/time/DateFormatUtilsTest.java b/src/test/java/org/apache/commons/lang3/time/DateFormatUtilsTest.java
index f197974..a938caa 100644
--- a/src/test/java/org/apache/commons/lang3/time/DateFormatUtilsTest.java
+++ b/src/test/java/org/apache/commons/lang3/time/DateFormatUtilsTest.java
@@ -225,7 +225,7 @@ public class DateFormatUtilsTest {
     public void testLang530() throws ParseException {
         final Date d = new Date();
         final String isoDateStr = DateFormatUtils.ISO_DATETIME_TIME_ZONE_FORMAT.format(d);
-        final Date d2 = DateUtils.parseDate(isoDateStr, new String[] { DateFormatUtils.ISO_DATETIME_TIME_ZONE_FORMAT.getPattern()
});
+        final Date d2 = DateUtils.parseDate(isoDateStr, DateFormatUtils.ISO_DATETIME_TIME_ZONE_FORMAT.getPattern());
         // the format loses milliseconds so have to reintroduce them
         assertEquals("Date not equal to itself ISO formatted and parsed", d.getTime(), d2.getTime()
+ d.getTime() % 1000);
     }

http://git-wip-us.apache.org/repos/asf/commons-lang/blob/3a818ed6/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java b/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java
index 77e1101..686c1a6 100644
--- a/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java
+++ b/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java
@@ -1282,7 +1282,7 @@ public class DateUtilsTest {
     public void testLang530() throws ParseException {
         final Date d = new Date();
         final String isoDateStr = DateFormatUtils.ISO_DATETIME_TIME_ZONE_FORMAT.format(d);
-        final Date d2 = DateUtils.parseDate(isoDateStr, new String[] { DateFormatUtils.ISO_DATETIME_TIME_ZONE_FORMAT.getPattern()
});
+        final Date d2 = DateUtils.parseDate(isoDateStr, DateFormatUtils.ISO_DATETIME_TIME_ZONE_FORMAT.getPattern());
         // the format loses milliseconds so have to reintroduce them
         assertEquals("Date not equal to itself ISO formatted and parsed", d.getTime(), d2.getTime()
+ d.getTime() % 1000);
     }
@@ -1736,7 +1736,7 @@ public class DateUtilsTest {
 
     @Test
     public void testLANG799() throws ParseException {
-        DateUtils.parseDateStrictly("09 abril 2008 23:55:38 GMT", new Locale("es"), new String[]{"dd
MMM yyyy HH:mm:ss zzz"});
+        DateUtils.parseDateStrictly("09 abril 2008 23:55:38 GMT", new Locale("es"), "dd MMM
yyyy HH:mm:ss zzz");
     }
 }
 

http://git-wip-us.apache.org/repos/asf/commons-lang/blob/3a818ed6/src/test/java/org/apache/commons/lang3/time/FastDateParserTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/lang3/time/FastDateParserTest.java b/src/test/java/org/apache/commons/lang3/time/FastDateParserTest.java
index c637f79..3289e5b 100644
--- a/src/test/java/org/apache/commons/lang3/time/FastDateParserTest.java
+++ b/src/test/java/org/apache/commons/lang3/time/FastDateParserTest.java
@@ -623,12 +623,12 @@ public class FastDateParserTest {
         return cal;
     }
 
-    private static enum Expected1806 {
+    private enum Expected1806 {
         India(INDIA, "+05", "+0530", "+05:30", true),
         Greenwich(GMT, "Z", "Z", "Z", false),
         NewYork(NEW_YORK, "-05", "-0500", "-05:00", false);
 
-        private Expected1806(final TimeZone zone, final String one, final String two, final
String three, final boolean hasHalfHourOffset) {
+        Expected1806(final TimeZone zone, final String one, final String two, final String
three, final boolean hasHalfHourOffset) {
             this.zone = zone;
             this.one = one;
             this.two = two;

http://git-wip-us.apache.org/repos/asf/commons-lang/blob/3a818ed6/src/test/java/org/apache/commons/lang3/time/FastDatePrinterTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/lang3/time/FastDatePrinterTest.java b/src/test/java/org/apache/commons/lang3/time/FastDatePrinterTest.java
index 8d83726..ff9180c 100644
--- a/src/test/java/org/apache/commons/lang3/time/FastDatePrinterTest.java
+++ b/src/test/java/org/apache/commons/lang3/time/FastDatePrinterTest.java
@@ -293,11 +293,11 @@ public class FastDatePrinterTest {
         getInstance("XXXX");
     }
 
-    private static enum Expected1806 {
+    private enum Expected1806 {
         India(INDIA, "+05", "+0530", "+05:30"), Greenwich(GMT, "Z", "Z", "Z"), NewYork(
                 NEW_YORK, "-05", "-0500", "-05:00");
 
-        private Expected1806(final TimeZone zone, final String one, final String two, final
String three) {
+        Expected1806(final TimeZone zone, final String one, final String two, final String
three) {
             this.zone = zone;
             this.one = one;
             this.two = two;


Mime
View raw message