Fix sonar naming warnings 63/27563/2
authorRobert Varga <rovarga@cisco.com>
Tue, 29 Sep 2015 05:25:33 +0000 (07:25 +0200)
committerRobert Varga <rovarga@cisco.com>
Tue, 29 Sep 2015 07:13:15 +0000 (09:13 +0200)
Fields/constants should comply with naming conventions.

Change-Id: I8955e0408e508e7eba7cb90bab78218885b12d0a
Signed-off-by: Robert Varga <rovarga@cisco.com>
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/repo/api/SchemaSourceFilter.java
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/repo/util/FilesystemSchemaSourceCache.java

index dfcbe3c9e660995e8266d55078403b5d9af95342..f3122ebec06c7bd7e6f3c7fc29623b90a56f7de6 100644 (file)
@@ -24,17 +24,18 @@ public interface SchemaSourceFilter {
      * A {@link SchemaSourceFilter} which accepts any schema source it is presented with.
      */
     SchemaSourceFilter ALWAYS_ACCEPT = new SchemaSourceFilter() {
-        private final Iterable<Class<? extends SchemaSourceRepresentation>> Representations =
+        private final Iterable<Class<? extends SchemaSourceRepresentation>> representations =
                 Collections.<Class<? extends SchemaSourceRepresentation>>singletonList(SchemaSourceRepresentation.class);
+        private final ListenableFuture<Boolean> applyFuture = Futures.immediateFuture(Boolean.TRUE);
 
         @Override
         public Iterable<Class<? extends SchemaSourceRepresentation>> supportedRepresentations() {
-            return Representations;
+            return representations;
         }
 
         @Override
         public ListenableFuture<Boolean> apply(final SchemaSourceRepresentation schemaSource) {
-            return Futures.immediateFuture(Boolean.TRUE);
+            return applyFuture;
         }
     };
 
index fd951f7ed27f7456b92afb93ec750fafd91b5d00..a260445cced9468ce53663ad83554ba997c7156c 100644 (file)
@@ -54,7 +54,7 @@ public final class FilesystemSchemaSourceCache<T extends SchemaSourceRepresentat
     private static final Logger LOG = LoggerFactory.getLogger(FilesystemSchemaSourceCache.class);
 
     // Init storage adapters
-    private static final Map<Class<? extends SchemaSourceRepresentation>, StorageAdapter<? extends SchemaSourceRepresentation>> storageAdapters =
+    private static final Map<Class<? extends SchemaSourceRepresentation>, StorageAdapter<? extends SchemaSourceRepresentation>> STORAGE_ADAPTERS =
             Collections.<Class<? extends SchemaSourceRepresentation>, StorageAdapter<? extends SchemaSourceRepresentation>> singletonMap(
                     YangTextSchemaSource.class, new YangTextSchemaStorageAdapter());
 
@@ -81,14 +81,14 @@ public final class FilesystemSchemaSourceCache<T extends SchemaSourceRepresentat
     }
 
     private static void checkSupportedRepresentation(final Class<? extends SchemaSourceRepresentation> representation) {
-        for (final Class<? extends SchemaSourceRepresentation> supportedRepresentation : storageAdapters.keySet()) {
+        for (final Class<? extends SchemaSourceRepresentation> supportedRepresentation : STORAGE_ADAPTERS.keySet()) {
             if(supportedRepresentation.isAssignableFrom(representation)) {
                 return;
             }
         }
 
        throw new IllegalArgumentException(String.format(
-                "This cache does not support representation: %s, supported representations are: %s", representation, storageAdapters.keySet()));
+                "This cache does not support representation: %s, supported representations are: %s", representation, STORAGE_ADAPTERS.keySet()));
     }
 
     private static final Pattern CACHED_FILE_PATTERN =
@@ -119,7 +119,7 @@ public final class FilesystemSchemaSourceCache<T extends SchemaSourceRepresentat
         final File file = sourceIdToFile(sourceIdentifier, storageDirectory);
         if(file.exists() && file.canRead()) {
             LOG.trace("Source {} found in cache as {}", sourceIdentifier, file);
-            final SchemaSourceRepresentation restored = storageAdapters.get(representation).restore(sourceIdentifier, file);
+            final SchemaSourceRepresentation restored = STORAGE_ADAPTERS.get(representation).restore(sourceIdentifier, file);
             return Futures.immediateCheckedFuture(representation.cast(restored));
         }
 
@@ -209,7 +209,7 @@ public final class FilesystemSchemaSourceCache<T extends SchemaSourceRepresentat
     }
 
     private void storeSource(final File file, final T schemaRepresentation) {
-        storageAdapters.get(representation).store(file, schemaRepresentation);
+        STORAGE_ADAPTERS.get(representation).store(file, schemaRepresentation);
     }
 
     private static abstract class StorageAdapter<T extends SchemaSourceRepresentation> {