changeset 801:0c0add06bfb7

2008-04-07 Joshua Sumali <jsumali@redhat.com> * patches/icedtea-netx-plugin.patch: Removed reflection hunk. * rt/net/sourceforge/jnlp/Parser.java: Removed inner Node class to ... * rt/net/sourceforge/jnlp/Node.java: here, as a separate class.
author Joshua Sumali <jsumali@redhat.com>
date Mon, 07 Apr 2008 13:06:27 -0400
parents fddbd2aeed27
children ff3d152968b5
files ChangeLog patches/icedtea-netx-plugin.patch rt/net/sourceforge/jnlp/Node.java rt/net/sourceforge/jnlp/Parser.java
diffstat 4 files changed, 166 insertions(+), 166 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Apr 07 09:39:14 2008 -0400
+++ b/ChangeLog	Mon Apr 07 13:06:27 2008 -0400
@@ -1,3 +1,9 @@
+2008-04-07  Joshua Sumali  <jsumali@redhat.com>
+
+	* patches/icedtea-netx-plugin.patch: Removed reflection hunk.
+	* rt/net/sourceforge/jnlp/Parser.java: Removed inner Node class to ...
+	* rt/net/sourceforge/jnlp/Node.java: here, as a separate class.
+
 2008-04-07  Gary Benson  <gbenson@redhat.com>
 
 	* acinclude.m4 (ENABLE_ZERO_BUILD): Added sparc and sparc64.
--- a/patches/icedtea-netx-plugin.patch	Mon Apr 07 09:39:14 2008 -0400
+++ b/patches/icedtea-netx-plugin.patch	Mon Apr 07 13:06:27 2008 -0400
@@ -1,16 +1,14 @@
-diff -u openjdk.orig/jdk/src/share/classes/sun/applet/PluginAppletViewer.java openjdk/jdk/src/share/classes/sun/applet/PluginAppletViewer.java
---- openjdk.orig/jdk/src/share/classes/sun/applet/PluginAppletViewer.java	2008-02-27 08:45:37.000000000 -0500
-+++ openjdk/jdk/src/share/classes/sun/applet/PluginAppletViewer.java	2008-02-27 08:51:14.000000000 -0500
-@@ -40,6 +40,8 @@
- import java.security.PrivilegedAction;
- import java.lang.reflect.InvocationTargetException;
- import java.lang.reflect.Method;
-+import java.lang.reflect.Constructor;
-+import java.lang.ClassNotFoundException;
- import sun.awt.SunToolkit;
+--- openjdk/jdk/src/share/classes/sun/applet/PluginAppletViewer.java.orig	2008-04-07 11:31:28.000000000 -0400
++++ openjdk/jdk/src/share/classes/sun/applet/PluginAppletViewer.java	2008-04-07 11:30:52.000000000 -0400
+@@ -44,6 +44,7 @@
  import sun.awt.AppContext;
  import sun.awt.X11.*;
-@@ -97,14 +99,33 @@
+ import java.lang.ref.WeakReference;
++import net.sourceforge.jnlp.NetxPanel;
+ 
+ /**
+  * Lets us construct one using unix-style one shot behaviors
+@@ -97,14 +98,21 @@
      /**
       * Create the applet viewer
       */
@@ -24,22 +22,10 @@
  	this.statusMsgStream = statusMsgStream;
  
 -	add("Center", panel = new AppletViewerPanel(doc, atts));
-+	try
-+	{
-+		Class c = Thread.currentThread().getContextClassLoader().loadClass("net.sourceforge.jnlp.NetxPanel");
-+		Class[] constructClasses = new Class[] {doc.getClass(), atts.getClass()};
-+		Constructor constructor = c.getConstructor(constructClasses);
-+		Object[] constructArgs = new Object[] {doc, atts};
-+		panel = (AppletViewerPanel) constructor.newInstance(constructArgs);
-+		AppletViewerPanel.debug("Using Netx panel");
-+	}
-+	catch (ClassNotFoundException ex)
-+	{
-+		AppletViewerPanel.debug("Netx Panel not found - using AppletViewerPanel", ex);
-+		panel = new AppletViewerPanel(doc, atts);
-+	}
-+	catch (Exception ex)
-+	{
++	try {
++		panel = new NetxPanel(doc, atts);
++		AppletViewerPanel.debug("Using NetX panel");
++	} catch (Exception ex) {
 +		AppletViewerPanel.debug("Unable to start NetX applet - defaulting to Sun applet", ex);
 +		panel = new AppletViewerPanel(doc, atts);
 +	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rt/net/sourceforge/jnlp/Node.java	Mon Apr 07 13:06:27 2008 -0400
@@ -0,0 +1,147 @@
+package net.sourceforge.jnlp;
+
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
+
+import net.sourceforge.nanoxml.XMLElement;
+
+// this class makes assumptions on how parser calls methods (such
+// as getFirstChild->getNextChild only called by a single loop at
+// a time, so no need for an iterator).
+
+/**
+ * This class converts the NanoXML's XMLElement nodes into the
+ * regular XML Node interface (for the methods used by Parser).
+ */
+/* NANO */
+class Node {
+    private XMLElement xml;
+    private Node next;
+    private Node children[];
+
+    Node(XMLElement xml) {
+        this.xml = xml;
+    }
+
+    Node getFirstChild() {
+        if (children == null)
+            getChildNodes();
+
+        if (children.length == 0)
+            return null;
+        else
+            return children[0];
+    }
+
+    Node getNextSibling() {
+        return next;
+    }
+
+    void normalize() {
+    }
+
+    String getNodeValue() {
+        return xml.getContent();
+    }
+
+    Node[] getChildNodes() {
+        if (children == null) {
+            List list = new ArrayList();
+
+            for (Enumeration e = xml.enumerateChildren(); e.hasMoreElements();)
+                list.add( new Node((XMLElement)e.nextElement()) );
+
+            children = (Node[]) list.toArray( new Node[list.size()] );
+
+            for (int i=0; i < children.length-1; i++)
+                children[i].next = children[i+1];
+        }
+
+        return children;
+    }
+
+    String getAttribute(String name) {
+        return (String)xml.getAttribute(name);
+    }
+
+    String getNodeName() {
+        if (xml.getName() == null)
+            return "";
+        else
+            return xml.getName();
+    }
+
+    public String toString() {
+        return getNodeName();
+    }
+}
+
+/**
+ * This class converts the TinyXML's ParsedXML nodes into the
+ * regular XML Node interface (for the methods used by Parser).
+ */
+/* TINY 
+class Node {
+    private ParsedXML tinyNode;
+    private Node next;
+    private Node children[];
+
+    Node(ParsedXML tinyNode) {
+        this.tinyNode = tinyNode;
+    }
+
+    Node getFirstChild() {
+        if (children == null)
+            getChildNodes();
+
+        if (children.length == 0)
+            return null;
+        else
+            return children[0];
+    }
+
+    Node getNextSibling() {
+        return next;
+    }
+
+    void normalize() {
+    }
+
+    String getNodeValue() {
+        return tinyNode.getContent();
+    }
+
+    Node[] getChildNodes() {
+        if (children == null) {
+            List list = new ArrayList();
+
+            for (Enumeration e = tinyNode.elements(); e.hasMoreElements();) {
+                list.add( new Node((ParsedXML)e.nextElement()) );
+            }
+            children = (Node[]) list.toArray( new Node[list.size()] );
+
+            for (int i=0; i < children.length-1; i++)
+                children[i].next = children[i+1];
+        }
+
+        return children;
+    }
+
+    String getAttribute(String name) {
+        return tinyNode.getAttribute(name);
+    }
+
+    String getNodeName() {
+        if (tinyNode.getName() == null)
+            return "";
+        else
+            return tinyNode.getName();
+    }
+
+    public String toString() {
+        return getNodeName();
+    }
+}
+*/
+
--- a/rt/net/sourceforge/jnlp/Parser.java	Mon Apr 07 09:39:14 2008 -0400
+++ b/rt/net/sourceforge/jnlp/Parser.java	Mon Apr 07 13:06:27 2008 -0400
@@ -959,143 +959,4 @@
 
 }
 
-// this class makes assumptions on how parser calls methods (such
-// as getFirstChild->getNextChild only called by a single loop at
-// a time, so no need for an iterator).
 
-/**
- * This class converts the NanoXML's XMLElement nodes into the
- * regular XML Node interface (for the methods used by Parser).
- */
-/* NANO */
-class Node {
-    private XMLElement xml;
-    private Node next;
-    private Node children[];
-
-    Node(XMLElement xml) {
-        this.xml = xml;
-    }
-
-    Node getFirstChild() {
-        if (children == null)
-            getChildNodes();
-
-        if (children.length == 0)
-            return null;
-        else
-            return children[0];
-    }
-
-    Node getNextSibling() {
-        return next;
-    }
-
-    void normalize() {
-    }
-
-    String getNodeValue() {
-        return xml.getContent();
-    }
-
-    Node[] getChildNodes() {
-        if (children == null) {
-            List list = new ArrayList();
-
-            for (Enumeration e = xml.enumerateChildren(); e.hasMoreElements();)
-                list.add( new Node((XMLElement)e.nextElement()) );
-
-            children = (Node[]) list.toArray( new Node[list.size()] );
-
-            for (int i=0; i < children.length-1; i++)
-                children[i].next = children[i+1];
-        }
-
-        return children;
-    }
-
-    String getAttribute(String name) {
-        return (String)xml.getAttribute(name);
-    }
-
-    String getNodeName() {
-        if (xml.getName() == null)
-            return "";
-        else
-            return xml.getName();
-    }
-
-    public String toString() {
-        return getNodeName();
-    }
-}
-
-/**
- * This class converts the TinyXML's ParsedXML nodes into the
- * regular XML Node interface (for the methods used by Parser).
- */
-/* TINY 
-class Node {
-    private ParsedXML tinyNode;
-    private Node next;
-    private Node children[];
-
-    Node(ParsedXML tinyNode) {
-        this.tinyNode = tinyNode;
-    }
-
-    Node getFirstChild() {
-        if (children == null)
-            getChildNodes();
-
-        if (children.length == 0)
-            return null;
-        else
-            return children[0];
-    }
-
-    Node getNextSibling() {
-        return next;
-    }
-
-    void normalize() {
-    }
-
-    String getNodeValue() {
-        return tinyNode.getContent();
-    }
-
-    Node[] getChildNodes() {
-        if (children == null) {
-            List list = new ArrayList();
-
-            for (Enumeration e = tinyNode.elements(); e.hasMoreElements();) {
-                list.add( new Node((ParsedXML)e.nextElement()) );
-            }
-            children = (Node[]) list.toArray( new Node[list.size()] );
-
-            for (int i=0; i < children.length-1; i++)
-                children[i].next = children[i+1];
-        }
-
-        return children;
-    }
-
-    String getAttribute(String name) {
-        return tinyNode.getAttribute(name);
-    }
-
-    String getNodeName() {
-        if (tinyNode.getName() == null)
-            return "";
-        else
-            return tinyNode.getName();
-    }
-
-    public String toString() {
-        return getNodeName();
-    }
-}
-*/
-
-