harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ton...@apache.org
Subject svn commit: r633384 [2/15] - in /harmony/enhanced/classlib/branches/java6: depends/build/platform/ depends/files/ depends/files/bcprov/ doc/ doc/classlib/ make/ make/linux.ia64/ make/linux.ppc32/ make/linux.ppc64/ make/linux.x86.libstdc++6/ make/linux....
Date Tue, 04 Mar 2008 08:02:45 GMT

Modified: harmony/enhanced/classlib/branches/java6/depends/build/platform/zos.s390.mk
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/depends/build/platform/zos.s390.mk?rev=633384&r1=633383&r2=633384&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/depends/build/platform/zos.s390.mk (original)
+++ harmony/enhanced/classlib/branches/java6/depends/build/platform/zos.s390.mk Tue Mar  4 00:02:13 2008
@@ -22,10 +22,10 @@
 DEFINES += -DZOS -DZOS_S390 -DHYS390 -DHY_ATOE
 OPT += -Wc,xplink,convlit\(ISO8859-1\),FLOAT\(IEEE,FOLD,AFP\) -Wc,"langlvl(commonc)" -Wa,goff -Wc,NOANSIALIAS -Wc,DLL,EXPORTALL
 
-CFLAGS += -Wc,"SSCOMM" -Wc,"langlvl(commonc)"
-CXXFLAGS += -+ -Wc,"langlvl(extended)"
+CFLAGS += -Wc,"SSCOMM" -Wc,"langlvl(commonc)" -Wc,gonumber
+CXXFLAGS += -+ -Wc,"langlvl(extended)" -Wc,gonumber
 
-ASFLAGS += -Wc,xplink,convlit\(ISO8859-1\) -Wa,goff -Wc,NOANSIALIAS -Wc,DLL,EXPORTALL -c
+ASFLAGS += -Wc,xplink,convlit\(ISO8859-1\) -Wc,gonumber -Wa,goff -Wc,NOANSIALIAS -Wc,DLL,EXPORTALL -c
 LDFLAGS += -Wl,xplink,dll
 
 # No need for --start-group and --end-group tags here

Propchange: harmony/enhanced/classlib/branches/java6/doc/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Mar  4 00:02:13 2008
@@ -0,0 +1,7 @@
+classlib_doc
+kernel_doc
+vm_doc
+DoxygenClasslibLog.txt
+DoxygenKernelLog.txt
+DoxygenNativesLog.txt
+temp

Modified: harmony/enhanced/classlib/branches/java6/doc/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/doc/build.xml?rev=633384&r1=633383&r2=633384&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/doc/build.xml (original)
+++ harmony/enhanced/classlib/branches/java6/doc/build.xml Tue Mar  4 00:02:13 2008
@@ -94,6 +94,111 @@
     </target>
 
     <!-- ================================= 
+          target: jdocs
+          
+          The jdocs target is used to generate a .jdoc file description of the Harmony
+          API suitable for uploading to the JDocs.com website.
+          
+          It has a dependency on a new task defined in "jdocs.jar" and available to download
+          from http://www.jdocs.com/page/AntTask
+          
+          This is work in progress, and currently requires you to manually download and
+          extract the source code for MX4J, Yoko, and XML commons into a 'temp' directory.
+          Plans are to automate that one the doc generation is up and running ok.
+          
+          The task description for jdocs is similar to the javadoc task - so to test it
+          you can always temporarily change it to javadoc and view the output. 
+         ================================= -->
+    <target name="jdocs">
+        <property name="modules.dir" location="${basedir}/../modules"/>
+        <taskdef name="jdocs" classname="com.dzone.jdocs.ant.jdk15.task.Jdocs"/>
+        <jdocs destdir="${basedir}/javadoc"
+            access="protected" >
+
+            <!-- Source files maintained by Harmony -->
+            <packageset dir="${modules.dir}/accessibility/src/main/java/">
+                <!-- This patternset will exclude any non-API packages -->
+                <patternset id="sourcefiles">
+                    <exclude name="org/apache/harmony/**" />
+                    <exclude name="java/awt/dnd/peer" />
+                    <exclude name="java/awt/peer" />
+                </patternset>
+            </packageset>
+
+            <packageset dir="${modules.dir}/annotation/src/main/java/"> <patternset refid="sourcefiles"/> </packageset>
+            <packageset dir="${modules.dir}/applet/src/main/java"> <patternset refid="sourcefiles"/> </packageset>
+            <packageset dir="${modules.dir}/archive/src/main/java"> <patternset refid="sourcefiles"/> </packageset>
+            <packageset dir="${modules.dir}/auth/src/main/java/${hy.os.family}"> <patternset refid="sourcefiles"/> </packageset>
+            <packageset dir="${modules.dir}/auth/src/main/java/common"> <patternset refid="sourcefiles"/> </packageset>
+            <packageset dir="${modules.dir}/awt/src/main/java/${hy.os.family}"> <patternset refid="sourcefiles"/> </packageset>
+            <packageset dir="${modules.dir}/awt/src/main/java/common"> <patternset refid="sourcefiles"/> </packageset>
+            <packageset dir="${modules.dir}/beans/src/main/java"> <patternset refid="sourcefiles"/> </packageset>
+            <packageset dir="${modules.dir}/concurrent/src/main/java/"> <patternset refid="sourcefiles"/> </packageset>
+            <packageset dir="${modules.dir}/concurrent/standard/src/main/java/"> <patternset refid="sourcefiles"/> </packageset>
+            <packageset dir="${modules.dir}/crypto/src/main/java"> <patternset refid="sourcefiles"/> </packageset>
+            <packageset dir="${modules.dir}/instrument/src/main/java"> <patternset refid="sourcefiles"/> </packageset>
+            <packageset dir="${modules.dir}/imageio/src/main/java"> <patternset refid="sourcefiles"/> </packageset>
+            <packageset dir="${modules.dir}/jndi/src/main/java"> <patternset refid="sourcefiles"/> </packageset>
+            <packageset dir="${modules.dir}/logging/src/main/java"> <patternset refid="sourcefiles"/> </packageset>
+            <packageset dir="${modules.dir}/lang-management/src/main/java/"> <patternset refid="sourcefiles"/> </packageset>
+            <packageset dir="${modules.dir}/luni-kernel/src/main/java"> <patternset refid="sourcefiles"/> </packageset>
+            <packageset dir="${modules.dir}/luni/src/main/java"> <patternset refid="sourcefiles"/> </packageset>
+            <packageset dir="${modules.dir}/math/src/main/java"> <patternset refid="sourcefiles"/> </packageset>
+            <packageset dir="${modules.dir}/misc/src/main/java"> <patternset refid="sourcefiles"/> </packageset>
+            <packageset dir="${modules.dir}/nio/src/main/java/common"> <patternset refid="sourcefiles"/> </packageset>
+            <packageset dir="${modules.dir}/nio/src/main/java/${hy.os.family}"> <patternset refid="sourcefiles"/> </packageset>
+            <packageset dir="${modules.dir}/nio_char/src/main/java"> <patternset refid="sourcefiles"/> </packageset>
+            <packageset dir="${modules.dir}/pack200/src/main/java"> <patternset refid="sourcefiles"/> </packageset>
+            <packageset dir="${modules.dir}/pack200/src/main/java5"> <patternset refid="sourcefiles"/> </packageset>
+            <packageset dir="${modules.dir}/prefs/src/main/java"> <patternset refid="sourcefiles"/> </packageset>
+            <packageset dir="${modules.dir}/print/src/main/java/${hy.os.family}"> <patternset refid="sourcefiles"/> </packageset>
+            <packageset dir="${modules.dir}/print/src/main/java/common"> <patternset refid="sourcefiles"/> </packageset>
+            <packageset dir="${modules.dir}/regex/src/main/java"> <patternset refid="sourcefiles"/> </packageset>
+            <packageset dir="${modules.dir}/rmi/src/main/java"> <patternset refid="sourcefiles"/> </packageset>
+            <packageset dir="${modules.dir}/security-kernel/src/main/java"> <patternset refid="sourcefiles"/> </packageset>
+            <packageset dir="${modules.dir}/security/src/main/java/${hy.os.family}"> <patternset refid="sourcefiles"/> </packageset>
+            <packageset dir="${modules.dir}/security/src/main/java/common"> <patternset refid="sourcefiles"/> </packageset>
+            <packageset dir="${modules.dir}/sound/src/main/java"> <patternset refid="sourcefiles"/> </packageset>
+            <packageset dir="${modules.dir}/sql/src/main/java"> <patternset refid="sourcefiles"/> </packageset>
+            <packageset dir="${modules.dir}/swing/src/main/java/${hy.os.family}"> <patternset refid="sourcefiles"/> </packageset>
+            <packageset dir="${modules.dir}/swing/src/main/java/common"> <patternset refid="sourcefiles"/> </packageset>
+            <packageset dir="${modules.dir}/text/src/main/java"> <patternset refid="sourcefiles"/> </packageset>
+            <packageset dir="${modules.dir}/x-net/src/main/java/"> <patternset refid="sourcefiles"/> </packageset>
+
+            <!-- Source files for our API dependencies -->
+            <!-- MX4J -->
+            <packageset dir="${basedir}/temp/mx4j-3.0.2/src/core/">
+                <include name="javax/**" />
+            </packageset>
+
+            <!-- Apache Yoko -->
+            <packageset dir="${basedir}/temp/yoko-incubating-src-1.0-M2/rmi-spec/src/main/java">
+                <include name="javax/**" />
+            </packageset>
+            <packageset dir="${basedir}/temp/yoko-incubating-src-1.0-M2/yoko-spec-corba/src/main/java">
+                <include name="org/omg/**" />
+            </packageset>
+           
+            <!-- XML commons -->
+            <packageset dir="${basedir}/temp/xml-commons-external-1.3.04-src">
+                <include name="javax/**" />
+                <include name="org/w3c/dom" />
+                <include name="org/w3c/dom/bootstrap" />
+                <include name="org/w3c/dom/events" />
+                <include name="org/w3c/dom/ls" />
+                <include name="org/xml/sax/**" />
+            </packageset>
+            
+            <classpath>
+                <fileset dir="../deploy/jdk/jre/lib/boot">
+                    <include name="**/*.jar" />
+                    <exclude name="**/*-src.jar" />
+                </fileset>
+            </classpath>
+        </jdocs>
+    </target>
+    
+    <!-- ================================= 
           target: clean-kernel    
          ================================= -->
     <target name="clean-kernel" description="Clean away the generated kernel documentation.">

Modified: harmony/enhanced/classlib/branches/java6/doc/classlib/classlib.cfg
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/doc/classlib/classlib.cfg?rev=633384&r1=633383&r2=633384&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/doc/classlib/classlib.cfg (original)
+++ harmony/enhanced/classlib/branches/java6/doc/classlib/classlib.cfg Tue Mar  4 00:02:13 2008
@@ -227,12 +227,12 @@
 # Private class members and static file members will be hidden unless
 # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
 
-EXTRACT_ALL            = NO
+EXTRACT_ALL            = YES
 
 # If the EXTRACT_PRIVATE tag is set to YES all private members of a class
 # will be included in the documentation.
 
-EXTRACT_PRIVATE        = YES
+EXTRACT_PRIVATE        = NO
 
 # If the EXTRACT_STATIC tag is set to YES all static members of a file
 # will be included in the documentation.
@@ -401,7 +401,7 @@
 # for undocumented members. If EXTRACT_ALL is set to YES then this flag will
 # automatically be disabled.
 
-WARN_IF_UNDOCUMENTED   = YES
+WARN_IF_UNDOCUMENTED   = NO
 
 # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
 # potential errors in the documentation, such as not documenting some
@@ -434,23 +434,42 @@
 
 # Must set the HARMONY_DOC_DIR to find the input.
 INPUT	= \
+  "$(HARMONY_DOC_DIR)/../modules/accessibility/src/main/java" \
+  "$(HARMONY_DOC_DIR)/../modules/annotation/src/main/java" \
   "$(HARMONY_DOC_DIR)/../modules/applet/src/main/java" \
   "$(HARMONY_DOC_DIR)/../modules/archive/src/main/java" \
+  "$(HARMONY_DOC_DIR)/../modules/auth/src/main/java" \
   "$(HARMONY_DOC_DIR)/../modules/awt/src/main/java" \
   "$(HARMONY_DOC_DIR)/../modules/beans/src/main/java" \
+  "$(HARMONY_DOC_DIR)/../modules/concurrent/src/main/java" \
+  "$(HARMONY_DOC_DIR)/../modules/concurrent/standard/src/main/java" \
   "$(HARMONY_DOC_DIR)/../modules/crypto/src/main/java" \
+  "$(HARMONY_DOC_DIR)/../modules/imageio/src/main/java" \
+  "$(HARMONY_DOC_DIR)/../modules/instrument/src/main/java" \
   "$(HARMONY_DOC_DIR)/../modules/jndi/src/main/java" \
+  "$(HARMONY_DOC_DIR)/../modules/lang-management/src/main/java" \
   "$(HARMONY_DOC_DIR)/../modules/logging/src/main/java" \
   "$(HARMONY_DOC_DIR)/../modules/luni/src/main/java" \
+  "$(HARMONY_DOC_DIR)/../modules/luni-kernel/src/main/java" \
   "$(HARMONY_DOC_DIR)/../modules/math/src/main/java" \
-  "$(HARMONY_DOC_DIR)/../modules/nio/src/main/java" \
+  "$(HARMONY_DOC_DIR)/../modules/misc/src/main/java" \
+  "$(HARMONY_DOC_DIR)/../modules/nio/src/main/java/common" \
+  "$(HARMONY_DOC_DIR)/../modules/nio/src/main/java/$(HARMONY_OS)" \
   "$(HARMONY_DOC_DIR)/../modules/nio_char/src/main/java" \
+  "$(HARMONY_DOC_DIR)/../modules/pack200/src/main/java" \
+  "$(HARMONY_DOC_DIR)/../modules/pack200/src/main/java5" \
   "$(HARMONY_DOC_DIR)/../modules/prefs/src/main/java" \
+  "$(HARMONY_DOC_DIR)/../modules/print/src/main/java" \
   "$(HARMONY_DOC_DIR)/../modules/regex/src/main/java" \
   "$(HARMONY_DOC_DIR)/../modules/rmi/src/main/java" \
   "$(HARMONY_DOC_DIR)/../modules/security/src/main/java/common" \
   "$(HARMONY_DOC_DIR)/../modules/security/src/main/java/$(HARMONY_OS)" \
+  "$(HARMONY_DOC_DIR)/../modules/security-kernel/src/main/java" \
+  "$(HARMONY_DOC_DIR)/../modules/sound/src/main/java" \
   "$(HARMONY_DOC_DIR)/../modules/sql/src/main/java" \
+# "$(HARMONY_DOC_DIR)/../modules/suncompat/src/main/java" \
+  "$(HARMONY_DOC_DIR)/../modules/swing/src/main/java/common" \
+  "$(HARMONY_DOC_DIR)/../modules/swing/src/main/java/$(HARMONY_OS)" \
   "$(HARMONY_DOC_DIR)/../modules/text/src/main/java" \
   "$(HARMONY_DOC_DIR)/../modules/x-net/src/main/java" \
   "$(HARMONY_DOC_DIR)/classlib"
@@ -475,7 +494,7 @@
 # excluded from the INPUT source files. This way you can easily exclude a
 # subdirectory from a directory tree whose root is specified with the INPUT tag.
 
-EXCLUDE                =
+EXCLUDE                = 
 
 # The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories
 # that are symbolic links (a Unix filesystem feature) are excluded from the input.
@@ -486,7 +505,7 @@
 # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
 # certain files from those directories.
 
-EXCLUDE_PATTERNS       = */.svn/*
+EXCLUDE_PATTERNS       = */.svn/* */org/apache/harmony/*
 
 # The EXAMPLE_PATH tag can be used to specify one or more files or
 # directories that contain example code fragments that are included (see
@@ -587,7 +606,7 @@
 # of all compounds will be generated. Enable this if the project
 # contains a lot of classes, structs, unions or interfaces.
 
-ALPHABETICAL_INDEX     = NO
+ALPHABETICAL_INDEX     = YES
 
 # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
 # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
@@ -706,7 +725,7 @@
 # Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
 # probably better off using the HTML help feature.
 
-GENERATE_TREEVIEW      = NO
+GENERATE_TREEVIEW      = YES
 
 # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
 # used to set the initial width (in pixels) of the frame in which the tree

Modified: harmony/enhanced/classlib/branches/java6/doc/hyfooter.txt
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/doc/hyfooter.txt?rev=633384&r1=633383&r2=633384&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/doc/hyfooter.txt (original)
+++ harmony/enhanced/classlib/branches/java6/doc/hyfooter.txt Tue Mar  4 00:02:13 2008
@@ -2,7 +2,7 @@
 <address style="text-align: center;">
   <small>
     <p>Genereated on $datetime by Doxygen.</p>
-    <p>(c) Copyright 2005, 2006 The Apache Software Foundation or its licensors, as applicable. </p>
+    <p>(c) Copyright 2005, 2008 The Apache Software Foundation or its licensors, as applicable. </p>
   </small>
 </address>
 </body>

Modified: harmony/enhanced/classlib/branches/java6/make/build-java.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/make/build-java.xml?rev=633384&r1=633383&r2=633384&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/make/build-java.xml (original)
+++ harmony/enhanced/classlib/branches/java6/make/build-java.xml Tue Mar  4 00:02:13 2008
@@ -154,6 +154,7 @@
             <src path="modules/security-kernel/src/main/java" />
             <src path="modules/security/src/main/java/${hy.os.family}" />
             <src path="modules/security/src/main/java/common" />
+            <src path="modules/sound/src/main/java" />
             <src path="modules/sql/src/main/java" />
             <src path="modules/suncompat/src/main/java" />
             <src path="modules/swing/src/main/java/${hy.os.family}" />

Modified: harmony/enhanced/classlib/branches/java6/make/build-native.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/make/build-native.xml?rev=633384&r1=633383&r2=633384&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/make/build-native.xml (original)
+++ harmony/enhanced/classlib/branches/java6/make/build-native.xml Tue Mar  4 00:02:13 2008
@@ -36,6 +36,12 @@
     <property name="depends.libs" location="depends/libs/${hy.platform}" />
     <property name="depends.files" location="depends/files" />
     <property name="native.lib.target" location="${hy.hdk}/lib" />
+    <condition property="needs.vme.v3.hack" value="true">
+        <or>
+            <equals arg1="${hy.platform}" arg2="windows.x86" />
+            <equals arg1="${hy.platform}" arg2="linux.x86" />
+        </or>
+    </condition>
 
     <!-- ================================= 
           target: default              
@@ -108,7 +114,7 @@
     <!-- ================================= 
           target: layout              
          ================================= -->
-    <target name="layout" depends="-layout.windows,-layout.linklib"
+    <target name="layout" depends="-layout.windows,-layout.vme.v3.hack"
         description="Construct the correct directory structure for native binaries">
 
     	<!-- Create the target directory structure -->
@@ -123,11 +129,6 @@
             </fileset>
         </copy>
 
-        <!-- Copy across dependency shared libs -->
-        <copy todir="${hy.jdk}/jre/bin" overwrite="yes">
-            <fileset dir="${icudll.dir}" includes="*${shlib.suffix}*" />
-        </copy>
-
     </target>
 
     <target name="-layout.windows" if="is.windows"
@@ -137,11 +138,19 @@
         <copy file="${msvcp.dll}" todir="${hy.jdk}/jre/bin" overwrite="yes" />
     </target>
 
-    <target name="-layout.linklib" unless="shlib.is.linklib">
-        <!-- on windows copy .lib files and on z/OS copy across .x files
-             to link against -->
-        <copy todir="${hy.hdk}/lib" overwrite="yes">
-            <fileset dir="${icudll.dir}" includes="*${linklib.suffix}*" />
+    <target name="-layout.vme.v3.hack" if="needs.vme.v3.hack">
+        <echo>Deploying empty ICU dynamic library stub</echo>
+        <copy todir="${hy.jdk}/jre/bin" verbose="true">
+            <fileset dir="${depends.files}">
+                <include name="hyempty.dll" if="is.windows" />
+            </fileset>
+            <globmapper from="*hyempty.dll" to="*ICUInterface34.dll" />
+        </copy>
+        <copy todir="${hy.jdk}/jre/bin" verbose="true">
+            <fileset dir="${depends.files}">
+                <include name="libhyempty.so" if="is.linux" />
+            </fileset>
+            <globmapper from="*libhyempty.so" to="*libICUInterface34.so" />
         </copy>
     </target>
 
@@ -154,6 +163,7 @@
                 <include name="**/bin/java${exe.suffix}" />
                 <include name="**/bin/javaw${exe.suffix}" />
                 <include name="**/bin/*${shlib.suffix}*" />
+                <include name="**/bin/*.pdb" />
             	<include name="**/bin/harmony*.properties" />
             </fileset>
         </delete>
@@ -169,10 +179,6 @@
 
     	<ant dir="modules/archive" antfile="build.xml" 
 	     target="overlay-oss" />        
-    	
-        <mkdir dir="${hy.hdk}/include/icu4c/unicode" />
-        <unzip src="${icuhdr.zip}" dest="${hy.hdk}/include/icu4c/unicode" />
-        <chmod dir="${hy.hdk}/include/icu4c/unicode" perm="ugo+r" />
     </target>
 
     <!-- ================================= 
@@ -238,7 +244,6 @@
              target="clean-overlay-oss" />
      	<ant dir="modules/archive" antfile="build.xml" 
     	     target="clean-overlay-oss" />
-	<delete dir="${hy.hdk}/include/icu4c" quiet="true" />     
     </target>
 
 </project>

Modified: harmony/enhanced/classlib/branches/java6/make/depends.properties
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/make/depends.properties?rev=633384&r1=633383&r2=633384&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/make/depends.properties (original)
+++ harmony/enhanced/classlib/branches/java6/make/depends.properties Tue Mar  4 00:02:13 2008
@@ -140,10 +140,6 @@
 derby.md5=f28d6047ab26445de53c4c96126494df
 
 depends.url=http://svn.apache.org/repos/asf/harmony/standard/depends
-icudll.dir=${depends.dir}/libs/${hy.platform.variant}/icu-3.4
-icudll.zip=${depends.dir}/libs/${hy.platform.variant}/icu-3.4/icu-3.4.zip
-icudll.url=${depends.url}/libs/${hy.platform.variant}/icu-3.4.zip
-icuhdr.zip=${depends.dir}/oss/icu4c-3.4-harmony-includes.zip
 
 bcprov.ver=bcprov-jdk15-138
 bcprov.dir=${depends.jars}/${bcprov.ver}

Modified: harmony/enhanced/classlib/branches/java6/make/depends.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/make/depends.xml?rev=633384&r1=633383&r2=633384&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/make/depends.xml (original)
+++ harmony/enhanced/classlib/branches/java6/make/depends.xml Tue Mar  4 00:02:13 2008
@@ -26,7 +26,6 @@
     </description>
 
     <import file="${basedir}/make/properties.xml" />
-    <property file="make/${hy.platform.variant}/depends.properties" />
     <property file="make/depends.properties" />
 
     <target name="check" description="Check whether dependencies are available"
@@ -49,7 +48,6 @@
         <check-one-file src="${servlet-api.url}" dest="${servlet-api.jar}" />
         <check-one-file src="${dejavu-fonts.url}" dest="${dejavu-fonts.zip}" />
         <check-one-file src="${derby.url}" dest="${derby.jar}" />
-        <check-one-file src="${icudll.url}" dest="${icudll.zip}" />
     </target>
 
     <target name="-check-win" if="is.windows" depends="-really-check-win" />
@@ -108,29 +106,8 @@
         <antcall target="-awt-tar-extract" />
     </target>
 
-    <target name="-temporary-warning" if="is.windows">
-        <!-- TODO: Remove this target in a week or two or when we
-             update to icu4c 3.8
-          -->
-        <condition property="windows.warn">
-            <not><available file="${icudll.dir}/icuuc.lib" /></not>
-        </condition>
-        <fail if="windows.warn">
-...
-
-
-Please remove the directory:
-
-  ${icudll.dir}
-
-and re-run "ant fetch-depends" to get a new version of icu-3.4.zip.  Sorry
-for the inconvinience.
-
-        </fail>
-    </target>
-
     <target name="-extract"
-         depends="-extract-props,-extract-mx4j,-extract-dejavu-fonts,-extract-xerces,-extract-icudlls,-temporary-warning" />
+         depends="-extract-props,-extract-mx4j,-extract-dejavu-fonts,-extract-xerces" />
 
     <target name="-extract-props">
         <uptodate property="dejavu-fonts.uptodate"
@@ -142,10 +119,6 @@
         <uptodate property="xerces.uptodate"
                   srcfile="${xerces.zip}"
                   targetfile="${xerces.dir}/xercesImpl.jar" />
-        <uptodate property="icudlls.uptodate"
-                  srcfile="${icudll.zip}"
-                  targetfile="${icudll.dir}/uptodate" />
-
     </target>
 
 
@@ -192,11 +165,6 @@
 	<touch file="${xerces.dir}/xercesImpl.jar" />
     </target>
 
-    <target name="-extract-icudlls" unless="icudlls.uptodate">
-        <unzip src="${icudll.zip}" dest="${icudll.dir}" />
-        <touch file="${icudll.dir}/uptodate" />
-    </target>
-
     <!-- 
        *  FIXME : the following awful little hack is because we noticed that for whatever
        *  reason, we can't link with libjpg.a et al on at least to kinds of 64-bit linux
@@ -429,10 +397,6 @@
     <download-one-file src="${derby.url}"
                        dest="${derby.jar}"
                        md5="${derby.md5}" />
-    <mkdir dir="${icudll.dir}" />
-    <download-one-file src="${icudll.url}"
-                       dest="${icudll.zip}"
-                       md5="${icudll.md5}" />
     </target>
 
     <target name="-download-win" if="is.windows" depends="-select-win-deps-x86_64,-select-win-deps-x86">

Modified: harmony/enhanced/classlib/branches/java6/modules/applet/src/main/java/java/applet/Applet.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/applet/src/main/java/java/applet/Applet.java?rev=633384&r1=633383&r2=633384&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/applet/src/main/java/java/applet/Applet.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/applet/src/main/java/java/applet/Applet.java Tue Mar  4 00:02:13 2008
@@ -169,7 +169,7 @@
     }
 
     public Image getImage(URL url) {
-        return Toolkit.getDefaultToolkit().getImage(url);
+        return getAppletContext().getImage(url);
     }
 
     public Image getImage(URL url, String name) {
@@ -230,7 +230,7 @@
 
     private static URL appendURL(URL url, String name) {
         try {
-            return new URL(url.toString() + name);
+            return new URL(url, name);
         } catch (MalformedURLException e) {
             return null;
         }

Modified: harmony/enhanced/classlib/branches/java6/modules/applet/src/main/java/org/apache/harmony/applet/Factory.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/applet/src/main/java/org/apache/harmony/applet/Factory.java?rev=633384&r1=633383&r2=633384&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/applet/src/main/java/org/apache/harmony/applet/Factory.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/applet/src/main/java/org/apache/harmony/applet/Factory.java Tue Mar  4 00:02:13 2008
@@ -91,6 +91,13 @@
         Proxy p = new Proxy(ds, params);
         p.create();
     }
+
+    void createAndRun(int id, long parentWindowId, URL documentBase,
+                int documentId, URL codeBase, String className,
+                String []paramStrings, String name, Object container) {
+        Parameters params = new Parameters(id, parentWindowId, documentBase, documentId, codeBase, className, paramStrings, name, container);
+        createAndRun(params);
+    }
     
     void start(int id) {
         Proxy p = allProxies.get(new Integer(id));

Modified: harmony/enhanced/classlib/branches/java6/modules/applet/src/main/java/org/apache/harmony/applet/Parameters.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/applet/src/main/java/org/apache/harmony/applet/Parameters.java?rev=633384&r1=633383&r2=633384&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/applet/src/main/java/org/apache/harmony/applet/Parameters.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/applet/src/main/java/org/apache/harmony/applet/Parameters.java Tue Mar  4 00:02:13 2008
@@ -22,6 +22,7 @@
 
 import java.net.URL;
 import java.util.Map;
+import java.util.HashMap;
 
 /**
  * Applet's startup parameters
@@ -66,6 +67,30 @@
         this.className = className;
         this.name = name;
         this.container = container;
+    }
+
+    Parameters(int id,
+                long parentWindowId,
+                URL documentBase,
+                int documentId,
+                URL codeBase,
+                String className,
+                String []paramStrings,
+                String name,
+                Object container) {
+
+        this.id = id;
+        this.parentWindowId = parentWindowId;
+        this.documentBase = documentBase;
+        this.documentId = documentId;
+        this.codeBase = codeBase;
+        this.className = className;
+        this.name = name;
+        this.container = container;
+        
+        this.parameters = new HashMap<String, String>(paramStrings.length/2);
+        for (int i = 0; i+1 < paramStrings.length; i += 2)
+            parameters.put(paramStrings[i], paramStrings[i+1]);
     }
 
     String getParameter(String name) {

Modified: harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/jar/InitManifest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/jar/InitManifest.java?rev=633384&r1=633383&r2=633384&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/jar/InitManifest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/jar/InitManifest.java Tue Mar  4 00:02:13 2008
@@ -67,7 +67,7 @@
         mainAttributesChunk = nextChunk(is, list);
 
         Iterator<String> it = list.iterator();
-        while (it.hasNext()) {
+        while (it.hasNext()) {             
             addAttribute(it.next(), current);
         }
 
@@ -109,7 +109,7 @@
         return mainAttributesChunk;
     }
 
-    private void addLine(int length, List<String> lines) throws IOException {
+    private void addLine(int length, List<String> lines) throws IOException {        
         if (encoding != null) {
             lines.add(new String(buffer, 0, length, encoding));
         } else {
@@ -118,7 +118,8 @@
                     if (charbuf.length < length) {
                         charbuf = new char[length];
                     }
-                    lines.add(Util.convertUTF8WithBuf(buffer, charbuf, 0,
+                    int start = skipFirstEmptyLines(0, buffer);
+                    lines.add(Util.convertUTF8WithBuf(buffer, charbuf, Math.min(Math.max(length - 1, 0), start),
                             length));
                 } catch (UTFDataFormatException e) {
                     usingUTF8 = false;
@@ -135,9 +136,30 @@
                 for (int i = length; --i >= 0;) {
                     charbuf[charOffset++] = (char) (buffer[offset++] & 0xff);
                 }
-                lines.add(new String(charbuf, 0, length));
+                int start = skipFirstEmptyLines(0, buffer);
+                lines.add(new String(charbuf, Math.min(Math.max(length - 1, 0), start), length));
             }
         }
+    }
+
+    private int skipFirstEmptyLines(int start, byte[] buf) {
+        int res = start;
+        if (buf.length > start) {
+            if ((char) buf[res] == '\r') {
+                res++;
+                if ((res < buf.length) && ((char) buf[res] == '\n')) {
+                    res++;
+                    return skipFirstEmptyLines(res, buf);
+                }
+                return res;
+            } else if ((char) buf[res] == '\n') {
+                res++;
+                return skipFirstEmptyLines(res, buf);
+            } else {
+                return res;
+            }
+        }
+        return res;
     }
 
     private byte[] nextChunk(InputStream in, List<String> lines)

Modified: harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/jar/Pack200.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/jar/Pack200.java?rev=633384&r1=633383&r2=633384&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/jar/Pack200.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/jar/Pack200.java Tue Mar  4 00:02:13 2008
@@ -28,7 +28,7 @@
 /**
  * Class that initialize Packer and Unpacker
  * 
- * @see JSR200
+ * See JSR200
  */
 public abstract class Pack200 {
 
@@ -97,7 +97,7 @@
     /**
      * interface of Packer
      * 
-     * @see JSR 200 specification
+     * See JSR 200 specification
      */
     public static interface Packer {
 
@@ -247,7 +247,7 @@
     /**
      * interface of unpacker
      * 
-     * @see JSR 200 specification
+     * See JSR 200 specification
      */
     public static interface Unpacker {
 

Modified: harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/zip/Checksum.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/zip/Checksum.java?rev=633384&r1=633383&r2=633384&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/zip/Checksum.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/zip/Checksum.java Tue Mar  4 00:02:13 2008
@@ -17,12 +17,40 @@
 
 package java.util.zip;
 
+/**
+ * Interface to types that can compute a checksum value of given data.
+ */
 public interface Checksum {
+
+    /**
+     * Answers the computed checksum value so far.
+     * 
+     * @return the checksum value
+     */
     public long getValue();
 
+    /**
+     * Reinitialize the checksum computation to its starting value.
+     */
     public void reset();
 
-    public void update(int val);
-
+    /**
+     * Update the checksum value based on the given byte array
+     * 
+     * @param buf
+     *            the data used to update the checksum
+     * @param off
+     *            the starting point for data values
+     * @param nbytes
+     *            the number of bytes to consider
+     */
     public void update(byte[] buf, int off, int nbytes);
+
+    /**
+     * Update the checksum value based on the given data value.
+     * 
+     * @param val
+     *            a single byte value
+     */
+    public void update(int val);
 }

Modified: harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/zip/Deflater.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/zip/Deflater.java?rev=633384&r1=633383&r2=633384&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/zip/Deflater.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/zip/Deflater.java Tue Mar  4 00:02:13 2008
@@ -28,20 +28,28 @@
  */
 public class Deflater {
 
+    /** Constant value representing the best available compression level. */
     public static final int BEST_COMPRESSION = 9;
 
+    /** Constant value representing the fastest available compression level. */
     public static final int BEST_SPEED = 1;
 
+    /** Constant value representing the default compression level. */
     public static final int DEFAULT_COMPRESSION = -1;
 
+    /** Constant value representing the default compression strategy. */
     public static final int DEFAULT_STRATEGY = 0;
 
+    /** Constant value representing the deflate compression strategy. */
     public static final int DEFLATED = 8;
 
+    /** Constant value representing the filtered compression strategy. */
     public static final int FILTERED = 1;
 
+    /** Constant value representing the Huffman compression strategy. */
     public static final int HUFFMAN_ONLY = 2;
 
+    /** Constant value representing the no compression strategy. */
     public static final int NO_COMPRESSION = 0;
 
     private static final int Z_NO_FLUSH = 0;
@@ -112,7 +120,8 @@
             throw new IllegalArgumentException();
         }
         compressLevel = level;
-        streamHandle = createStreamWithMemoryEnsurance(compressLevel, strategy, noHeader);
+        streamHandle = createStreamWithMemoryEnsurance(compressLevel, strategy,
+                noHeader);
     }
 
     /**
@@ -186,7 +195,7 @@
      * Indicates to the Deflater that all uncompressed input has been provided
      * to it.
      * 
-     * @see #finished
+     * @see #finished()
      */
     public synchronized void finish() {
         flushParm = Z_FINISH;
@@ -279,7 +288,7 @@
      * operation <i>must</i> be called after <code>finished()</code> returns
      * <code>true</code> if the <code>Deflater</code> is to be reused.
      * 
-     * @see #finished
+     * @see #finished()
      */
     public synchronized void reset() {
         if (streamHandle == -1) {
@@ -294,15 +303,30 @@
 
     private synchronized native void resetImpl(long handle);
 
+    /**
+     * Defines a dictionary to be used for compression by the receiver.
+     * 
+     * @param buf
+     *            the entire set of bytes comprising the dictionary
+     * @see #setDictionary(byte[], int, int)
+     */
     public void setDictionary(byte[] buf) {
         setDictionary(buf, 0, buf.length);
     }
 
     /**
      * Sets the dictionary to be used for compression by this Deflater.
-     * setDictionary() can only be called if this Deflater supports the writing
-     * of ZLIB headers. This is the default behaviour but can be overridden
-     * using Deflater(int, boolean).
+     * 
+     * <code>setDictionary()</code> can only be called if this Deflater
+     * supports the writing of ZLIB headers. This is the default behaviour but
+     * can be overridden using <code>Deflater(int, boolean)</code>.
+     * 
+     * @param buf
+     *            the byte array containing the dictionary
+     * @param off
+     *            offset into the byte array
+     * @param nbytes
+     *            number of bytes comprising the dictionary
      * 
      * @see Deflater#Deflater(int, boolean)
      */
@@ -325,6 +349,9 @@
     /**
      * Sets the input buffer the Deflater will use to extract uncompressed bytes
      * for later compression.
+     * 
+     * @param buf
+     *            the input buffer
      */
     public void setInput(byte[] buf) {
         setInput(buf, 0, buf.length);
@@ -334,6 +361,13 @@
      * Sets the input buffer the Deflater will use to extract uncompressed bytes
      * for later compression. Input will be taken from the buffer region
      * starting at off and ending at nbytes - 1.
+     * 
+     * @param buf
+     *            the input data byte array
+     * @param off
+     *            offset into the input bytes
+     * @param nbytes
+     *            number of valid bytes in the input array
      */
     public synchronized void setInput(byte[] buf, int off, int nbytes) {
         if (streamHandle == -1) {
@@ -406,7 +440,7 @@
      * method performs the same as getTotalIn except it returns a long value
      * instead of an integer
      * 
-     * @see getTotalIn
+     * @see #getTotalIn()
      * @return bytes exactly read by deflater
      */
     public synchronized long getBytesRead() {
@@ -422,7 +456,7 @@
      * method performs the same as getTotalOut except it returns a long value
      * instead of an integer
      * 
-     * @see getTotalOut
+     * @see #getTotalOut()
      * @return bytes exactly write by deflater
      */
     public synchronized long getBytesWritten() {
@@ -433,9 +467,11 @@
         return getTotalOutImpl(streamHandle);
     }
 
-    private long createStreamWithMemoryEnsurance(int level, int strategy1, boolean noHeader1){
+    private long createStreamWithMemoryEnsurance(int level, int strategy1,
+            boolean noHeader1) {
         OSResourcesMonitor.ensurePhysicalMemoryCapacity();
         return createStream(level, strategy1, noHeader1);
     }
+
     private native long createStream(int level, int strategy1, boolean noHeader1);
 }

Modified: harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/zip/DeflaterOutputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/zip/DeflaterOutputStream.java?rev=633384&r1=633383&r2=633384&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/zip/DeflaterOutputStream.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/zip/DeflaterOutputStream.java Tue Mar  4 00:02:13 2008
@@ -149,17 +149,16 @@
     }
 
     /**
-     * Compress nbytes of data from buf starting at off and write it to the
-     * underlying stream.
+     * Compress data from a buffer and write it to the underlying stream.
      * 
-     * @param buf
+     * @param buffer
      *            Buffer of data to compress
      * @param off
      *            offset in buffer to extract data from
      * @param nbytes
      *            Number of bytes of data to compress and write
      * 
-     * @exception java.io.IOException
+     * @exception IOException
      *                If an error occurs during writing.
      */
     @Override

Modified: harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/zip/GZIPInputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/zip/GZIPInputStream.java?rev=633384&r1=633383&r2=633384&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/zip/GZIPInputStream.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/zip/GZIPInputStream.java Tue Mar  4 00:02:13 2008
@@ -26,20 +26,22 @@
 /**
  * The GZIPInputStream class is used to read data stored in the GZIP format.
  */
-public class GZIPInputStream extends java.util.zip.InflaterInputStream {
-    protected CRC32 crc = new CRC32();
+public class GZIPInputStream extends InflaterInputStream {
 
-    protected boolean eos = false;
+    private static final int FCOMMENT = 16;
 
-    public final static int GZIP_MAGIC = 0x8b1f;
+    private static final int FEXTRA = 4;
 
     private static final int FHCRC = 2;
 
-    private static final int FEXTRA = 4;
-
     private static final int FNAME = 8;
 
-    private static final int FCOMMENT = 16;
+    /** Value of GZIP header magic number. */
+    public final static int GZIP_MAGIC = 0x8b1f;
+
+    protected CRC32 crc = new CRC32();
+
+    protected boolean eos = false;
 
     /**
      * Construct a GZIPInputStream to read from GZIP data from the underlying
@@ -47,6 +49,8 @@
      * 
      * @param is
      *            InputStream to read data from
+     * @throws IOException
+     *             if an IO error occurs reading the stream
      */
     public GZIPInputStream(InputStream is) throws IOException {
         this(is, BUF_SIZE);
@@ -60,6 +64,8 @@
      *            InputStream to read data from
      * @param size
      *            Internal read buffer size
+     * @throws IOException
+     *             if an IO exception occurs reading the stream
      */
     public GZIPInputStream(InputStream is, int size) throws IOException {
         super(is, new Inflater(true), size);
@@ -107,6 +113,15 @@
         }
     }
 
+    /**
+     * Closes this stream and any underlying streams.
+     */
+    @Override
+    public void close() throws IOException {
+        eos = true;
+        super.close();
+    }
+
     private long getLong(byte[] buffer, int off) {
         long l = 0;
         l |= (buffer[off] & 0xFF);
@@ -121,7 +136,8 @@
     }
 
     /**
-     * Reads and decompresses GZIP data from the underlying stream into buf.
+     * Reads and decompresses GZIP data from the underlying stream into the
+     * given buffer.
      * 
      * @param buffer
      *            Buffer to receive data
@@ -149,7 +165,7 @@
                 // Get non-compressed bytes read by fill
                 int size = inf.getRemaining();
                 final int trailerSize = 8; // crc (4 bytes) + total out (4
-                                            // bytes)
+                // bytes)
                 byte[] b = new byte[trailerSize];
                 int copySize = (size > trailerSize) ? trailerSize : size;
 
@@ -166,15 +182,6 @@
             return val;
         }
         throw new ArrayIndexOutOfBoundsException();
-    }
-
-    /**
-     * Closes this stream and any underlying streams.
-     */
-    @Override
-    public void close() throws IOException {
-        eos = true;
-        super.close();
     }
 
     private void readFully(byte[] buffer, int offset, int length)

Modified: harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/zip/GZIPOutputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/zip/GZIPOutputStream.java?rev=633384&r1=633383&r2=633384&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/zip/GZIPOutputStream.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/zip/GZIPOutputStream.java Tue Mar  4 00:02:13 2008
@@ -34,6 +34,8 @@
      * 
      * @param os
      *            OutputStream to write to
+     * @throws IOException
+     *             if an IO error occurs writing to the output stream
      */
     public GZIPOutputStream(OutputStream os) throws IOException {
         this(os, BUF_SIZE);
@@ -47,6 +49,8 @@
      *            OutputStream to write to
      * @param size
      *            Internal buffer size
+     * @throws IOException
+     *             if an IO error occurs writing to the output stream
      */
     public GZIPOutputStream(OutputStream os, int size) throws IOException {
         super(os, new Deflater(Deflater.DEFAULT_COMPRESSION, true), size);
@@ -70,8 +74,8 @@
     }
 
     /**
-     * Write up to nbytes of data from buf, starting at offset off, to the
-     * underlying stream in GZIP format.
+     * Write up to nbytes of data from the given buffer, starting at offset off,
+     * to the underlying stream in GZIP format.
      */
     @Override
     public void write(byte[] buffer, int off, int nbytes) throws IOException {
@@ -79,18 +83,18 @@
         crc.update(buffer, off, nbytes);
     }
 
-    private int writeShort(int i) throws IOException {
-        out.write(i & 0xFF);
-        out.write((i >> 8) & 0xFF);
-        return i;
-    }
-
     private long writeLong(long i) throws IOException {
         // Write out the long value as an unsigned int
         out.write((int) (i & 0xFF));
         out.write((int) (i >> 8) & 0xFF);
         out.write((int) (i >> 16) & 0xFF);
         out.write((int) (i >> 24) & 0xFF);
+        return i;
+    }
+
+    private int writeShort(int i) throws IOException {
+        out.write(i & 0xFF);
+        out.write((i >> 8) & 0xFF);
         return i;
     }
 }

Modified: harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/zip/Inflater.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/zip/Inflater.java?rev=633384&r1=633383&r2=633384&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/zip/Inflater.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/zip/Inflater.java Tue Mar  4 00:02:13 2008
@@ -28,28 +28,48 @@
  */
 public class Inflater {
 
+    private static final byte MAGIC_NUMBER = 120;
+
+    static {
+        oneTimeInitialization();
+    }
+
+    // Fill in the JNI id caches
+    private static native void oneTimeInitialization();
+
     private boolean finished; // Set by the inflateImpl native
 
-    private boolean needsDictionary; // Set by the inflateImpl native
+    private boolean gotFirstByte = false;
 
-    private long streamHandle = -1;
+    int inLength;
 
     int inRead;
 
-    int inLength;
+    private boolean needsDictionary; // Set by the inflateImpl native
 
-    // Fill in the JNI id caches
-    private static native void oneTimeInitialization();
+    private boolean pass_magic_number_check = true;
 
-    static {
-        oneTimeInitialization();
-    }
+    private long streamHandle = -1;
 
-    private static final byte MAGIC_NUMBER = 120;
+    /**
+     * Constructs a new Inflater instance.
+     */
+    public Inflater() {
+        this(false);
+    }
 
-    private boolean gotFirstByte = false;
+    /**
+     * Constructs a new Inflater instance. If noHeader is true the Inflater will
+     * not attempt to read a ZLIB header.
+     * 
+     * @param noHeader
+     *            If true, read a ZLIB header from input.
+     */
+    public Inflater(boolean noHeader) {
+        streamHandle = createStream(noHeader);
+    }
 
-    private boolean pass_magic_number_check = true;
+    private native long createStream(boolean noHeader1);
 
     /**
      * Release any resources associated with this Inflater. Any unused
@@ -99,6 +119,38 @@
     private native synchronized int getAdlerImpl(long handle);
 
     /**
+     * Returns a long int of total number of bytes of input read by the
+     * Inflater. This method performs the same as getTotalIn except it returns a
+     * long value instead of an integer
+     * 
+     * @see #getTotalIn()
+     * @return Total bytes read
+     */
+    public synchronized long getBytesRead() {
+        // Throw NPE here
+        if (streamHandle == -1) {
+            throw new NullPointerException();
+        }
+        return getTotalInImpl(streamHandle);
+    }
+
+    /**
+     * Returns a long int of total number of bytes of input output by the
+     * Inflater. This method performs the same as getTotalOut except it returns
+     * a long value instead of an integer
+     * 
+     * @see #getTotalOut()
+     * @return Total bytes output
+     */
+    public synchronized long getBytesWritten() {
+        // Throw NPE here
+        if (streamHandle == -1) {
+            throw new NullPointerException();
+        }
+        return getTotalOutImpl(streamHandle);
+    }
+
+    /**
      * Returns the number of bytes of current input remaining to be read by the
      * inflater
      * 
@@ -203,24 +255,6 @@
             int nbytes, long handle);
 
     /**
-     * Constructs a new Inflater instance.
-     */
-    public Inflater() {
-        this(false);
-    }
-
-    /**
-     * Constructs a new Inflater instance. If noHeader is true the Inflater will
-     * not attempt to read a ZLIB header.
-     * 
-     * @param noHeader
-     *            If true, read a ZLIB header from input.
-     */
-    public Inflater(boolean noHeader) {
-        streamHandle = createStream(noHeader);
-    }
-
-    /**
      * Indicates whether the input bytes were compressed with a preset
      * dictionary. This method should be called prior to inflate() to determine
      * if a dictionary is required. If so setDictionary() should be called with
@@ -234,6 +268,12 @@
         return needsDictionary;
     }
 
+    /**
+     * Answers whether more data is required in the input buffer.
+     * 
+     * @return true if the input buffer is empty, and false otherwise.
+     * @see #setInput(byte[])
+     */
     public synchronized boolean needsInput() {
         return inRead == inLength;
     }
@@ -254,18 +294,33 @@
     private native synchronized void resetImpl(long handle);
 
     /**
-     * Sets the preset dictionary to be used for inflation to buf.
-     * needsDictionary() can be called to determine whether the current input
-     * was deflated using a preset dictionary.
+     * Sets the preset dictionary to be used for inflation.
+     * 
+     * <code>needsDictionary()</code> can be called to determine whether the
+     * current input was deflated using a preset dictionary.
      * 
      * @param buf
      *            The buffer containing the dictionary bytes
-     * @see #needsDictionary
+     * @see #needsDictionary()
      */
     public synchronized void setDictionary(byte[] buf) {
         setDictionary(buf, 0, buf.length);
     }
 
+    /**
+     * Sets the dictionary used to inflate the given data.
+     * 
+     * The dictionary should be set if the {@link #inflate(byte[])} returned
+     * zero bytes inflated and {@link #needsDictionary()} returns
+     * <code>true</code>.
+     * 
+     * @param buf
+     *            the bytes containing the dictionary
+     * @param off
+     *            offset into the buffer to the start of the dictionary
+     * @param nbytes
+     *            length of the dictionary, in bytes
+     */
     public synchronized void setDictionary(byte[] buf, int off, int nbytes) {
         if (streamHandle == -1) {
             throw new IllegalStateException();
@@ -327,40 +382,6 @@
         }
     }
 
-    /**
-     * Returns a long int of total number of bytes of input read by the
-     * Inflater. This method performs the same as getTotalIn except it returns a
-     * long value instead of an integer
-     * 
-     * @see getTotalIn
-     * @return Total bytes read
-     */
-    public synchronized long getBytesRead() {
-        // Throw NPE here
-        if (streamHandle == -1) {
-            throw new NullPointerException();
-        }
-        return getTotalInImpl(streamHandle);
-    }
-
-    /**
-     * Returns a long int of total number of bytes of input output by the
-     * Inflater. This method performs the same as getTotalOut except it returns
-     * a long value instead of an integer
-     * 
-     * @see getTotalOut
-     * @return Total bytes output
-     */
-    public synchronized long getBytesWritten() {
-        // Throw NPE here
-        if (streamHandle == -1) {
-            throw new NullPointerException();
-        }
-        return getTotalOutImpl(streamHandle);
-    }
-
     private native synchronized void setInputImpl(byte[] buf, int off,
             int nbytes, long handle);
-
-    private native long createStream(boolean noHeader1);
 }

Modified: harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/zip/ZipFile.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/zip/ZipFile.java?rev=633384&r1=633383&r2=633384&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/zip/ZipFile.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/zip/ZipFile.java Tue Mar  4 00:02:13 2008
@@ -35,7 +35,6 @@
  * @see ZipInputStream
  * @see ZipEntry
  */
-
 public class ZipFile implements ZipConstants {
 
     String fileName;
@@ -50,14 +49,10 @@
         ntvinit();
     }
 
-    /**
-     * Open zip file for read.
-     */
+    /** Open ZIP file for read. */
     public static final int OPEN_READ = 1;
 
-    /**
-     * Delete zip file when closed.
-     */
+    /** Delete ZIP file when closed. */
     public static final int OPEN_DELETE = 4;
 
     /**
@@ -65,19 +60,26 @@
      * 
      * @param file
      *            the File
+     * @throws ZipException
+     *             if a ZIP format exception occurs reading the file
+     * @throws IOException
+     *             if an IO exception occurs reading the file
      */
     public ZipFile(File file) throws ZipException, IOException {
         this(file.getPath());
     }
 
     /**
-     * Constructs a new ZipFile opened on the specified File using the specified
+     * Constructs a new ZipFile opened on the specified file using the specified
      * mode.
      * 
      * @param file
-     *            the File
+     *            the file
      * @param mode
-     *            the mode to use, either OPEN_READ or OPEN_READ | OPEN_DELETE
+     *            the mode to use, either <code>OPEN_READ</code> or
+     *            <code>OPEN_READ | OPEN_DELETE</code>
+     * @throws IOException
+     *             if an IO exception occurs reading the file
      */
     public ZipFile(File file, int mode) throws IOException {
         if (mode == OPEN_READ || mode == (OPEN_READ | OPEN_DELETE)) {
@@ -101,6 +103,8 @@
      * 
      * @param filename
      *            the file path name
+     * @throws IOException
+     *             if an IO exception occured reading the file
      */
     public ZipFile(String filename) throws IOException {
         SecurityManager security = System.getSecurityManager();
@@ -135,6 +139,9 @@
 
     /**
      * Closes this ZipFile.
+     * 
+     * @throws IOException
+     *             if an IO exception occured closing the file
      */
     public synchronized void close() throws IOException {
         if (descriptor != -1 && fileName != null) {
@@ -152,9 +159,9 @@
     }
 
     /**
-     * Answers all of the zip entries contained in this ZipFile.
+     * Answers all of the ZIP entries contained in this ZipFile.
      * 
-     * @return an Enumeration of the zip entries
+     * @return an Enumeration of the ZIP entries
      */
     public Enumeration<? extends ZipEntry> entries() {
         return new ZFEnum<ZipEntry>();
@@ -182,6 +189,8 @@
      * @param entry
      *            the ZipEntry
      * @return an input stream on the ZipEntry data
+     * @throws IOException
+     *             if an IO exception occurs reading the data
      */
     public InputStream getInputStream(ZipEntry entry) throws IOException {
         if (descriptor == -1) {

Modified: harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/zip/ZipInputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/zip/ZipInputStream.java?rev=633384&r1=633383&r2=633384&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/zip/ZipInputStream.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/zip/ZipInputStream.java Tue Mar  4 00:02:13 2008
@@ -89,6 +89,9 @@
 
     /**
      * Closes the current zip entry and positions to read the next entry.
+     * 
+     * @throws IOException
+     *             if an IO exception occurs closing the entry
      */
     public void closeEntry() throws IOException {
         if (zipClosed) {
@@ -143,6 +146,10 @@
 
     /**
      * Reads the next zip entry from this ZipInputStream.
+     * 
+     * @return the next entry
+     * @throws IOException
+     *             if an IO exception occurs reading the next entry
      */
     public ZipEntry getNextEntry() throws IOException {
         if (currentEntry != null) {

Modified: harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/zip/ZipOutputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/zip/ZipOutputStream.java?rev=633384&r1=633383&r2=633384&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/zip/ZipOutputStream.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/zip/ZipOutputStream.java Tue Mar  4 00:02:13 2008
@@ -34,8 +34,10 @@
 public class ZipOutputStream extends DeflaterOutputStream implements
         ZipConstants {
 
+    /** Method for compressed entries */
     public static final int DEFLATED = 8;
 
+    /** Method for uncompressed entries */
     public static final int STORED = 0;
 
     static final int ZIPDataDescriptorFlag = 8;
@@ -307,6 +309,8 @@
     /**
      * Sets the ZipFile comment associated with the file being written.
      * 
+     * @param comment
+     *            the file comment
      */
     public void setComment(String comment) {
         if (comment.length() > 0xFFFF) {
@@ -317,9 +321,10 @@
 
     /**
      * Sets the compression level to be used for writing entry data. This level
-     * may be set on a per entry basis. level must have a value between 0 and
-     * 10.
+     * may be set on a per entry basis.
      * 
+     * @param level
+     *            the compression level, must have a value between 0 and 10.
      */
     public void setLevel(int level) {
         if (level < Deflater.DEFAULT_COMPRESSION

Modified: harmony/enhanced/classlib/branches/java6/modules/archive/src/main/native/archive/shared/adler32.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/archive/src/main/native/archive/shared/adler32.c?rev=633384&r1=633383&r2=633384&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/archive/src/main/native/archive/shared/adler32.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/archive/src/main/native/archive/shared/adler32.c Tue Mar  4 00:02:13 2008
@@ -18,20 +18,23 @@
 #include "jni.h"
 #include "vmi.h"
 #include "zconf.h"
-uLong adler32 PROTOTYPE ((uLong crc, const Bytef * buf, uInt size));
+#include "zlib.h"
+#include "exceptions.h"
 
 JNIEXPORT jlong JNICALL
 Java_java_util_zip_Adler32_updateImpl (JNIEnv * env, jobject recv,
                                        jbyteArray buf, int off, int len,
                                        jlong crc)
 {
-  PORT_ACCESS_FROM_ENV (env);
-
   jbyte *b;
   jboolean isCopy;
   jlong result;
 
   b = (*env)->GetPrimitiveArrayCritical (env, buf, &isCopy);
+  if (b == NULL) {
+    throwNewOutOfMemoryError(env, "");
+    return 0;
+  }
   result = (jlong) adler32 ((uLong) crc, (Bytef *) (b + off), (uInt) len);
   (*env)->ReleasePrimitiveArrayCritical (env, buf, b, JNI_ABORT);
 
@@ -42,7 +45,6 @@
 Java_java_util_zip_Adler32_updateByteImpl (JNIEnv * env, jobject recv,
                                            jint val, jlong crc)
 {
-  PORT_ACCESS_FROM_ENV (env);
   Bytef bytefVal = val;
   return adler32 ((uLong) crc, (Bytef *) (&bytefVal), 1);
 }

Modified: harmony/enhanced/classlib/branches/java6/modules/archive/src/main/native/archive/shared/archiveglob.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/archive/src/main/native/archive/shared/archiveglob.c?rev=633384&r1=633383&r2=633384&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/archive/src/main/native/archive/shared/archiveglob.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/archive/src/main/native/archive/shared/archiveglob.c Tue Mar  4 00:02:13 2008
@@ -101,7 +101,7 @@
           PORT_ACCESS_FROM_ENV (env);
 #ifdef HY_ZIP_API
           VMI_ACCESS_FROM_ENV(env);
-          HyZipFunctionTable *zipFuncs = (*VMI)->GetZipFunctions(VMI);
+          VMIZipFunctionTable *zipFuncs = (*VMI)->GetZipFunctions(VMI);
 #endif /* HY_ZIP_API */
 
           /* Detach from the common library */

Modified: harmony/enhanced/classlib/branches/java6/modules/archive/src/main/native/archive/shared/deflater.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/archive/src/main/native/archive/shared/deflater.c?rev=633384&r1=633383&r2=633384&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/archive/src/main/native/archive/shared/deflater.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/archive/src/main/native/archive/shared/deflater.c Tue Mar  4 00:02:13 2008
@@ -45,15 +45,15 @@
       throwNewOutOfMemoryError (env, "");
       return;
     }
-  (*env)->GetByteArrayRegion (env, dict, off, len, dBytes);
+  (*env)->GetByteArrayRegion (env, dict, off, len, (jbyte *) dBytes);
   err = deflateSetDictionary (stream->stream, (Bytef *) dBytes, len);
   if (err != Z_OK)
     {
       jclmem_free_memory (env, dBytes);
-      throwNewIllegalArgumentException (env, "");
+      THROW_ZIP_EXCEPTION(env, err, IllegalArgumentException);
       return;
     }
-  stream->dict = dBytes;
+  stream->dict = (U_8*) dBytes;
 }
 
 JNIEXPORT jlong JNICALL
@@ -100,7 +100,7 @@
   int wbits = 15;		/*Use MAX for fastest */
 #ifdef HY_ZIP_API
   VMI_ACCESS_FROM_ENV (env);
-  HyZipFunctionTable *zipFuncs;
+  VMIZipFunctionTable *zipFuncs;
   zipFuncs = (*VMI)->GetZipFunctions(VMI);
 #endif
 
@@ -119,15 +119,9 @@
       throwNewOutOfMemoryError (env, "");
       return -1;
     }
-#ifndef HY_ZIP_API
   stream->opaque = (void *) privatePortLibrary;
   stream->zalloc = zalloc;
   stream->zfree = zfree;
-#else
-  stream->opaque = (void *) VMI;
-  stream->zalloc = zipFuncs->zip_zalloc;
-  stream->zfree =zipFuncs->zip_zfree;
-#endif
   jstream->stream = stream;
   jstream->dict = NULL;
   jstream->inaddr = NULL;
@@ -139,11 +133,10 @@
 		      wbits,	/*Window bits to use. 15 is fastest but consumes the most memory */
 		      9,	/*Memory allocation for internal compression state. 9 uses the most. */
 		      strategy);
-  if (err != Z_OK)
-    {
-      throwNewIllegalArgumentException (env, "");
-      return -1;
-    }
+  if (err != Z_OK) {
+    THROW_ZIP_EXCEPTION(env, err, IllegalArgumentException);
+    return -1;
+  }
 
   return (jlong) ((IDATA) jstream);
 }
@@ -168,8 +161,10 @@
       return;
     }
   in = ((*env)->GetPrimitiveArrayCritical (env, buf, 0));
-  if (in == NULL)
+  if (in == NULL) {
+    throwNewOutOfMemoryError(env, "");
     return;
+  }
   memcpy (stream->inaddr, (in + off), len);
   ((*env)->ReleasePrimitiveArrayCritical (env, buf, in, JNI_ABORT));
   stream->stream->next_in = (Bytef *) stream->inaddr;
@@ -183,8 +178,6 @@
 					 jbyteArray buf, int off, int len,
 					 jlong handle, int flushParm)
 {
-  PORT_ACCESS_FROM_ENV (env);
-
   jbyte *out;
   JCLZipStream *stream;
   jint err = 0;
@@ -201,30 +194,35 @@
   sin = stream->stream->total_in;
   sout = stream->stream->total_out;
   out = ((*env)->GetPrimitiveArrayCritical (env, buf, 0));
-  if (out == NULL)
+  if (out == NULL) {
+    throwNewOutOfMemoryError(env, "");
     return -1;
+  }
   stream->stream->next_out = (Bytef *) out + off;
   err = deflate (stream->stream, flushParm);
   ((*env)->ReleasePrimitiveArrayCritical (env, buf, out, 0));
-  if (err != Z_OK)
-    {
-      if (err == Z_STREAM_END)
-	{
-	  ((*env)->
-	   SetBooleanField (env, recv,
-			    JCL_CACHE_GET (env,
-					   FID_java_util_zip_Deflater_finished),
-			    JNI_TRUE));
-	  return stream->stream->total_out - sout;
-	}
-    }
+  if (err != Z_OK) {
+    if (err == Z_MEM_ERROR) {
+      throwNewOutOfMemoryError(env, "");
+      return 0;
+    }
+    if (err == Z_STREAM_END)
+      {
+        ((*env)->
+         SetBooleanField (env, recv,
+                          JCL_CACHE_GET (env,
+                                         FID_java_util_zip_Deflater_finished),
+                          JNI_TRUE));
+        return stream->stream->total_out - sout;
+      }
+  }
   if (flushParm != Z_FINISH)
     {
       /* Need to update the number of input bytes read. */
       ((*env)->
        SetIntField (env, recv,
-		    JCL_CACHE_GET (env, FID_java_util_zip_Deflater_inRead),
-		    (jint) stream->stream->total_in - sin + inBytes));
+                    JCL_CACHE_GET (env, FID_java_util_zip_Deflater_inRead),
+                    (jint) stream->stream->total_in - sin + inBytes));
     }
   return stream->stream->total_out - sout;
 }
@@ -261,8 +259,6 @@
 					   int level, int strategy,
 					   jlong handle)
 {
-  PORT_ACCESS_FROM_ENV (env);
-
   JCLZipStream *stream;
   jbyte b = 0;
   int err = 0;
@@ -275,8 +271,9 @@
   stream = (JCLZipStream *) ((IDATA) handle);
   stream->stream->next_out = (Bytef *) & b;
   err = deflateParams (stream->stream, level, strategy);
-  if (err != Z_OK)
-    throwNewIllegalStateException (env, "");
+  if (err != Z_OK) {
+    THROW_ZIP_EXCEPTION(env, err, IllegalStateException);
+  }
 }
 
 JNIEXPORT void JNICALL

Modified: harmony/enhanced/classlib/branches/java6/modules/archive/src/main/native/archive/shared/inflater.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/archive/src/main/native/archive/shared/inflater.c?rev=633384&r1=633383&r2=633384&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/archive/src/main/native/archive/shared/inflater.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/archive/src/main/native/archive/shared/inflater.c Tue Mar  4 00:02:13 2008
@@ -38,7 +38,7 @@
   int wbits = 15;               /*Use MAX for fastest */
 #ifdef HY_ZIP_API
   VMI_ACCESS_FROM_ENV (env);
-  HyZipFunctionTable *zipFuncs;
+  VMIZipFunctionTable *zipFuncs;
   zipFuncs = (*VMI)->GetZipFunctions(VMI);
 #endif
 
@@ -58,15 +58,9 @@
       throwNewOutOfMemoryError (env, "");
       return -1;
     }
-#ifndef HY_ZIP_API
   stream->opaque = (void *) privatePortLibrary;
   stream->zalloc = zalloc;
   stream->zfree = zfree;
-#else
-  stream->opaque = (void *) VMI;
-  stream->zalloc = zipFuncs->zip_zalloc;
-  stream->zfree = zipFuncs->zip_zfree;
-#endif
   stream->adler = 1;
   jstream->stream = stream;
   jstream->dict = NULL;
@@ -81,7 +75,7 @@
     {
       jclmem_free_memory (env, stream);
       jclmem_free_memory (env, jstream);
-      throwNewIllegalArgumentException (env, "");
+      THROW_ZIP_EXCEPTION(env, err, IllegalArgumentException);
       return -1;
     }
 
@@ -111,8 +105,10 @@
   stream->stream->next_in = (Bytef *) baseAddr;
   stream->stream->avail_in = len;
   in = ((*env)->GetPrimitiveArrayCritical (env, buf, 0));
-  if (in == NULL)
+  if (in == NULL) {
+    throwNewOutOfMemoryError(env, "");
     return;
+  }
   memcpy (baseAddr, (in + off), len);
   ((*env)->ReleasePrimitiveArrayCritical (env, buf, in, JNI_ABORT));
   return;
@@ -123,8 +119,6 @@
                                          jbyteArray buf, int off, int len,
                                          jlong handle)
 {
-  PORT_ACCESS_FROM_ENV (env);
-
   jbyte *out;
   JCLZipStream *stream = (JCLZipStream *) ((IDATA) handle);
   jint err = 0;
@@ -139,8 +133,10 @@
   sin = stream->stream->total_in;
   sout = stream->stream->total_out;
   out = ((*env)->GetPrimitiveArrayCritical (env, buf, 0));
-  if (out == NULL)
+  if (out == NULL) {
+    throwNewOutOfMemoryError(env, "");
     return -1;
+  }
   stream->stream->next_out = (Bytef *) out + off;
   err = inflate (stream->stream, Z_SYNC_FLUSH);
   ((*env)->ReleasePrimitiveArrayCritical (env, buf, out, 0));
@@ -164,7 +160,7 @@
         }
       else
         {
-          throwNewDataFormatException (env, "");
+          THROW_ZIP_EXCEPTION(env, err, DataFormatException);
           return -1;
         }
     }
@@ -222,12 +218,12 @@
       throwNewOutOfMemoryError (env, "");
       return;
     }
-  (*env)->GetByteArrayRegion (env, dict, off, len, dBytes);
+  (*env)->GetByteArrayRegion (env, dict, off, len, (jbyte*)dBytes);
   err = inflateSetDictionary (stream->stream, (Bytef *) dBytes, len);
   if (err != Z_OK)
     {
       jclmem_free_memory (env, dBytes);
-      throwNewIllegalArgumentException (env, "");
+      THROW_ZIP_EXCEPTION(env, err, IllegalArgumentException);
       return;
     }
   stream->dict = dBytes;
@@ -244,7 +240,7 @@
   err = inflateReset (stream->stream);
   if (err != Z_OK)
     {
-      throwNewIllegalArgumentException (env, "");
+      THROW_ZIP_EXCEPTION(env, err, IllegalArgumentException);
       return;
     }
 }

Modified: harmony/enhanced/classlib/branches/java6/modules/archive/src/main/native/archive/shared/jarfile.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/archive/src/main/native/archive/shared/jarfile.c?rev=633384&r1=633383&r2=633384&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/archive/src/main/native/archive/shared/jarfile.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/archive/src/main/native/archive/shared/jarfile.c Tue Mar  4 00:02:13 2008
@@ -20,16 +20,20 @@
 #include "exceptions.h"
 #include "jclglob.h"
 #include "jclprots.h"
-#ifndef HY_ZIP_API
 
+#ifndef HY_ZIP_API
 #include "zipsup.h"
 #else /* HY_ZIP_API */
-#include "hyzip.h"
+#include "vmizip.h"
 #endif /* HY_ZIP_API */
 
 /* Build a new ZipEntry from the C struct */
 jobject
+#ifndef HY_ZIP_API
 createZipEntry (JNIEnv * env, HyZipFile * zipFile, HyZipEntry * zipEntry)
+#else
+createZipEntry (JNIEnv * env, VMIZipFile * zipFile, VMIZipEntry * zipEntry)
+#endif
 {
   PORT_ACCESS_FROM_ENV (env);
 #ifdef HY_ZIP_API
@@ -39,11 +43,11 @@
   jobject java_ZipEntry, extra, entryName;
   jmethodID mid;
 #ifdef HY_ZIP_API
-  HyZipFunctionTable *zipFuncs = (*VMI)->GetZipFunctions(VMI);
+  VMIZipFunctionTable *zipFuncs = (*VMI)->GetZipFunctions(VMI);
 #endif /* HY_ZIP_API */
 
   /* Build a new ZipEntry from the C struct */
-  entryName = ((*env)->NewStringUTF (env, zipEntry->filename));
+  entryName = ((*env)->NewStringUTF (env, (const char*)zipEntry->filename));
   if (((*env)->ExceptionCheck (env)))
     return NULL;
 
@@ -63,7 +67,7 @@
 	return NULL;
       ((*env)->
        SetByteArrayRegion (env, extra, 0, zipEntry->extraFieldLength,
-			   zipEntry->extraField));
+			   (jbyte*)zipEntry->extraField));
       jclmem_free_memory (env, zipEntry->extraField);
       zipEntry->extraField = NULL;
     }
@@ -97,22 +101,26 @@
 #endif /* HY_ZIP_API */
 
   JCLZipFile *jclZipFile;
+#ifdef HY_ZIP_API
+  VMIZipFile *zipFile;
+  VMIZipEntry zipEntry;
+#else
   HyZipFile *zipFile;
   HyZipEntry zipEntry;
+#endif
   jobject current;
   jclass javaClass;
   jobject resultArray[RESULT_BUF_SIZE];
   UDATA resultCount = 0, offset, i;
   void *scanPtr;
   char metaInfName[10];		/* 10 == strlen("META-INF/") + 1 */
-  const UDATA metaInfSize = 10;	/* 10 == strlen("META-INF/") + 1 */
   jobjectArray result = NULL;
   char *nameBuf, *newNameBuf, *oldNameBuf = NULL;
   char startNameBuf[MAX_PATH_J];
   UDATA nameBufSize = MAX_PATH_J;
   IDATA rc;
 #ifdef HY_ZIP_API
-  HyZipFunctionTable *zipFuncs = (*VMI)->GetZipFunctions(VMI);
+  VMIZipFunctionTable *zipFuncs = (*VMI)->GetZipFunctions(VMI);
 #endif /* HY_ZIP_API */
 
   nameBuf = (char *) &startNameBuf;
@@ -178,7 +186,7 @@
 	  if (zip_getZipEntryFromOffset (PORTLIB, zipFile, &zipEntry, offset))
 #else /* HY_ZIP_API */
 	  zipFuncs->zip_initZipEntry (VMI, &zipEntry);
-	  if (zipFuncs->zip_getZipEntryFromOffset (VMI, zipFile, &zipEntry, offset))
+	  if (zipFuncs->zip_getZipEntryFromOffset (VMI, zipFile, &zipEntry, offset, 0))
 #endif /* HY_ZIP_API */
 	    goto cleanup;
 	  current = createZipEntry (env, zipFile, &zipEntry);
@@ -195,11 +203,6 @@
 	    goto cleanup;
 	}
       javaClass = JCL_CACHE_GET (env, CLS_java_util_zip_ZipEntry);
-	  javaClass = (*env)->NewLocalRef(env, javaClass);
-      if (javaClass == NULL) {
-          result = NULL;
-          goto cleanup;
-      }
       result = ((*env)->NewObjectArray (env, resultCount, javaClass, NULL));
       if (((*env)->ExceptionCheck (env)))
 	{

Modified: harmony/enhanced/classlib/branches/java6/modules/archive/src/main/native/archive/shared/zip.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/archive/src/main/native/archive/shared/zip.c?rev=633384&r1=633383&r2=633384&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/archive/src/main/native/archive/shared/zip.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/archive/src/main/native/archive/shared/zip.c Tue Mar  4 00:02:13 2008
@@ -24,6 +24,33 @@
 void zfree PROTOTYPE ((void *opaque, void *address));
 void *zalloc PROTOTYPE ((void *opaque, U_32 items, U_32 size));
 
+
+#ifdef HY_ZIP_API
+/*
+	ZLib interface to hymem_allocate_memory.
+*/
+void *
+zalloc (void *opaque, U_32 items, U_32 size)
+{
+  PORT_ACCESS_FROM_PORT (((HyPortLibrary *) opaque));
+
+  return hymem_allocate_memory (items * size);
+}
+
+
+/*
+	ZLib interface to hymem_free_memory.
+*/
+void
+zfree (void *opaque, void *address)
+{
+  PORT_ACCESS_FROM_PORT ((HyPortLibrary *) opaque);
+
+  hymem_free_memory (address);
+}
+
+#endif /* HY_ZIP_API */
+
 /**
   * Throw java.lang.InternalError
   */
@@ -57,7 +84,7 @@
 #ifndef HY_ZIP_API
   HyZipCachePool *zipCachePool;
 #else /* HY_ZIP_API */
-  HyZipFunctionTable *zipFuncs;
+  VMIZipFunctionTable *zipFuncs;
 #endif /* HY_ZIP_API */
 
   jclZipFile = jclmem_allocate_memory (env, sizeof (*jclZipFile));
@@ -66,7 +93,7 @@
 
   length = (*env)->GetArrayLength (env, zipName);
   length = length < HyMaxPath - 1 ? length : HyMaxPath - 1;
-  ((*env)->GetByteArrayRegion (env, zipName, 0, length, pathCopy));
+  ((*env)->GetByteArrayRegion (env, zipName, 0, length, (jbyte*)pathCopy));
   pathCopy[length++] = '\0';
   ioh_convertToPlatform (pathCopy);
 
@@ -79,7 +106,7 @@
 #else /* HY_ZIP_API */
   /* Open the zip file (caching will be managed automatically) */
   zipFuncs = (*VMI)->GetZipFunctions(VMI);
-  retval = zipFuncs->zip_openZipFile(VMI, pathCopy, &(jclZipFile->hyZipFile));
+  retval = zipFuncs->zip_openZipFile(VMI, pathCopy, &(jclZipFile->hyZipFile), ZIP_FLAG_OPEN_CACHE);
 #endif /* HY_ZIP_API */
 
   if (retval)
@@ -117,20 +144,26 @@
 {
 #ifdef HY_ZIP_API
   VMI_ACCESS_FROM_ENV(env);
-#endif /* HY_ZIP_API */
+#else
   PORT_ACCESS_FROM_ENV (env);
+#endif /* HY_ZIP_API */
 
   I_32 retval;
   I_32 extraval;
+#ifdef HY_ZIP_API
+  VMIZipFile *zipFile;
+  VMIZipEntry zipEntry;
+#else
   HyZipFile *zipFile;
   HyZipEntry zipEntry;
+#endif
   jobject java_ZipEntry, extra;
   jclass entryClass;
   jmethodID mid;
   const char *entryCopy;
   JCLZipFile *jclZipFile = (JCLZipFile *) (IDATA) zipPointer;
 #ifdef HY_ZIP_API
-  HyZipFunctionTable *zipFuncs = (*VMI)->GetZipFunctions(VMI);
+  VMIZipFunctionTable *zipFuncs = (*VMI)->GetZipFunctions(VMI);
 #endif /* HY_ZIP_API */
 
   if (jclZipFile == (void *) -1)
@@ -148,7 +181,7 @@
   retval = zip_getZipEntry (PORTLIB, zipFile, &zipEntry, entryCopy, TRUE);
 #else /* HY_ZIP_API */
   zipFuncs->zip_initZipEntry (VMI, &zipEntry);
-  retval = zipFuncs->zip_getZipEntry (VMI, zipFile, &zipEntry, entryCopy, TRUE);
+  retval = zipFuncs->zip_getZipEntry (VMI, zipFile, &zipEntry, entryCopy, ZIP_FLAG_FIND_DIRECTORY|ZIP_FLAG_READ_DATA_POINTER);
 #endif /* HY_ZIP_API */
   (*env)->ReleaseStringUTFChars (env, entryName, entryCopy);
   if (retval)
@@ -198,7 +231,7 @@
         }
       ((*env)->
        SetByteArrayRegion (env, extra, 0, zipEntry.extraFieldLength,
-                           zipEntry.extraField));
+                           (jbyte*)zipEntry.extraField));
     }
 
   entryClass = JCL_CACHE_GET (env, CLS_java_util_zip_ZipEntry);
@@ -243,7 +276,7 @@
   JCLZipFileLink *zipfileHandles;
   JCLZipFile *jclZipFile = (JCLZipFile *) (IDATA) zipPointer;
 #ifdef HY_ZIP_API
-  HyZipFunctionTable *zipFuncs = (*VMI)->GetZipFunctions(VMI);
+  VMIZipFunctionTable *zipFuncs = (*VMI)->GetZipFunctions(VMI);
 #endif /* HY_ZIP_API */
 
   if (jclZipFile != (void *) -1)
@@ -343,15 +376,16 @@
 Java_java_util_zip_ZipFile_00024ZFEnum_resetZip (JNIEnv * env, jobject recv,
                                                  jlong descriptor)
 {
-  PORT_ACCESS_FROM_ENV (env);
 #ifdef HY_ZIP_API
   VMI_ACCESS_FROM_ENV(env);
+#else
+  PORT_ACCESS_FROM_ENV (env);
 #endif /* HY_ZIP_API */
 
   IDATA nextEntryPointer;
   JCLZipFile *jclZipFile = (JCLZipFile *) (IDATA) descriptor;
 #ifdef HY_ZIP_API
-  HyZipFunctionTable *zipFuncs = (*VMI)->GetZipFunctions(VMI);
+  VMIZipFunctionTable *zipFuncs = (*VMI)->GetZipFunctions(VMI);
 #endif /* HY_ZIP_API */
 
   if (jclZipFile == (void *) -1)
@@ -382,8 +416,13 @@
 
   I_32 retval;
   I_32 extraval;
+#ifdef HY_ZIP_API
+  VMIZipFile *zipFile;
+  VMIZipEntry zipEntry;
+#else
   HyZipFile *zipFile;
   HyZipEntry zipEntry;
+#endif
   jobject java_ZipEntry, extra;
   jclass javaClass;
   jmethodID mid;
@@ -391,7 +430,7 @@
   IDATA nextEntryPointer;
   JCLZipFile *jclZipFile = (JCLZipFile *) (IDATA) descriptor;
 #ifdef HY_ZIP_API
-  HyZipFunctionTable *zipFuncs = (*VMI)->GetZipFunctions(VMI);
+  VMIZipFunctionTable *zipFuncs = (*VMI)->GetZipFunctions(VMI);
 #endif /* HY_ZIP_API */
 
   if (jclZipFile == (void *) -1)
@@ -411,7 +450,7 @@
 #ifndef HY_ZIP_API
     zip_getNextZipEntry (PORTLIB, zipFile, &zipEntry, &nextEntryPointer);
 #else /* HY_ZIP_API */
-    zipFuncs->zip_getNextZipEntry (VMI, zipFile, &zipEntry, &nextEntryPointer);
+    zipFuncs->zip_getNextZipEntry (VMI, zipFile, &zipEntry, &nextEntryPointer, ZIP_FLAG_READ_DATA_POINTER);
 #endif /* HY_ZIP_API */
   if (retval)
     {
@@ -425,7 +464,7 @@
     }
 
   /* Build a new ZipEntry from the C struct */
-  entryName = ((*env)->NewStringUTF (env, zipEntry.filename));
+  entryName = ((*env)->NewStringUTF (env, (const char*)zipEntry.filename));
 
   if (((*env)->ExceptionCheck (env)))
     return NULL;
@@ -462,13 +501,13 @@
 #ifndef HY_ZIP_API
           zip_freeZipEntry (PORTLIB, &zipEntry);
 #else /* HY_ZIP_API */
-          zipFuncs->zip_freeZipEntry (VMI, &zipEntry); //not valid zipEntry (-1)
+          zipFuncs->zip_freeZipEntry (VMI, &zipEntry); /* not valid zipEntry (-1) */
 #endif /* HY_ZIP_API */
           return NULL;
         }
       ((*env)->
        SetByteArrayRegion (env, extra, 0, zipEntry.extraFieldLength,
-                           zipEntry.extraField));
+                           (jbyte*)zipEntry.extraField));
       jclmem_free_memory (env, zipEntry.extraField);
       zipEntry.extraField = NULL;
     }
@@ -501,19 +540,24 @@
 					                          jlong descriptor,
                                               jstring entryName)
 {
-  PORT_ACCESS_FROM_ENV (env);
 #ifdef HY_ZIP_API
   VMI_ACCESS_FROM_ENV(env);
 #endif /* HY_ZIP_API */
+  PORT_ACCESS_FROM_ENV (env);
 
   I_32 retval;
+#ifdef HY_ZIP_API
+  VMIZipFile *zipFile;
+  VMIZipEntry zipEntry;
+#else
   HyZipFile *zipFile;
   HyZipEntry zipEntry;
+#endif
   const char *entryCopy;
   jbyteArray buf;
   JCLZipFile *jclZipFile = (JCLZipFile *) (IDATA) descriptor;
 #ifdef HY_ZIP_API
-  HyZipFunctionTable *zipFuncs = (*VMI)->GetZipFunctions(VMI);
+  VMIZipFunctionTable *zipFuncs = (*VMI)->GetZipFunctions(VMI);
 #endif /* HY_ZIP_API */
 
   /* Build the zipFile */
@@ -536,7 +580,7 @@
 #ifndef HY_ZIP_API
     zip_getZipEntry (privatePortLibrary, zipFile, &zipEntry, entryCopy, TRUE);
 #else /* HY_ZIP_API */
-    zipFuncs->zip_getZipEntry (VMI, zipFile, &zipEntry, entryCopy, TRUE);
+    zipFuncs->zip_getZipEntry (VMI, zipFile, &zipEntry, entryCopy, ZIP_FLAG_FIND_DIRECTORY|ZIP_FLAG_READ_DATA_POINTER);
 #endif /* HY_ZIP_API */
   (*env)->ReleaseStringUTFChars (env, entryName, entryCopy);
   if (retval)
@@ -567,7 +611,7 @@
                          zipEntry.uncompressedSize);
   if (retval == 0)
     (*env)->SetByteArrayRegion (env, buf, 0, zipEntry.uncompressedSize,
-                                zipEntry.data);
+                                (jbyte*)zipEntry.data);
 #ifndef HY_ZIP_API
   zip_freeZipEntry (privatePortLibrary, &zipEntry);
 #else /* HY_ZIP_API */

Modified: harmony/enhanced/classlib/branches/java6/modules/archive/src/main/native/archive/shared/zip.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/archive/src/main/native/archive/shared/zip.h?rev=633384&r1=633383&r2=633384&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/archive/src/main/native/archive/shared/zip.h (original)
+++ harmony/enhanced/classlib/branches/java6/modules/archive/src/main/native/archive/shared/zip.h Tue Mar  4 00:02:13 2008
@@ -21,7 +21,7 @@
 #ifndef HY_ZIP_API
 #include "zipsup.h"
 #else /* HY_ZIP_API */
-#include "hyzip.h"
+#include "vmizip.h"
 #endif /* HY_ZIP_API */
 
 #include "hymutex.h"
@@ -30,7 +30,11 @@
 {
   struct JCLZipFile *last;
   struct JCLZipFile *next;
+#ifndef HY_ZIP_API
   HyZipFile hyZipFile;
+#else
+  VMIZipFile hyZipFile;
+#endif
 } JCLZipFile;
 
 /* Fake JCLZipFile entry. last, next must be in the same position as JCLZipFile */
@@ -40,5 +44,12 @@
   JCLZipFile *next;
   MUTEX mutex;
 } JCLZipFileLink;
+
+#define THROW_ZIP_EXCEPTION(env, err, type)            \
+  if (err == Z_MEM_ERROR) {                            \
+    throwNewOutOfMemoryError(env, "");                 \
+  } else {                                             \
+    throwNew##type(env, (const char*) zError(err));    \
+  }
 
 #endif /* zip_h */

Modified: harmony/enhanced/classlib/branches/java6/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/ManifestTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/ManifestTest.java?rev=633384&r1=633383&r2=633384&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/ManifestTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/ManifestTest.java Tue Mar  4 00:02:13 2008
@@ -20,7 +20,6 @@
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
-import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.Map;
 import java.util.jar.Attributes;
@@ -95,15 +94,9 @@
 		 * assertTrue("Manifests should be equal", myManifest.equals(m2));
 		 */
 
-		Manifest manifest = null;
-		try {
-			manifest = new Manifest(new URL(Support_Resources
-					.getURL(MANIFEST_NAME)).openStream());
-		} catch (MalformedURLException e) {
-			fail("Malformed URL");
-		} catch (IOException e) {
-			fail("IOException");
-		}
+        Manifest manifest = new Manifest(new URL(Support_Resources
+                .getURL(MANIFEST_NAME)).openStream());
+
 		Attributes main = manifest.getMainAttributes();
 		assertEquals("Bundle-Name not correct", "ClientSupport", main.getValue("Bundle-Name")
 				);
@@ -148,14 +141,15 @@
                 .getBytes());
         Manifest mf = new Manifest(bis);
 
-        assertTrue("Wrong number of main attributes", mf.getMainAttributes().size() == 4);
+        assertEquals("Wrong number of main attributes", 4, mf
+                .getMainAttributes().size());
 
         Map<String, Attributes> entries = mf.getEntries();
-        assertTrue("Wrong number of named entries", entries.size() == 1);
+        assertEquals("Wrong number of named entries", 1, entries.size());
 
         Attributes namedEntryAttributes = (Attributes) (entries.get(""));
-        assertTrue("Wrong number of named entry attributes",
-                namedEntryAttributes.size() == 6);
+        assertEquals("Wrong number of named entry attributes", 6,
+                namedEntryAttributes.size());
 	}
 
 	/**

Modified: harmony/enhanced/classlib/branches/java6/modules/auth/.classpath
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/auth/.classpath?rev=633384&r1=633383&r2=633384&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/auth/.classpath (original)
+++ harmony/enhanced/classlib/branches/java6/modules/auth/.classpath Tue Mar  4 00:02:13 2008
@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-	<classpathentry kind="src" output="bin/main" path="src/main/java/windows"/>
-	<classpathentry kind="src" output="bin/test" path="src/test/resources"/>
 	<classpathentry kind="src" output="bin/main" path="src/main/java/common"/>
+	<classpathentry kind="src" output="bin/main" path="src/main/java/windows"/>
 	<classpathentry kind="src" output="bin/main" path="src/main/java/unix"/>
 	<classpathentry kind="src" output="bin/test" path="src/test/java/common"/>
 	<classpathentry kind="src" output="bin/test" path="src/test/java/windows"/>
 	<classpathentry kind="src" output="bin/test" path="src/test/java/unix"/>
+	<classpathentry kind="src" output="bin/test" path="src/test/resources"/>
 	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
-	<classpathentry sourcepath="JUNIT_SRC_HOME/junitsrc.zip" kind="var" path="JUNIT_HOME/junit.jar"/>
+	<classpathentry kind="var" path="JUNIT_HOME/junit.jar" sourcepath="JUNIT_SRC_HOME/junitsrc.zip"/>
 	<classpathentry kind="output" path="bin/main"/>
 </classpath>



Mime
View raw message