1878N/A/*
2362N/A * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
1878N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1878N/A *
1878N/A * This code is free software; you can redistribute it and/or modify it
1878N/A * under the terms of the GNU General Public License version 2 only, as
1878N/A * published by the Free Software Foundation.
1878N/A *
1878N/A * This code is distributed in the hope that it will be useful, but WITHOUT
1878N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1878N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1878N/A * version 2 for more details (a copy is included in the LICENSE file that
1878N/A * accompanied this code).
1878N/A *
1878N/A * You should have received a copy of the GNU General Public License version
1878N/A * 2 along with this work; if not, write to the Free Software Foundation,
1878N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1878N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
1878N/A */
1878N/A
1878N/A/**
1878N/A * @test
1878N/A * @bug 6887494
1878N/A *
1878N/A * @summary Verifies that no NullPointerException is thrown in Pisces Renderer
1878N/A * under certain circumstances.
1878N/A *
1878N/A * @run main TestNPE
1878N/A */
1878N/A
1878N/Aimport java.awt.*;
1878N/Aimport java.awt.geom.*;
1878N/Aimport java.awt.image.BufferedImage;
1878N/A
1878N/Apublic class TestNPE {
1878N/A
1878N/A private static void paint(Graphics g) {
1878N/A Graphics2D g2d = (Graphics2D) g;
1878N/A g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
1878N/A RenderingHints.VALUE_ANTIALIAS_ON);
1878N/A g2d.setClip(0, 0, 0, 0);
1878N/A g2d.setTransform(
1878N/A new AffineTransform(4.0f, 0.0f, 0.0f, 4.0f, -1248.0f, -744.0f));
1878N/A g2d.draw(new Line2D.Float(131.21428571428572f, 33.0f,
1878N/A 131.21428571428572f, 201.0f));
1878N/A }
1878N/A
1878N/A public static void main(String[] args) {
1878N/A BufferedImage im = new BufferedImage(100, 100,
1878N/A BufferedImage.TYPE_INT_ARGB);
1878N/A
1878N/A // Trigger exception in main thread.
1878N/A Graphics g = im.getGraphics();
1878N/A paint(g);
1878N/A }
1878N/A}