package org.opendaylight.yangtools.yang.test.util;
import com.google.common.annotations.Beta;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.File;
import java.io.FileFilter;
import java.io.IOException;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
+import java.util.Locale;
import java.util.ServiceLoader;
import java.util.Set;
import java.util.stream.Collectors;
public final class YangParserTestUtils {
private static final FileFilter YANG_FILE_FILTER = file -> {
- final String name = file.getName().toLowerCase();
+ // Locale keeps SpotBugs happy. It should not matter that much anyway.
+ final String name = file.getName().toLowerCase(Locale.ENGLISH);
return name.endsWith(YangConstants.RFC6020_YANG_FILE_EXTENSION) && file.isFile();
};
* @param parserMode mode of statement parser
* @return effective schema context
*/
+ @SuppressFBWarnings(value = "NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE", justification = "Wrong inferent on listFiles")
public static SchemaContext parseYangResourceDirectory(final String resourcePath,
final Set<QName> supportedFeatures, final StatementParserMode parserMode) {
final URI directoryPath;
}
}
+ @SuppressFBWarnings(value = "NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE", justification = "Wrong inferent on listFiles")
private static Collection<File> getYangFiles(final String resourcePath) {
final URI directoryPath;
try {