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
The following commit(s) were added to refs/heads/master by this push:
new 16a8d5d Add NullPrintStream.INSTANCE and deprecate NULL_PRINT_STREAM.
16a8d5d is described below
commit 16a8d5ddcc4fae561891f8a237c4d8ff364f71bb
Author: Gary Gregory <[email protected]>
AuthorDate: Mon Jul 12 14:53:20 2021 -0400
Add NullPrintStream.INSTANCE and deprecate NULL_PRINT_STREAM.
---
src/changes/changes.xml | 3 +++
.../java/org/apache/commons/io/output/NullPrintStream.java | 12 +++++++++++-
.../org/apache/commons/io/output/NullPrintStreamTest.java | 2 +-
3 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index f690430..b597e4d 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -90,6 +90,9 @@ The <action> type attribute can be add,update,fix,remove.
<action dev="ggregory" type="add" due-to="Gary Gregory">
Add NullOutputStream.INSTANCE and deprecate NULL_OUTPUT_STREAM.
</action>
+ <action dev="ggregory" type="add" due-to="Gary Gregory">
+ Add NullPrintStream.INSTANCE and deprecate NULL_PRINT_STREAM.
+ </action>
<!-- UPDATE -->
<action dev="ggregory" type="update" due-to="Dependabot">
Bump Maven Javadoc plugin from 3.2.0 to 3.3.0.
diff --git a/src/main/java/org/apache/commons/io/output/NullPrintStream.java
b/src/main/java/org/apache/commons/io/output/NullPrintStream.java
index 8f833c9..d3ac880 100644
--- a/src/main/java/org/apache/commons/io/output/NullPrintStream.java
+++ b/src/main/java/org/apache/commons/io/output/NullPrintStream.java
@@ -31,8 +31,18 @@ public class NullPrintStream extends PrintStream {
/**
* The singleton instance.
+ *
+ * @since 2.12.0
*/
- public static final NullPrintStream NULL_PRINT_STREAM = new
NullPrintStream();
+ public static final NullPrintStream INSTANCE = new NullPrintStream();
+
+ /**
+ * The singleton instance.
+ *
+ * @deprecated Use {@link #INSTANCE}.
+ */
+ @Deprecated
+ public static final NullPrintStream NULL_PRINT_STREAM = INSTANCE;
/**
* Constructs an instance.
diff --git
a/src/test/java/org/apache/commons/io/output/NullPrintStreamTest.java
b/src/test/java/org/apache/commons/io/output/NullPrintStreamTest.java
index e70c533..86a4439 100644
--- a/src/test/java/org/apache/commons/io/output/NullPrintStreamTest.java
+++ b/src/test/java/org/apache/commons/io/output/NullPrintStreamTest.java
@@ -47,7 +47,7 @@ public class NullPrintStreamTest {
@Test
public void testNullSingleton() throws IOException {
- try (final NullPrintStream nos = NullPrintStream.NULL_PRINT_STREAM) {
+ try (final NullPrintStream nos = NullPrintStream.INSTANCE) {
process(nos);
}
}