creadur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject svn commit: r1548624 - /creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/analysis/license/DirectoryScanner.java
Date Fri, 06 Dec 2013 17:56:09 GMT
Author: rdonkin
Date: Fri Dec  6 17:56:08 2013
New Revision: 1548624

URL: http://svn.apache.org/r1548624
Log:
Format Code.

Modified:
    creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/analysis/license/DirectoryScanner.java

Modified: creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/analysis/license/DirectoryScanner.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/analysis/license/DirectoryScanner.java?rev=1548624&r1=1548623&r2=1548624&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/analysis/license/DirectoryScanner.java
(original)
+++ creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/analysis/license/DirectoryScanner.java
Fri Dec  6 17:56:08 2013
@@ -33,35 +33,36 @@ import org.junit.Assert;
 
 class DirectoryScanner {
 
-    @SuppressWarnings("boxing")
-    /**
-     * Get list of files in a directory, and scan for license matches
-     * @param directory the directory containing the files
-     * @param matcher the license matcher
-     * @param expected the expected result of the each scan
-     * @throws Exception
-     */
-    public static void testFilesInDir(String directory, IHeaderMatcher matcher, boolean expected)
throws IOException {
-        final File[] resourceFiles = Resources.getResourceFiles(directory);
-        if (resourceFiles.length == 0) {
-            Assert.fail("No files found under "+directory);
-        }
-        for(File f : resourceFiles) {
-            final Document subject = new MockLocation(f.toString());
-            BufferedReader br = null;
-            try {
-                boolean result = false;
-                br = Resources.getBufferedReader(f);
-                String line;
-                while(!result && (line = br.readLine()) != null) {
-                    result = matcher.match(subject, line);
-                }
-                assertEquals(f.toString(), expected, result);
-            } finally {
-                matcher.reset();
-                IOUtils.closeQuietly(br);
-            }
-        }
-    }
+	@SuppressWarnings("boxing")
+	/**
+	 * Get list of files in a directory, and scan for license matches
+	 * @param directory the directory containing the files
+	 * @param matcher the license matcher
+	 * @param expected the expected result of the each scan
+	 * @throws Exception
+	 */
+	public static void testFilesInDir(String directory, IHeaderMatcher matcher,
+			boolean expected) throws IOException {
+		final File[] resourceFiles = Resources.getResourceFiles(directory);
+		if (resourceFiles.length == 0) {
+			Assert.fail("No files found under " + directory);
+		}
+		for (File f : resourceFiles) {
+			final Document subject = new MockLocation(f.toString());
+			BufferedReader br = null;
+			try {
+				boolean result = false;
+				br = Resources.getBufferedReader(f);
+				String line;
+				while (!result && (line = br.readLine()) != null) {
+					result = matcher.match(subject, line);
+				}
+				assertEquals(f.toString(), expected, result);
+			} finally {
+				matcher.reset();
+				IOUtils.closeQuietly(br);
+			}
+		}
+	}
 
 }



Mime
View raw message