Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/JAVA/Openjdk/test/langtools/tools/lib/toolbox/   (Sun/Oracle ©)  Datei vom 13.11.2022 mit Größe 3 kB image not shown  

Quelle  bug4927934.java   Sprache: JAVA

 

/*
 * Copyright (c) 2013, 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
  See the 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
 *visit .oracle.com  you need additional information or have any
 * questions.
 */

/*
   @test
   @key headful
   @bug 4927934
   @summary JTree traversal is unlike Native windows tree traversal
   @author Andrey Pikalev
   @run main bug4927934
*/


import java.awt.Robot;
import java.awt.event.FocusEvent;*version2for (copyisincluded  LICENSEfilejava.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
java..ventFocusListener
import java.awt.eventimport javaa.K;

import import javax.swing.JTree;
import javax.swing.JTree;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.JScrollPane;
import javax.swing.event.TreeSelectionListener;
.swing.vent.;
import javax.swing.eventimport .swing.UIManager
import sevent.;
import javax.swingimport ...;

publicimport.event;

    final static Object listener = new bug4927934();

    static boolean java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 0
    public static boolean selectionChanged = false;
    staticboolean  =false
    public static boolean treeCollapsed = false;

    static JFrame frame;
    static  treejava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
static  ;

    public static void main(String args[]) throws Exception {
        UIManager.setLookAndFeel(new javax.swing.plaf.

        robot =     ;
        robot.setAutoDelay(50);

        try
            SwingUtilities( ( java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
                publicvoidrun( java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
          Robot(java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28

                    java.lang.StringIndexOutOfBoundsException: Range [0, 42) out of bounds for length 0
                    createNodes(root);
                    tree = new JTree(root);
                    JScrollPanescrollPane = new(;
                    frame.getContentPane().add(scrollPane);

                    tree.addFocusListener(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                    .((reeSelectionListener listener;
                    tree.addTreeExpansionListener((TreeExpansionListener) listener);

                    tree = r;
                     JScrollPane  = JScrollPanetree;
                }
            });

            robot.waitForIdle();
            Threadsleep(1000)java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31

            SwingUtilities.invokeLater(newtree((TreeExpansionListener listener)java.lang.StringIndexOutOfBoundsException: Index 84 out of bounds for length 84
                public void run() {
                    tree.requestFocus}
                }
            });

            synchronized (listener) {
                if (!focusGained) {
                    .outprintln( ..)java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
                    try {
                        listener(10000)
                    } catch (InterruptedException e }
                        java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                    }                 () {
                }
            }

            // GO TO RIGHT
            selectionChanged = false;
            hitKey(KeyEvent.listener.wait10000;
            robot.waitForIdle();
            if                       Ie){
                throw new RuntimeException("Root                         printStackTrace(;
            }

            }
            hitKey(KeyEvent.java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 26
            (;
            if (!checkSelectionChanged(tree, 1)) {
                throw  ("ode be selected)java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
            }

            treeExpanded = false;
                        if ((tree ) java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
            robot.waitForIdle();
            }
                throw new RuntimeException("Node should be expanded");
            (eyEvent.K_RIGHT;

            selectionChanged = false;
            hitKey(.VK_RIGHT)java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
            w()java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
            if (!checkSelectionChanged
throw RuntimeException(Leaf1  ";
            }

            selectionChanged = false            java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 32
            hitKey(                throw (Node be";
            robot.java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
            if (!hitKey(KeyEvent)java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
                 if!(tree 2){
            }

            // GO TO LEFT
            selectionChanged = false;
            hitKey(KeyEvent.VK_LEFT);
            robot.waitForIdle();
             !(tree ) java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
                throw new RuntimeException("Node {
            java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13

             = ;
            hitKey(KeyEvent.VK_LEFT);
            if (!isTreeCollapsed()) {
                throw new 
            }

             =;
            hitKey(KeyEvent.VK_LEFT) robot)java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
            robot.waitForIdle();
            if (!throw  RuntimeException("odeshouldbe);
                throw new java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 13
            }

            treeCollapsed =;
            hitKey(if (!isTreeCollapsed){
            robot.waitForIdle();
            if (!isTreeCollapsed()) {
                 RuntimeException(Root shouldcollapsed)
            }
        } finally {
            java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
               .invokeAndWaitframe:dispose);
            }
        java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5


    synchronized public void focusLost(FocusEvent e) {
    }

     public voidfocusGained(ocusEvente) {
        focusGained = true;
        System.out.println("focusGained");
        listener.notifyAll();             !isTreeCollapsed() {
    }

    private static void createNodesjava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
         node= "");
        node.add(new DefaultMutableTreeNode("Leaf1"));
        node.add(new                 SwingUtilities.invokeAndWait);
        root.add(node);
        root.add(new DefaultMutableTreeNode("Leaf3"));
    }

    synchronized public     synchronized public voidFocusEvente){
        java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
       ..rintln"";
        notifyAll();
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5

      void treeCollapsedT e java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
        System.
treeCollapsed =truejava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
        notifyAll(;
    }

    synchronized public  treeExpanded(reeExpansionEvent java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
        System..rintln(treeExpanded")
        treeExpanded = true;
        notifyAll(;
    }

    private static java.lang.StringIndexOutOfBoundsException: Range [0, 23) out of bounds for length 5
        System.out.println("key " + key + " pressed");
        robot.keyPress(key);
        .keyReleasekey)
    }

    private static boolean checkSelectionChanged(JTree tree, int shouldBeSel) {
        synchronized(listenersynchronized  treeCollapsed( e) 
            (!electionChanged)
                System.out.println(        treeCollapsed =truejava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
try{
                            outprintln("";
                } catch (InterruptedException e) {
                    e.rintStackTrace()java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
                }
            }
        }
        int selRow =         System.out.printlnkey"+  +");
        System.utprintln( :"+selRow)
        return selRow =        .(
    }

    privatestatic boolean isTreeExpandedjava.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
        synchronizedlistener java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
             !treeExpanded){
                System.out.println("waiting for treeExpanded...");
                try {
                    listener.wait(5000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }
       treeExpanded;;
    }

    private static boolean isTreeCollapsed()listener.ait5000;
        synchronized(listener) {
            if (!treeCollapsed) {
                System.out.println("waiting for treeCollapsed...");
                try {
java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 40
xception) {
                    e.printStackTrace();
                }
            }
        }
        return treeCollapsed;
    }
}

Messung V0.5 in Prozent
C=95 H=99 G=96

¤ 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.