rpms/java-1.6.0-openjdk/F-10 java-1.6.0-openjdk-plugin-1217.patch, NONE, 1.1 java-1.6.0-openjdk.spec, 1.90, 1.91

Lillian Angel langel at fedoraproject.org
Fri Nov 21 21:13:25 UTC 2008


Author: langel

Update of /cvs/pkgs/rpms/java-1.6.0-openjdk/F-10
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv20552

Modified Files:
	java-1.6.0-openjdk.spec 
Added Files:
	java-1.6.0-openjdk-plugin-1217.patch 
Log Message:
* Fri Nov 21 2008 Lillian Angel <langel at redhat.com> - 1:1.6.0-5.b12
- Added plugin patch to resolve issues on 64-bit.
- Resolves: rhbz#471987
- Resolves: rhbz#465531
- Resolves: rhbz#470551

* Thu Nov 20 2008 Lillian Angel <langel at redhat.com> - 1:1.6.0-5.b12
- Redirect error from removing gcjwebplugin link.
- Resolves: rhbz#471568



java-1.6.0-openjdk-plugin-1217.patch:

--- NEW FILE java-1.6.0-openjdk-plugin-1217.patch ---
diff -up ./IcedTeaPlugin.cc.sav ./IcedTeaPlugin.cc
--- ./IcedTeaPlugin.cc.sav	2008-11-21 15:43:18.000000000 -0500
+++ ./IcedTeaPlugin.cc	2008-11-21 15:43:32.000000000 -0500
@@ -194,6 +194,7 @@ inline suseconds_t get_time_in_ms()
 	return tv.tv_usec;
 }
 
+
 inline long get_time_in_s()
 {
 	time_t t;
@@ -342,15 +343,12 @@ static gboolean plugin_in_pipe_callback 
 #include <queue>
 #include <nsCOMPtr.h>
 #include <nsIThread.h>
+#include <nspr.h>
 
 PRMonitor *jvmMsgQueuePRMonitor;
 std::queue<nsCString> jvmMsgQueue;
 nsCOMPtr<nsIThread> processThread;
 
-#include <nspr.h>
-
-#include <prtypes.h>
-
 // IcedTeaJNIEnv helpers.
 class JNIReference
 {
@@ -700,9 +698,10 @@ char const* TYPES[10] = { "Object",
 //   printf ("RECEIVE_BOOLEAN: %s result: %x = %s\n",              \
 //           __func__, result, *result ? "true" : "false");
 
-#include <nscore.h>
 #include <nsISupports.h>
 #include <nsIFactory.h>
+#include <nscore.h>
+#include <prtypes.h>
 
 // Factory functions.
 extern "C" NS_EXPORT nsresult NSGetFactory (nsISupports* aServMgr,
@@ -901,7 +900,33 @@ ResultContainer::stop_timer()
 #include <nsILiveconnect.h>
 #include <nsICollection.h>
 #include <nsIProcess.h>
-#include <map>
+
+#ifndef __STDC_FORMAT_MACROS
+# define __STDC_FORMAT_MACROS
+#endif
+
+#include <inttypes.h>
+
+inline void js_id_to_string(char** str, PLUGIN_JAVASCRIPT_TYPE jsid)
+{
+	if (sizeof(PLUGIN_JAVASCRIPT_TYPE) == 4)
+		sprintf(*str, "%"PRId32, jsid);
+
+	if (sizeof(PLUGIN_JAVASCRIPT_TYPE) == 8)
+		sprintf(*str, "%"PRId64, jsid);
+}
+
+inline PLUGIN_JAVASCRIPT_TYPE string_to_js_id(nsCString str)
+{
+	if (sizeof(PLUGIN_JAVASCRIPT_TYPE) == sizeof(int))
+		return atoi(str.get());
+
+	if (sizeof(PLUGIN_JAVASCRIPT_TYPE) == sizeof(long))
+		return atol(str.get());
+
+	if (sizeof(PLUGIN_JAVASCRIPT_TYPE) == sizeof(long long))
+		return atoll(str.get());
+}
 
 class IcedTeaJNIEnv;
 
@@ -988,7 +1013,7 @@ private:
   PRUint32 next_instance_identifier;
   PRUint32 object_identifier_return;
   PRUint32 instance_count;
-  int javascript_identifier;
+  PLUGIN_JAVASCRIPT_TYPE javascript_identifier;
   int name_identifier;
   int args_identifier;
   int string_identifier;
@@ -1334,7 +1359,6 @@ private:
 #include <nsPIPluginInstancePeer.h>
 #include <nsIPluginInstanceOwner.h>
 #include <nsIRunnable.h>
-#include <iostream>
 
 class IcedTeaRunnable : public nsIRunnable
 {
@@ -2310,10 +2334,28 @@ IcedTeaPluginInstance::Initialize (nsIPl
   tagMessage += appletTag;
   tagMessage += "</embed>";
 
-  // remove newline characters from the message
-  tagMessage.StripChars("\r\n");
+  PLUGIN_DEBUG_1ARG("TAG FROM BROWSER = %s\n", tagMessage.get());
+
+  // encode newline characters in the message
+  nsCString toSend("");
+  for (int i=0; i < tagMessage.Length(); i++)
+  {
+	  if (tagMessage.get()[i] == '\r')
+	  {
+		  toSend += "
";
+		  continue;
+	  }
+
+	  if (tagMessage.get()[i] == '\n')
+	  {
+		  toSend += "
";
+		  continue;
+	  }
+
+	  toSend += tagMessage.get()[i];
+  }
 
-  factory->SendMessageToAppletViewer (tagMessage);
+  factory->SendMessageToAppletViewer (toSend);
 
   // Set back-pointer to peer instance.
   PLUGIN_DEBUG_1ARG ("SETTING PEER!!!: %p\n", aPeer);
@@ -2894,8 +2936,8 @@ IcedTeaPluginFactory::HandleMessage (nsC
           PLUGIN_DEBUG_0ARG ("POSTING GetMember\n");
           space = rest.FindChar (' ');
           nsDependentCSubstring javascriptID = Substring (rest, 0, space);
-          javascript_identifier = javascriptID.ToInteger (&conversionResult);
-          PLUGIN_CHECK ("parse javascript id", conversionResult);
+          javascript_identifier = string_to_js_id ((nsCString) javascriptID);
+          PLUGIN_DEBUG_1ARG ("parse javascript id %ld\n", javascript_identifier);
           nsDependentCSubstring nameID = Substring (rest, space + 1);
           name_identifier = nameID.ToInteger (&conversionResult);
           PLUGIN_CHECK ("parse name id", conversionResult);
@@ -2912,8 +2954,8 @@ IcedTeaPluginFactory::HandleMessage (nsC
           PLUGIN_DEBUG_0ARG ("POSTING SetMember\n");
           space = rest.FindChar (' ');
           nsDependentCSubstring javascriptID = Substring (rest, 0, space);
-          javascript_identifier = javascriptID.ToInteger (&conversionResult);
-          PLUGIN_CHECK ("parse javascript id", conversionResult);
+          javascript_identifier = string_to_js_id ((nsCString) javascriptID);
+          PLUGIN_DEBUG_1ARG ("parse javascript id %ld\n", javascript_identifier);
           nsDependentCSubstring nameAndValue = Substring (rest, space + 1);
           space = nameAndValue.FindChar (' ');
           nsDependentCSubstring nameID = Substring (nameAndValue, 0, space);
@@ -2936,8 +2978,8 @@ IcedTeaPluginFactory::HandleMessage (nsC
           PLUGIN_DEBUG_0ARG ("POSTING GetSlot\n");
           space = rest.FindChar (' ');
           nsDependentCSubstring javascriptID = Substring (rest, 0, space);
-          javascript_identifier = javascriptID.ToInteger (&conversionResult);
-          PLUGIN_CHECK ("parse javascript id", conversionResult);
+          javascript_identifier = string_to_js_id ((nsCString) javascriptID);
+          PLUGIN_DEBUG_1ARG ("parse javascript id %ld\n", javascript_identifier);
           nsDependentCSubstring indexStr = Substring (rest, space + 1);
           slot_index = indexStr.ToInteger (&conversionResult);
           PLUGIN_CHECK ("parse name id", conversionResult);
@@ -2954,8 +2996,8 @@ IcedTeaPluginFactory::HandleMessage (nsC
           PLUGIN_DEBUG_0ARG ("POSTING SetSlot\n");
           space = rest.FindChar (' ');
           nsDependentCSubstring javascriptID = Substring (rest, 0, space);
-          javascript_identifier = javascriptID.ToInteger (&conversionResult);
-          PLUGIN_CHECK ("parse javascript id", conversionResult);
+          javascript_identifier = string_to_js_id ((nsCString) javascriptID);
+          PLUGIN_DEBUG_1ARG ("parse javascript id %ld\n", javascript_identifier);
           nsDependentCSubstring nameAndValue = Substring (rest, space + 1);
           space = nameAndValue.FindChar (' ');
           nsDependentCSubstring indexStr = Substring (nameAndValue, 0, space);
@@ -2977,8 +3019,8 @@ IcedTeaPluginFactory::HandleMessage (nsC
           PLUGIN_DEBUG_0ARG ("POSTING Eval\n");
           space = rest.FindChar (' ');
           nsDependentCSubstring javascriptID = Substring (rest, 0, space);
-          javascript_identifier = javascriptID.ToInteger (&conversionResult);
-          PLUGIN_CHECK ("parse javascript id", conversionResult);
+          javascript_identifier = string_to_js_id ((nsCString) javascriptID);
+          PLUGIN_DEBUG_1ARG ("parse javascript id %ld\n", javascript_identifier);
           nsDependentCSubstring stringID = Substring (rest, space + 1);
           string_identifier = stringID.ToInteger (&conversionResult);
           PLUGIN_CHECK ("parse string id", conversionResult);
@@ -2995,8 +3037,8 @@ IcedTeaPluginFactory::HandleMessage (nsC
           PLUGIN_DEBUG_0ARG ("POSTING RemoveMember\n");
           space = rest.FindChar (' ');
           nsDependentCSubstring javascriptID = Substring (rest, 0, space);
-          javascript_identifier = javascriptID.ToInteger (&conversionResult);
-          PLUGIN_CHECK ("parse javascript id", conversionResult);
+          javascript_identifier = string_to_js_id ((nsCString) javascriptID);
+          PLUGIN_DEBUG_1ARG ("parse javascript id %ld\n", javascript_identifier);
           nsDependentCSubstring nameID = Substring (rest, space + 1);
           name_identifier = nameID.ToInteger (&conversionResult);
           PLUGIN_CHECK ("parse name id", conversionResult);
@@ -3013,8 +3055,8 @@ IcedTeaPluginFactory::HandleMessage (nsC
           PLUGIN_DEBUG_0ARG ("POSTING Call\n");
           space = rest.FindChar (' ');
           nsDependentCSubstring javascriptID = Substring (rest, 0, space);
-          javascript_identifier = javascriptID.ToInteger (&conversionResult);
-          PLUGIN_CHECK ("parse javascript id", conversionResult);
+          javascript_identifier = string_to_js_id ((nsCString) javascriptID);
+          PLUGIN_DEBUG_1ARG ("parse javascript id %ld\n", javascript_identifier);
           nsDependentCSubstring nameAndArgs = Substring (rest, space + 1);
           space = nameAndArgs.FindChar (' ');
           nsDependentCSubstring nameID = Substring (nameAndArgs, 0, space);
@@ -3034,9 +3076,8 @@ IcedTeaPluginFactory::HandleMessage (nsC
       else if (command == "Finalize")
         {
           PLUGIN_DEBUG_0ARG ("POSTING Finalize\n");
-          nsDependentCSubstring javascriptID = Substring (rest, 0, space);
-          javascript_identifier = rest.ToInteger (&conversionResult);
-          PLUGIN_CHECK ("parse javascript id", conversionResult);
+          javascript_identifier = string_to_js_id ((nsCString) rest);
+          PLUGIN_DEBUG_1ARG ("parse javascript id %ld\n", javascript_identifier);
 
           nsCOMPtr<nsIRunnable> event =
             new IcedTeaRunnableMethod<IcedTeaPluginFactory>
@@ -3048,8 +3089,8 @@ IcedTeaPluginFactory::HandleMessage (nsC
       else if (command == "ToString")
         {
           PLUGIN_DEBUG_0ARG ("POSTING ToString\n");
-          javascript_identifier = rest.ToInteger (&conversionResult);
-          PLUGIN_CHECK ("parse javascript id", conversionResult);
+          javascript_identifier = string_to_js_id ((nsCString) rest);
+          PLUGIN_DEBUG_1ARG ("parse javascript id %ld\n", javascript_identifier);
 
           nsCOMPtr<nsIRunnable> event =
             new IcedTeaRunnableMethod<IcedTeaPluginFactory>
@@ -3878,18 +3919,24 @@ IcedTeaPluginInstance::GetWindow ()
                                                NULL, 0, NULL,
                                                &liveconnect_window);
       PLUGIN_CHECK ("get window", result);
-      PLUGIN_DEBUG_1ARG ("HERE 24: %d\n", liveconnect_window);
+      PLUGIN_DEBUG_1ARG ("HERE 24: %ld\n", liveconnect_window);
     }
 
-  PLUGIN_DEBUG_1ARG ("HERE 20: %d\n", liveconnect_window);
+  PLUGIN_DEBUG_1ARG ("HERE 20: %ld\n", liveconnect_window);
+
+  char *windowAddr;
+  windowAddr = (char*) malloc(20*sizeof(char));
+  js_id_to_string(&windowAddr, liveconnect_window);
 
   nsCString message ("context ");
   message.AppendInt (0);
   message += " ";
   message += "JavaScriptGetWindow";
   message += " ";
-  message.AppendInt ((PRUintn) liveconnect_window);
+  message += windowAddr;
   factory->SendMessageToAppletViewer (message);
+
+  free(windowAddr);
 }
 
 IcedTeaPluginInstance::~IcedTeaPluginInstance ()
@@ -4392,7 +4439,6 @@ NS_IMPL_ISUPPORTS1 (IcedTeaJNIEnv, nsISe
 #include <nsITransport.h>
 #include <nsNetCID.h>
 #include <nsServiceManagerUtils.h>
-#include <iostream>
 #include <nsIPrincipal.h>
 #include <nsIScriptSecurityManager.h>
 #include <nsIURI.h>
@@ -4610,7 +4656,7 @@ IcedTeaJNIEnv::ValueString (jni_type typ
       retstr.AppendInt (value.i);
       break;
     case jlong_type:
-      retstr.AppendInt ((PRUintn) value.j);
+      retstr += IcedTeaPrintfCString ("%ld", value.j);
       break;
     case jfloat_type:
       retstr += IcedTeaPrintfCString ("%f", value.f);
@@ -4739,7 +4785,7 @@ IcedTeaJNIEnv::ExpandArgs (JNIID* id, jv
           retstr.AppendInt (args[arg].i);
           break;
         case 'J':
-          retstr.AppendInt ((PRUintn) args[arg].j);
+          retstr += IcedTeaPrintfCString ("%ld", args[arg].j);
           break;
         case 'F':
           retstr += IcedTeaPrintfCString ("%f", args[arg].f);
diff -up ./plugin/icedtea/netscape/javascript/JSObject.java.sav ./plugin/icedtea/netscape/javascript/JSObject.java
--- ./plugin/icedtea/netscape/javascript/JSObject.java.sav	2008-10-24 14:19:00.000000000 -0400
+++ ./plugin/icedtea/netscape/javascript/JSObject.java	2008-11-21 15:44:20.000000000 -0500
@@ -86,8 +86,7 @@ import sun.applet.PluginDebug;
  */
 public final class JSObject {
     /* the internal object data */
-    private int                               internal;
-    private long                              long_internal;
+    private long                              internal;
 
     /**
      * initialize
@@ -111,7 +110,7 @@ public final class JSObject {
 
     public JSObject(long jsobj_addr) {
         PluginDebug.debug ("JSObject long CONSTRUCTOR");
-        long_internal = jsobj_addr;
+        internal = jsobj_addr;
     }
 
     /**
@@ -231,7 +230,7 @@ public final class JSObject {
     {
         PluginDebug.debug("JSObject.getWindow");
         // FIXME: handle long case as well.
-        int internal = 0;
+        long internal = 0;
         internal = ((PluginAppletViewer)
                     applet.getAppletContext()).getWindow();
         PluginDebug.debug ("GOT IT: " + internal);
diff -up ./plugin/icedtea/sun/applet/GetWindowPluginCallRequest.java.sav ./plugin/icedtea/sun/applet/GetWindowPluginCallRequest.java
--- ./plugin/icedtea/sun/applet/GetWindowPluginCallRequest.java.sav	2008-10-17 08:32:38.000000000 -0400
+++ ./plugin/icedtea/sun/applet/GetWindowPluginCallRequest.java	2008-11-21 15:44:14.000000000 -0500
@@ -44,7 +44,7 @@ import java.security.ProtectionDomain;
 
 public class GetWindowPluginCallRequest extends PluginCallRequest {
     // FIXME: look into int vs long JavaScript internal values.
-    int internal;
+    long internal;
 
     public GetWindowPluginCallRequest(String message, String returnString) {
         super(message, returnString);
@@ -55,7 +55,7 @@ public class GetWindowPluginCallRequest 
         String[] args = message.split(" ");
         // FIXME: add thread ID to messages to support multiple
         // threads using the netscape.javascript package.
-        internal = Integer.parseInt(args[1]);
+        internal = Long.parseLong(args[1]);
         setDone(true);
     }
     
@@ -69,7 +69,7 @@ public class GetWindowPluginCallRequest 
     	return message.contains("JavaScriptGetWindow");
     }
 
-    public Integer getObject() {
+    public Long getObject() {
     	return this.internal;
     }
 }
diff -up ./plugin/icedtea/sun/applet/PluginAppletSecurityContext.java.sav ./plugin/icedtea/sun/applet/PluginAppletSecurityContext.java
--- ./plugin/icedtea/sun/applet/PluginAppletSecurityContext.java.sav	2008-10-27 15:36:31.000000000 -0400
+++ ./plugin/icedtea/sun/applet/PluginAppletSecurityContext.java	2008-11-21 15:44:14.000000000 -0500
@@ -996,7 +996,7 @@ public class PluginAppletSecurityContext
 
 		String classSrc = this.classLoaders.get(target.getClassLoader());
 
-		PluginDebug.debug("jsSrc=" + jsSrc + " classSrc=" + classSrc);
+		PluginDebug.debug("target = " + target + " jsSrc=" + jsSrc + " classSrc=" + classSrc);
 		
 		// if src is not a file and class loader does not map to the same base, UniversalBrowserRead (BrowserReadPermission) must be set
 		if (jsSrc != "file://" && !classSrc.equals(jsSrc)) {
diff -up ./plugin/icedtea/sun/applet/PluginAppletViewer.java.sav ./plugin/icedtea/sun/applet/PluginAppletViewer.java
--- ./plugin/icedtea/sun/applet/PluginAppletViewer.java.sav	2008-11-05 14:37:49.000000000 -0500
+++ ./plugin/icedtea/sun/applet/PluginAppletViewer.java	2008-11-21 15:44:14.000000000 -0500
@@ -63,6 +63,7 @@ import java.util.Vector;
 import javax.swing.SwingUtilities;
 
 import net.sourceforge.jnlp.NetxPanel;
+import net.sourceforge.jnlp.runtime.JNLPClassLoader;
 import sun.awt.AppContext;
 import sun.awt.SunToolkit;
 import sun.awt.X11.XEmbeddedFrame;
@@ -103,7 +104,7 @@ import sun.misc.Ref;
       * Some constants...
       */
      private static String defaultSaveFile = "Applet.ser";
- 
+     
      /**
       * The panel in which the applet is being displayed.
       */
@@ -168,7 +169,7 @@ import sun.misc.Ref;
         	 proposedHeightFactor = (Integer) atts.get("heightPercentage")/100.0;
          }
          
-         if (((String) atts.get("width")).endsWith("%")) {
+         if (atts.get("widthPercentage") != null) {
         	 proposedWidthFactor = (Integer) atts.get("widthPercentage")/100.0;
          }
  
@@ -177,6 +178,7 @@ import sun.misc.Ref;
             	 	try {
             	 		panel = new NetxPanel(doc, atts, true);
             	 		AppletViewerPanel.debug("Using NetX panel");
+            	 		PluginDebug.debug(atts.toString());
             	 	} catch (Exception ex) {
             	 		AppletViewerPanel.debug("Unable to start NetX applet - defaulting to Sun applet", ex);
             	 		panel = new AppletViewerPanel(doc, atts);
@@ -291,7 +293,7 @@ import sun.misc.Ref;
 
     if (atts.get("codebase") != null) {
     	try {
-    		URL appletSrcURL = new URL((String) atts.get("codebase"));
+    		URL appletSrcURL = new URL(codeBase + (String) atts.get("codebase"));
     		codeBase = appletSrcURL.getProtocol() + "://" + appletSrcURL.getHost();
     	} catch (MalformedURLException mfue) {
     		// do nothing
@@ -587,7 +589,7 @@ import sun.misc.Ref;
  	return getCachedImage(url);
      }
  
-     static Image getCachedImage(URL url) {
+     private Image getCachedImage(URL url) {
  	// System.getSecurityManager().checkConnection(url.getHost(), url.getPort());
  	return (Image)getCachedImageRef(url).get();
      }
@@ -595,15 +597,43 @@ import sun.misc.Ref;
      /**
       * Get an image ref.
       */
-     static Ref getCachedImageRef(URL url) {
- 	synchronized (imageRefs) {
- 	    AppletImageRef ref = (AppletImageRef)imageRefs.get(url);
- 	    if (ref == null) {
- 		ref = new AppletImageRef(url);
- 		imageRefs.put(url, ref);
- 	    }
- 	    return ref;
- 	}
+     private synchronized Ref getCachedImageRef(URL url) {
+         PluginDebug.debug("getCachedImageRef() searching for " + url);
+         
+         try {
+
+             String originalURL = url.toString();
+             String codeBase = panel.getCodeBase().toString();
+
+             if (originalURL.startsWith(codeBase)) {
+
+                 PluginDebug.debug("getCachedImageRef() got URL = " + url);
+                 PluginDebug.debug("getCachedImageRef() plugin codebase = " + codeBase);
+
+                 // try to fetch it locally
+                 if (panel instanceof NetxPanel) {
+                     URL localURL = null;
+                     localURL = ((NetxPanel) panel).getAppletClassLoader().getResource(originalURL.substring(codeBase.length()));
+
+                     url = localURL != null ? localURL : url;
+                 }
+             }
+
+             PluginDebug.debug("getCachedImageRef() getting img from URL = " + url);
+
+             synchronized (imageRefs) {
+                 AppletImageRef ref = (AppletImageRef)imageRefs.get(url);
+                 if (ref == null) {
+                     ref = new AppletImageRef(url);
+                     imageRefs.put(url, ref);
+                 }
+                 return ref;
+             }
+         } catch (Exception e) {
+             System.err.println("Error occurred wgen trying to fetch image:");
+             e.printStackTrace();
+             return null;
+         }
      }
  
      /**
@@ -703,7 +733,7 @@ import sun.misc.Ref;
  	}
      }
  
-     public int getWindow() {
+     public long getWindow() {
     	 PluginDebug.debug ("STARTING getWindow");
     	 PluginCallRequest request = requestFactory.getPluginCallRequest("window",
     			 							"instance " + identifier + " " + "GetWindow", 
@@ -716,7 +746,7 @@ import sun.misc.Ref;
     		 PluginDebug.debug ("wait request 1");
     		 synchronized(request) {
     			 PluginDebug.debug ("wait request 2");
-    			 while ((Integer) request.getObject() == 0)
+    			 while ((Long) request.getObject() == 0)
     				 request.wait();
     			 PluginDebug.debug ("wait request 3");
     		 }
@@ -726,11 +756,11 @@ import sun.misc.Ref;
     	 }
 
     	 PluginDebug.debug ("STARTING getWindow DONE");
-    	 return (Integer) request.getObject();
+    	 return (Long) request.getObject();
      }
  
      // FIXME: make private, access via reflection.
-     public static Object getMember(int internal, String name)
+     public static Object getMember(long internal, String name)
      {
     	 AppletSecurityContextManager.getSecurityContext(0).store(name);
          int nameID = AppletSecurityContextManager.getSecurityContext(0).getIdentifier(name);
@@ -757,7 +787,7 @@ import sun.misc.Ref;
          return request.getObject();
      }
  
-     public static void setMember(int internal, String name, Object value) {
+     public static void setMember(long internal, String name, Object value) {
     	 AppletSecurityContextManager.getSecurityContext(0).store(name);
          int nameID = AppletSecurityContextManager.getSecurityContext(0).getIdentifier(name);
          AppletSecurityContextManager.getSecurityContext(0).store(value);
@@ -786,7 +816,7 @@ import sun.misc.Ref;
      }
  
      // FIXME: handle long index as well.
-     public static void setSlot(int internal, int index, Object value) {
+     public static void setSlot(long internal, int index, Object value) {
     	 AppletSecurityContextManager.getSecurityContext(0).store(value);
          int valueID = AppletSecurityContextManager.getSecurityContext(0).getIdentifier(value);
  
@@ -811,7 +841,7 @@ import sun.misc.Ref;
          PluginDebug.debug (" setSlot DONE");
      }
  
-     public static Object getSlot(int internal, int index)
+     public static Object getSlot(long internal, int index)
      {
          // Prefix with dummy instance for convenience.
          PluginCallRequest request = requestFactory.getPluginCallRequest("member", 
@@ -835,7 +865,7 @@ import sun.misc.Ref;
          return request.getObject();
      }
  
-     public static Object eval(int internal, String s)
+     public static Object eval(long internal, String s)
      {
     	 AppletSecurityContextManager.getSecurityContext(0).store(s);
          int stringID = AppletSecurityContextManager.getSecurityContext(0).getIdentifier(s);
@@ -862,7 +892,7 @@ import sun.misc.Ref;
          return request.getObject();
      }
  
-     public static void removeMember (int internal, String name) {
+     public static void removeMember (long internal, String name) {
     	 AppletSecurityContextManager.getSecurityContext(0).store(name);
          int nameID = AppletSecurityContextManager.getSecurityContext(0).getIdentifier(name);
  
@@ -887,7 +917,7 @@ import sun.misc.Ref;
          PluginDebug.debug (" RemoveMember DONE");
      }
  
-     public static Object call(int internal, String name, Object args[])
+     public static Object call(long internal, String name, Object args[])
      {
          // FIXME: when is this removed from the object store?
          // FIXME: reference should return the ID.
@@ -919,7 +949,7 @@ import sun.misc.Ref;
          return request.getObject();
      }
  
-     public static void JavaScriptFinalize(int internal)
+     public static void JavaScriptFinalize(long internal)
      {
          // Prefix with dummy instance for convenience.
          PluginCallRequest request = requestFactory.getPluginCallRequest("void",
@@ -942,7 +972,7 @@ import sun.misc.Ref;
          PluginDebug.debug (" finalize DONE");
      }
  
-     public static String javascriptToString(int internal)
+     public static String javascriptToString(long internal)
      {
          // Prefix with dummy instance for convenience.
          PluginCallRequest request = requestFactory.getPluginCallRequest("member",
@@ -1221,6 +1251,16 @@ import sun.misc.Ref;
       */
      public static String scanIdentifier(Reader in) throws IOException {
  	StringBuffer buf = new StringBuffer();
+ 	
+ 	if (c == '!') {
+        // Technically, we should be scanning for '!--' but we are reading 
+        // from a stream, and there is no way to peek ahead. That said, 
+        // a ! at this point can only mean comment here afaik, so we 
+        // should be okay
+        skipComment(in);
+        return "";
+    }
+ 	
  	while (true) {
  	    if (((c >= 'a') && (c <= 'z')) ||
  		((c >= 'A') && (c <= 'Z')) ||
@@ -1232,6 +1272,41 @@ import sun.misc.Ref;
  	    }
  	}
      }
+
+     public static void skipComment(Reader in) throws IOException {
+         StringBuffer buf = new StringBuffer();
+         boolean commentHeaderPassed = false;
+         c = in.read();
+         buf.append((char)c);
+
+         while (true) {
+             if (c == '-' && (c = in.read()) == '-') {
+                 buf.append((char)c);
+                 if (commentHeaderPassed) {
+                     // -- encountered ... is > next?
+                     if ((c = in.read()) == '>') {
+                         buf.append((char)c);
+
+                         PluginDebug.debug("Comment skipped: " + buf.toString());
+
+                         // comment skipped.
+                         return;
+                     }
+                 } else {
+                     // first -- is part of <!-- ... , just mark that we have passed it
+                     commentHeaderPassed = true;
+                 }
+
+             } else if (commentHeaderPassed == false) {
+                 buf.append((char)c);
+                 PluginDebug.debug("Warning: Attempted to skip comment, but this tag does not appear to be a comment: " + buf.toString());
+                 return;
+             }
+
+             c = in.read();
+             buf.append((char)c);
+         }
+     }
  
      /**
       * Scan tag
@@ -1266,11 +1341,21 @@ import sun.misc.Ref;
  		val = buf.toString();
  	    }
 
+        att = att.replace(">", ">");
+        att = att.replace("<", "<");
+        att = att.replace("&", "&");
+        att = att.replace("
", "\n");
+        att = att.replace("
", "\r");
+ 	    
         val = val.replace(">", ">");
         val = val.replace("<", "<");
         val = val.replace("&", "&");
- 	    PluginDebug.debug("PUT " + att + " = '" + val + "'");
- 	    atts.put(att.toLowerCase(java.util.Locale.ENGLISH), val);
+        val = val.replace("
", "\n");
+        val = val.replace("
", "\r");
+
+        PluginDebug.debug("PUT " + att + " = '" + val + "'");
+        atts.put(att.toLowerCase(java.util.Locale.ENGLISH), val);
+
              while (true) {
                  if ((c == '>') || (c < 0) ||
                      ((c >= 'a') && (c <= 'z')) ||
@@ -1283,6 +1368,20 @@ import sun.misc.Ref;
  	}
  	return atts;
      }
+     
+     // private static final == inline
+     private static final boolean isInt(Object o) {
+         boolean isInt = false;
+
+         try {
+             Integer.parseInt((String) o);
+             isInt = true;
+         } catch (Exception e) {
+             // don't care
+         }
+
+         return isInt;
+     }
  
      /* values used for placement of AppletViewer's frames */
      private static int x = 0;
@@ -1426,12 +1525,19 @@ import sun.misc.Ref;
     						 if (val == null) {
     							 statusMsgStream.println(requiresNameWarning);
     						 } else if (atts != null) {
-    							 // to prevent headaches, c++ side encodes &, < and >
-    							 // decode them back
+    							 att = att.replace(">", ">");
+    							 att = att.replace("<", "<");
+    							 att = att.replace("&", "&");
+    							 att = att.replace("
", "\n");
+    							 att = att.replace("
", "\r");
+
     							 val = val.replace(">", ">");
     							 val = val.replace("<", "<");
     							 val = val.replace("&", "&");
-    							 atts.put(att.toLowerCase(), val);
+    							 val = val.replace("
", "\n");
+    							 val = val.replace("
", "\r");
+    							 PluginDebug.debug("PUT " + att + " = " + val);
+   							     atts.put(att.toLowerCase(), val);
     						 } else {
     							 statusMsgStream.println(paramOutsideWarning);
     						 }
@@ -1453,21 +1559,21 @@ import sun.misc.Ref;
     						 atts = null;
     					 }
 
-    					 if (atts.get("width") == null) {
-    						 atts.put("width", "100");
+    					 if (atts.get("width") == null || !isInt(atts.get("width"))) {
+    						 atts.put("width", "1000");
     						 atts.put("widthPercentage", 100);
     					 } else if (((String) atts.get("width")).endsWith("%")) {
     						 String w = (String) atts.get("width");
-    						 atts.put("width", "100");
+    						 atts.put("width", "1000");
     						 atts.put("widthPercentage", Integer.parseInt((w.substring(0,  w.length() -1))));
     					  }
 
-    					 if (atts.get("height") == null) {
-    						 atts.put("height", "100");
+    					 if (atts.get("height") == null || !isInt(atts.get("height"))) {
+    						 atts.put("height", "1000");
     						 atts.put("heightPercentage", 100);
     					 } else if (((String) atts.get("height")).endsWith("%")) {
     						 String h = (String) atts.get("height");
-    						 atts.put("height", "100");
+    						 atts.put("height", "1000");
     						 atts.put("heightPercentage", Integer.parseInt(h.substring(0,  h.length() -1)));
     					 }
     				 }
@@ -1482,6 +1588,28 @@ import sun.misc.Ref;
     						 atts.put("code", ((String) atts.get("classid")).substring(5));
     					 }
 
+                         // java_* aliases override older names:
+                         // http://java.sun.com/j2se/1.4.2/docs/guide/plugin/developer_guide/using_tags.html#in-ie
+                         if (atts.get("java_code") != null) {
+                             atts.put("code", ((String) atts.get("java_code")));
+                         }
+
+                         if (atts.get("java_codebase") != null) {
+                             atts.put("codebase", ((String) atts.get("java_codebase")));
+                         }
+
+                         if (atts.get("java_archive") != null) {
+                             atts.put("archive", ((String) atts.get("java_archive")));
+                         }
+
+                         if (atts.get("java_object") != null) {
+                             atts.put("object", ((String) atts.get("java_object")));
+                         }
+
+                         if (atts.get("java_type") != null) {
+                             atts.put("type", ((String) atts.get("java_type")));
+                         }
+
     					 // The <OBJECT> attribute codebase isn't what
     					 // we want when not dealing with jars. If its 
     					 // defined, remove it in that case.
@@ -1489,21 +1617,21 @@ import sun.misc.Ref;
     						 atts.remove("codebase");
     					 }
 
-    					 if (atts.get("width") == null) {
-    						 atts.put("width", "100");
+    					 if (atts.get("width") == null || !isInt(atts.get("width"))) {
+    						 atts.put("width", "1000");
     						 atts.put("widthPercentage", 100);
     					 } else if (((String) atts.get("width")).endsWith("%")) {
     						 String w = (String) atts.get("width");
-    						 atts.put("width", "100");
+    						 atts.put("width", "1000");
     						 atts.put("widthPercentage", Integer.parseInt(w.substring(0,  w.length() -1)));
     					 }
 
-    					 if (atts.get("height") == null) {
-    						 atts.put("height", "100");
+    					 if (atts.get("height") == null || !isInt(atts.get("height"))) {
+    						 atts.put("height", "1000");
     						 atts.put("heightPercentage", 100);
     					 } else if (((String) atts.get("height")).endsWith("%")) {
     						 String h = (String) atts.get("height");
-    						 atts.put("height", "100");
+    						 atts.put("height", "1000");
     						 atts.put("heightPercentage", Integer.parseInt(h.substring(0,  h.length() -1)));
     					 }
     				 }
@@ -1517,14 +1645,36 @@ import sun.misc.Ref;
     						 //skip "java:"
     						 atts.put("code", ((String) atts.get("classid")).substring(5));
     					 }
+    					 
+    					 // java_* aliases override older names:
+    					 // http://java.sun.com/j2se/1.4.2/docs/guide/plugin/developer_guide/using_tags.html#in-nav
+    					 if (atts.get("java_code") != null) {
+    					     atts.put("code", ((String) atts.get("java_code")));
+    					 }
+    					 
+                         if (atts.get("java_codebase") != null) {
+                             atts.put("codebase", ((String) atts.get("java_codebase")));
+                         }
+                         
+                         if (atts.get("java_archive") != null) {
+                             atts.put("archive", ((String) atts.get("java_archive")));
+                         }
+                         
+                         if (atts.get("java_object") != null) {
+                             atts.put("object", ((String) atts.get("java_object")));
+                         }
+    					 
+                         if (atts.get("java_type") != null) {
+                             atts.put("type", ((String) atts.get("java_type")));
+                         }
 
     					 if (atts.get("code") == null && atts.get("object") == null) {
     						 statusMsgStream.println(embedRequiresCodeWarning);
     						 atts = null;
     					 }
     					 
-    					 if (atts.get("width") == null) {
-    						 atts.put("width", "100");
+    					 if (atts.get("width") == null || !isInt(atts.get("width"))) {
+    						 atts.put("width", "1000");
     						 atts.put("widthPercentage", 100);
     					 } else if (((String) atts.get("width")).endsWith("%")) {
     						 String w = (String) atts.get("width");
@@ -1532,8 +1682,8 @@ import sun.misc.Ref;
     						 atts.put("widthPercentage", Integer.parseInt(w.substring(0,  w.length() -1)));
     					 }
 
-    					 if (atts.get("height") == null) {
-    						 atts.put("height", "100");
+    					 if (atts.get("height") == null || !isInt(atts.get("height"))) {
+    						 atts.put("height", "1000");
     						 atts.put("heightPercentage", 100);
     					 } else if (((String) atts.get("height")).endsWith("%")) {
     						 String h = (String) atts.get("height");
@@ -1554,17 +1704,17 @@ import sun.misc.Ref;
     						 atts2.remove("src");
     						 atts2.put("codebase", nm);
     					 }
-    					 if (atts2.get("width") == null) {
-    						 atts2.put("width", "100");
+    					 if (atts2.get("width") == null || !isInt(atts2.get("width"))) {
+    						 atts2.put("width", "1000");
     						 atts2.put("widthPercentage", 100);
     					 } else if (((String) atts.get("width")).endsWith("%")) {
     						 String w = (String) atts.get("width");
     						 atts2.put("width", "100");
     						 atts2.put("widthPercentage", Integer.parseInt(w.substring(0,  w.length() -1)));
     					 }
-    					 
-    					 if (atts2.get("height") == null) {
-    						 atts2.put("height", "100");
+
+    					 if (atts2.get("height") == null || !isInt(atts2.get("height"))) {
+    						 atts2.put("height", "1000");
     						 atts2.put("heightPercentage", 100);
     					 } else if (((String) atts.get("height")).endsWith("%")) {
     						 String h = (String) atts.get("height");
diff -up ./plugin/icedtea/sun/applet/PluginMessageHandlerWorker.java.sav ./plugin/icedtea/sun/applet/PluginMessageHandlerWorker.java
--- ./plugin/icedtea/sun/applet/PluginMessageHandlerWorker.java.sav	2008-10-17 08:32:38.000000000 -0400
+++ ./plugin/icedtea/sun/applet/PluginMessageHandlerWorker.java	2008-11-21 15:44:14.000000000 -0500
@@ -24,6 +24,8 @@ class PluginMessageHandlerWorker extends
 
 			if (message != null) {
 				
+			    PluginDebug.debug("Consumer thread " + id + " consuming " + message);
+			    
 				// ideally, whoever returns things object should mark it 
 				// busy first, but just in case..
 				busy();
@@ -39,21 +41,24 @@ class PluginMessageHandlerWorker extends
 				}
 
 				this.message = null;
+				
+				PluginDebug.debug("Consumption completed by consumer thread " + id);
+
+	            // mark ourselves free again
+				free();
+				
 			} else {
 				
 				// Sleep when there is nothing to do
-				try {
-					Thread.sleep(Integer.MAX_VALUE);
-					PluginDebug.debug("Consumer thread " + id + " sleeping...");
-				} catch (InterruptedException ie) {
-					PluginDebug.debug("Consumer thread " + id + " woken...");
-					// nothing.. someone woke us up, see if there 
-					// is work to do
-				}
+			    try {
+			        Thread.sleep(Integer.MAX_VALUE);
+			        PluginDebug.debug("Consumer thread " + id + " sleeping...");
+			    } catch (InterruptedException ie) {
+			        PluginDebug.debug("Consumer thread " + id + " woken...");
+			        // nothing.. someone woke us up, see if there 
+			        // is work to do
+			    }
 			}
-			
-			// mark ourselves free again
-			free();
 		}
 	}
 	
diff -up ./rt/net/sourceforge/jnlp/NetxPanel.java.sav ./rt/net/sourceforge/jnlp/NetxPanel.java
--- ./rt/net/sourceforge/jnlp/NetxPanel.java.sav	2008-11-21 15:46:19.000000000 -0500
+++ ./rt/net/sourceforge/jnlp/NetxPanel.java	2008-11-21 15:46:19.000000000 -0500
@@ -40,6 +40,7 @@ public class NetxPanel extends AppletVie
 {
     private PluginBridge bridge = null;
     private boolean exitOnFailure = true;
+    private AppletInstance appInst = null;
 
     public NetxPanel(URL documentURL, Hashtable atts)
     {
@@ -81,7 +82,7 @@ public class NetxPanel extends AppletVie
     		status = APPLET_LOAD;
 
     		Launcher l = new Launcher(exitOnFailure);
-    		AppletInstance appInst = null;
+    		
                 try {
                     appInst = (AppletInstance) l.launch(bridge, this);
                 } catch (LaunchException e) {
@@ -128,5 +129,9 @@ public class NetxPanel extends AppletVie
     	this.atts.put("height", Integer.toString(height));
     	this.atts.put("width", Integer.toString(width));
     }
+    
+    public ClassLoader getAppletClassLoader() {
+        return appInst.getClassLoader();
+    }
 }
 
diff -up ./rt/net/sourceforge/jnlp/runtime/JNLPClassLoader.java.sav ./rt/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
--- ./rt/net/sourceforge/jnlp/runtime/JNLPClassLoader.java.sav	2008-11-21 15:46:18.000000000 -0500
+++ ./rt/net/sourceforge/jnlp/runtime/JNLPClassLoader.java	2008-11-21 15:46:18.000000000 -0500
@@ -29,6 +29,7 @@ import java.security.CodeSource;
 import java.security.Permission;
 import java.security.PermissionCollection;
 import java.security.Permissions;
+import java.security.Policy;
 import java.security.PrivilegedAction;
 import java.util.ArrayList;
 import java.util.Enumeration;
@@ -434,7 +435,7 @@ public class JNLPClassLoader extends URL
         // add in the permissions that the user granted.
         for (int i=0; i < runtimePermissions.size(); i++)
         	result.add(runtimePermissions.get(i));
-        
+
         return result;
     }
 
@@ -731,7 +732,7 @@ public class JNLPClassLoader extends URL
 
                         }
 
-                        // If it still fails, let it error out
+                        // If it still fails, let it error out                        
                         result = loadClassExt(name);
                     }
                 }
diff -up ./rt/net/sourceforge/jnlp/runtime/JNLPPolicy.java.sav ./rt/net/sourceforge/jnlp/runtime/JNLPPolicy.java
--- ./rt/net/sourceforge/jnlp/runtime/JNLPPolicy.java.sav	2008-11-21 15:46:18.000000000 -0500
+++ ./rt/net/sourceforge/jnlp/runtime/JNLPPolicy.java	2008-11-21 15:46:18.000000000 -0500
@@ -18,6 +18,7 @@
 package net.sourceforge.jnlp.runtime;
 
 import java.security.*;
+import java.util.Enumeration;
 
 /**
  * Policy for JNLP environment.  This class delegates to the
@@ -60,7 +61,15 @@ public class JNLPPolicy extends Policy {
         if (JNLPRuntime.getApplication() != null) {
         	if (JNLPRuntime.getApplication().getClassLoader() instanceof JNLPClassLoader) {
         		JNLPClassLoader cl = (JNLPClassLoader) JNLPRuntime.getApplication().getClassLoader();
-        		return cl.getPermissions(source);
+        		
+        		PermissionCollection clPermissions = cl.getPermissions(source);
+        		
+        		// systempolicy permissions need to be accounted for as well
+        		Enumeration e = systemPolicy.getPermissions(source).elements();
+                while (e.hasMoreElements())
+                    clPermissions.add((Permission) e.nextElement());
+
+        		return clPermissions;
         	}
         }
 
diff -up ./rt/net/sourceforge/jnlp/tools/JarSigner.java.sav ./rt/net/sourceforge/jnlp/tools/JarSigner.java
--- ./rt/net/sourceforge/jnlp/tools/JarSigner.java.sav	2008-11-21 15:46:18.000000000 -0500
+++ ./rt/net/sourceforge/jnlp/tools/JarSigner.java	2008-11-21 15:46:18.000000000 -0500
@@ -189,7 +189,16 @@ public class JarSigner {
             certs = new ArrayList<CertPath>();
 
             try {
-                String localFile = tracker.getCacheFile(jar.getLocation()).getAbsolutePath();
+                
+                File jarFile = tracker.getCacheFile(jar.getLocation());
+                
+                // some sort of resource download/cache error. Nothing to add 
+                // in that case ... but don't fail here
+                if (jarFile == null) {
+                    return;
+                }
+
+                String localFile = jarFile.getAbsolutePath();
                 boolean result = verifyJar(localFile);
                 checkTrustedCerts();
 


Index: java-1.6.0-openjdk.spec
===================================================================
RCS file: /cvs/pkgs/rpms/java-1.6.0-openjdk/F-10/java-1.6.0-openjdk.spec,v
retrieving revision 1.90
retrieving revision 1.91
diff -u -r1.90 -r1.91
--- java-1.6.0-openjdk.spec	20 Nov 2008 15:55:43 -0000	1.90
+++ java-1.6.0-openjdk.spec	21 Nov 2008 21:12:55 -0000	1.91
@@ -142,6 +142,7 @@
 Patch1:   java-1.6.0-openjdk-java-access-bridge-tck.patch
 Patch2:   java-1.6.0-openjdk-makefile.patch
 Patch3:   java-1.6.0-openjdk-java-access-bridge-idlj.patch
+Patch4:   java-1.6.0-openjdk-plugin-1217.patch
 
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
@@ -354,6 +355,7 @@
 %setup -q -n icedtea6-%{icedteaver} -T -D -a 2
 %patch0
 %patch2
+%patch4
 cp %{SOURCE4} .
 cp %{SOURCE5} .
 cp %{SOURCE7} .
@@ -900,6 +902,12 @@
 %{_jvmdir}/%{jredir}/lib/%{archinstall}/IcedTeaPlugin.so
 
 %changelog
+* Fri Nov 21 2008 Lillian Angel <langel at redhat.com> - 1:1.6.0-5.b12
+- Added plugin patch to resolve issues on 64-bit.
+- Resolves: rhbz#471987
+- Resolves: rhbz#465531
+- Resolves: rhbz#470551
+
 * Thu Nov 20 2008 Lillian Angel <langel at redhat.com> - 1:1.6.0-5.b12
 - Redirect error from removing gcjwebplugin link.
 - Resolves: rhbz#471568




More information about the fedora-extras-commits mailing list