From 0913090f2d7f2e8b3869e1646d5779b6c58b0fa7 Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Sun, 10 Dec 2023 10:54:03 -0500 Subject: [PATCH] Use a constant instead of a magic string --- .../commons/collections4/properties/EmptyPropertiesTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/java/org/apache/commons/collections4/properties/EmptyPropertiesTest.java b/src/test/java/org/apache/commons/collections4/properties/EmptyPropertiesTest.java index 0bac008218..d5c509a87e 100644 --- a/src/test/java/org/apache/commons/collections4/properties/EmptyPropertiesTest.java +++ b/src/test/java/org/apache/commons/collections4/properties/EmptyPropertiesTest.java @@ -289,8 +289,8 @@ public void testSave() throws IOException { PropertiesFactory.INSTANCE.createProperties().store(expected, comments); // Properties.store stores the specified comment appended with current time stamp in the next line - final String expectedComment = getFirstLine(expected.toString("UTF-8")); - final String actualComment = getFirstLine(actual.toString("UTF-8")); + final String expectedComment = getFirstLine(expected.toString(StandardCharsets.UTF_8.name())); + final String actualComment = getFirstLine(actual.toString(StandardCharsets.UTF_8.name())); assertEquals(expectedComment, actualComment, () -> String.format("Expected String '%s' with length '%s'", expectedComment, expectedComment.length())); expected.reset();