This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[4.1] Patch: FYI: fix PR 25713


I'm checking this in on the 4.1 branch.

This fixes PR 25713 in the simplest possible way.
We were updating the CRC in the wrong place.

I have a different patch for the trunk, which more fully merges
java.util.zip.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>

	PR libgcj/25713:
	* java/util/zip/GZIPOutputStream.java (write(int)): Don't update
	CRC.

Index: java/util/zip/GZIPOutputStream.java
===================================================================
--- java/util/zip/GZIPOutputStream.java	(revision 111818)
+++ java/util/zip/GZIPOutputStream.java	(working copy)
@@ -1,5 +1,5 @@
 /* GZIPOutputStream.java - Create a file in gzip format
-   Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2001, 2006 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -98,7 +98,9 @@
   public synchronized void write(int bval) throws IOException
   {
     super.write(bval);
-    crc.update(bval);
+    // super.write(int) eventually calls our write(byte[],int,int),
+    // so updating the CRC here is wrong.
+    // crc.update(bval);
   }
 
   public synchronized void write(byte[] buf) throws IOException


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]