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

jvergara
28.44.2009 86f0abd09d87f89e2358a0c99db35a6f5e4d7c49
Fix for issue 4150 (DynamicConstants class loading of ReleaseDefinition breaks Java Web Start).

The fix checks whether WebStart is being run. If it is the case use a URLClassLoader to check whether ReleaseDefinition class is defined or not in quicksetup.jar.
1 files modified
19 ■■■■ changed files
opends/resource/DynamicConstants.java.stubs 19 ●●●● patch | view | raw | blame | history
opends/resource/DynamicConstants.java.stubs
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Copyright 2006-2009 Sun Microsystems, Inc.
 */
package org.opends.server.util;
@@ -156,7 +156,22 @@
      try {
        Class c = Class.forName("org.opends.server.util.ReleaseDefinition");
        Class c;
        if (org.opends.server.util.SetupUtils.isWebStart())
        {
          Class<?> cS = Class.forName("org.opends.server.util.SetupUtils");
          java.net.URL[] urls = new java.net.URL[]
          {
            cS.getProtectionDomain().getCodeSource().getLocation()
          };
          ClassLoader webstartClassLoader = new java.net.URLClassLoader(urls);
          c = webstartClassLoader.loadClass(
            "org.opends.server.util.ReleaseDefinition");
        }
        else
        {
          c = Class.forName("org.opends.server.util.ReleaseDefinition");
        }
        Object obj = c.newInstance();
        try {