Fixup checkstyle in yang-repo-spi 76/107576/1
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 30 Aug 2023 11:38:44 +0000 (13:38 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 30 Aug 2023 11:39:05 +0000 (13:39 +0200)
Upgraded checkstyle is finding some violations, clean them up.

Change-Id: Iebc51805be902b15cc40e88c43e5c346e8936b6a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-repo-spi/src/main/java/org/opendaylight/yangtools/yang/model/repo/spi/AbstractSchemaRepository.java
yang/yang-repo-spi/src/test/java/org/opendaylight/yangtools/yang/model/repo/spi/SchemaSourceTransformerTest.java

index 33d0c01e7a40665df33e83bcedc41666c8ec6866..45befd23921733a0f0555331c86ee40fabe2282e 100644 (file)
@@ -195,9 +195,11 @@ public abstract class AbstractSchemaRepository implements SchemaRepository, Sche
         return ret;
     }
 
-    private static class SchemaProviderCostComparator implements Comparator<AbstractSchemaSourceRegistration<?>>,
+    private static final class SchemaProviderCostComparator implements Comparator<AbstractSchemaSourceRegistration<?>>,
             Serializable {
         static final SchemaProviderCostComparator INSTANCE = new SchemaProviderCostComparator();
+
+        @java.io.Serial
         private static final long serialVersionUID = 1L;
 
         @Override
@@ -205,6 +207,7 @@ public abstract class AbstractSchemaRepository implements SchemaRepository, Sche
             return o1.getInstance().getCost() - o2.getInstance().getCost();
         }
 
+        @java.io.Serial
         private Object readResolve() {
             return INSTANCE;
         }
index 217f34eeeb71613e5b55ba6322ff761aacadad3c..8fe0350d0f96fcbcf2699e4954775ad4a8af27d3 100644 (file)
@@ -83,8 +83,8 @@ public class SchemaSourceTransformerTest {
         reg.register(sourceIdentifier);
 
         final Consumer c = new Consumer();
-        schema = new SchemaSourceTransformer<>(p,
-                SchemaSourceTransformerTest.SRC_CLASS, c, SchemaSourceTransformerTest.DST_CLASS, function);
+        schema = new SchemaSourceTransformer<>(p, SchemaSourceTransformerTest.SRC_CLASS, c,
+            SchemaSourceTransformerTest.DST_CLASS, function);
 
         final SchemaSourceListener listener = schema;
         p.registerSchemaSourceListener(listener);
@@ -101,22 +101,18 @@ public class SchemaSourceTransformerTest {
     }
 
     private static class Foo<T extends SchemaSourceRepresentation> {
-
         final PotentialSchemaSource<T> src;
 
         Foo(final SourceIdentifier sourceIdentifier, final Class<T> representation, final Costs cost) {
-            this.src = PotentialSchemaSource.create(sourceIdentifier, representation,
-                    cost.getValue());
+            src = PotentialSchemaSource.create(sourceIdentifier, representation, cost.getValue());
         }
 
         public PotentialSchemaSource<T> getPotentialSchemSource() {
-            return this.src;
+            return src;
         }
-
     }
 
     private static class Registrator extends AbstractSchemaSourceCache<YangSchemaSourceRepresentation> {
-
         Registrator(final SchemaSourceRegistry consumer, final Class<YangSchemaSourceRepresentation> srcClass,
                 final Costs cost) {
             super(consumer, srcClass, cost);
@@ -132,10 +128,9 @@ public class SchemaSourceTransformerTest {
                 final SourceIdentifier sourceIdentifier) {
             return SettableFuture.create();
         }
-
     }
 
-    private static class Provider extends AbstractSchemaRepository {
+    private static final class Provider extends AbstractSchemaRepository {
         @Override
         public EffectiveModelContextFactory createEffectiveModelContextFactory(
                 final SchemaContextFactoryConfiguration config) {
@@ -143,7 +138,7 @@ public class SchemaSourceTransformerTest {
         }
     }
 
-    private static class Consumer extends AbstractSchemaRepository {
+    private static final class Consumer extends AbstractSchemaRepository {
         @Override
         public EffectiveModelContextFactory createEffectiveModelContextFactory(
                 final SchemaContextFactoryConfiguration config) {