diff -r d150e4453b0b Makefile.am --- a/Makefile.am Mon May 12 12:55:21 2014 -0400 +++ b/Makefile.am Tue May 13 20:10:44 2014 +0200 @@ -135,7 +135,8 @@ net.sourceforge.jnlp.controlpanel net.sourceforge.jnlp.event \ net.sourceforge.jnlp.runtime net.sourceforge.jnlp.security \ net.sourceforge.jnlp.security.viewer net.sourceforge.jnlp.services \ - net.sourceforge.jnlp.tools net.sourceforge.jnlp.util + net.sourceforge.jnlp.tools net.sourceforge.jnlp.util \ + sun.applet NETX_EXCLUDE_SRCS= @@ -502,11 +503,11 @@ (cd $(NETX_DIR) ; \ mkdir -p lib ; \ $(BOOT_DIR)/bin/jar cfm lib/classes.jar \ - $(abs_top_builddir)/netx.manifest javax/jnlp net ; \ + $(abs_top_builddir)/netx.manifest javax/jnlp net sun; \ cp -pPR $(SRC_DIR_LINK) $(NETX_SRCDIR) src; \ find src -type f -exec chmod 640 '{}' ';' -o -type d -exec chmod 750 '{}' ';'; \ cd src ; \ - $(ZIP) -qr $(NETX_DIR)/lib/src.zip javax net ) + $(ZIP) -qr $(NETX_DIR)/lib/src.zip javax net sun) mkdir -p stamps touch $@ diff -r d150e4453b0b acinclude.m4 --- a/acinclude.m4 Mon May 12 12:55:21 2014 -0400 +++ b/acinclude.m4 Tue May 13 20:10:44 2014 +0200 @@ -865,67 +865,7 @@ AM_CONDITIONAL([JAVADOC_SUPPORTS_J_OPTIONS], test x"${JAVADOC_KNOWS_J_OPTIONS}" = "xyes") ]) -dnl Checks that sun.applet.AppletViewerPanel is available -dnl and public (via the patch in IcedTea6, applet_hole.patch) -dnl Can be removed when that is upstream or unneeded -AC_DEFUN([IT_CHECK_FOR_APPLETVIEWERPANEL_HOLE],[ -AC_REQUIRE([IT_FIND_JAVAC]) -AC_REQUIRE([IT_FIND_JAVA]) -AC_CACHE_CHECK([if sun.applet.AppletViewerPanel is available and public], it_cv_applet_hole, [ -CLASS=TestAppletViewer.java -BYTECODE=$(echo $CLASS|sed 's#\.java##') -mkdir -p tmp.$$ -cd tmp.$$ -cat << \EOF > $CLASS -[/* [#]line __oline__ "configure" */ -import java.lang.reflect.Modifier; -public class TestAppletViewer -{ - public static void main(String[] args) - { - try - { - Class clazz = Class.forName("sun.applet.AppletViewerPanel"); - if (Modifier.isPublic(clazz.getModifiers())) - { - System.err.println("Found public sun.applet.AppletViewerPanel"); - System.exit(0); - } - System.err.println("Found non-public sun.applet.AppletViewerPanel"); - System.exit(2); - } - catch (ClassNotFoundException e) - { - System.err.println("Could not find sun.applet.AppletViewerPanel"); - System.exit(1); - } - } -} -] -EOF -if $JAVAC -cp . $JAVACFLAGS -nowarn $CLASS >&AS_MESSAGE_LOG_FD 2>&1; then - if $JAVA -classpath . $BYTECODE >&AS_MESSAGE_LOG_FD 2>&1; then - it_cv_applet_hole=yes; - else - it_cv_applet_hole=$?; - fi -else - it_cv_applet_hole=3; -fi -]) -rm -f $CLASS *.class -cd .. -rmdir tmp.$$ -if test x"${it_cv_applet_hole}" = "x1"; then - AC_MSG_ERROR([sun.applet.AppletViewerPanel is not available.]) -elif test x"${it_cv_applet_hole}" = "x2"; then - AC_MSG_ERROR([sun.applet.AppletViewerPanel is not public.]) -elif test x"${it_cv_applet_hole}" = "x3"; then - AC_MSG_ERROR([Compilation failed. See config.log.]) -fi -AC_PROVIDE([$0])dnl -]) AC_DEFUN_ONCE([IT_SET_VERSION], [ diff -r d150e4453b0b configure.ac --- a/configure.ac Mon May 12 12:55:21 2014 -0400 +++ b/configure.ac Tue May 13 20:10:44 2014 +0200 @@ -86,7 +86,6 @@ IT_CHECK_FOR_CLASS(SUN_MISC_REF, [sun.misc.Ref]) IT_CHECK_FOR_CLASS(COM_SUN_JNDI_TOOLKIT_URL_URLUTIL, [com.sun.jndi.toolkit.url.UrlUtil]) IT_CHECK_FOR_CLASS(SUN_APPLET_APPLETIMAGEREF, [sun.applet.AppletImageRef]) -IT_CHECK_FOR_APPLETVIEWERPANEL_HOLE IT_CHECK_GLIB_VERSION IT_CHECK_XULRUNNER_MIMEDESCRIPTION_CONSTCHAR IT_CHECK_XULRUNNER_REQUIRES_C11 diff -r d150e4453b0b netx/net/sourceforge/jnlp/NetxPanel.java --- a/netx/net/sourceforge/jnlp/NetxPanel.java Mon May 12 12:55:21 2014 -0400 +++ b/netx/net/sourceforge/jnlp/NetxPanel.java Tue May 13 20:10:44 2014 +0200 @@ -35,7 +35,7 @@ import net.sourceforge.jnlp.splashscreen.SplashUtils; import net.sourceforge.jnlp.util.logging.OutputController; -import sun.applet.AppletViewerPanel; +import sun.applet.AppletViewerPanelAccess; import sun.awt.SunToolkit; /** @@ -44,7 +44,7 @@ * * @author Francis Kung <fkung@redhat.com> */ -public class NetxPanel extends AppletViewerPanel implements SplashController { +public class NetxPanel extends AppletViewerPanelAccess implements SplashController { private final PluginParameters parameters; private PluginBridge bridge = null; private AppletInstance appInst = null; @@ -76,7 +76,7 @@ String uniqueKey = params.getUniqueKey(getCodeBase()); synchronized(TGMapMutex) { if (!uKeyToTG.containsKey(uniqueKey)) { - ThreadGroup tg = new ThreadGroup(Launcher.mainGroup, this.documentURL.toString()); + ThreadGroup tg = new ThreadGroup(Launcher.mainGroup, this.getDocumentURL().toString()); uKeyToTG.put(uniqueKey, tg); } } @@ -95,10 +95,10 @@ //Overriding to use Netx classloader. You might need to relax visibility //in sun.applet.AppletPanel for runLoader(). @Override - protected void runLoader() { + protected void ourRunLoader() { try { - bridge = new PluginBridge(baseURL, + bridge = new PluginBridge(getBaseURL(), getDocumentBase(), getJarFiles(), getCode(), @@ -114,13 +114,13 @@ // May throw LaunchException: appInst = (AppletInstance) l.launch(bridge, this); - applet = appInst.getApplet(); + setApplet(appInst.getApplet()); - if (applet != null) { + if (getApplet() != null) { // Stick it in the frame - applet.setStub(this); - applet.setVisible(false); - add("Center", applet); + getApplet().setStub(this); + getApplet().setVisible(false); + add("Center", getApplet()); showAppletStatus("loaded"); validate(); } @@ -157,7 +157,7 @@ } } - handler = new Thread(getThreadGroup(), this, "NetxPanelThread@" + this.documentURL); + handler = new Thread(getThreadGroup(), this, "NetxPanelThread@" + this.getDocumentURL()); handler.start(); } @@ -213,5 +213,5 @@ public int getSplashHeigth() { return splashController.getSplashHeigth(); } - + } diff -r d150e4453b0b netx/sun/applet/AppletViewerPanelAccess.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netx/sun/applet/AppletViewerPanelAccess.java Tue May 13 20:10:44 2014 +0200 @@ -0,0 +1,128 @@ +/* package-info.java + Copyright (C) 2014 Red Hat, Inc. + + This file is part of IcedTea. + + IcedTea is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation, version 2. + + IcedTea 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 General Public License for more details. + + You should have received a copy of the GNU General Public License along with + IcedTea; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. + + Linking this library statically or dynamically with other modules is making a + combined work based on this library. Thus, the terms and conditions of the GNU + General Public License cover the whole combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent modules, and + to copy and distribute the resulting executable under terms of your choice, + provided that you also meet, for each linked independent module, the terms and + conditions of the license of that module. An independent module is a module + which is not derived from or based on this library. If you modify this library, + you may extend this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this exception + statement from your version.*/ +package sun.applet; + +import java.applet.Applet; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.net.URL; +import java.util.Hashtable; + +public abstract class AppletViewerPanelAccess extends AppletViewerPanel { + + static final Method runLoaderMethod; + static boolean initialized = false; + + static { + Class klazz = AppletPanel.class; + try { + runLoaderMethod = klazz.getDeclaredMethod("runLoader"); + runLoaderMethod.setAccessible(true); + } catch (NoSuchMethodException e) { + throw new ExceptionInInitializerError(e); + } + initialized = true; + } + + public AppletViewerPanelAccess(URL documentURL, Hashtable atts) { + super(documentURL, atts); + } + + protected URL getDocumentURL() { + try { + Field field = AppletViewerPanel.class.getDeclaredField("documentURL"); + field.setAccessible(true); + return (URL) field.get(this); + } catch (IllegalAccessException | IllegalArgumentException | NoSuchFieldException | SecurityException ex) { + throw new RuntimeException(ex); + } + } + + protected void setApplet(Applet iapplet) { + try { + Field field = AppletPanel.class.getDeclaredField("applet"); + field.setAccessible(true); + field.set(this, iapplet); + } catch (IllegalAccessException | IllegalArgumentException | NoSuchFieldException | SecurityException ex) { + throw new RuntimeException(ex); + } + } + + @Override + public void run() { + // this is copypasted chunk from AppletPanel.run (the only current + // call of runLoader). Pray it do not change + Thread curThread = Thread.currentThread(); + if (curThread == loaderThread) { + ourRunLoader(); + return; + } + + super.run(); + } + + /** + * NOTE. We cannot override private method, and this call is unused and useless. + * But kept for record of troubles to run on any openjdk. + */ + private void superRunLoader() { + try { + runLoaderMethod.invoke(getApplet()); + } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) { + throw new RuntimeException(ex); + } + } + + @Override + protected synchronized void createAppletThread() { + + } + + protected URL getBaseURL() { + try { + Field field = AppletViewerPanel.class + .getDeclaredField("baseURL"); + field.setAccessible( + true); + return (URL) field.get( + this); + } catch (IllegalAccessException | IllegalArgumentException | NoSuchFieldException | SecurityException ex) { + throw new RuntimeException(ex); + } + + } + + abstract protected void ourRunLoader(); + +} diff -r d150e4453b0b netx/sun/applet/package-info.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netx/sun/applet/package-info.java Tue May 13 20:10:44 2014 +0200 @@ -0,0 +1,37 @@ +/* package-info.java + Copyright (C) 2014 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify it under the +terms of the GNU General Public License as published by the Free Software +Foundation, version 2. + +IcedTea 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 General Public License for more details. + +You should have received a copy of the GNU General Public License along with +IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is making a +combined work based on this library. Thus, the terms and conditions of the GNU +General Public License cover the whole combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent modules, and +to copy and distribute the resulting executable under terms of your choice, +provided that you also meet, for each linked independent module, the terms and +conditions of the license of that module. An independent module is a module +which is not derived from or based on this library. If you modify this library, +you may extend this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this exception +statement from your version.*/ +/** + * This package serve as access to package private classes in JDK. + *

Do not use it for anything else

+ */ +package sun.applet; diff -r d150e4453b0b plugin/icedteanp/java/sun/applet/PluginAppletPanelFactory.java --- a/plugin/icedteanp/java/sun/applet/PluginAppletPanelFactory.java Mon May 12 12:55:21 2014 -0400 +++ b/plugin/icedteanp/java/sun/applet/PluginAppletPanelFactory.java Tue May 13 20:10:44 2014 +0200 @@ -87,7 +87,7 @@ final NetxPanel panel = AccessController.doPrivileged(new PrivilegedAction() { public NetxPanel run() { NetxPanel panel = new NetxPanel(doc, params); - NetxPanel.debug("Using NetX panel"); + OutputController.getLogger().log("Using NetX panel"); PluginDebug.debug(params.toString()); return panel; } diff -r d150e4453b0b plugin/icedteanp/java/sun/applet/PluginAppletViewer.java --- a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java Mon May 12 12:55:21 2014 -0400 +++ b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java Tue May 13 20:10:44 2014 +0200 @@ -646,7 +646,7 @@ pav.dispose(); // If panel is already disposed, return - if (pav.panel.applet == null) { + if (pav.panel.getApplet() == null) { PluginDebug.debug(identifier, " panel inactive. Returning."); return; } @@ -722,8 +722,8 @@ panel.setSize(width, height); panel.validate(); - panel.applet.resize(width, height); - panel.applet.validate(); + panel.getApplet().resize(width, height); + panel.getApplet().validate(); } }); } @@ -1425,8 +1425,8 @@ * at the same time. */ try { - ((AppletViewerPanel)panel).joinAppletThread(); - ((AppletViewerPanel)panel).release(); + ((AppletViewerPanelAccess)panel).joinAppletThread(); + ((AppletViewerPanelAccess)panel).release(); } catch (InterruptedException e) { return; // abort the reload } @@ -1434,7 +1434,7 @@ AccessController.doPrivileged(new PrivilegedAction() { @Override public Void run() { - ((AppletViewerPanel)panel).createAppletThread(); + ((AppletViewerPanelAccess)panel).createAppletThread(); return null; } });