Rename YangIRSchemaSource
[yangtools.git] / parser / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / repo / SourceIdMismatchDetector.java
index 56be3949637968efa1307c7293339d8831cf4ed2..5da30bd26e2d7513d6858cce7a7dadf3c895054f 100644 (file)
@@ -11,19 +11,17 @@ import static java.util.Objects.requireNonNull;
 
 import com.google.common.base.Function;
 import com.google.common.collect.ImmutableList;
-import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Set;
 import org.gaul.modernizer_maven_annotations.SuppressModernizer;
 import org.opendaylight.yangtools.yang.model.api.source.SourceIdentifier;
-import org.opendaylight.yangtools.yang.model.spi.source.YangIRSchemaSource;
+import org.opendaylight.yangtools.yang.model.spi.source.YangIRSource;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 @SuppressModernizer
-final class SourceIdMismatchDetector implements Function<List<YangIRSchemaSource>, List<YangIRSchemaSource>> {
+final class SourceIdMismatchDetector implements Function<List<YangIRSource>, List<YangIRSource>> {
     private static final Logger LOG = LoggerFactory.getLogger(SourceIdMismatchDetector.class);
 
     private final Set<SourceIdentifier> sourceIdentifiers;
@@ -33,10 +31,10 @@ final class SourceIdMismatchDetector implements Function<List<YangIRSchemaSource
     }
 
     @Override
-    public List<YangIRSchemaSource> apply(final List<YangIRSchemaSource> input) {
-        final Iterator<SourceIdentifier> srcIt = sourceIdentifiers.iterator();
-        final Map<SourceIdentifier, YangIRSchemaSource> filtered = new LinkedHashMap<>();
-        for (YangIRSchemaSource irSchemaSource : input) {
+    public List<YangIRSource> apply(final List<YangIRSource> input) {
+        final var srcIt = sourceIdentifiers.iterator();
+        final var filtered = new LinkedHashMap<SourceIdentifier, YangIRSource>();
+        for (var irSchemaSource : input) {
             final SourceIdentifier realSId = irSchemaSource.sourceId();
             if (srcIt.hasNext()) {
                 final SourceIdentifier expectedSId = srcIt.next();
@@ -46,7 +44,7 @@ final class SourceIdMismatchDetector implements Function<List<YangIRSchemaSource
                 }
             }
 
-            final YangIRSchemaSource prev = filtered.put(realSId, irSchemaSource);
+            final var prev = filtered.put(realSId, irSchemaSource);
             if (prev != null) {
                 LOG.warn("Duplicate source for module {} detected in reactor", realSId);
             }