From f303dd91c4c81b0b2fb9d9479671657a204b577b Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Wed, 15 Jun 2016 09:57:33 +0000
Subject: [PATCH] code cleanups

---
 opendj-server-legacy/src/main/java/org/opends/server/tools/upgrade/UpgradeTasks.java |   33 +++++++++++----------------------
 1 files changed, 11 insertions(+), 22 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/upgrade/UpgradeTasks.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/upgrade/UpgradeTasks.java
index c066d85..43dda75 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/upgrade/UpgradeTasks.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/upgrade/UpgradeTasks.java
@@ -271,18 +271,13 @@
         final ProgressNotificationCallback pnc = new ProgressNotificationCallback(INFORMATION, summary, 20);
         context.notifyProgress(pnc);
 
-        final File schemaFileTemplate =
-            new File(templateConfigSchemaDirectory, fileName);
-
+        final File schemaFileTemplate = new File(templateConfigSchemaDirectory, fileName);
         final File pathDestination = new File(configSchemaDirectory, fileName);
         try
         {
-          final int changeCount =
-              updateSchemaFile(schemaFileTemplate, pathDestination,
-                  attributeOids, null);
+          final int changeCount = updateSchemaFile(schemaFileTemplate, pathDestination, attributeOids, null);
 
-          displayChangeCount(pathDestination.getPath(), changeCount);
-
+          displayChangeCount(pathDestination, changeCount);
           context.notifyProgress(pnc.setProgress(100));
         }
         catch (final IOException | IllegalStateException e)
@@ -330,21 +325,15 @@
         final ProgressNotificationCallback pnc = new ProgressNotificationCallback(INFORMATION, summary, 20);
         context.notifyProgress(pnc);
 
-        final File schemaFileTemplate =
-            new File(templateConfigSchemaDirectory, fileName);
-
+        final File schemaFileTemplate = new File(templateConfigSchemaDirectory, fileName);
         final File pathDestination = new File(configSchemaDirectory, fileName);
-
         context.notifyProgress(pnc.setProgress(20));
 
         try
         {
-          final int changeCount =
-              updateSchemaFile(schemaFileTemplate, pathDestination,
-                  null, objectClassesOids);
+          final int changeCount = updateSchemaFile(schemaFileTemplate, pathDestination, null, objectClassesOids);
 
-          displayChangeCount(pathDestination.getPath(), changeCount);
-
+          displayChangeCount(pathDestination, changeCount);
           context.notifyProgress(pnc.setProgress(100));
         }
         catch (final IOException e)
@@ -714,7 +703,7 @@
 
         List<String> args = new ArrayList<>(baseArgs);
         args.add("--configFile");
-        args.add(CONFIG_FILE_PATH);
+        args.add(configFile.getAbsolutePath());
         for (final String be : baseDNs)
         {
           args.add("--baseDN");
@@ -1147,9 +1136,9 @@
     }
   }
 
-  private static void displayChangeCount(final String fileName,
-      final int changeCount)
+  private static void displayChangeCount(final File configfile, final int changeCount)
   {
+    String fileName = configfile.getAbsolutePath();
     if (changeCount != 0)
     {
       logger.debug(INFO_UPGRADE_CHANGE_DONE_IN_SPECIFIC_FILE, fileName, changeCount);
@@ -1218,8 +1207,8 @@
     try
     {
       final Filter filterVal = filter != null ? Filter.valueOf(filter) : null;
-      final int changeCount = updateConfigFile(CONFIG_FILE_PATH, filterVal, changeOperationType, ldif);
-      displayChangeCount(CONFIG_FILE_PATH, changeCount);
+      final int changeCount = updateConfigFile(configFile, filterVal, changeOperationType, ldif);
+      displayChangeCount(configFile, changeCount);
 
       context.notifyProgress(pnc.setProgress(100));
     }

--
Gitblit v1.10.0