From ca669ae54f86dbeea277280690584d9f591c7571 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Wed, 18 Feb 2015 07:26:26 +0000
Subject: [PATCH] AutoRefactor: collapse if statements

---
 opendj-server-legacy/src/main/java/org/opends/server/tools/WaitForFileDelete.java |   29 +++++++++++++----------------
 1 files changed, 13 insertions(+), 16 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/WaitForFileDelete.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/WaitForFileDelete.java
index 4b1cde2..7badd6b 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/WaitForFileDelete.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/WaitForFileDelete.java
@@ -22,7 +22,7 @@
  *
  *
  *      Copyright 2006-2009 Sun Microsystems, Inc.
- *      Portions Copyright 2013-2014 ForgeRock AS
+ *      Portions Copyright 2013-2015 ForgeRock AS
  */
 package org.opends.server.tools;
 
@@ -293,25 +293,22 @@
     // and append data to it.
     RandomAccessFile outputFile = null;
     long outputFileOffset = 0L;
-    if (logFile != null)
+    if (logFile != null && outputFilePath.isPresent())
     {
-      if (outputFilePath.isPresent())
+      try
       {
-        try
+        File f = new File(outputFilePath.getValue());
+        if (f.exists())
         {
-          File f = new File(outputFilePath.getValue());
-          if (f.exists())
-          {
-            outputFile = new RandomAccessFile(f, "rw");
-            outputFileOffset = outputFile.length();
-            outputFile.seek(outputFileOffset);
-          }
+          outputFile = new RandomAccessFile(f, "rw");
+          outputFileOffset = outputFile.length();
+          outputFile.seek(outputFileOffset);
         }
-        catch (Exception e)
-        {
-          println(WARN_WAIT4DEL_CANNOT_OPEN_OUTPUT_FILE.get(outputFilePath.getValue(), e));
-          outputFile = null;
-        }
+      }
+      catch (Exception e)
+      {
+        println(WARN_WAIT4DEL_CANNOT_OPEN_OUTPUT_FILE.get(outputFilePath.getValue(), e));
+        outputFile = null;
       }
     }
     // Figure out when to stop waiting.

--
Gitblit v1.10.0