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 2022/08/08 05:10:57 UTC
[commons-io] 05/05: Use final, end file with empty line, refactor commons code in test
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-io.git
commit 3facb4e0f3720c9b534a244b76ca21ff2d480b19
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Aug 8 01:10:44 2022 -0400
Use final, end file with empty line, refactor commons code in test
---
.../apache/commons/io/function/IOSupplierTest.java | 6 ++--
.../apache/commons/io/function/TestConstants.java | 40 ++++++----------------
2 files changed, 13 insertions(+), 33 deletions(-)
diff --git a/src/test/java/org/apache/commons/io/function/IOSupplierTest.java b/src/test/java/org/apache/commons/io/function/IOSupplierTest.java
index e21125a2..981a65bc 100644
--- a/src/test/java/org/apache/commons/io/function/IOSupplierTest.java
+++ b/src/test/java/org/apache/commons/io/function/IOSupplierTest.java
@@ -35,11 +35,11 @@ public class IOSupplierTest {
private AtomicReference<String> ref1;
- private String getThrows(IOSupplier<String> supplier) throws IOException {
+ private String getThrows(final IOSupplier<String> supplier) throws IOException {
return supplier.get();
}
- private String getThrowsNone(IOSupplier<String> supplier) {
+ private String getThrowsNone(final IOSupplier<String> supplier) {
return supplier.asSupplier().get();
}
@@ -66,4 +66,4 @@ public class IOSupplierTest {
assertEquals("new1", ref1.get());
}
-}
+}
\ No newline at end of file
diff --git a/src/test/java/org/apache/commons/io/function/TestConstants.java b/src/test/java/org/apache/commons/io/function/TestConstants.java
index 1823e216..16c9c95b 100644
--- a/src/test/java/org/apache/commons/io/function/TestConstants.java
+++ b/src/test/java/org/apache/commons/io/function/TestConstants.java
@@ -32,49 +32,29 @@ class TestConstants {
static final Path ABS_PATH_B = Paths.get("NOTICE.txt").toAbsolutePath();
- static IOBiConsumer<Object, Object> THROWING_IO_BI_CONSUMER = (t, u) -> {
- throw new IOException("Failure");
- };
+ static IOBiConsumer<Object, Object> THROWING_IO_BI_CONSUMER = (t, u) -> throwIOException();
- static IOBiFunction<Object, Object, Object> THROWING_IO_BI_FUNCTION = (t, u) -> {
- throw new IOException("Failure");
- };
+ static IOBiFunction<Object, Object, Object> THROWING_IO_BI_FUNCTION = (t, u) -> throwIOException();
static IOBinaryOperator<?> THROWING_IO_BINARY_OPERATOR = (t, u) -> throwIOException();
static IOComparator<Object> THROWING_IO_COMPARATOR = (t, u) -> throwIOException();
- static IOConsumer<Object> THROWING_IO_CONSUMER = t -> {
- throw new IOException("Failure");
- };
+ static IOConsumer<Object> THROWING_IO_CONSUMER = t -> throwIOException();
- static IOFunction<Object, Object> THROWING_IO_FUNCTION = t -> {
- throw new IOException("Failure");
- };
+ static IOFunction<Object, Object> THROWING_IO_FUNCTION = t -> throwIOException();
- static IOPredicate<Object> THROWING_IO_PREDICATE = t -> {
- throw new IOException("Failure");
- };
+ static IOPredicate<Object> THROWING_IO_PREDICATE = t -> throwIOException();
- static IOQuadFunction<Object, Object, Object, Object, Object> THROWING_IO_QUAD_FUNCTION = (t, u, v, w) -> {
- throw new IOException("Failure");
- };
+ static IOQuadFunction<Object, Object, Object, Object, Object> THROWING_IO_QUAD_FUNCTION = (t, u, v, w) -> throwIOException();
- static IORunnable THROWING_IO_RUNNABLE = () -> {
- throw new IOException("Failure");
- };
+ static IORunnable THROWING_IO_RUNNABLE = () -> throwIOException();
- static IOSupplier<Object> THROWING_IO_SUPPLIER = () -> {
- throw new IOException("Failure");
- };
+ static IOSupplier<Object> THROWING_IO_SUPPLIER = () -> throwIOException();
- static IOTriConsumer<Object, Object, Object> THROWING_IO_TRI_CONSUMER = (t, u, v) -> {
- throw new IOException("Failure");
- };
+ static IOTriConsumer<Object, Object, Object> THROWING_IO_TRI_CONSUMER = (t, u, v) -> throwIOException();
- static IOTriFunction<Object, Object, Object, Object> THROWING_IO_TRI_FUNCTION = (t, u, v) -> {
- throw new IOException("Failure");
- };
+ static IOTriFunction<Object, Object, Object, Object> THROWING_IO_TRI_FUNCTION = (t, u, v) -> throwIOException();
static IOUnaryOperator<?> THROWING_IO_UNARY_OPERATOR = t -> throwIOException();