/hg/icedtea-web: 5 new changesets

jvanek at icedtea.classpath.org jvanek at icedtea.classpath.org
Thu May 22 16:30:57 UTC 2014


changeset c6591d36d68a in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=c6591d36d68a
author: Jiri Vanek <jvanek at redhat.com>
date: Thu May 22 16:45:11 2014 +0200

	Made it works (basicaly) on any JDK


changeset b1e4f8185c10 in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=b1e4f8185c10
author: Jiri Vanek <jvanek at redhat.com>
date: Thu May 22 17:21:35 2014 +0200

	All tests adapted to run from XBootclaspath (forced by extending package private rt.jar class)


changeset 7ce5153a6fd1 in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=7ce5153a6fd1
author: Jiri Vanek <jvanek at redhat.com>
date: Thu May 22 17:57:52 2014 +0200

	Making the previous chnage actualy take an effect.  All tests runs using CLASSPATH varibale on line, separated by semicolon.


changeset 96ccc89ddb57 in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=96ccc89ddb57
author: Jiri Vanek <jvanek at redhat.com>
date: Thu May 22 18:08:36 2014 +0200

	Added accidentally skipped hunk


changeset 0c7dcde1cfe0 in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=0c7dcde1cfe0
author: Jiri Vanek <jvanek at redhat.com>
date: Thu May 22 18:30:41 2014 +0200

	Fixed slipped test classlaoder fix in JavawsAWTRobotFindsButtonTest.java


diffstat:

 ChangeLog                                                                                       |   52 ++++
 Makefile.am                                                                                     |   37 +-
 acinclude.m4                                                                                    |   43 +--
 configure.ac                                                                                    |    2 +-
 netx/net/sourceforge/jnlp/NetxPanel.java                                                        |   24 +-
 netx/sun/applet/AppletViewerPanelAccess.java                                                    |  122 ++++++++++
 netx/sun/applet/package-info.java                                                               |   37 +++
 plugin/icedteanp/java/sun/applet/PluginAppletPanelFactory.java                                  |    2 +-
 plugin/icedteanp/java/sun/applet/PluginAppletViewer.java                                        |   12 +-
 tests/netx/unit/net/sourceforge/jnlp/JNLPMatcherTest.java                                       |    2 +-
 tests/reproducers/simple/JavawsAWTRobotFindsButton/testcases/JavawsAWTRobotFindsButtonTest.java |    2 +-
 tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/ComponentFinder.java                 |    2 +-
 12 files changed, 269 insertions(+), 68 deletions(-)

diffs (truncated from 603 to 500 lines):

diff -r 02a18cce94c7 -r 0c7dcde1cfe0 ChangeLog
--- a/ChangeLog	Wed May 21 11:08:18 2014 -0400
+++ b/ChangeLog	Thu May 22 18:30:41 2014 +0200
@@ -1,3 +1,55 @@
+2014-05-21  Jiri Vanek  <jvanek at redhat.com>
+
+	Fixed slipped test classlaoder fix
+	* sts/reproducers/simple/JavawsAWTRobotFindsButton/testcases/JavawsAWTRobotFindsButtonTest.java
+	(static init) used system classlaoder to laod image
+
+2014-05-21  Jiri Vanek  <jvanek at redhat.com>
+
+	* netx/sun/applet/AppletViewerPanelAccess.java: addedd accidentally skipped
+	createAppletThread method
+
+2014-05-21  Jiri Vanek  <jvanek at redhat.com>
+
+	Making the previous chnage actualy take an effect.
+	* Makefile.am: All tests runs using CLASSPATH varibale on line, separated by
+	semicolon. I have no idea wy this was needing.
+
+2014-05-21  Jiri Vanek  <jvanek at redhat.com>
+
+	All tests adapted to run from XBootclaspath (forced by extending package private
+	rt.jar class)
+	* Makefile.am: all sets of call of -Xbootclasspath in tests and coverage
+	are now adding $CLASSPATH to boot classapth. Where CLASSPATH was not deffined,
+	was added.
+	* tests/netx/unit/net/sourceforge/jnlp/JNLPMatcherTest.java: and
+	* tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/ComponentFinder.java:
+	resources loaded from boot classloader
+
+2014-05-21  Jiri Vanek  <jvanek at redhat.com>
+
+	Made it works (basicaly) on any JDK
+	* Makefile.am: (NETX_PKGS) sun.applet added to recognized netx packages
+	(netx-dist.stamp) sun directory included into packed list
+	* acinclude.m4: removed (IT_CHECK_FOR_APPLETVIEWERPANEL_HOLE) check. Added 
+	IT_CHECK_FOR_SUN_APPLET_ACCESSIBILITY, which test existence of 
+	classes sun.applet.AppletPanel, sun.applet.AppletViewerPanel
+	fields applet, documentURL, baseURL and methods run and runLoader. Addapted messge
+	* configure.ac:  call to IT_CHECK_FOR_APPLETVIEWERPANEL_HOLE replaced by call
+	to IT_CHECK_FOR_SUN_APPLET_ACCESSIBILITY
+	* /netx/net/sourceforge/jnlp/NetxPanel.java: now extends AppletViewerPanelAccess
+	instead of AppletViewerPanel directly. Access to baseURL, applet and documentURL
+	replaced by dedicated getters/setters
+	* netx/sun/applet/AppletViewerPanelAccess.java: new class extending AppletViewerPanel
+	and enabling access to applet, documentURL and baseURL. Backed by reflection.
+	Also overriding run by usage of short copypasted code.
+	* netx/sun/applet/package-info.java: new file with worning about usage of this
+	package in itw
+	* plugin/icedteanp/java/sun/applet/PluginAppletPanelFactory.java: only call
+	to super debug repalced by ITW's debugging call
+	* plugin/icedteanp/java/sun/applet/PluginAppletViewer.java: used getters as in 
+	NetxPanel
+
 2014-05-21  Andrew Azores  <aazores at redhat.com>
 
 	* AUTHORS: added Lukasz Dracz and Jie Kang
diff -r 02a18cce94c7 -r 0c7dcde1cfe0 Makefile.am
--- a/Makefile.am	Wed May 21 11:08:18 2014 -0400
+++ b/Makefile.am	Thu May 22 18:30:41 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 $@
 
@@ -893,9 +894,9 @@
  $(TESTS_DIR)/$(REPORT_STYLES_DIRNAME) $(REPRODUCERS_CLASS_NAMES) stamps/process-custom-reproducers.stamp
 	cd $(TEST_EXTENSIONS_DIR) ; \
 	class_names=`cat $(REPRODUCERS_CLASS_NAMES)` ; \
-	CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):.:$(TEST_EXTENSIONS_TESTS_DIR):$(TEST_EXTENSIONS_SRCDIR) \
+	CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):.:$(TEST_EXTENSIONS_TESTS_DIR):$(TEST_EXTENSIONS_SRCDIR) ; \
 	  $(BOOT_DIR)/bin/java $(REPRODUCERS_DPARAMETERS) \
-	 -Xbootclasspath:$(RUNTIME) CommandLine $$class_names
+	 -Xbootclasspath/a:$(RUNTIME):$$CLASSPATH CommandLine $$class_names
 if WITH_XSLTPROC
 	-$(XSLTPROC)  --stringparam logs logs_reproducers.html $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/jreport.xsl $(TEST_EXTENSIONS_DIR)/tests-output.xml > $(TESTS_DIR)/index_reproducers.html
 	-$(XSLTPROC)  $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/logs.xsl $(TEST_EXTENSIONS_DIR)/ServerAccess-logs.xml > $(TESTS_DIR)/logs_reproducers.html
@@ -1072,8 +1073,8 @@
 	done ; \
 	cd $(NETX_UNIT_TEST_DIR) ; \
 	class_names=`cat $(UNIT_CLASS_NAMES)` ; \
-	CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(abs_top_builddir)/liveconnect/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):$(TEST_EXTENSIONS_DIR):.:$(TEST_EXTENSIONS_SRCDIR):$(TAGSOUP_JAR) \
-	  $(BOOT_DIR)/bin/java -Xbootclasspath:$(RUNTIME) CommandLine $$class_names 
+	CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(abs_top_builddir)/liveconnect/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):$(TEST_EXTENSIONS_DIR):.:$(TEST_EXTENSIONS_SRCDIR):$(TAGSOUP_JAR) ; \
+	  $(BOOT_DIR)/bin/java -Xbootclasspath/a:$(RUNTIME):$$CLASSPATH CommandLine $$class_names 
 if WITH_XSLTPROC
 	-$(XSLTPROC) --stringparam logs logs_unit.html $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/jreport.xsl $(NETX_UNIT_TEST_DIR)/tests-output.xml > $(TESTS_DIR)/index_unit.html
 	-$(XSLTPROC) $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/logs.xsl $(NETX_UNIT_TEST_DIR)/ServerAccess-logs.xml > $(TESTS_DIR)/logs_unit.html
@@ -1093,7 +1094,8 @@
 	  mv $(NETX_UNIT_TEST_DIR)/$$file  $(NETX_UNIT_TEST_DIR)/"$$file""$(EMMA_BACKUP_SUFFIX)" ; \
 	done ;\
 	class_names=`cat $(UNIT_CLASS_NAMES)` ; \
-	$(BOOT_DIR)/bin/java $(EMMA_JAVA_ARGS) -Xbootclasspath:$(RUNTIME) -cp $(EMMA_JAR) -Demma.report.html.out.encoding=UTF-8 emmarun \
+	CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(abs_top_builddir)/liveconnect/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):$(TEST_EXTENSIONS_DIR):.:$(TEST_EXTENSIONS_SRCDIR) ; \
+	$(BOOT_DIR)/bin/java $(EMMA_JAVA_ARGS) -Xbootclasspath/a:$(RUNTIME):$$CLASSPATH -cp $(EMMA_JAR) -Demma.report.html.out.encoding=UTF-8 emmarun \
 	 -Dreport.html.out.encoding=UTF-8 \
 	 -raw \
 	 -sp $(NETX_SRCDIR) \
@@ -1157,8 +1159,8 @@
 	  mv $(NETX_UNIT_TEST_DIR)/$$file  $(NETX_UNIT_TEST_DIR)/"$$file""$(EMMA_BACKUP_SUFFIX)" ; \
 	done ;\
 	class_names=`cat $(UNIT_CLASS_NAMES)` ; \
-	CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(abs_top_builddir)/liveconnect/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):$(TEST_EXTENSIONS_DIR):$(JACOCO_CLASSPATH):.:$(TEST_EXTENSIONS_SRCDIR):$(TAGSOUP_JAR)  \
-	  $(BOOT_DIR)/bin/java $(JACOCO_AGENT_SWITCH) -Xbootclasspath:$(RUNTIME)  CommandLine $$class_names ; \
+	CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(abs_top_builddir)/liveconnect/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):$(TEST_EXTENSIONS_DIR):$(JACOCO_CLASSPATH):.:$(TEST_EXTENSIONS_SRCDIR):$(TAGSOUP_JAR) ; \
+	  $(BOOT_DIR)/bin/java $(JACOCO_AGENT_SWITCH) -Xbootclasspath/a:$(RUNTIME):$$CLASSPATH  CommandLine $$class_names ; \
 	for file in $(EMMA_MODIFIED_FILES) ; do \
 	  mv $(NETX_UNIT_TEST_DIR)/$$file  $(NETX_UNIT_TEST_DIR)/"$$file""$(EMMA_SUFFIX)" ; \
 	  mv $(NETX_UNIT_TEST_DIR)/"$$file""$(EMMA_BACKUP_SUFFIX)"  $(NETX_UNIT_TEST_DIR)/$$file ; \
@@ -1214,10 +1216,11 @@
 	  done ; \
 	cd $(TEST_EXTENSIONS_DIR) ; \
 	class_names=`cat $(REPRODUCERS_CLASS_NAMES)` ; \
+	CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(abs_top_builddir)/liveconnect/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):$(TEST_EXTENSIONS_DIR):.:$(TEST_EXTENSIONS_SRCDIR) ; \
 	$(BOOT_DIR)/bin/java  \
 	 $(EMMA_JAVA_ARGS) \
 	  $(REPRODUCERS_DPARAMETERS) \
-	 -Xbootclasspath:$(RUNTIME) -cp $(EMMA_JAR) emmarun  \
+	 -Xbootclasspath/a:$(RUNTIME):$$CLASSPATH -cp $(EMMA_JAR) emmarun  \
 	   -raw \
 	   -cp $(NETX_DIR)/lib/classes.jar \
 	   -cp $(JUNIT_JAR) \
@@ -1331,9 +1334,9 @@
 	  done ; \
 	cd $(TEST_EXTENSIONS_DIR) ; \
 	class_names=`cat $(REPRODUCERS_CLASS_NAMES)` ; \
-	CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):.:$(TEST_EXTENSIONS_DIR):$(JACOCO_CLASSPATH):$(TEST_EXTENSIONS_TESTS_DIR):$(TEST_EXTENSIONS_SRCDIR) \
+	CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):.:$(TEST_EXTENSIONS_DIR):$(JACOCO_CLASSPATH):$(TEST_EXTENSIONS_TESTS_DIR):$(TEST_EXTENSIONS_SRCDIR) ; \
 	  $(BOOT_DIR)/bin/java $(JACOCO_AGENT_SWITCH) $(REPRODUCERS_DPARAMETERS) \
-	 -Xbootclasspath:$(RUNTIME) CommandLine $$class_names ; \
+	 -Xbootclasspath/a:$(RUNTIME):$$CLASSPATH CommandLine $$class_names ; \
 	if [ -f $(JACOCO_JAVAWS_RESULTS) ] ; then \
 	  jacoco_javaws_results=$(JACOCO_JAVAWS_RESULTS) ; \
 	  $(JACOCO_OPERATOR_EXEC) \
@@ -1440,16 +1443,16 @@
 run-test-server-on-44321: stamps/netx.stamp stamps/junit-jnlp-dist-dirs stamps/netx-dist-tests-import-cert-to-public \
  stamps/test-extensions-compile.stamp stamps/compile-reproducers-testcases.stamp $(JUNIT_RUNNER_JAR) stamps/copy-reproducers-resources.stamp
 	cd $(TEST_EXTENSIONS_DIR) ; \
-	CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):.:$(TEST_EXTENSIONS_TESTS_DIR) \
+	CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):.:$(TEST_EXTENSIONS_TESTS_DIR) ; \
 	  $(BOOT_DIR)/bin/java $(REPRODUCERS_DPARAMETERS) \
-	 -Xbootclasspath:$(RUNTIME) net.sourceforge.jnlp.ServerAccess 
+	 -Xbootclasspath/a:$(RUNTIME):$$CLASSPATH net.sourceforge.jnlp.ServerAccess
 
 run-test-server-on-random-port: stamps/netx.stamp stamps/junit-jnlp-dist-dirs stamps/netx-dist-tests-import-cert-to-public \
  stamps/test-extensions-compile.stamp stamps/compile-reproducers-testcases.stamp $(JUNIT_RUNNER_JAR) stamps/copy-reproducers-resources.stamp
 	cd $(TEST_EXTENSIONS_DIR) ; \
-	CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):.:$(TEST_EXTENSIONS_TESTS_DIR) \
+	CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):.:$(TEST_EXTENSIONS_TESTS_DIR) ; \
 	  $(BOOT_DIR)/bin/java $(REPRODUCERS_DPARAMETERS) \
-	 -Xbootclasspath:$(RUNTIME) net.sourceforge.jnlp.ServerAccess randomport
+	 -Xbootclasspath/a:$(RUNTIME):$$CLASSPATH net.sourceforge.jnlp.ServerAccess randomport 
 
 clean-netx-tests: clean-netx-unit-tests clean-junit-runner clean-netx-dist-tests clean-test-code-coverage-jacoco clean-test-code-coverage
 	if [ -e $(TESTS_DIR)/netx ]; then \
diff -r 02a18cce94c7 -r 0c7dcde1cfe0 acinclude.m4
--- a/acinclude.m4	Wed May 21 11:08:18 2014 -0400
+++ b/acinclude.m4	Thu May 22 18:30:41 2014 +0200
@@ -868,38 +868,29 @@
 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_DEFUN([IT_CHECK_FOR_SUN_APPLET_ACCESSIBILITY],[
 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, [
+AC_CACHE_CHECK([if selected classes, fields and methods from sun.applet are accessible via reflection], 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;
+import java.lang.reflect.*;
 
 public class TestAppletViewer
 {
-  public static void main(String[] args)
+  public static void main(String[] args) throws Exception
   {
-    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);
-      }
+   Class<?> ap = Class.forName("sun.applet.AppletPanel");
+   Class<?> avp = Class.forName("sun.applet.AppletViewerPanel");
+   Field f1 = ap.getDeclaredField("applet");
+   Field f2 = avp.getDeclaredField("documentURL");
+   Method m1 = ap.getDeclaredMethod("run");
+   Method m2 = ap.getDeclaredMethod("runLoader");
+   Field f3 = avp.getDeclaredField("baseURL");
   }
 }
 ]
@@ -908,21 +899,17 @@
   if $JAVA -classpath . $BYTECODE >&AS_MESSAGE_LOG_FD 2>&1; then
       it_cv_applet_hole=yes;
   else
-      it_cv_applet_hole=$?;
+      it_cv_applet_hole=no;
   fi
 else
-  it_cv_applet_hole=3;
+  it_cv_applet_hole=no;
 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.])
+if test x"${it_cv_applet_hole}" = "xno"; then
+   AC_MSG_ERROR([Some of the checked items is not avaiable. Check logs.])
 fi
 AC_PROVIDE([$0])dnl
 ])
diff -r 02a18cce94c7 -r 0c7dcde1cfe0 configure.ac
--- a/configure.ac	Wed May 21 11:08:18 2014 -0400
+++ b/configure.ac	Thu May 22 18:30:41 2014 +0200
@@ -86,7 +86,7 @@
 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_FOR_SUN_APPLET_ACCESSIBILITY
 IT_CHECK_GLIB_VERSION
 IT_CHECK_XULRUNNER_MIMEDESCRIPTION_CONSTCHAR
 IT_CHECK_XULRUNNER_REQUIRES_C11
diff -r 02a18cce94c7 -r 0c7dcde1cfe0 netx/net/sourceforge/jnlp/NetxPanel.java
--- a/netx/net/sourceforge/jnlp/NetxPanel.java	Wed May 21 11:08:18 2014 -0400
+++ b/netx/net/sourceforge/jnlp/NetxPanel.java	Thu May 22 18:30:41 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 at 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 02a18cce94c7 -r 0c7dcde1cfe0 netx/sun/applet/AppletViewerPanelAccess.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/netx/sun/applet/AppletViewerPanelAccess.java	Thu May 22 18:30:41 2014 +0200
@@ -0,0 +1,122 @@
+/* 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 {
+
+    public AppletViewerPanelAccess(URL documentURL, Hashtable<String, String> 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.
+     * upstream patch posted http://mail.openjdk.java.net/pipermail/awt-dev/2014-May/007828.html
+     */
+    private void superRunLoader() {
+        try {
+            Class klazz = AppletPanel.class;
+            Method runLoaderMethod = klazz.getDeclaredMethod("runLoader");
+            runLoaderMethod.setAccessible(true);
+            runLoaderMethod.invoke(getApplet());
+        } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException ex) {
+            throw new RuntimeException(ex);
+        }
+    }
+
+
+    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);
+        }
+
+    }
+    
+    @Override
+    //remaining stub of unpatched jdk
+    protected synchronized void createAppletThread() {
+        throw new RuntimeException("Not yet implemented");
+        //no need to call super, is overriden, and not used in  upstream
+        //AppletViewerPanel or AppletPanel
+    }
+
+    abstract protected void ourRunLoader();
+
+}
diff -r 02a18cce94c7 -r 0c7dcde1cfe0 netx/sun/applet/package-info.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/netx/sun/applet/package-info.java	Thu May 22 18:30:41 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


More information about the distro-pkg-dev mailing list