changeset 191:a5cd63b3367c

Make PluginDebug a bit lazier.
author Denis Lila <dlila@redhat.com>
date Thu, 31 Mar 2011 14:01:04 -0400
parents 12065cfb29e1
children cea9ea395406
files ChangeLog plugin/icedteanp/java/sun/applet/AppletSecurityContextManager.java plugin/icedteanp/java/sun/applet/GetMemberPluginCallRequest.java plugin/icedteanp/java/sun/applet/GetWindowPluginCallRequest.java plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java plugin/icedteanp/java/sun/applet/PluginAppletViewer.java plugin/icedteanp/java/sun/applet/PluginCookieInfoRequest.java plugin/icedteanp/java/sun/applet/PluginDebug.java plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java plugin/icedteanp/java/sun/applet/PluginMessageHandlerWorker.java plugin/icedteanp/java/sun/applet/PluginObjectStore.java plugin/icedteanp/java/sun/applet/PluginProxyInfoRequest.java plugin/icedteanp/java/sun/applet/PluginProxySelector.java plugin/icedteanp/java/sun/applet/PluginStreamHandler.java plugin/icedteanp/java/sun/applet/RequestQueue.java plugin/icedteanp/java/sun/applet/VoidPluginCallRequest.java
diffstat 16 files changed, 117 insertions(+), 93 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Mar 31 13:54:45 2011 -0400
+++ b/ChangeLog	Thu Mar 31 14:01:04 2011 -0400
@@ -1,3 +1,24 @@
+2011-03-31  Denis Lila  <dlila@redhat.com>
+
+	* plugin/icedteanp/java/sun/applet/AppletSecurityContextManager.java
+	* plugin/icedteanp/java/sun/applet/GetMemberPluginCallRequest.java
+	* plugin/icedteanp/java/sun/applet/GetWindowPluginCallRequest.java
+	* plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java
+	* plugin/icedteanp/java/sun/applet/PluginAppletViewer.java
+	* plugin/icedteanp/java/sun/applet/PluginCookieInfoRequest.java
+	* plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java
+	* plugin/icedteanp/java/sun/applet/PluginMessageHandlerWorker.java
+	* plugin/icedteanp/java/sun/applet/PluginObjectStore.java
+	* plugin/icedteanp/java/sun/applet/PluginProxyInfoRequest.java
+	* plugin/icedteanp/java/sun/applet/PluginProxySelector.java
+	* plugin/icedteanp/java/sun/applet/PluginStreamHandler.java
+	* plugin/icedteanp/java/sun/applet/RequestQueue.java
+	* plugin/icedteanp/java/sun/applet/VoidPluginCallRequest.java:
+	Change all instances of PluginDebug.debug(arg1 + arg2 + ...)
+	to PluginDebug.debug(arg1, arg2, ...).
+	* plugin/icedteanp/java/sun/applet/PluginDebug.java:
+	Change debug from "void debug(String)" to "void debug(Object...)". 
+
 2011-03-31  Denis Lila  <dlila@redhat.com>
 
 	* plugin/icedteanp/java/sun/applet/PluginObjectStore.java
--- a/plugin/icedteanp/java/sun/applet/AppletSecurityContextManager.java	Thu Mar 31 13:54:45 2011 -0400
+++ b/plugin/icedteanp/java/sun/applet/AppletSecurityContextManager.java	Thu Mar 31 14:01:04 2011 -0400
@@ -59,7 +59,7 @@
     }
 
     public static void handleMessage(int identifier, int reference, String src, String[] privileges, String message) {
-        PluginDebug.debug(identifier + " -- " + src + " -- " + reference + " -- " + message + " CONTEXT= " + contexts.get(identifier));
+        PluginDebug.debug(identifier, " -- ", src, " -- ", reference, " -- ", message, " CONTEXT= ", contexts.get(identifier));
         AccessControlContext callContext = null;
 
         privileges = privileges != null ? privileges : new String[0];
--- a/plugin/icedteanp/java/sun/applet/GetMemberPluginCallRequest.java	Thu Mar 31 13:54:45 2011 -0400
+++ b/plugin/icedteanp/java/sun/applet/GetMemberPluginCallRequest.java	Thu Mar 31 14:01:04 2011 -0400
@@ -42,11 +42,11 @@
 
     public GetMemberPluginCallRequest(String message, Long reference) {
         super(message, reference);
-        PluginDebug.debug("GetMemberPluginCall " + message);
+        PluginDebug.debug("GetMemberPluginCall ", message);
     }
 
     public void parseReturn(String message) {
-        PluginDebug.debug("GetMemberParseReturn GOT: " + message);
+        PluginDebug.debug("GetMemberParseReturn GOT: ", message);
         String[] args = message.split(" ");
         // FIXME: Is it even possible to distinguish between null and void
         // here?
--- a/plugin/icedteanp/java/sun/applet/GetWindowPluginCallRequest.java	Thu Mar 31 13:54:45 2011 -0400
+++ b/plugin/icedteanp/java/sun/applet/GetWindowPluginCallRequest.java	Thu Mar 31 14:01:04 2011 -0400
@@ -46,7 +46,7 @@
     }
 
     public void parseReturn(String message) {
-        PluginDebug.debug("GetWindowParseReturn GOT: " + message);
+        PluginDebug.debug("GetWindowParseReturn GOT: ", message);
         String[] args = message.split(" ");
         // FIXME: add thread ID to messages to support multiple
         // threads using the netscape.javascript package.
--- a/plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java	Thu Mar 31 13:54:45 2011 -0400
+++ b/plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java	Thu Mar 31 14:01:04 2011 -0400
@@ -181,7 +181,7 @@
             c = Class.forName(name);
         } catch (ClassNotFoundException cnfe) {
 
-            PluginDebug.debug("Class " + name + " not found in primordial loader. Looking in " + cl);
+            PluginDebug.debug("Class ", name, " not found in primordial loader. Looking in ", cl);
             try {
                 c = cl.loadClass(name);
             } catch (ClassNotFoundException e) {
@@ -294,12 +294,12 @@
     }
 
     public void associateSrc(ClassLoader cl, URL src) {
-        PluginDebug.debug("Associating " + cl + " with " + src);
+        PluginDebug.debug("Associating ", cl, " with ", src);
         this.classLoaders.put(cl, src);
     }
 
     public void associateInstance(Integer i, ClassLoader cl) {
-        PluginDebug.debug("Associating " + cl + " with instance " + i);
+        PluginDebug.debug("Associating ", cl, " with instance ", i);
         this.instanceClassLoaders.put(i, cl);
     }
 
@@ -329,7 +329,7 @@
                 String[] args = message.split(" ");
                 Integer instance = new Integer(args[1]);
                 String className = args[2].replace('/', '.');
-                PluginDebug.debug("Searching for class " + className + " in " + cl);
+                PluginDebug.debug("Searching for class ", className, " in ", cl);
 
                 try {
                     c = cl.loadClass(className);
@@ -338,7 +338,7 @@
                 } catch (ClassNotFoundException cnfe) {
 
                     cl = this.instanceClassLoaders.get(instance);
-                    PluginDebug.debug("Not found. Looking in " + cl);
+                    PluginDebug.debug("Not found. Looking in ", cl);
 
                     if (instance != 0 && cl != null) {
                         try {
@@ -381,7 +381,7 @@
                     o = m = c.getMethod(methodName, signature.getClassArray());
                     store.reference(m);
                 }
-                PluginDebug.debug(o + " has id " + store.getIdentifier(o));
+                PluginDebug.debug(o, " has id ", store.getIdentifier(o));
                 write(reference, args[0] + " " + store.getIdentifier(o));
             } else if (message.startsWith("GetStaticFieldID")
                                         || message.startsWith("GetFieldID")) {
@@ -392,7 +392,7 @@
 
                 Class<?> c = (Class<?>) store.getObject(classID);
 
-                PluginDebug.debug("GetStaticFieldID/GetFieldID got class=" + c.getName());
+                PluginDebug.debug("GetStaticFieldID/GetFieldID got class=", c.getName());
 
                 Field f = null;
                 f = c.getField(fieldName);
@@ -631,7 +631,7 @@
                 arguments[1] = methodName;
                 for (int i = 0; i < args.length - 3; i++) {
                     arguments[i + 2] = store.getObject(parseCall(args[3 + i], null, Integer.class));
-                    PluginDebug.debug("GOT ARG: " + arguments[i + 2]);
+                    PluginDebug.debug("GOT ARG: ", arguments[i + 2]);
                 }
 
                 Object[] matchingMethodAndArgs = MethodOverloadResolver.getMatchingMethod(arguments);
@@ -652,8 +652,8 @@
                     collapsedArgs += " " + arg;
                 }
 
-                PluginDebug.debug("Calling method " + m + " on object " + o
-                                                + " (" + c + ") with " + collapsedArgs);
+                PluginDebug.debug("Calling method ", m, " on object ", o
+                                                , " (", c, ") with ", collapsedArgs);
 
                 AccessControlContext acc = callContext != null ? callContext : getClosedAccessControlContext();
                 checkPermission(src, c, acc);
@@ -683,9 +683,9 @@
                     retO = m.getReturnType().toString();
                 }
 
-                PluginDebug.debug("Calling " + m + " on " + o + " with "
-                                                + collapsedArgs + " and that returned: " + ret
-                                                + " of type " + retO);
+                PluginDebug.debug("Calling ", m, " on ", o, " with "
+                                                , collapsedArgs, " and that returned: ", ret
+                                                , " of type ", retO);
 
                 if (m.getReturnType().equals(java.lang.Void.class) ||
                                     m.getReturnType().equals(java.lang.Void.TYPE)) {
@@ -799,8 +799,8 @@
                                                                         + Integer
                                                                                         .toString(((int) b[i]) & 0x0ff, 16));
 
-                PluginDebug.debug("Java: GetStringChars: " + o);
-                PluginDebug.debug("  String BYTES: " + buf);
+                PluginDebug.debug("Java: GetStringChars: ", o);
+                PluginDebug.debug("  String BYTES: ", buf);
                 write(reference, "GetStringChars " + buf);
             } else if (message.startsWith("GetToStringValue")) {
                 String[] args = message.split(" ");
@@ -965,7 +965,7 @@
                 for (int i = 0; i < args.length - 2; i++) {
                     arguments[i + 1] = store.getObject(parseCall(args[2 + i],
                             null, Integer.class));
-                    PluginDebug.debug("GOT ARG: " + arguments[i + 1]);
+                    PluginDebug.debug("GOT ARG: ", arguments[i + 1]);
                 }
 
                 Object[] matchingConstructorAndArgs = MethodOverloadResolver
@@ -990,8 +990,8 @@
                     collapsedArgs += " " + arg.toString();
                 }
 
-                PluginDebug.debug("Calling constructor on class " + c +
-                                   " with " + collapsedArgs);
+                PluginDebug.debug("Calling constructor on class ", c,
+                                   " with ", collapsedArgs);
 
                 AccessControlContext acc = callContext != null ? callContext : getClosedAccessControlContext();
                 checkPermission(src, c, acc);
@@ -1014,7 +1014,7 @@
                 write(reference, "NewObject " + store.getIdentifier(ret));
 
             } else if (message.startsWith("NewStringUTF")) {
-                PluginDebug.debug("MESSAGE: " + message);
+                PluginDebug.debug("MESSAGE: ", message);
                 String[] args = message.split(" ");
                 int length = new Integer(args[1]);
                 byte[] byteArray = new byte[length];
@@ -1028,12 +1028,12 @@
                 }
 
                 ret = new String(byteArray, "UTF-8");
-                PluginDebug.debug("NEWSTRINGUTF: " + ret);
+                PluginDebug.debug("NEWSTRINGUTF: ", ret);
 
                 store.reference(ret);
                 write(reference, "NewStringUTF " + store.getIdentifier(ret));
             } else if (message.startsWith("NewString")) {
-                PluginDebug.debug("MESSAGE: " + message);
+                PluginDebug.debug("MESSAGE: ", message);
                 String[] args = message.split(" ");
                 Integer strlength = parseCall(args[1], null, Integer.class);
                 int bytelength = 2 * strlength;
@@ -1041,20 +1041,20 @@
                 String ret = null;
                 for (int i = 0; i < strlength; i++) {
                     int c = parseCall(args[2 + i], null, Integer.class);
-                    PluginDebug.debug("char " + i + " " + c);
+                    PluginDebug.debug("char ", i, " ", c);
                     // Low.
                     byteArray[2 * i] = (byte) (c & 0x0ff);
                     // High.
                     byteArray[2 * i + 1] = (byte) ((c >> 8) & 0x0ff);
                 }
                 ret = new String(byteArray, 0, bytelength, "UTF-16LE");
-                PluginDebug.debug("NEWSTRING: " + ret);
+                PluginDebug.debug("NEWSTRING: ", ret);
 
                 store.reference(ret);
                 write(reference, "NewString " + store.getIdentifier(ret));
 
             } else if (message.startsWith("ExceptionOccurred")) {
-                PluginDebug.debug("EXCEPTION: " + throwable);
+                PluginDebug.debug("EXCEPTION: ", throwable);
                 if (throwable != null)
                     store.reference(throwable);
                 write(reference, "ExceptionOccurred "
@@ -1132,7 +1132,7 @@
     }
 
     private void write(int reference, String message) {
-        PluginDebug.debug("appletviewer writing " + message);
+        PluginDebug.debug("appletviewer writing ", message);
         streamhandler.write("context " + identifier + " reference " + reference
                                 + " " + message);
     }
--- a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java	Thu Mar 31 13:54:45 2011 -0400
+++ b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java	Thu Mar 31 14:01:04 2011 -0400
@@ -189,7 +189,7 @@
             return null;
         }
 
-        PluginDebug.debug("Applet " + a.getClass() + " initialized");
+        PluginDebug.debug("Applet ", a.getClass(), " initialized");
         streamhandler.write("instance " + identifier + " reference 0 initialized");
 
         AppletSecurityContextManager.getSecurityContext(0).associateSrc(((NetxPanel) panel).getAppletClassLoader(), doc);
@@ -232,7 +232,7 @@
             String[] events = splitSeparator(",", eventList);
 
             for (int i = 0; i < events.length; i++) {
-                PluginDebug.debug("Adding event to queue: " + events[i]);
+                PluginDebug.debug("Adding event to queue: ", events[i]);
                 if (events[i].equals("dispose"))
                     panel.sendEvent(AppletPanel.APPLET_DISPOSE);
                 else if (events[i].equals("load"))
@@ -251,7 +251,7 @@
                     panel.sendEvent(AppletPanel.APPLET_ERROR);
                 else
                     // non-fatal error if we get an unrecognized event
-                    PluginDebug.debug("Unrecognized event name: " + events[i]);
+                    PluginDebug.debug("Unrecognized event name: ", events[i]);
             }
 
             while (!panel.emptyEventQueue())
@@ -371,7 +371,7 @@
     public static void framePanel(int identifier, PrintStream statusMsgStream,
                                   long handle, AppletViewerPanel panel) {
 
-        PluginDebug.debug("Framing " + panel);
+        PluginDebug.debug("Framing ", panel);
 
         // SecurityManager MUST be set, and only privileged code may call reFrame()
         System.getSecurityManager().checkPermission(new AllPermission());
@@ -386,7 +386,7 @@
 
         applets.put(identifier, appletFrame);
 
-        PluginDebug.debug(panel + " framed");
+        PluginDebug.debug(panel, " framed");
     }
 
     /**
@@ -486,7 +486,7 @@
      */
     public static void handleMessage(int identifier, int reference, String message) {
 
-        PluginDebug.debug("PAV handling: " + message);
+        PluginDebug.debug("PAV handling: ", message);
 
         try {
             if (message.startsWith("handle")) {
@@ -515,11 +515,11 @@
                         UrlUtil.decode(message.substring("tag".length() + 1, spaceLocation));
                 String tag = message.substring(spaceLocation + 1);
 
-                PluginDebug.debug("Handle = " + handle + "\n" +
-                                    "Width = " + width + "\n" +
-                                    "Height = " + height + "\n" +
-                                    "DocumentBase = " + documentBase + "\n" +
-                                    "Tag = " + tag);
+                PluginDebug.debug("Handle = ", handle, "\n",
+                                    "Width = ", width, "\n",
+                                    "Height = ", height, "\n",
+                                    "DocumentBase = ", documentBase, "\n",
+                                    "Tag = ", tag);
 
                 PluginAppletViewer.parse
                                         (identifier, handle, width, height,
@@ -561,7 +561,7 @@
 
                 // Set it inactive, and try to do cleanup is applicable
                 PAV_INIT_STATUS previousStatus = updateStatus(identifier, PAV_INIT_STATUS.INACTIVE);
-                PluginDebug.debug("Destroy status set for " + identifier);
+                PluginDebug.debug("Destroy status set for ", identifier);
 
                 if (previousStatus != null &&
                          previousStatus.equals(PAV_INIT_STATUS.REFRAME_COMPLETE)) {
@@ -569,7 +569,7 @@
                 }
 
             } else {
-                PluginDebug.debug("Handling message: " + message + " instance " + identifier + " " + Thread.currentThread());
+                PluginDebug.debug("Handling message: ", message, " instance ", identifier, " ", Thread.currentThread());
 
                 // Wait till initialization finishes
                 while (!applets.containsKey(identifier) &&
@@ -643,17 +643,17 @@
 
     private static synchronized void destroyApplet(int identifier) {
 
-        PluginDebug.debug("DestroyApplet called for " + identifier);
+        PluginDebug.debug("DestroyApplet called for ", identifier);
 
         PAV_INIT_STATUS prev = updateStatus(identifier, PAV_INIT_STATUS.DESTROYED);
 
         // If already destroyed, return
         if (prev.equals(PAV_INIT_STATUS.DESTROYED)) {
-            PluginDebug.debug(identifier + " already destroyed. Returning.");
+            PluginDebug.debug(identifier, " already destroyed. Returning.");
             return;
         }
 
-        PluginDebug.debug("Attempting to destroy frame " + identifier);
+        PluginDebug.debug("Attempting to destroy frame ", identifier);
 
         // Try to dispose the panel right away
         if (applets.containsKey(identifier))
@@ -661,11 +661,11 @@
 
         // If panel is already disposed, return
         if (applets.get(identifier).panel.applet == null) {
-            PluginDebug.debug(identifier + " panel inactive. Returning.");
+            PluginDebug.debug(identifier, " panel inactive. Returning.");
             return;
         }
 
-        PluginDebug.debug("Attempting to destroy panel " + identifier);
+        PluginDebug.debug("Attempting to destroy panel ", identifier);
 
         final int fIdentifier = identifier;
         SwingUtilities.invokeLater(new Runnable() {
@@ -674,7 +674,7 @@
             }
         });
 
-        PluginDebug.debug(identifier + " destroyed");
+        PluginDebug.debug(identifier, " destroyed");
     }
 
     /**
@@ -692,7 +692,7 @@
                 waitTime < APPLET_TIMEOUT) {
             try {
                 if (waitTime % 500 == 0)
-                    PluginDebug.debug("Waiting for applet panel " + panel + " to initialize...");
+                    PluginDebug.debug("Waiting for applet panel ", panel, " to initialize...");
 
                 Thread.sleep(waitTime += 50);
             } catch (InterruptedException ie) {
@@ -700,7 +700,7 @@
             }
         }
 
-        PluginDebug.debug("Applet panel " + panel + " initialized");
+        PluginDebug.debug("Applet panel ", panel, " initialized");
     }
 
     public void handleMessage(int reference, String message) {
@@ -783,7 +783,7 @@
             // (happens in a separate thread)
             waitForAppletInit((NetxPanel) panel);
 
-            PluginDebug.debug(panel + " -- " + panel.getApplet() + " -- " + ((NetxPanel) panel).isAlive());
+            PluginDebug.debug(panel, " -- ", panel.getApplet(), " -- ", ((NetxPanel) panel).isAlive());
 
             // Still null?
             if (panel.getApplet() == null) {
@@ -792,10 +792,10 @@
             }
 
             o = panel.getApplet();
-            PluginDebug.debug("Looking for object " + o + " panel is " + panel);
+            PluginDebug.debug("Looking for object ", o, " panel is ", panel);
             AppletSecurityContextManager.getSecurityContext(0).store(o);
-            PluginDebug.debug("WRITING 1: " + "context 0 reference " + reference + " GetJavaObject "
-                                 + AppletSecurityContextManager.getSecurityContext(0).getIdentifier(o));
+            PluginDebug.debug("WRITING 1: ", "context 0 reference ", reference, " GetJavaObject "
+                                 , AppletSecurityContextManager.getSecurityContext(0).getIdentifier(o));
             streamhandler.write("context 0 reference " + reference + " GetJavaObject "
                               + AppletSecurityContextManager.getSecurityContext(0).getIdentifier(o));
             PluginDebug.debug("WRITING 1 DONE");
@@ -844,7 +844,7 @@
      * Get an image ref.
      */
     private synchronized Ref getCachedImageRef(URL url) {
-        PluginDebug.debug("getCachedImageRef() searching for " + url);
+        PluginDebug.debug("getCachedImageRef() searching for ", url);
 
         try {
 
@@ -853,8 +853,8 @@
 
             if (originalURL.startsWith(codeBase)) {
 
-                PluginDebug.debug("getCachedImageRef() got URL = " + url);
-                PluginDebug.debug("getCachedImageRef() plugin codebase = " + codeBase);
+                PluginDebug.debug("getCachedImageRef() got URL = ", url);
+                PluginDebug.debug("getCachedImageRef() plugin codebase = ", codeBase);
 
                 // try to fetch it locally
                 if (panel instanceof NetxPanel) {
@@ -871,7 +871,7 @@
                 }
             }
 
-            PluginDebug.debug("getCachedImageRef() getting img from URL = " + url);
+            PluginDebug.debug("getCachedImageRef() getting img from URL = ", url);
 
             synchronized (imageRefs) {
                 AppletImageRef ref = imageRefs.get(url);
@@ -1049,7 +1049,7 @@
                 PluginDebug.debug("wait getMEM request 2");
                 while (request.isDone() == false)
                     request.wait();
-                PluginDebug.debug("wait getMEM request 3 GOT: " + request.getObject().getClass());
+                PluginDebug.debug("wait getMEM request 3 GOT: ", request.getObject().getClass());
             }
         } catch (InterruptedException e) {
             throw new RuntimeException("Interrupted waiting for call request.",
@@ -1101,7 +1101,7 @@
         streamhandler.postCallRequest(request);
         streamhandler.write(request.getMessage());
         try {
-            PluginDebug.debug("wait setMem request: " + request.getMessage());
+            PluginDebug.debug("wait setMem request: ", request.getMessage());
             PluginDebug.debug("wait setMem request 1");
             synchronized (request) {
                 PluginDebug.debug("wait setMem request 2");
@@ -1342,7 +1342,7 @@
 
             requestURI = UrlUtil.encode(scheme + "://" + uri.getHost() + port + "/" + uri.getPath(), "UTF-8");
         } catch (Exception e) {
-            PluginDebug.debug("Cannot construct URL from " + uri.toString() + " ... falling back to DIRECT proxy");
+            PluginDebug.debug("Cannot construct URL from ", uri.toString(), " ... falling back to DIRECT proxy");
             e.printStackTrace();
             return null;
         }
@@ -1424,7 +1424,7 @@
     // FIXME: make this private and access it from JSObject using
     // reflection.
     private void write(String message) throws IOException {
-        PluginDebug.debug("WRITING 2: " + "instance " + identifier + " " + message);
+        PluginDebug.debug("WRITING 2: ", "instance ", identifier, " " + message);
         streamhandler.write("instance " + identifier + " " + message);
         PluginDebug.debug("WRITING 2 DONE");
     }
@@ -1741,7 +1741,7 @@
                     if ((c[0] = in.read()) == '>') {
                         buf.append((char) c[0]);
 
-                        PluginDebug.debug("Comment skipped: " + buf.toString());
+                        PluginDebug.debug("Comment skipped: ", buf.toString());
 
                         // comment skipped.
                         return;
@@ -1753,7 +1753,7 @@
 
             } else if (commentHeaderPassed == false) {
                 buf.append((char) c[0]);
-                PluginDebug.debug("Warning: Attempted to skip comment, but this tag does not appear to be a comment: " + buf.toString());
+                PluginDebug.debug("Warning: Attempted to skip comment, but this tag does not appear to be a comment: ", buf.toString());
                 return;
             }
 
@@ -1795,7 +1795,7 @@
                 val = decodeString(buf.toString());
             }
 
-            PluginDebug.debug("PUT " + att + " = '" + val + "'");
+            PluginDebug.debug("PUT ", att, " = '", val, "'");
             atts.put(att.toLowerCase(java.util.Locale.ENGLISH), val);
 
             while (true) {
@@ -1958,7 +1958,7 @@
                             if (val == null) {
                                 statusMsgStream.println(requiresNameWarning);
                             } else {
-                                PluginDebug.debug("PUT " + att + " = " + val);
+                                PluginDebug.debug("PUT ", att, " = ", val);
                                 atts.put(att.toLowerCase(), val);
                             }
                         }
--- a/plugin/icedteanp/java/sun/applet/PluginCookieInfoRequest.java	Thu Mar 31 13:54:45 2011 -0400
+++ b/plugin/icedteanp/java/sun/applet/PluginCookieInfoRequest.java	Thu Mar 31 14:01:04 2011 -0400
@@ -54,7 +54,7 @@
         // try to parse the proxy information. If things go wrong, do nothing .. 
         // this will keep internal = null which forces a direct connection
 
-        PluginDebug.debug("PluginCookieInfoRequest GOT: " + cookieInfo);
+        PluginDebug.debug("PluginCookieInfoRequest GOT: ", cookieInfo);
 
         // skip 'plugin' marker
         cookieInfo = cookieInfo.substring(cookieInfo.indexOf(' ') + 1);
--- a/plugin/icedteanp/java/sun/applet/PluginDebug.java	Thu Mar 31 13:54:45 2011 -0400
+++ b/plugin/icedteanp/java/sun/applet/PluginDebug.java	Thu Mar 31 14:01:04 2011 -0400
@@ -41,8 +41,11 @@
 
     static final boolean DEBUG = System.getenv().containsKey("ICEDTEAPLUGIN_DEBUG");
 
-    public static void debug(String message) {
-        if (DEBUG)
-            System.err.println(message);
+    public static void debug(Object... messageChunks) {
+        if (DEBUG) {
+            for (Object chunk : messageChunks) {
+                System.err.println(chunk.toString());
+            }
+        }
     }
 }
--- a/plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java	Thu Mar 31 13:54:45 2011 -0400
+++ b/plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java	Thu Mar 31 14:01:04 2011 -0400
@@ -69,7 +69,7 @@
      * @param reference The reference to give priority to
      */
     public static void registerPriorityWait(Long reference) {
-        PluginDebug.debug("Registering priority for reference " + reference);
+        PluginDebug.debug("Registering priority for reference ", reference);
         registerPriorityWait("reference " + reference.toString());
     }
 
@@ -79,7 +79,7 @@
      * @param searchString the string to look for in a response
      */
     private static void registerPriorityWait(String searchString) {
-        PluginDebug.debug("Registering priority for string " + searchString);
+        PluginDebug.debug("Registering priority for string ", searchString);
         synchronized (priorityWaitQueue) {
             if (!priorityWaitQueue.contains(searchString)) {
                 priorityWaitQueue.add(searchString);
@@ -206,7 +206,7 @@
 
         for (PluginMessageHandlerWorker worker : workers) {
             if (worker.isFree(prioritized)) {
-                PluginDebug.debug("Found free worker (" + worker.isPriority() + ") with id " + worker.getWorkerId());
+                PluginDebug.debug("Found free worker (", worker.isPriority(), ") with id ", worker.getWorkerId());
                 // mark it busy before returning
                 worker.busy();
                 return worker;
@@ -218,10 +218,10 @@
             PluginMessageHandlerWorker worker = null;
 
             if (workers.size() < (MAX_WORKERS - PRIORITY_WORKERS)) {
-                PluginDebug.debug("Cannot find free worker, creating worker " + workers.size());
+                PluginDebug.debug("Cannot find free worker, creating worker ", workers.size());
                 worker = new PluginMessageHandlerWorker(this, streamHandler, workers.size(), false);
             } else if (prioritized) {
-                PluginDebug.debug("Cannot find free worker, creating priority worker " + workers.size());
+                PluginDebug.debug("Cannot find free worker, creating priority worker ", workers.size());
                 worker = new PluginMessageHandlerWorker(this, streamHandler, workers.size(), true);
             } else {
                 return null;
--- a/plugin/icedteanp/java/sun/applet/PluginMessageHandlerWorker.java	Thu Mar 31 13:54:45 2011 -0400
+++ b/plugin/icedteanp/java/sun/applet/PluginMessageHandlerWorker.java	Thu Mar 31 14:01:04 2011 -0400
@@ -56,7 +56,7 @@
         this.isPriorityWorker = isPriorityWorker;
         this.consumer = consumer;
 
-        PluginDebug.debug("Worker " + this.id + " (priority=" + isPriorityWorker + ") created.");
+        PluginDebug.debug("Worker ", this.id, " (priority=", isPriorityWorker, ") created.");
     }
 
     public void setmessage(String message) {
@@ -68,7 +68,7 @@
 
             if (message != null) {
 
-                PluginDebug.debug("Consumer (priority=" + isPriorityWorker + ") thread " + id + " consuming " + message);
+                PluginDebug.debug("Consumer (priority=", isPriorityWorker, ") thread ", id, " consuming ", message);
 
                 // ideally, whoever returns this object should mark it
                 // busy first, but just in case..
@@ -86,7 +86,7 @@
 
                 this.message = null;
 
-                PluginDebug.debug("Consumption (priority=" + isPriorityWorker + ") completed by consumer thread " + id);
+                PluginDebug.debug("Consumption (priority=", isPriorityWorker, ") completed by consumer thread ", id);
 
                 // mark ourselves free again
                 free();
@@ -96,9 +96,9 @@
                 // Sleep when there is nothing to do
                 try {
                     Thread.sleep(Integer.MAX_VALUE);
-                    PluginDebug.debug("Consumer thread " + id + " sleeping...");
+                    PluginDebug.debug("Consumer thread ", id, " sleeping...");
                 } catch (InterruptedException ie) {
-                    PluginDebug.debug("Consumer thread " + id + " woken...");
+                    PluginDebug.debug("Consumer thread ", id, " woken...");
                     // nothing.. someone woke us up, see if there 
                     // is work to do
                 }
--- a/plugin/icedteanp/java/sun/applet/PluginObjectStore.java	Thu Mar 31 13:54:45 2011 -0400
+++ b/plugin/icedteanp/java/sun/applet/PluginObjectStore.java	Thu Mar 31 14:01:04 2011 -0400
@@ -127,7 +127,7 @@
         synchronized(lock) {
             if (PluginDebug.DEBUG) {
                 for (Map.Entry<Integer, Object> e : objects.entrySet()) {
-                    PluginDebug.debug(e.getKey() + "::" + e.getValue());
+                    PluginDebug.debug(e.getKey(), "::", e.getValue());
                 }
             }
         }
--- a/plugin/icedteanp/java/sun/applet/PluginProxyInfoRequest.java	Thu Mar 31 13:54:45 2011 -0400
+++ b/plugin/icedteanp/java/sun/applet/PluginProxyInfoRequest.java	Thu Mar 31 14:01:04 2011 -0400
@@ -56,7 +56,7 @@
         // try to parse the proxy information. If things go wrong, do nothing .. 
         // this will keep internal = null which forces a direct connection
 
-        PluginDebug.debug("PluginProxyInfoRequest GOT: " + proxyInfo);
+        PluginDebug.debug("PluginProxyInfoRequest GOT: ", proxyInfo);
         String[] messageComponents = proxyInfo.split(" ");
 
         try {
--- a/plugin/icedteanp/java/sun/applet/PluginProxySelector.java	Thu Mar 31 13:54:45 2011 -0400
+++ b/plugin/icedteanp/java/sun/applet/PluginProxySelector.java	Thu Mar 31 14:01:04 2011 -0400
@@ -84,7 +84,7 @@
         // If the browser returned anything, try to parse it. If anything in the try block fails, the fallback is direct connection
         try {
             if (o != null) {
-                PluginDebug.debug("Proxy URI = " + o);
+                PluginDebug.debug("Proxy URI = ", o);
                 URI proxyURI = (URI) o;
 
                 // If origin uri is http/ftp, we're good. If origin uri is not that, the proxy _must_ be socks, else we fallback to direct
@@ -98,7 +98,7 @@
                     String uriKey = uri.getScheme() + "://" + uri.getHost();
                     proxyCache.put(uriKey, proxy);
                 } else {
-                    PluginDebug.debug("Proxy " + proxyURI + " cannot be used for " + uri + ". Falling back to DIRECT");
+                    PluginDebug.debug("Proxy ", proxyURI, " cannot be used for ", uri, ". Falling back to DIRECT");
                 }
             }
         } catch (Exception e) {
@@ -107,7 +107,7 @@
 
         proxyList.add(proxy);
 
-        PluginDebug.debug("Proxy for " + uri.toString() + " is " + proxy);
+        PluginDebug.debug("Proxy for ", uri.toString(), " is ", proxy);
 
         return proxyList;
     }
--- a/plugin/icedteanp/java/sun/applet/PluginStreamHandler.java	Thu Mar 31 13:54:45 2011 -0400
+++ b/plugin/icedteanp/java/sun/applet/PluginStreamHandler.java	Thu Mar 31 14:01:04 2011 -0400
@@ -65,7 +65,7 @@
     public PluginStreamHandler(InputStream inputstream, OutputStream outputstream)
             throws MalformedURLException, IOException {
 
-        PluginDebug.debug("Current context CL=" + Thread.currentThread().getContextClassLoader());
+        PluginDebug.debug("Current context CL=", Thread.currentThread().getContextClassLoader());
 
         PluginDebug.debug("Creating consumer...");
         consumer = new PluginMessageConsumer(this);
@@ -168,7 +168,7 @@
 
         try {
 
-            PluginDebug.debug("Breakdown -- type: " + type + " identifier: " + identifier + " reference: " + reference + " src: " + src + " privileges: " + privileges + " rest: \"" + rest + "\"");
+            PluginDebug.debug("Breakdown -- type: ", type, " identifier: ", identifier, " reference: ", reference, " src: ", src, " privileges: ", privileges, " rest: \"", rest, "\"");
 
             if (rest.contains("JavaScriptGetWindow")
                     || rest.contains("JavaScriptGetMember")
@@ -191,7 +191,7 @@
             if (type.equals("instance")) {
                 PluginAppletViewer.handleMessage(identifier, freference, frest);
             } else if (type.equals("context")) {
-                PluginDebug.debug("Sending to PASC: " + identifier + "/" + reference + " and " + rest);
+                PluginDebug.debug("Sending to PASC: ", identifier, "/", reference, " and ", rest);
                 AppletSecurityContextManager.handleMessage(identifier, reference, src, privileges, rest);
             }
         } catch (Exception e) {
@@ -234,7 +234,7 @@
 
                 while (!request.serviceable(message)) {
 
-                    PluginDebug.debug(request + " cannot service " + message);
+                    PluginDebug.debug(request, " cannot service ", message);
 
                     // something is very wrong.. we have a message to 
                     // process, but no one to service it
@@ -279,7 +279,7 @@
 
         try {
             message = pluginInputReader.readLine();
-            PluginDebug.debug("  PIPE: appletviewer read: " + message);
+            PluginDebug.debug("  PIPE: appletviewer read: ", message);
 
             if (message == null || message.equals("shutdown")) {
                 synchronized (shuttingDown) {
@@ -313,7 +313,7 @@
      */
     public void write(String message) {
 
-        PluginDebug.debug("  PIPE: appletviewer wrote: " + message);
+        PluginDebug.debug("  PIPE: appletviewer wrote: ", message);
         synchronized (pluginOutputWriter) {
             try {
                 pluginOutputWriter.write(message + "\n", 0, message.length());
--- a/plugin/icedteanp/java/sun/applet/RequestQueue.java	Thu Mar 31 13:54:45 2011 -0400
+++ b/plugin/icedteanp/java/sun/applet/RequestQueue.java	Thu Mar 31 14:01:04 2011 -0400
@@ -43,7 +43,7 @@
     private int size = 0;
 
     public void post(PluginCallRequest request) {
-        PluginDebug.debug("Securitymanager=" + System.getSecurityManager());
+        PluginDebug.debug("Securitymanager=", System.getSecurityManager());
         if (head == null) {
             head = tail = request;
             tail.setNext(null);
--- a/plugin/icedteanp/java/sun/applet/VoidPluginCallRequest.java	Thu Mar 31 13:54:45 2011 -0400
+++ b/plugin/icedteanp/java/sun/applet/VoidPluginCallRequest.java	Thu Mar 31 14:01:04 2011 -0400
@@ -40,7 +40,7 @@
 public class VoidPluginCallRequest extends PluginCallRequest {
     public VoidPluginCallRequest(String message, Long reference) {
         super(message, reference);
-        PluginDebug.debug("VoidPluginCall " + message);
+        PluginDebug.debug("VoidPluginCall ", message);
     }
 
     public void parseReturn(String message) {