Adjust to yangtools-2.0.0 changes
[mdsal.git] / binding / mdsal-binding-java-api-generator / src / test / java / org / opendaylight / mdsal / binding / java / api / generator / test / CompilationTestUtils.java
index 680bfbe1dae4ae3e85682de65601059989ae04a8..ad6e250319e7b5b457c8a400d2ab0278f728a47c 100644 (file)
@@ -21,6 +21,7 @@ import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
 import java.lang.reflect.ParameterizedType;
 import java.net.URI;
+import java.net.URISyntaxException;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
@@ -396,20 +397,20 @@ public class CompilationTestUtils {
         return result;
     }
 
-    static List<File> getSourceFiles(final String path) throws Exception {
+    static List<File> getSourceFiles(final String path) throws FileNotFoundException, URISyntaxException {
         final URI resPath = BaseCompilationTest.class.getResource(path).toURI();
         final File sourcesDir = new File(resPath);
-        if (sourcesDir.exists()) {
-            final List<File> sourceFiles = new ArrayList<>();
-            final File[] fileArray = sourcesDir.listFiles();
-            if (fileArray == null) {
-                throw new IllegalArgumentException("Unable to locate files in " + sourcesDir);
-            }
-            sourceFiles.addAll(Arrays.asList(fileArray));
-            return sourceFiles;
-        } else {
+        if (!sourcesDir.exists()) {
             throw new FileNotFoundException("Testing files were not found(" + sourcesDir.getName() + ")");
         }
+
+        final List<File> sourceFiles = new ArrayList<>();
+        final File[] fileArray = sourcesDir.listFiles();
+        if (fileArray == null) {
+            throw new IllegalArgumentException("Unable to locate files in " + sourcesDir);
+        }
+        sourceFiles.addAll(Arrays.asList(fileArray));
+        return sourceFiles;
     }
 
     static void deleteTestDir(final File file) {