Skip to content

Commit 02f2057

Browse files
committed
Use blocks.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/io/trunk@1308108 13f79535-47bb-0310-9956-ffa450edef68
1 parent bde5c71 commit 02f2057

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

src/test/java/org/apache/commons/io/FileUtilsFileNewerTestCase.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,9 @@ protected void tearDown() throws Exception {
6363
* @see FileUtils#isFileNewer(File, File)
6464
*/
6565
public void testIsFileNewer() {
66-
if (!m_testFile1.exists())
66+
if (!m_testFile1.exists()) {
6767
throw new IllegalStateException("The m_testFile1 should exist");
68+
}
6869

6970
long fileLastModified = m_testFile1.lastModified();
7071
final long TWO_SECOND = 2000;
@@ -83,8 +84,9 @@ public void testIsFileNewer() {
8384
*/
8485
public void testIsFileNewerImaginaryFile() {
8586
File imaginaryFile = new File(getTestDirectory(), "imaginaryFile");
86-
if (imaginaryFile.exists())
87+
if (imaginaryFile.exists()) {
8788
throw new IllegalStateException("The imaginary File exists");
89+
}
8890

8991
testIsFileNewer("imaginary file can be newer" , imaginaryFile, m_testFile2.lastModified(), false);
9092
}

src/test/java/org/apache/commons/io/FileUtilsTestCase.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,8 +1226,9 @@ public void testForceDeleteAFile3() throws Exception {
12261226

12271227
public void testCopyFile1ToDir() throws Exception {
12281228
File directory = new File(getTestDirectory(), "subdir");
1229-
if (!directory.exists())
1229+
if (!directory.exists()) {
12301230
directory.mkdirs();
1231+
}
12311232
File destination = new File(directory, testFile1.getName());
12321233

12331234
//Thread.sleep(LAST_MODIFIED_DELAY);
@@ -1251,8 +1252,9 @@ public void testCopyFile1ToDir() throws Exception {
12511252

12521253
public void testCopyFile2ToDir() throws Exception {
12531254
File directory = new File(getTestDirectory(), "subdir");
1254-
if (!directory.exists())
1255+
if (!directory.exists()) {
12551256
directory.mkdirs();
1257+
}
12561258
File destination = new File(directory, testFile1.getName());
12571259

12581260
//Thread.sleep(LAST_MODIFIED_DELAY);

0 commit comments

Comments
 (0)