changeset 752:e09b9813d6de

Removed out-of date Boot13 class
author Jiri Vanek <jvanek@redhat.com>
date Thu, 20 Jun 2013 17:00:52 +0200
parents 2469bedc6d63
children a236aa5f729b
files ChangeLog NEWS netx/net/sourceforge/jnlp/runtime/Boot.java netx/net/sourceforge/jnlp/runtime/Boot13.java
diffstat 4 files changed, 7 insertions(+), 101 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Jun 20 15:20:57 2013 +0200
+++ b/ChangeLog	Thu Jun 20 17:00:52 2013 +0200
@@ -1,3 +1,9 @@
+2013-06-20  Jiri Vanek <jvanek@redhat.com>
+
+	Removed out-of date support for jdk 1.5  and older
+	* netx/net/sourceforge/jnlp/runtime/Boot.java: removed memories to Boot13
+	* netx/net/sourceforge/jnlp/runtime/Boot13.java: removed
+	
 2013-06-20  Jiri Vanek <jvanek@redhat.com>
 
 	Made it work with OpenJDK build 25
--- a/NEWS	Thu Jun 20 15:20:57 2013 +0200
+++ b/NEWS	Thu Jun 20 17:00:52 2013 +0200
@@ -9,6 +9,7 @@
 CVE-XXXX-YYYY: http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=XXXX-YYYY
 
 New in release 1.5 (2013-XX-XX):
+* JDK older then 1.5 no longer supported
 * NetX
   - PR1465 - java.io.FileNotFoundException while trying to download a JAR file
 * Plugin
--- a/netx/net/sourceforge/jnlp/runtime/Boot.java	Thu Jun 20 15:20:57 2013 +0200
+++ b/netx/net/sourceforge/jnlp/runtime/Boot.java	Thu Jun 20 17:00:52 2013 +0200
@@ -171,9 +171,6 @@
 
         JNLPRuntime.setInitialArgments(Arrays.asList(argsIn));
 
-        // do in a privileged action to clear the security context of
-        // the Boot13 class, which doesn't have any privileges in
-        // JRE1.3; JRE1.4 works without Boot13 or this PrivilegedAction.
         AccessController.doPrivileged(new Boot());
 
     }
--- a/netx/net/sourceforge/jnlp/runtime/Boot13.java	Thu Jun 20 15:20:57 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,98 +0,0 @@
-// Copyright (C) 2001-2003 Jon A. Maxwell (JAM)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-package net.sourceforge.jnlp.runtime;
-
-import java.lang.reflect.*;
-import java.net.*;
-import java.security.*;
-
-/**
- * Allows a Policy and SecurityManager to be set in JRE1.3 without
- * running the code with only applet permissions; this class is
- * for backward compatibility only and is totally unnecessary if
- * running in jdk 1.4 or later (can call Boot directly).
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.5 $
- */
-public class Boot13 extends URLClassLoader {
-
-    // The problem with setting a Policy in jdk1.3 is that the
-    // system and application classes seem to be loaded in such a
-    // way that only their protection domain determines the
-    // permissions; the policy object is never asked for permissions
-    // after the class is loaded.  This hack creates a classloader
-    // that loads duplicate versions of the classes in such a
-    // manner where they ask with the policy object.  The jdk1.4
-    // correctly honors the Policy object making this unneccessary
-    // post-1.3.
-
-    private Boot13(URL source[]) {
-        super(source);
-    }
-
-    protected PermissionCollection getPermissions(CodeSource source) {
-        Permissions result = new Permissions();
-        result.add(new AllPermission());
-
-        return result;
-    }
-
-    public Class loadClass(String name) throws ClassNotFoundException {
-        Class c = findLoadedClass(name);
-        if (c != null)
-            return c;
-
-        // reverse the search order so that classes from this
-        // classloader, which sets the right permissions, are found
-        // before the parent classloader which has the same classes
-        // but the wrong permissions.
-        try {
-            return findClass(name);
-        } catch (ClassNotFoundException ex) {
-        }
-
-        return getParent().loadClass(name);
-    }
-
-    public static void main(final String args[]) throws Exception {
-        URL cs = Boot13.class.getProtectionDomain().getCodeSource().getLocation();
-        //  instead of using a custom loadClass search order, we could
-        //  put the classes in a boot/ subdir of the JAR and load
-        //  them from there.  This would be an improvement by not
-        //  allowing applications to get a duplicate jnlp engine (one
-        //  with applet access permissions) by using the system
-        //  classloader but a drawback by not allowing Boot to be
-        //  called directly.
-        //cs = new URL("jar:"+cs+"!/boot/");
-
-        if (cs == null) {
-            System.err.println("fatal: cannot determine code source.");
-            System.exit(1);
-        }
-
-        Boot13 b = new Boot13(new URL[] { cs });
-
-        Thread.currentThread().setContextClassLoader(b); // try to prevent getting the non-policy version of classes
-
-        Class<?> c = b.loadClass("net.sourceforge.jnlp.runtime.Boot");
-        Method main = c.getDeclaredMethod("main", new Class<?>[] { String[].class });
-
-        main.invoke(null, new Object[] { args });
-    }
-
-}