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]

FYI: Patch: classpath merge


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi list,


I commited the attached patch to trunk to merge java/awt/image/
SinglePixelPackedSampleModel.java and java/io/ObjectOutputStream.java 
again.


Michael
- -- 
Homepage: http://www.worldforge.org/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQE/dJteWSOgCCdjSDsRAtGqAJ44TevLvtUnNNGhhwrJhV1MYQfnZACeL3OC
w+wPJiO++ucVMqWxgsJ4voQ=
=90U/
-----END PGP SIGNATURE-----
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/libjava/ChangeLog,v
retrieving revision 1.2193
diff -u -b -B -r1.2193 ChangeLog
--- ChangeLog	26 Sep 2003 16:22:08 -0000	1.2193
+++ ChangeLog	26 Sep 2003 19:58:53 -0000
@@ -1,3 +1,14 @@
+2003-09-26  Sascha Brawer  <brawer@dandelis.ch>
+
+	* java/awt/image/SinglePixelPackedSampleModel.java (createDataBuffer): 
+	Save space for some pixels at the buffer end.  Added Javadoc.
+
+2003-09-26  Tom Tromey  <tromey@redhat.com>
+
+	* java/io/ObjectOutputStream.java (writeFields): Fixed
+	indentation.
+	(putFields): Likewise.
+
 2003-09-26  Michael Koch  <konqueror@gmx.de>
 
 	* java/nio/ByteBufferHelper.java:
Index: java/awt/image/SinglePixelPackedSampleModel.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/awt/image/SinglePixelPackedSampleModel.java,v
retrieving revision 1.4
diff -u -b -B -r1.4 SinglePixelPackedSampleModel.java
--- java/awt/image/SinglePixelPackedSampleModel.java	22 Jan 2002 22:40:10 -0000	1.4
+++ java/awt/image/SinglePixelPackedSampleModel.java	26 Sep 2003 19:58:53 -0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2002  Free Software Foundation
+/* Copyright (C) 2000, 2002, 2003  Free Software Foundation
 
 This file is part of GNU Classpath.
 
@@ -88,12 +88,24 @@
     return new SinglePixelPackedSampleModel(dataType, w, h, bitMasks);
   }
 
+
+  /**
+   * Creates a DataBuffer for holding pixel data in the format and
+   * layout described by this SampleModel. The returned buffer will
+   * consist of one single bank.
+   */
   public DataBuffer createDataBuffer()
   {
-    // Important: use scanlineStride here, not width!
-    int size = scanlineStride*height;
+    int size;
+
+    // We can save (scanlineStride - width) pixels at the very end of
+    // the buffer. The Sun reference implementation (J2SE 1.3.1 and
+    // 1.4.1_01) seems to do this; tested with Mauve test code.
+    size = scanlineStride * (height - 1) + width;
+
     return Buffers.createBuffer(getDataType(), size);
   }
+
 
   public int[] getSampleSize()
   {
Index: java/io/ObjectOutputStream.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/io/ObjectOutputStream.java,v
retrieving revision 1.20
diff -u -b -B -r1.20 ObjectOutputStream.java
--- java/io/ObjectOutputStream.java	25 Sep 2003 19:06:20 -0000	1.20
+++ java/io/ObjectOutputStream.java	26 Sep 2003 19:58:53 -0000
@@ -870,10 +870,10 @@
       {
     currentPutField = new PutField ()
       {
-	private byte[] prim_field_data
-	= new byte[currentObjectStreamClass.primFieldSize];
-	private Object[] objs
-	= new Object[currentObjectStreamClass.objectFieldCount];
+	    private byte[] prim_field_data =
+	      new byte[currentObjectStreamClass.primFieldSize];
+	    private Object[] objs =
+	      new Object[currentObjectStreamClass.objectFieldCount];
 
 	public void put (String name, boolean value)
 	{
@@ -996,12 +996,11 @@
 	private void checkType (ObjectStreamField field, char type)
 	  throws IllegalArgumentException
 	{
-	  if (TypeSignature.getEncodingOfClass (field.getType ()).charAt (0)
+	      if (TypeSignature.getEncodingOfClass(field.getType ()).charAt(0)
 	      != type)
 	    throw new IllegalArgumentException ();
 	}
       };
-    // end PutFieldImpl
       }
 
     return currentPutField;
@@ -1013,8 +1012,7 @@
     if (currentPutField == null)
       throw new NotActiveException ("writeFields can only be called after putFields has been called");
 
-	// moved here from putFields since putFields 
-	// may be called more than once, but not writeFields
+    // putFields may be called more than once, but not writeFields.
 	markFieldsWritten();
 	
     currentPutField.write (this);

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