Skip to content

Commit

Permalink
minor: make private class final with default constructor (#2740)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin222004 authored Apr 20, 2023
1 parent e2db4dd commit 7a186d8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/test/java/io/vavr/collection/BitSetTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ public void shouldReturnTailOfNonEmptyHavingReversedOrder() {

// -- classes

private static class Mapper<T> implements Serializable {
private static final class Mapper<T> implements Serializable {

private static final long serialVersionUID = 1L;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ public int compareTo(WeakInteger other) {
}
}

private class Comparator<K, V> {
private final class Comparator<K, V> {
private final java.util.Map<K, V> classic = new java.util.HashMap<>();
private Map<K, V> hamt = HashMap.empty();

Expand Down
4 changes: 2 additions & 2 deletions src/test/java/io/vavr/collection/euler/Euler17Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ default int letterCount(Seq<Integer> 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*/
Expand All @@ -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();
Expand Down

0 comments on commit 7a186d8

Please sign in to comment.