changeset 914:bc97499d95f4

Added getter for java-abrt-connector on demand whitelist of fields
author Jiri Vanek <jvanek@redhat.com>
date Mon, 10 Mar 2014 16:02:39 +0100
parents 2217cdd13ad6
children 2157f0e06002
files ChangeLog netx/net/sourceforge/jnlp/Launcher.java netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java plugin/icedteanp/java/sun/applet/PluginAppletViewer.java
diffstat 4 files changed, 37 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Mar 10 15:48:24 2014 +0100
+++ b/ChangeLog	Mon Mar 10 16:02:39 2014 +0100
@@ -1,3 +1,13 @@
+2014-03-10  Jiri Vanek  <jvanek@redhat.com>
+
+	Added getter for java-abrt-connector on demand whitelist of fields.
+	* netx/net/sourceforge/jnlp/Launcher.java: (launch) saving (location.toExternalForm())
+	via JNLPRuntime.saveHistory
+	* netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: (history) new static field
+	with getter (getHistory) and "setter" (saveHistory)
+	* plugin/icedteanp/java/sun/applet/PluginAppletViewer.java: (handleInitializationMessage)
+	saving (documentBase) via JNLPRuntime.saveHistory
+
 2014-03-10  Jiri Vanek  <jvanek@redhat.com>
 
 	Actualized man page for javaws
--- a/netx/net/sourceforge/jnlp/Launcher.java	Mon Mar 10 15:48:24 2014 +0100
+++ b/netx/net/sourceforge/jnlp/Launcher.java	Mon Mar 10 16:02:39 2014 +0100
@@ -281,6 +281,7 @@
      * @return the application instance
      */
     public ApplicationInstance launch(URL location) throws LaunchException {
+        JNLPRuntime.saveHistory(location.toExternalForm());
         return launch(fromUrl(location));
     }
 
@@ -944,6 +945,4 @@
 
     };
 
- 
-
 }
--- a/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java	Mon Mar 10 15:48:24 2014 +0100
+++ b/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java	Mon Mar 10 16:02:39 2014 +0100
@@ -91,6 +91,14 @@
         loadResources();
     }
 
+    /**
+     * java-abrt-connector can print out specific application String method, it is good to save visited urls for reproduce purposes.
+     * For javaws we can read the destination jnlp from commandline
+     * However for plugin (url arrive via pipes). Also for plugin we can not be sure which opened tab/window
+     * have caused the crash. Thats why the individual urls are added, not replaced.
+     */
+    private static String history = "";
+
     /** the localized resource strings */
     private static ResourceBundle resources;
 
@@ -831,4 +839,20 @@
         OutputController.getLogger().close();
         System.exit(i);
     }
+
+
+    public static void saveHistory(String documentBase) {
+        JNLPRuntime.history += " " + documentBase + " ";
+    }
+
+    /**
+     * Used by java-abrt-connector via reflection
+     * @return history
+     */
+    private static String getHistory() {
+        return history;
+    }
+    
+    
+
 }
--- a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java	Mon Mar 10 15:48:24 2014 +0100
+++ b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java	Mon Mar 10 16:02:39 2014 +0100
@@ -118,6 +118,7 @@
 import sun.misc.Ref;
 
 import com.sun.jndi.toolkit.url.UrlUtil;
+import net.sourceforge.jnlp.runtime.JNLPRuntime;
 import net.sourceforge.jnlp.util.logging.OutputController;
 
 /*
@@ -467,6 +468,7 @@
                             "Height = ", height, "\n",
                             "DocumentBase = ", documentBase, "\n",
                             "Params = ", paramString);
+        JNLPRuntime.saveHistory(documentBase);
 
         PluginAppletPanelFactory factory = new PluginAppletPanelFactory();
         AppletMessageHandler amh = new AppletMessageHandler("appletviewer");