mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

jvergara
28.34.2007 c4b98e42370137d03d3967abc77b035925dc5d6a
Fix for issue 1815.
Test the class of the Throwable we get in the backgroundTaskCompleted method.
Use directly the File objects we get from the Installation class and add some debug lines to help tracking down issues in the future.
1 files modified
32 ■■■■■ changed files
opends/src/quicksetup/org/opends/quicksetup/uninstaller/Uninstaller.java 32 ●●●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/uninstaller/Uninstaller.java
@@ -38,6 +38,7 @@
import java.io.*;
import java.util.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.awt.event.WindowEvent;
@@ -268,6 +269,7 @@
          catch (UserDataException uude) {
            throw uude;
          } catch (Throwable t) {
            LOG.log(Level.WARNING, "Error processing task: "+t, t);
            throw new UserDataException(cStep,
                    getThrowableMsg("bug-msg", t));
          }
@@ -279,8 +281,17 @@
                                            Throwable throwable) {
          qs.getDialog().workerFinished();
          if (throwable != null) {
            qs.displayError(throwable.getLocalizedMessage(),
            if (throwable instanceof UserDataException)
            {
              qs.displayError(throwable.getLocalizedMessage(),
                    getMsg("error-title"));
            }
            else
            {
              LOG.log(Level.WARNING, "Error processing task: "+throwable,
                  throwable);
              qs.displayError(throwable.toString(), getMsg("error-title"));
            }
          } else {
            boolean serverRunning = (Boolean) returnValue;
            if (!serverRunning) {
@@ -903,14 +914,14 @@
      };
      Installation installation = getInstallation();
      String[] parentFiles = {
              Utils.getPath(installation.getLibrariesDirectory()),
              Utils.getPath(installation.getBinariesDirectory()),
              Utils.getPath(installation.getDatabasesDirectory()),
              Utils.getPath(installation.getLogsDirectory()),
              Utils.getPath(installation.getConfigurationDirectory()),
              Utils.getPath(installation.getBackupDirectory()),
              Utils.getPath(installation.getLdifDirectory())
      File[] parentFiles = {
              installation.getLibrariesDirectory(),
              installation.getBinariesDirectory(),
              installation.getDatabasesDirectory(),
              installation.getLogsDirectory(),
              installation.getConfigurationDirectory(),
              installation.getBackupDirectory(),
              installation.getLdifDirectory()
      };
      boolean accept =
@@ -925,9 +936,10 @@
      for (int i = 0; i < uData.length && accept; i++) {
        accept &= uData[i] ||
                !equalsOrDescendant(file, new File(parentFiles[i]));
                !equalsOrDescendant(file, parentFiles[i]);
      }
      LOG.log(Level.INFO, "accept for :"+file+" is: "+accept);
      return accept;
    }
  }