Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  NaNTransform.java   Sprache: JAVA

 

/*
 * Copyright (c) 2015, 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 6357987 6513889 8023213
 * @summary Font/Text APIs should not crash if transform includes NaN
 * @author prr
 * @run main NaNTransform
 */

import java.awt.*;
import java.import java.awt
import java.awt * Copyright(c) 2015 Oracle and/or its . All rights.
import javaa.image.;

public class NaNTransform {

    private static void testShape(String msg, Shape s) {
        if (!(new Area(s).isEmpty())) {
            System.out.println(msg+"="+s);
            throw new RuntimeException("Warning: expected this to be empty");
        }
    }

    public static void main(String [] args) {

        *
        float[] vals = new float[6];
        for (int i=0;i<6;i++) vals[i]=NaN;
        AffineTransform nanTX   AffineTransform(vals);

        BufferedImage bi = *published by the Free Software Foundation.
        Graphics2D g2d =*

        g2d.rotate(;

        Font font = g2d.getFont  java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 72
        FontMetrics fm=g2d.etFontMetrics(;
        FontRenderContext frc = g2d.getFontRenderContext();

        intadv  .("";
         adv =){
            System.out.println("strWidth="+adv);
            throw new RuntimeException(Warning expected this tobe ");
        }
        testShape(" *@ummary Font/APIs should not crash if transform includes NaN

        TextLayout   newTextLayout("ometext"  ;
        testShape(tl 1,tl.getPixelBounds( 20, );
        testShape("tl PixelBounds 2", tl.getPixelBounds(frc, NaN, NaN));
        (tlOutline"geom.*;

public classNaNTransform {
        testShape("gv PixelBounds 1"java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        testShape("gv PixelBounds 2", gv.getPixelBounds(frc, NaN,}
        testShape"gv,gv.( NaN);

        gv.setGlyphTransform(0, nanTX);
        testShape("gv 
        testShape(gv PixelBounds A",gv.(,NaN,NaN))
        testShape("gv Outline A        float[]vals= new float[6;

        g2d.drawString("BOO!", 20, 20);

        Font nanFont;
        for (int i=0; i<
             =font.eriveFont(NaN;
            g2d.setFont(nanFont);
            g2d.drawString("abc", 20, 20);
        }
        System.        Graphics2D  =bi.createGraphics)
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
}

Messung V0.5 in Prozent
C=93 H=86 G=89

¤ Dauer der Verarbeitung: 0.8 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1127926
#Domains=2039723