Skip to content

Commit

Permalink
Fixed the checkStyle RedundantModifier: Redundant 'final' modifier.
Browse files Browse the repository at this point in the history
[ERROR] src/test/java/org/apache/commons/collections4/properties/EmptyPropertiesTest.java:[264,22] (modifier) RedundantModifier: Redundant 'final' modifier.
  • Loading branch information
dota17 committed Apr 28, 2020
1 parent d63a3ca commit f72ba86
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -250,18 +250,18 @@ public void testReplaceOldValue() {
public void testSave() throws IOException {
final String comments = "Hello world!";
// actual
try (final ByteArrayOutputStream actual = new ByteArrayOutputStream()) {
try (final PrintStream out = new PrintStream(actual)) {
try (ByteArrayOutputStream actual = new ByteArrayOutputStream()) {
try (PrintStream out = new PrintStream(actual)) {
PropertiesFactory.EMPTY_PROPERTIES.save(out, comments);
}
// expected
try (final ByteArrayOutputStream expected = new ByteArrayOutputStream()) {
try (final PrintStream out = new PrintStream(expected)) {
try (ByteArrayOutputStream expected = new ByteArrayOutputStream()) {
try (PrintStream out = new PrintStream(expected)) {
PropertiesFactory.INSTANCE.createProperties().save(out, comments);
}
Assert.assertArrayEquals(expected.toByteArray(), actual.toByteArray());
expected.reset();
try (final PrintStream out = new PrintStream(expected)) {
try (PrintStream out = new PrintStream(expected)) {
new Properties().save(out, comments);
}
Assert.assertArrayEquals(expected.toByteArray(), actual.toByteArray());
Expand Down

0 comments on commit f72ba86

Please sign in to comment.