From 7a186d88fcb91577b1d8efdf24ae3bf01f877b33 Mon Sep 17 00:00:00 2001 From: Kevin222004 <97679350+Kevin222004@users.noreply.github.com> Date: Fri, 21 Apr 2023 02:53:23 +0530 Subject: [PATCH] minor: make private class final with default constructor (#2740) --- src/test/java/io/vavr/collection/BitSetTest.java | 2 +- src/test/java/io/vavr/collection/HashArrayMappedTrieTest.java | 2 +- src/test/java/io/vavr/collection/euler/Euler17Test.java | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/test/java/io/vavr/collection/BitSetTest.java b/src/test/java/io/vavr/collection/BitSetTest.java index e8595507e5..480e86f7f1 100644 --- a/src/test/java/io/vavr/collection/BitSetTest.java +++ b/src/test/java/io/vavr/collection/BitSetTest.java @@ -589,7 +589,7 @@ public void shouldReturnTailOfNonEmptyHavingReversedOrder() { // -- classes - private static class Mapper implements Serializable { + private static final class Mapper implements Serializable { private static final long serialVersionUID = 1L; diff --git a/src/test/java/io/vavr/collection/HashArrayMappedTrieTest.java b/src/test/java/io/vavr/collection/HashArrayMappedTrieTest.java index 5227010519..8d88669d01 100644 --- a/src/test/java/io/vavr/collection/HashArrayMappedTrieTest.java +++ b/src/test/java/io/vavr/collection/HashArrayMappedTrieTest.java @@ -190,7 +190,7 @@ public int compareTo(WeakInteger other) { } } - private class Comparator { + private final class Comparator { private final java.util.Map classic = new java.util.HashMap<>(); private Map hamt = HashMap.empty(); diff --git a/src/test/java/io/vavr/collection/euler/Euler17Test.java b/src/test/java/io/vavr/collection/euler/Euler17Test.java index 02853a6976..232e504701 100644 --- a/src/test/java/io/vavr/collection/euler/Euler17Test.java +++ b/src/test/java/io/vavr/collection/euler/Euler17Test.java @@ -120,7 +120,7 @@ default int letterCount(Seq range) { /** * Solution using Vavr Pattern Matching. */ - private static class SolutionA implements SolutionProblem17 { + private static final class SolutionA implements SolutionProblem17 { @Override public int letterCount(int num) { return Match(num).of( /*@formatter:off*/ @@ -142,7 +142,7 @@ private static int length(int number) { /** * A more general solution using functionality of the Vavr Collections. */ - private static class SolutionB implements SolutionProblem17 { + private static final class SolutionB implements SolutionProblem17 { @Override public int letterCount(int number) { return asText(number).length();