From d864e54627911e5bd9e3bc520ec099ae2f2253f8 Mon Sep 17 00:00:00 2001 From: Jonathan Gibbons Date: Tue, 25 May 2010 15:39:38 -0700 Subject: [PATCH] 6934615: Relative classpaths in jarfile manifests are handled inefficiently by rmic Reviewed-by: darcy --- .../sun/rmi/rmic/BatchEnvironment.java | 2 +- .../sun/rmi/rmic/manifestClassPath/run.sh | 43 ++++++++----------- 2 files changed, 19 insertions(+), 26 deletions(-) diff --git a/jdk/src/share/classes/sun/rmi/rmic/BatchEnvironment.java b/jdk/src/share/classes/sun/rmi/rmic/BatchEnvironment.java index 7e86857fb1d..7fb9119607b 100644 --- a/jdk/src/share/classes/sun/rmi/rmic/BatchEnvironment.java +++ b/jdk/src/share/classes/sun/rmi/rmic/BatchEnvironment.java @@ -429,7 +429,7 @@ public class BatchEnvironment extends sun.tools.javac.BatchEnvironment { st.hasMoreTokens();) { String elt = st.nextToken(); if (jarParent != null) - elt = new File(jarParent, elt).toString(); + elt = new File(jarParent, elt).getCanonicalPath(); addFile(elt, warn); } } finally { diff --git a/jdk/test/sun/rmi/rmic/manifestClassPath/run.sh b/jdk/test/sun/rmi/rmic/manifestClassPath/run.sh index 7be3091f24e..99130fcbe2c 100644 --- a/jdk/test/sun/rmi/rmic/manifestClassPath/run.sh +++ b/jdk/test/sun/rmi/rmic/manifestClassPath/run.sh @@ -23,7 +23,7 @@ #!/bin/sh # @test -# @bug 6473331 +# @bug 6473331 6485027 6934615 # @summary Test handling of the Class-Path attribute in jar file manifests # for the rmic tool # @author Andrey Ozerov @@ -65,26 +65,23 @@ EOF Sys "$javac" pkg/A.java pkg/B.java -# NOTE: Certain lines below are commented out in order to work around -# bug 6485027, with alternative lines added as part of the workaround -# as indicated. In particular, the mutally referential JAR files are -# placed in the same directory instead of different directories, and -# javac is not expected to handle the extensions directories cases. +# NOTE: Previously, some lines were commented out and alternative lines +# provided, to work around javac bug 6485027. That bug, and related rmic +# bug 6934615 have now been fixed, so most of the workarounds have been +# removed. However, javac still does not evaluate jar class paths on +# the bootclasspath, including -extdirs. -#MkManifestWithClassPath "sub/B.zip" -MkManifestWithClassPath "B.zip" # 6485027 workaround +MkManifestWithClassPath "sub/B.zip" Sys "$jar" cmf MANIFEST.MF A.jar pkg/A.class -#MkManifestWithClassPath "../A.jar" -MkManifestWithClassPath "A.jar" # 6485027 workaround +MkManifestWithClassPath "../A.jar" Sys "$jar" cmf MANIFEST.MF B.zip pkg/B.class Sys rm -rf pkg Sys mkdir jars Sys mv A.jar jars/. -#Sys mkdir jars/sub -#Sys mv B.zip jars/sub/. -Sys mv B.zip jars/. # 6485027 workaround +Sys mkdir jars/sub +Sys mv B.zip jars/sub/. cat >MainI.java <