Path: blob/master/test/langtools/tools/javac/6199662/Tree.java
41149 views
/*1* Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/2223/*24* @test25* @bug 6199662 6325201 672601526* @summary javac: compilation success depends on compilation order27*28* @compile Tree.java TreeScanner.java TreeInfo.java29* @compile TreeInfo.java TreeScanner.java Tree.java30*31* @compile -XDcompilePolicy=bytodo Tree.java TreeScanner.java TreeInfo.java32* @compile -XDcompilePolicy=bytodo TreeInfo.java TreeScanner.java Tree.java33*34* @compile -XDcompilePolicy=byfile Tree.java TreeScanner.java TreeInfo.java35* @compile -XDcompilePolicy=byfile TreeInfo.java TreeScanner.java Tree.java36*37* @compile -XDcompilePolicy=simple Tree.java TreeScanner.java TreeInfo.java38* @compile -XDcompilePolicy=simple TreeInfo.java TreeScanner.java Tree.java39*40* @compile -XDshould-stop.ifError=FLOW -XDshould-stop.ifNoError=FLOW Tree.java TreeScanner.java TreeInfo.java41* @compile -XDshould-stop.ifError=FLOW -XDshould-stop.ifNoError=FLOW TreeInfo.java TreeScanner.java Tree.java42*43* @compile -XDshould-stop.ifError=ATTR -XDshould-stop.ifNoError=ATTR Tree.java TreeScanner.java TreeInfo.java44* @compile -XDshould-stop.ifError=ATTR -XDshould-stop.ifNoError=ATTR TreeInfo.java TreeScanner.java Tree.java45*/4647package p;4849public abstract class Tree {5051/** Visit this tree with a given visitor.52*/53public abstract <E extends Throwable> void accept(Visitor<E> v) throws E;545556/** A generic visitor class for trees.57*/58public static abstract class Visitor<E extends Throwable> {59public void visitTree(Tree that) throws E { assert false; }60}61}626364