Request for review: cleanup in preparation of the final java2d backport.

Dr Andrew John Hughes ahughes at redhat.com
Thu Feb 24 16:37:17 PST 2011


On 14:46 Thu 24 Feb     , Denis Lila wrote:
> > The IcedTea version:
> > 
> > 2008-10-27 Mark Wielaard <mark at klomp.org>
> > 
> > * patches/icedtea-renderer-crossing.patch: New patch.
> > 
> > predates the OpenJDK one:
> > 
> > changeset: 1878:ccc36189f2a7
> > user: rkennke
> > date: Mon Oct 05 23:12:22 2009 +0200
> > 
> > by just under a year. Roman may even have been using the IcedTea patch
> > and not bothered
> > to report to us.
> > 
> > Anyway, good to be replaced in a separate changeset.
> 
> The attached patch does the replacement of
> patches/renderer-crossings.patch. I do this first because it came
> before any of the other things, and the other patches won't apply
> without it.
> 

Looks good.

> Unfortunately, it also has to stop applying
> patches/openjdk/6967436-6976265-6967434-pisces.patch
> patches/openjdk/6766342-AA-simple-shape-performance.patch
> If we don't stop applying the first of those, the patching will
> fail. It's not a good idea to apply the second because it changes
> a file that is also changed by 6967436-6976265-6967434-pisces.patch.
> So until the replacement for 6967436-6976265-6967434-pisces.patch is
> in, we shouldn't apply it.
> 

I can accept this temporarily but 6766342 should be re-enabled once the
Pisces patch is split.  You may have to rejig it to apply, but that's life.
It's usually just a case of applying rejected chunks manually and generating
a fresh patch.

> Ok to push?
> 

Yes.

> The next changeset after this will introduce the three replacements of
> patches/openjdk/6967436-6976265-6967434-pisces.patch.
> 
> Thank you.
> 
> ----- Original Message -----
> > On 12:45 Thu 24 Feb , Denis Lila wrote:
> > > Hi.
> > >
> > > I want to push this patch:
> > > http://icedtea.classpath.org/~dlila/hgCleanup.diff. I tried
> > > attaching it,
> > > but it was too big and I cancelled the message.
> > >
> > 
> > Ok let's split this up and do them in individual changesets with
> > individual
> > ChangeLogs. It's much easier to track things that way if we're not
> > mixing
> > up orthogonal things.
> > 
> > > The changes are:
> > > patches/openjdk/6967436-6976265-6967434-pisces.patch was replaced by
> > > 6967436-6967433-floating-pt-conversion.patch,
> > > 6967434-bad-round-joins.patch,
> > > and 6976265-stroke-control.patch. Each of the separate patches is
> > > its own
> > > changeset in openjdk7, so it was my mistake to begin with to lump
> > > them
> > > all into one backport. Splitting it up into the 3 patches fixes it.
> > > Also
> > > each of the three patches is an unmodified "hg export" of its
> > > openjdk7
> > > revision. What we had in 6967436-6976265-6967434-pisces.patch
> > > wasn't,
> > > because I had to remove some of the @Override annotations so that
> > > the
> > > build wouldn't fail. The proper way to get around this is by
> > > changing
> > > the source and target options to ecj, which is what
> > > patches/piscesMakefile.patch does.
> > >
> > 
> > Ok so this is one patch: the three patch split + the piscesMakefile to
> > make
> > it work.
> > 
> > > I replaced patches/renderer-crossing.patch with
> > > patches/openjdk/6887494-NPE-in-pisces.patch. The former adds
> > >     if (crossingIndices != null && crossingIndices.length >
> > >     DEFAULT_INDICES_SIZE) {
> > > while the latter adds
> > >     if (crossingIndices != null &&
> > >         crossingIndices.length > DEFAULT_INDICES_SIZE)
> > >     {
> > > so they do exactly the same thing, but the layout is different. What
> > > I think
> > > happened is that patches/renderer-crossing.patch was added to
> > > icedtea before
> > > openjdk7, and when it went into openjdk7 the newlines were changed.
> > > So now
> > > I'm replacing the patch with a proper backport.
> > >
> > 
> 
> > 
> > > The other changes are just removing obsolete patches, and they're
> > > described
> > > in the ChangeLog.
> > >
> > 
> > Again, separate changeset.
> > 
> > > Thank you,
> > > Denis.
> > 
> > --
> > Andrew :)
> > 
> > Free Java Software Engineer
> > Red Hat, Inc. (http://www.redhat.com)
> > 
> > Support Free Java!
> > Contribute to GNU Classpath and IcedTea
> > http://www.gnu.org/software/classpath
> > http://icedtea.classpath.org
> > PGP Key: F5862A37 (https://keys.indymedia.org/)
> > Fingerprint = EA30 D855 D50F 90CD F54D 0698 0713 C3ED F586 2A37

> diff -r 6e7f2c1f25df ChangeLog
> --- a/ChangeLog	Thu Feb 24 03:22:54 2011 +0000
> +++ b/ChangeLog	Thu Feb 24 14:36:52 2011 -0500
> @@ -1,3 +1,15 @@
> +2011-02-24  Denis Lila  <dlila at redhat.com>
> +
> +	* Makefile.am: Replaced patches/renderer-crossing.patch with
> +	patches/openjdk/6887494-NPE-in-pisces.patch.
> +	No longer applying:
> +	patches/openjdk/6967436-6976265-6967434-pisces.patch
> +	patches/openjdk/6766342-AA-simple-shape-performance.patch
> +	* patches/openjdk/6887494-NPE-in-pisces.patch:
> +	Added.
> +	* patches/renderer-crossing.patch:
> +	Removed. Replaced by 6887494-NPE-in-pisces.patch.
> +
>  2011-02-24  Andrew John Hughes  <ahughes at redhat.com>
>  
>  	* patches/pr639-missing_shark_include.patch:
> diff -r 6e7f2c1f25df Makefile.am
> --- a/Makefile.am	Thu Feb 24 03:22:54 2011 +0000
> +++ b/Makefile.am	Thu Feb 24 14:36:52 2011 -0500
> @@ -249,7 +249,6 @@
>  	patches/arch.patch \
>  	patches/lc_ctype.patch \
>  	patches/xjc.patch \
> -	patches/renderer-crossing.patch \
>  	patches/stroker-finish.patch \
>  	patches/linker-libs-order.patch \
>  	patches/testenv.patch \
> @@ -293,7 +292,6 @@
>  	patches/openjdk/6650759-missing_inference.patch \
>  	patches/numa_on_early_glibc.patch \
>  	patches/jtreg-international-fonts.patch \
> -	patches/openjdk/6967436-6976265-6967434-pisces.patch \
>  	patches/f14-fonts.patch \
>  	patches/jtreg-T6638712-fix.patch \
>  	patches/jtreg-T6650759m-fix.patch \
> @@ -323,8 +321,8 @@
>  	patches/pr586-include_all_srcs.patch \
>  	patches/jtreg-LastErrorString.patch \
>  	patches/openjdk/6663040-com.sun.awt.patch \
> +	patches/openjdk/6887494-NPE-in-pisces.patch \
>  	patches/openjdk/6775317-non-AA-simple-shape-performance.patch \
> -	patches/openjdk/6766342-AA-simple-shape-performance.patch \
>  	patches/pr600-arm-jvm.cfg.patch
>  
>  if !WITH_ALT_HSBUILD
> diff -r 6e7f2c1f25df patches/openjdk/6887494-NPE-in-pisces.patch
> --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
> +++ b/patches/openjdk/6887494-NPE-in-pisces.patch	Thu Feb 24 14:36:52 2011 -0500
> @@ -0,0 +1,90 @@
> +# HG changeset patch
> +# User rkennke
> +# Date 1254777142 -7200
> +# Node ID ccc36189f2a7615ffb798e76ba5b31d8c535dc40
> +# Parent  31e68419715e0a8e88ee6005ab1d69180cfe6f44
> +6887494: NPE in pisces Renderer
> +Summary: Only recreate crossings array, if there actually exists one before.
> +Reviewed-by: flar, tdv
> +
> +diff -r 31e68419715e -r ccc36189f2a7 src/share/classes/sun/java2d/pisces/Renderer.java
> +--- openjdk.orig/jdk/src/share/classes/sun/java2d/pisces/Renderer.java	Fri Oct 02 10:15:12 2009 -0700
> ++++ openjdk/jdk/src/share/classes/sun/java2d/pisces/Renderer.java	Mon Oct 05 23:12:22 2009 +0200
> +@@ -775,10 +775,12 @@
> + 
> +     // Free sorting arrays if larger than maximum size
> +     private void crossingListFinished() {
> +-        if (crossings.length > DEFAULT_CROSSINGS_SIZE) {
> ++        if (crossings != null && crossings.length > DEFAULT_CROSSINGS_SIZE) {
> +             crossings = new int[DEFAULT_CROSSINGS_SIZE];
> +         }
> +-        if (crossingIndices.length > DEFAULT_INDICES_SIZE) {
> ++        if (crossingIndices != null &&
> ++            crossingIndices.length > DEFAULT_INDICES_SIZE)
> ++        {
> +             crossingIndices = new int[DEFAULT_INDICES_SIZE];
> +         }
> +     }
> +diff -r 31e68419715e -r ccc36189f2a7 test/sun/java2d/pisces/Renderer/TestNPE.java
> +--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
> ++++ openjdk/jdk/test/sun/java2d/pisces/Renderer/TestNPE.java	Mon Oct 05 23:12:22 2009 +0200
> +@@ -0,0 +1,59 @@
> ++/*
> ++ * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
> ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
> ++ *
> ++ * This code is free software; you can redistribute it and/or modify it
> ++ * under the terms of the GNU General Public License version 2 only, as
> ++ * published by the Free Software Foundation.
> ++ *
> ++ * This code is distributed in the hope that it will be useful, but WITHOUT
> ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
> ++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
> ++ * version 2 for more details (a copy is included in the LICENSE file that
> ++ * accompanied this code).
> ++ *
> ++ * You should have received a copy of the GNU General Public License version
> ++ * 2 along with this work; if not, write to the Free Software Foundation,
> ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
> ++ *
> ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
> ++ * or visit www.oracle.com if you need additional information or have any
> ++ * questions. 
> ++ */
> ++
> ++/**
> ++ * @test
> ++ * @bug     6887494
> ++ *
> ++ * @summary Verifies that no NullPointerException is thrown in Pisces Renderer
> ++ *          under certain circumstances.
> ++ *
> ++ * @run     main TestNPE
> ++ */
> ++
> ++import java.awt.*;
> ++import java.awt.geom.*;
> ++import java.awt.image.BufferedImage;
> ++
> ++public class TestNPE {
> ++
> ++    private static void paint(Graphics g) {
> ++        Graphics2D g2d = (Graphics2D) g;
> ++        g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
> ++                             RenderingHints.VALUE_ANTIALIAS_ON);
> ++        g2d.setClip(0, 0, 0, 0);
> ++        g2d.setTransform(
> ++               new AffineTransform(4.0f, 0.0f, 0.0f, 4.0f, -1248.0f, -744.0f));
> ++        g2d.draw(new Line2D.Float(131.21428571428572f, 33.0f,
> ++                                  131.21428571428572f, 201.0f));
> ++    }
> ++
> ++    public static void main(String[] args) {
> ++        BufferedImage im = new BufferedImage(100, 100,
> ++                                             BufferedImage.TYPE_INT_ARGB);
> ++
> ++        // Trigger exception in main thread.
> ++        Graphics g = im.getGraphics();
> ++        paint(g);
> ++    }
> ++}
> diff -r 6e7f2c1f25df patches/renderer-crossing.patch
> --- a/patches/renderer-crossing.patch	Thu Feb 24 03:22:54 2011 +0000
> +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
> @@ -1,15 +0,0 @@
> ---- openjdk6/jdk/src/share/classes/sun/java2d/pisces/Renderer.java	2008-08-28 10:14:15.000000000 +0200
> -+++ openjdk/jdk/src/share/classes/sun/java2d/pisces/Renderer.java	2008-10-27 13:54:25.000000000 +0100
> -@@ -775,10 +775,10 @@
> - 
> -     // Free sorting arrays if larger than maximum size
> -     private void crossingListFinished() {
> --        if (crossings.length > DEFAULT_CROSSINGS_SIZE) {
> -+        if (crossings != null && crossings.length > DEFAULT_CROSSINGS_SIZE) {
> -             crossings = new int[DEFAULT_CROSSINGS_SIZE];
> -         }
> --        if (crossingIndices.length > DEFAULT_INDICES_SIZE) {
> -+        if (crossingIndices != null && crossingIndices.length > DEFAULT_INDICES_SIZE) {
> -             crossingIndices = new int[DEFAULT_INDICES_SIZE];
> -         }
> -     }


-- 
Andrew :)

Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)

Support Free Java!
Contribute to GNU Classpath and IcedTea
http://www.gnu.org/software/classpath
http://icedtea.classpath.org
PGP Key: F5862A37 (https://keys.indymedia.org/)
Fingerprint = EA30 D855 D50F 90CD F54D  0698 0713 C3ED F586 2A37



More information about the distro-pkg-dev mailing list