302N/A/*
2362N/A * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
302N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
302N/A *
302N/A * This code is free software; you can redistribute it and/or modify it
302N/A * under the terms of the GNU General Public License version 2 only, as
302N/A * published by the Free Software Foundation.
302N/A *
302N/A * This code is distributed in the hope that it will be useful, but WITHOUT
302N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
302N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
302N/A * version 2 for more details (a copy is included in the LICENSE file that
302N/A * accompanied this code).
302N/A *
302N/A * You should have received a copy of the GNU General Public License version
302N/A * 2 along with this work; if not, write to the Free Software Foundation,
302N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
302N/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.
302N/A */
302N/A
302N/A/**
302N/A * @test
302N/A * @bug 6699843
302N/A * @summary IllegalArgumentException when using Graphics.drawString( "", 0, 0 )
302N/A */
302N/A
302N/Aimport java.awt.*;
302N/Aimport java.awt.font.*;
302N/Aimport java.awt.image.*;
302N/Aimport java.text.*;
302N/Aimport java.util.*;
302N/A
302N/Apublic class EmptyAttrString {
302N/A
302N/A public static void main(String[] args) {
302N/A BufferedImage bi =
302N/A new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB);
302N/A Graphics2D g = bi.createGraphics();
302N/A Font f = new Font( "Dialog", Font.PLAIN, 12 );
302N/A Map map = new HashMap();
302N/A map.put(TextAttribute.STRIKETHROUGH, TextAttribute.STRIKETHROUGH_ON);
302N/A f = f.deriveFont(map);
302N/A g.setFont(f);
302N/A g.drawString("", 50, 50);
302N/A g.drawString("", 50f, 50f);
302N/A char[] chs = { } ;
302N/A g.drawChars(chs, 0, 0, 50, 50);
302N/A byte[] bytes = { } ;
302N/A g.drawBytes(bytes, 0, 0, 50, 50);
302N/A AttributedString astr = new AttributedString("");
302N/A g.drawString(astr.getIterator(), 50, 50);
302N/A g.drawString(astr.getIterator(), 50f, 50f);
302N/A return;
302N/A }
302N/A}