/hg/icedtea6: 3 new changesets

andrew at icedtea.classpath.org andrew at icedtea.classpath.org
Tue Nov 2 16:28:49 PDT 2010


changeset 13734765e6dd in /hg/icedtea6
details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=13734765e6dd
author: Andrew John Hughes <ahughes at redhat.com>
date: Fri Oct 22 12:43:16 2010 +0100

	Cleanup ecj.jar detection.

	2010-10-22 Andrew John Hughes <ahughes at redhat.com>

	 * acinclude.m4: (FIND_JAVAC): Don't fail if $JAVAC
	is empty, ecj.jar can be used. (FIND_ECJ_JAR): Check
	additional Gentoo locations. Fail only if both $JAVAC is
	empty and ECJ_JAR is no.


changeset e8f1ae620c8e in /hg/icedtea6
details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=e8f1ae620c8e
author: Andrew John Hughes <ahughes at redhat.com>
date: Tue Nov 02 23:26:57 2010 +0000

	Fix hs19 on ppc machines.

	2010-10-22 Andrew John Hughes <ahughes at redhat.com>

	 * Makefile.am: Add new patch for hs19 builds only.
		* NEWS: Mention fix.
		* patches/openjdk/6994130-ppc_fix.patch: Fix build on PPC
	machines (thanks to Gary Benson).


changeset 119d733ccf0a in /hg/icedtea6
details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=119d733ccf0a
author: Andrew John Hughes <ahughes at redhat.com>
date: Tue Nov 02 23:28:02 2010 +0000

	Merge


diffstat:

6 files changed, 248 insertions(+), 12 deletions(-)
ChangeLog                                       |   28 +++
Makefile.am                                     |   10 -
NEWS                                            |    5 
acinclude.m4                                    |   11 -
patches/icedtea-jtreg-international-fonts.patch |  195 +++++++++++++++++++++++
patches/openjdk/6994130-ppc_fix.patch           |   11 +

diffs (325 lines):

diff -r 0bfb4898c039 -r 119d733ccf0a ChangeLog
--- a/ChangeLog	Wed Oct 20 14:45:55 2010 +0100
+++ b/ChangeLog	Tue Nov 02 23:28:02 2010 +0000
@@ -1,4 +1,30 @@ 2010-10-19  Andrew John Hughes  <ahughes
-2010-10-19  Andrew John Hughes  <ahughes at redhat.com>
+2010-11-02  Pavel Tisnovsky  <ptisnovs at redhat.com>
+
+	* Makefile.am:
+	* patches/icedtea-jtreg-international-fonts.patch:
+	Added new regression test
+	patches/icedtea-jtreg-international-fonts.patch
+	for checking if all non-Latin fonts are installed
+	and properly configured.
+
+2010-10-22  Andrew John Hughes  <ahughes at redhat.com>
+
+	* Makefile.am: Add new patch for hs19
+	builds only.
+	* NEWS: Mention fix.
+	* patches/openjdk/6994130-ppc_fix.patch:
+	Fix build on PPC machines (thanks to Gary
+	Benson).
+
+2010-10-22  Andrew John Hughes  <ahughes at redhat.com>
+
+	* acinclude.m4:
+	(FIND_JAVAC): Don't fail if $JAVAC is empty,
+	ecj.jar can be used.
+	(FIND_ECJ_JAR): Check additional Gentoo locations.
+	Fail only if both $JAVAC is empty and ECJ_JAR is no.
+
+2010-10-20  Andrew John Hughes  <ahughes at redhat.com>
 
 	* INSTALL: Clarify HotSpot build documentation.
 	* acinclude.m4:
diff -r 0bfb4898c039 -r 119d733ccf0a Makefile.am
--- a/Makefile.am	Wed Oct 20 14:45:55 2010 +0100
+++ b/Makefile.am	Tue Nov 02 23:28:02 2010 +0000
@@ -291,10 +291,14 @@ ICEDTEA_PATCHES = \
 	patches/numa_on_early_glibc.patch \
 	patches/icedtea-shark-build.patch \
 	patches/openjdk/6985992-test_6933784.patch \
-        patches/openjdk/6853592-badwindow-warning-fix.patch \
-        patches/6703377-freetypescaler.patch
+	patches/openjdk/6853592-badwindow-warning-fix.patch \
+	patches/6703377-freetypescaler.patch \
+	patches/icedtea-jtreg-international-fonts.patch
 
-if !WITH_ALT_HSBUILD
+if WITH_ALT_HSBUILD
+ICEDTEA_PATCHES += \
+	patches/openjdk/6994130-ppc_fix.patch
+else
 ICEDTEA_PATCHES += \
 	patches/shark_do_nothing_on_stub_frame.patch \
 	patches/icedtea-shark-build-hotspot.patch \
diff -r 0bfb4898c039 -r 119d733ccf0a NEWS
--- a/NEWS	Wed Oct 20 14:45:55 2010 +0100
+++ b/NEWS	Tue Nov 02 23:28:02 2010 +0000
@@ -36,13 +36,14 @@ New in release 1.10 (2010-XX-XX):
   - S6980004, CVE-2010-3573: limit HTTP request cookie headers in HttpURLConnection
   - S6981426, CVE-2010-3574: limit use of TRACE method in HttpURLConnection
   - S6990437: Update with correct copyright info for source and test files from SSR10_02 fixes
-* Backports from OpenJDK6
+* Backports
   - S4356282, RH525870: RFE: T2K should be used to rasterize CID/CFF fonts
   - S6954424: Support OpenType/CFF fonts in JDK 7
   - S6438179: XToolkit.isTraySupported() result has nothing to do with the system tray
   - S6638712: Inference with wildcard types causes selection of inapplicable method
   - S6650759: Inference of formal type parameter (unused in formal parameters) is not performed
-* Netx
+  - S6991430, PR579: Zero PowerPC fix.
+* NetX
   - A new man page for javaws.
   - Add a new option -Xclearcache
 * Plugin  
diff -r 0bfb4898c039 -r 119d733ccf0a acinclude.m4
--- a/acinclude.m4	Wed Oct 20 14:45:55 2010 +0100
+++ b/acinclude.m4	Tue Nov 02 23:28:02 2010 +0000
@@ -135,9 +135,6 @@ AC_DEFUN([FIND_JAVAC],
   IT_FIND_JAVAC
   IT_FIND_ECJ
 
-  if test "x${JAVAC}" = x; then
-      AC_MSG_ERROR([cannot find a Java compiler, try --with-javac or --with-ecj])
-  fi
   AC_SUBST(JAVAC)
 ])
 
@@ -332,7 +329,9 @@ AC_DEFUN([FIND_ECJ_JAR],
   if test -z "${ECJ_JAR}"; then
     for jar in /usr/share/java/eclipse-ecj.jar \
       /usr/share/java/ecj.jar \
-      /usr/share/eclipse-ecj-3.{2,3,4,5}/lib/ecj.jar; do
+      /usr/share/eclipse-ecj/ecj.jar \
+      /usr/share/eclipse-ecj-3.{2,3,4,5}/lib/ecj.jar \
+      /usr/share/ecj-gcj-3.{2,3,4,5}/lib/ecj.jar ; do
         if test -e $jar; then
           ECJ_JAR=$jar
 	  break
@@ -343,8 +342,8 @@ AC_DEFUN([FIND_ECJ_JAR],
       fi
   fi
   AC_MSG_RESULT(${ECJ_JAR})
-  if test "x${ECJ_JAR}" = "xno"; then
-    AC_MSG_ERROR("No compiler or ecj JAR file was found.")
+  if test "x${JAVAC}" = "x" && test "x${ECJ_JAR}" = "xno"; then
+    AC_MSG_ERROR([No compiler or ecj JAR file was found; try --with-javac, --with-ecj or --with-ecj-jar])
   fi
   AC_SUBST(ECJ_JAR)
 ])
diff -r 0bfb4898c039 -r 119d733ccf0a patches/icedtea-jtreg-international-fonts.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/icedtea-jtreg-international-fonts.patch	Tue Nov 02 23:28:02 2010 +0000
@@ -0,0 +1,195 @@
+--- /dev/null	2010-06-29 14:56:30.329576932 +0200
++++ openjdk/jdk/test/java/awt/font/InternationalFonts/InternationalFontsRendering.java	2010-11-01 11:27:46.000000000 +0100
+@@ -0,0 +1,192 @@
++import java.awt.Color;
++import java.awt.Font;
++import java.awt.Graphics2D;
++import java.awt.RenderingHints;
++import java.awt.image.BufferedImage;
++import java.io.File;
++import java.io.IOException;
++import java.util.Arrays;
++import java.util.List;
++import java.util.ArrayList;
++
++import javax.imageio.ImageIO;
++
++/**
++ * @test
++ * @run main InternationalFontsRendering
++ * @author Pavel Tisnovsky
++ *
++ * @summary This test check if all required fonts are properly installed and configured.
++ *
++ * This regression test checks if all required fonts are properly installed and
++ * that .src.properties font configuration is correct. The test is based on
++ * rendering certain characters from selected code pages into BufferedImage.
++ *
++ * When the font does not exists or font configuration is broken, only empty
++ * rectangle is rendered instead of the selected character shape. This rectangle
++ * is filtered and then the destination image is tested whether it is empty
++ * (=white).
++ *
++ * If test images with rendered characters needs to be created use following flag:
++ * -create-images
++ *
++ * regression for bug: https://bugzilla.redhat.com/show_bug.cgi?id=643674
++ * (Bug 643674 Misconfigured Path for Asian Font)
++ *
++ */
++public class InternationalFontsRendering
++{
++    private static int WIDTH = 200;
++    private static int HEIGHT = 200;
++
++    private static final int FONT_SIZE = 160;
++
++    private static final int MINIMUM_HORIZONTAL_LINE_LENGTH = 70;
++    private static final int MINIMUM_VERTICAL_LINE_LENGTH = 80;
++    private static final int BLACK_WHITE_THRESHOLD = 128;
++    private static final int BLACK_PIXEL_COUNT_THRESHOLD = WIDTH * HEIGHT / 1000;
++
++    private static final String[][] testedStrings = {
++        {"Latin-1",    "abcdefABCDEF"},
++        {"Latin-2",    "ěščřžýáíéúůľň"},
++        {"Cyrilic",    "ДЗИѲФХѰѠЦ"},
++        {"Greek",      "βξγδπερζΣσςητθυΩ"},
++        {"Asia-Test1", "体中文符号"},
++        {"Asia-Test2", "繁體中文符號"},
++        {"Asia-Test3", "日本の象徴"},
++        {"Asia-Test4", "한국어기호"},
++    };
++
++    /**
++     * Creates test image a renders one big character to it.
++     * @param testedString
++     * @return
++     */
++    private BufferedImage createTestImage(String str) {
++        BufferedImage image = new BufferedImage(WIDTH, HEIGHT, BufferedImage.TYPE_BYTE_GRAY);
++        Graphics2D gc = image.createGraphics();
++        gc.setBackground(Color.WHITE);
++        gc.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
++        gc.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_OFF);
++        gc.clearRect(0, 0, WIDTH, HEIGHT);
++        gc.setFont(new Font(Font.DIALOG, Font.PLAIN, FONT_SIZE));
++        gc.setColor(Color.BLACK);
++        gc.drawString(str, 0, HEIGHT - 40);
++        gc.dispose();
++        return image;
++    }
++
++    /**
++     * Creates destination image and then copies data from source image to it
++     * @param src
++     * @return
++     */
++    private BufferedImage createDestinationImage(BufferedImage src) {
++        BufferedImage image = new BufferedImage(WIDTH, HEIGHT, BufferedImage.TYPE_BYTE_GRAY);
++        src.copyData(image.getRaster());
++        return image;
++    }
++
++    /**
++     * Removes long horizontal lines from image
++     */
++    private void removeHorizontalLines(BufferedImage image) {
++        for (int y = 0; y < image.getHeight(); y++) {
++            int startX = -1, endX = -1;
++            for (int x = 0; x < image.getWidth(); x++) {
++                int color = image.getRaster().getSample(x, y, 0);
++                if (startX < 0 && color <= BLACK_WHITE_THRESHOLD) {
++                    startX = x;
++                    //System.out.println("> " + y + "\t" + x);
++                }
++                if (startX > 0 && endX < 0 && color > BLACK_WHITE_THRESHOLD) {
++                    endX = x;
++                    //System.out.println("< " + y + "\t" + x);
++                }
++            }
++            // remove long horizontal line, but only if this line found detected in image
++            if (startX > 0 && endX > 0 && (endX - startX) > MINIMUM_HORIZONTAL_LINE_LENGTH) {
++                for (int x = startX; x < endX; x++) {
++                    image.getRaster().setSample(x, y, 0, 255);
++                }
++            }
++        }
++    }
++
++    /**
++     * Removes long vertical lines from image
++     */
++    private void removeVerticalLines(BufferedImage image) {
++        for (int x = 0; x < image.getWidth(); x++) {
++            int startY = -1, endY = -1;
++            for (int y = 0; y < image.getHeight(); y++) {
++                int color = image.getRaster().getSample(x, y, 0);
++                if (startY < 0 && color <= BLACK_WHITE_THRESHOLD) {
++                    startY = y;
++                }
++                if (startY > 0 && endY < 0 && color > BLACK_WHITE_THRESHOLD) {
++                    endY = y;
++                    //System.out.println("< " + y + "\t" + x);
++                }
++            }
++            // remove long vertical line, but only if this line found detected in image
++            if (startY > 0 && endY > 0 && (endY - startY) > MINIMUM_VERTICAL_LINE_LENGTH) {
++                for (int y = startY; y < endY; y++) {
++                    image.getRaster().setSample(x, y, 0, 255);
++                }
++            }
++        }
++    }
++
++    /**
++     * Test if image is almost empty (one large white area)
++     * @param image
++     * @return
++     */
++    private boolean isImageAlmostEmpty(BufferedImage image) {
++        int blackPixelCount = 0;
++        for (int y = 0; y < image.getHeight(); y++) {
++            for (int x = 0; x < image.getWidth(); x++) {
++                if (image.getRaster().getSample(x, y, 0) < BLACK_WHITE_THRESHOLD) {
++                    blackPixelCount++;
++                }
++            }
++        }
++        return blackPixelCount < BLACK_PIXEL_COUNT_THRESHOLD;
++    }
++
++    public void runTest(boolean createImages) throws IOException
++    {
++        List<Integer> badCharacters = new ArrayList<Integer>();
++        for (String[] testedString : testedStrings) {
++            System.out.println("\nTesting " + testedString[0]);
++            for (int i = 0; i < testedString[1].length(); i++) {
++                String str = testedString[1].substring(i, 1+i);
++                int code = str.charAt(0);
++                System.out.print(code + "\t");
++                BufferedImage src = createTestImage(str);
++                BufferedImage dst = createDestinationImage(src);
++                removeHorizontalLines(dst);
++                removeVerticalLines(dst);
++
++                if (createImages /* || true*/) {
++                    ImageIO.write(src, "png", new File(code + "_src.png"));
++                    ImageIO.write(dst, "png", new File(code + "_dst.png"));
++                }
++
++                if (isImageAlmostEmpty(dst)) {
++                    System.err.println("Bad rendering of character with code: " + code);
++                    badCharacters.add(Integer.valueOf(code));
++                }
++            }
++        }
++        if (!badCharacters.isEmpty()) {
++            throw new RuntimeException("Error in rendering of character(s) with code(s): " + badCharacters.toString());
++        }
++    }
++
++    public static void main(String[] args) throws IOException {
++        new InternationalFontsRendering().runTest(Arrays.asList(args).contains("-create-images"));
++    }
++}
++
diff -r 0bfb4898c039 -r 119d733ccf0a patches/openjdk/6994130-ppc_fix.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/openjdk/6994130-ppc_fix.patch	Tue Nov 02 23:28:02 2010 +0000
@@ -0,0 +1,11 @@
+--- openjdk.orig/hotspot/src/share/vm/runtime/frame.cpp	2010-10-22 10:56:58.000000000 +0100
++++ openjdk/hotspot/src/share/vm/runtime/frame.cpp	2010-10-22 10:56:58.000000000 +0100
+@@ -878,7 +878,7 @@
+ 
+ #endif /* CC_INTERP */
+ 
+-#ifndef PPC
++#if !defined(PPC) || defined(ZERO)
+   if (m->is_native()) {
+ #ifdef CC_INTERP
+     f->do_oop((oop*)&istate->_oop_temp);



More information about the distro-pkg-dev mailing list