Author: ggregory Date: Sun Apr 1 13:30:34 2012 New Revision: 1308108 URL: http://svn.apache.org/viewvc?rev=1308108&view=rev Log: Use blocks.
Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileUtilsFileNewerTestCase.java commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileUtilsTestCase.java Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileUtilsFileNewerTestCase.java URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileUtilsFileNewerTestCase.java?rev=1308108&r1=1308107&r2=1308108&view=diff ============================================================================== --- commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileUtilsFileNewerTestCase.java (original) +++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileUtilsFileNewerTestCase.java Sun Apr 1 13:30:34 2012 @@ -63,8 +63,9 @@ public class FileUtilsFileNewerTestCase * @see FileUtils#isFileNewer(File, File) */ public void testIsFileNewer() { - if (!m_testFile1.exists()) + if (!m_testFile1.exists()) { throw new IllegalStateException("The m_testFile1 should exist"); + } long fileLastModified = m_testFile1.lastModified(); final long TWO_SECOND = 2000; @@ -83,8 +84,9 @@ public class FileUtilsFileNewerTestCase */ public void testIsFileNewerImaginaryFile() { File imaginaryFile = new File(getTestDirectory(), "imaginaryFile"); - if (imaginaryFile.exists()) + if (imaginaryFile.exists()) { throw new IllegalStateException("The imaginary File exists"); + } testIsFileNewer("imaginary file can be newer" , imaginaryFile, m_testFile2.lastModified(), false); } Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileUtilsTestCase.java URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileUtilsTestCase.java?rev=1308108&r1=1308107&r2=1308108&view=diff ============================================================================== --- commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileUtilsTestCase.java (original) +++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileUtilsTestCase.java Sun Apr 1 13:30:34 2012 @@ -1226,8 +1226,9 @@ public class FileUtilsTestCase extends F public void testCopyFile1ToDir() throws Exception { File directory = new File(getTestDirectory(), "subdir"); - if (!directory.exists()) + if (!directory.exists()) { directory.mkdirs(); + } File destination = new File(directory, testFile1.getName()); //Thread.sleep(LAST_MODIFIED_DELAY); @@ -1251,8 +1252,9 @@ public class FileUtilsTestCase extends F public void testCopyFile2ToDir() throws Exception { File directory = new File(getTestDirectory(), "subdir"); - if (!directory.exists()) + if (!directory.exists()) { directory.mkdirs(); + } File destination = new File(directory, testFile1.getName()); //Thread.sleep(LAST_MODIFIED_DELAY);