changeset 1906:91e3d06e1283

Merge
author Andrew John Hughes <ahughes@redhat.com>
date Wed, 20 Jan 2010 10:48:37 +0000
parents a8247a10bcac (current diff) 98c88b32cdb4 (diff)
children bd1235460fae
files ChangeLog Makefile.am configure.ac
diffstat 7 files changed, 104 insertions(+), 71 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun Jan 17 19:06:56 2010 +0000
+++ b/ChangeLog	Wed Jan 20 10:48:37 2010 +0000
@@ -1,8 +1,38 @@
+2010-01-19 Man Lung Wong  <mwong@redhat.com>
+
+	* rt/net/sourceforge/jnlp/JNLPFile.java
+	(parse): Added a default value for sourceLocation to make sure it is
+	not null (location is never null).
+	* rt/net/sourceforge/jnlp/Parser.java:
+	Removed variable base, and replaced it with codebase. The fix ended
+	with base the same as codebase, hence no longer needed. Otherwise,
+	netx will launch a jnlp file with codebase null and href not 
+	null (not the way sun's webstart behaves).
+	* rt/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
+	(setSecurity): Added a variable codebase, which gets the value of
+	codebae attribute in the jnlp file ifit exists. Otherwise, it gets
+	the value of the location of main jar resource (which needs to be
+	changed to the codebase portion instead of the entire location).
+
+2010-01-18 Andrew John Hughes  <ahughes@redhat.com>
+
+	* configure.ac:
+	Use AC_LANG_PUSH and AC_LANG_POP instead
+	of deprecated SAVE and RESTORE macros.
+
+2010-01-18 Andrew John Hughes  <ahughes@redhat.com>
+
+	PR icedtea/416:
+	* Makefile.am:
+	Use $(OPENJDK_SRC_ZIP) and $(HOTSPOT_SRC_ZIP)
+	to determine names of tarballs rather than
+	hardcoding openjdk.tar.gz and hotspot.tar.gz
+
 2010-01-17 Andrew John Hughes  <ahughes@redhat.com>
 
 	* acinclude.m4:
 	Re-add missing bracket removed by merge.
-	
+
 2010-01-16 Andrew John Hughes  <ahughes@redhat.com>
 
 	* patches/icedtea-liveconnect.patch:
@@ -14,6 +44,11 @@
 	Remove @Override on interface methods
 	in OCSPResponse.java
 	http://hg.openjdk.java.net/jdk6/jdk6/jdk/rev/c33ca6c539bf
+	
+2010-01-17  Matthias Klose  <doko@ubuntu.com>
+
+	* patches/icedtea-sparc-trapsfix.patch: Merged sparc headers
+	are located in asm/.
 
 2010-01-16 Andrew John Hughes  <ahughes@redhat.com>
 
--- a/Makefile.am	Sun Jan 17 19:06:56 2010 +0000
+++ b/Makefile.am	Wed Jan 20 10:48:37 2010 +0000
@@ -1895,8 +1895,10 @@
 			'--with-rmic=% '--with-additional-vms=% \
 			'--with-openjdk '--with-openjdk=% , \
 		$(CONFIGURE_ARGS)) \
-	$(foreach i, openjdk hotspot, \
-	  $(if $(findstring --with-$(i)-src-zip=, $(CONFIGURE_ARGS)),, --with-$(i)-src-zip=$(abs_top_builddir)/$(i).tar.gz))
+	$(if $(findstring --with-openjdk-src-zip=, $(CONFIGURE_ARGS)),, \
+	  --with-openjdk-src-zip=$(abs_top_builddir)/$(OPENJDK_SRC_ZIP)) \
+	$(if $(findstring --with-hotspot-src-zip=, $(CONFIGURE_ARGS)),, \
+	  --with-hotspot-src-zip=$(abs_top_builddir)/$(HOTSPOT_SRC_ZIP))
 
 ADD_ZERO_EXTRA_BUILD_ENV = \
 	BUILD_LANGTOOLS=false ALT_LANGTOOLS_DIST=$(ICEDTEA_BUILD_DIR)/langtools/dist \
--- a/configure.ac	Sun Jan 17 19:06:56 2010 +0000
+++ b/configure.ac	Wed Jan 20 10:48:37 2010 +0000
@@ -1,4 +1,4 @@
-AC_INIT([icedtea6], [1.8pre], [distro-pkg-dev@openjdk.java.net])
+AC_INIT([icedtea6],[1.8pre],[distro-pkg-dev@openjdk.java.net])
 AM_INIT_AUTOMAKE([1.9 tar-pax foreign])
 AC_CONFIG_FILES([Makefile])
 
@@ -318,8 +318,7 @@
                    AC_MSG_ERROR([systemtap support needs sys/sdt.h header])])
 
  AC_MSG_CHECKING([working sys/sdt.h and g++ support])
- AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
+ AC_LANG_PUSH([C++])
  AC_LINK_IFELSE([AC_LANG_PROGRAM([[
 #include <sys/sdt.h>
 class ProbeClass
@@ -352,7 +351,7 @@
   ProbeClass inst = ProbeClass(i, "call");
   inst.method(24);
 ]])], [AC_MSG_RESULT([yes])], [AC_MSG_ERROR([systemtap sdt.h or g++ too old])])
-  AC_LANG_RESTORE
+  AC_LANG_POP([C++])
 
   AC_MSG_CHECKING([for absolute java home install dir])
   AC_ARG_WITH([abs-install-dir],
--- a/patches/icedtea-sparc-trapsfix.patch	Sun Jan 17 19:06:56 2010 +0000
+++ b/patches/icedtea-sparc-trapsfix.patch	Wed Jan 20 10:48:37 2010 +0000
@@ -1,21 +1,12 @@
-diff -Nru openjdk.orig/hotspot/src/os_cpu/linux_sparc/vm/assembler_linux_sparc.cpp openjdk/hotspot/src/os_cpu/linux_sparc/vm/assembler_linux_sparc.cpp
---- openjdk.orig/hotspot/src/os_cpu/linux_sparc/vm/assembler_linux_sparc.cpp	2008-08-04 08:40:18.000000000 +0100
-+++ openjdk/hotspot/src/os_cpu/linux_sparc/vm/assembler_linux_sparc.cpp	2008-08-09 01:29:51.000000000 +0100
-@@ -25,7 +25,16 @@
+--- openjdk/hotspot/src/os_cpu/linux_sparc/vm/assembler_linux_sparc.cpp.orig	2010-01-16 23:19:45.703450297 +0000
++++ openjdk/hotspot/src/os_cpu/linux_sparc/vm/assembler_linux_sparc.cpp	2010-01-16 23:21:23.942337146 +0000
+@@ -25,7 +25,8 @@
  #include "incls/_precompiled.incl"
  #include "incls/_assembler_linux_sparc.cpp.incl"
  
 -#include <asm-sparc/traps.h>
-+/* Headers for 32bit sparc with a 32bit userland end up in asm/
-+ * Headers for 32bit sparc with a 64bit userland end up in asm-sparc/
-+ * There is no traps.h in asm-sparc64/
-+ */
-+
-+#if defined(__sparc__) && defined(__arch64__)
-+# include <asm-sparc/traps.h>
-+#else 
-+# include <asm/traps.h>
-+#endif
++// always found in asm/ with merged sparc/sparc64 headers
++#include <asm/traps.h>
  
  void MacroAssembler::read_ccr_trap(Register ccr_save) {
    // No implementation
--- a/rt/net/sourceforge/jnlp/JNLPFile.java	Sun Jan 17 19:06:56 2010 +0000
+++ b/rt/net/sourceforge/jnlp/JNLPFile.java	Wed Jan 20 10:48:37 2010 +0000
@@ -559,8 +559,7 @@
             specVersion = parser.getSpecVersion();
             fileVersion = parser.getFileVersion();
             codeBase = parser.getCodeBase();
-            sourceLocation = parser.getFileLocation();
-
+            sourceLocation = parser.getFileLocation() != null ? parser.getFileLocation() : location;
             info = parser.getInfo(root);
             resources = parser.getResources(root, false); // false == not a j2se/java resources section
             launchType = parser.getLauncher(root);
--- a/rt/net/sourceforge/jnlp/Parser.java	Sun Jan 17 19:06:56 2010 +0000
+++ b/rt/net/sourceforge/jnlp/Parser.java	Wed Jan 20 10:48:37 2010 +0000
@@ -87,9 +87,6 @@
     /** the specification version */
     private Version spec;
 
-    /** the base URL that all hrefs are relative to */
-    private URL base;
-
     /** the codebase URL */
     private URL codebase;
 
@@ -132,8 +129,8 @@
         // JNLP tag information
         this.spec = getVersion(root, "spec", "1.0+");
         this.codebase = addSlash(getURL(root, "codebase", base));
-        this.base = (codebase!=null) ? codebase : base; // if codebase not specified use default codebase
-        fileLocation = getURL(root, "href", this.base);
+        
+        fileLocation = getURL(root, "href", codebase);
 
         // ensure version is supported
         if (!supportedVersions.matchesAny(spec))
@@ -279,7 +276,7 @@
      */
     public JREDesc getJRE(Node node) throws ParseException {
         Version version = getVersion(node, "version", null);
-        URL location = getURL(node, "href", base);
+        URL location = getURL(node, "href", codebase);
         String vmArgs = getAttribute(node, "java-vm-args",null);
         try {
             checkVMArgs(vmArgs);
@@ -306,7 +303,7 @@
      */
     public JARDesc getJAR(Node node) throws ParseException {
         boolean nativeJar = "nativelib".equals(node.getNodeName());
-        URL location = getRequiredURL(node, "href", base);
+        URL location = getRequiredURL(node, "href", codebase);
         Version version = getVersion(node, "version", null);
         String part = getAttribute(node, "part", null);
         boolean main = "true".equals(getAttribute(node, "main", "false"));
@@ -330,7 +327,7 @@
     public ExtensionDesc getExtension(Node node) throws ParseException {
         String name = getAttribute(node, "name", null);
         Version version = getVersion(node, "version", null);
-        URL location = getRequiredURL(node, "href", base);
+        URL location = getRequiredURL(node, "href", codebase);
 
         ExtensionDesc ext = new ExtensionDesc(name, version, location);
 
@@ -433,7 +430,7 @@
                 addInfo(info, child, kind, getSpanText(child));
             }
             if ("homepage".equals(name))
-                addInfo(info, child, null, getRequiredURL(child, "href", base));
+                addInfo(info, child, null, getRequiredURL(child, "href", codebase));
             if ("icon".equals(name))
                 addInfo(info, child, getAttribute(child, "kind", "default"), getIcon(child));
             if ("offline-allowed".equals(name))
@@ -487,7 +484,7 @@
         int height = Integer.parseInt(getAttribute(node, "height", "-1"));
         int size = Integer.parseInt(getAttribute(node, "size", "-1"));
         int depth = Integer.parseInt(getAttribute(node, "depth", "-1"));
-        URL location = getRequiredURL(node, "href", base);
+        URL location = getRequiredURL(node, "href", codebase);
         Object kind = getAttribute(node, "kind", "default"); 
 
         return new IconDesc(location, kind, width, height, depth, size);
@@ -524,8 +521,8 @@
         else if (strict)
             throw new ParseException(R("PEmptySecurity"));
 
-        if (base != null)
-            return new SecurityDesc(file, type, base.getHost());
+        if (codebase != null)
+            return new SecurityDesc(file, type, codebase.getHost());
         else
             return new SecurityDesc(file, type, null);
     }
@@ -592,7 +589,7 @@
     public AppletDesc getApplet(Node node) throws ParseException {
         String name = getRequiredAttribute(node, "name", R("PUnknownApplet"));
         String main = getRequiredAttribute(node, "main-class", null);
-        URL docbase = getURL(node, "documentbase", base);
+        URL docbase = getURL(node, "documentbase", codebase);
         Map paramMap = new HashMap();
         int width = 0;
         int height = 0;
@@ -724,7 +721,7 @@
     public RelatedContentDesc getRelatedContent(Node node) throws ParseException {
         
         getRequiredAttribute(node, "href", null);
-        URL location = getURL(node, "href", base);
+        URL location = getURL(node, "href", codebase);
         
         String title = null;
         String description = null;
@@ -1176,8 +1173,7 @@
             final XMLElement xml = new XMLElement();
             final PipedInputStream pin = new PipedInputStream();
             final PipedOutputStream pout = new PipedOutputStream(pin);
-            final InputStreamReader isr = new InputStreamReader(input);
-            
+            final InputStreamReader isr = new InputStreamReader(input);    
             // Clean the jnlp xml file of all comments before passing
             // it to the parser.
             new Thread(
--- a/rt/net/sourceforge/jnlp/runtime/JNLPClassLoader.java	Sun Jan 17 19:06:56 2010 +0000
+++ b/rt/net/sourceforge/jnlp/runtime/JNLPClassLoader.java	Wed Jan 20 10:48:37 2010 +0000
@@ -167,39 +167,50 @@
     }
 
     private void setSecurity() {
-		/**
-		 * When we're trying to load an applet, file.getSecurity() will return
-		 * null since there is no jnlp file to specify permissions. We
-		 * determine security settings here, after trying to verify jars.
-		 */
-		if (file instanceof PluginBridge) {
-			if (signing == true) {
-				this.security = new SecurityDesc(file, 
-					SecurityDesc.ALL_PERMISSIONS,
-					file.getCodeBase().getHost());
-			} else {
-				this.security = new SecurityDesc(file, 
-					SecurityDesc.SANDBOX_PERMISSIONS, 
-					file.getCodeBase().getHost());
-			}
-		} else { //regular jnlp file
+		
+        URL codebase = null;
+
+        if (file.getCodeBase() != null) {
+            codebase = file.getCodeBase();
+        } else {
+            //Fixme: codebase should be the codebase of the Main Jar not 
+            //the location. Although, it still works in the current state.
+            codebase = file.getResources().getMainJAR().getLocation();
+        }
+
+        /**
+         * When we're trying to load an applet, file.getSecurity() will return
+         * null since there is no jnlp file to specify permissions. We
+         * determine security settings here, after trying to verify jars.
+         */
+        if (file instanceof PluginBridge) {
+            if (signing == true) {
+                this.security = new SecurityDesc(file, 
+                    SecurityDesc.ALL_PERMISSIONS,
+                    codebase.getHost());
+            } else {
+                this.security = new SecurityDesc(file, 
+                    SecurityDesc.SANDBOX_PERMISSIONS, 
+                    codebase.getHost());
+            }
+        } else { //regular jnlp file
 			
-			/**
-			 * If the application is signed, then we set the SecurityDesc to the
-			 * <security> tag in the jnlp file. Note that if an application is
-			 * signed, but there is no <security> tag in the jnlp file, the
-			 * application will get sandbox permissions.
-			 * If the application is unsigned, we ignore the <security> tag and 
-			 * use a sandbox instead. 
-			 */
-			if (signing == true) {
-				this.security = file.getSecurity();
-			} else {
-				this.security = new SecurityDesc(file, 
-						SecurityDesc.SANDBOX_PERMISSIONS, 
-						file.getCodeBase().getHost());
-			}
-		}
+            /**
+             * If the application is signed, then we set the SecurityDesc to the
+             * <security> tag in the jnlp file. Note that if an application is
+             * signed, but there is no <security> tag in the jnlp file, the
+             * application will get sandbox permissions.
+             * If the application is unsigned, we ignore the <security> tag and 
+             * use a sandbox instead. 
+             */
+            if (signing == true) {
+                this.security = file.getSecurity();
+            } else {
+                this.security = new SecurityDesc(file, 
+                        SecurityDesc.SANDBOX_PERMISSIONS, 
+                        codebase.getHost());
+            }
+        }
     }
     
     /**