equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
50 |
50 |
51 import javax.tools.*; |
51 import javax.tools.*; |
52 |
52 |
53 import com.sun.source.tree.CaseTree.CaseKind; |
53 import com.sun.source.tree.CaseTree.CaseKind; |
54 import com.sun.source.tree.Tree; |
54 import com.sun.source.tree.Tree; |
|
55 import com.sun.source.util.JavacTask; |
55 import com.sun.source.util.TreeScanner; |
56 import com.sun.source.util.TreeScanner; |
56 import com.sun.tools.javac.tree.JCTree; |
57 import com.sun.tools.javac.tree.JCTree; |
57 import com.sun.tools.javac.tree.JCTree.JCCase; |
58 import com.sun.tools.javac.tree.JCTree.JCCase; |
58 import com.sun.tools.javac.tree.JCTree.JCCompilationUnit; |
59 import com.sun.tools.javac.tree.JCTree.JCCompilationUnit; |
59 import com.sun.tools.javac.tree.JCTree.JCModuleDecl; |
60 import com.sun.tools.javac.tree.JCTree.JCModuleDecl; |
60 import com.sun.tools.javac.tree.JCTree.TypeBoundKind; |
61 import com.sun.tools.javac.tree.JCTree.TypeBoundKind; |
61 import com.sun.tools.javac.util.List; |
62 import com.sun.tools.javac.util.List; |
|
63 import com.sun.tools.javac.util.Pair; |
62 |
64 |
63 public class SourceTreeScannerTest extends AbstractTreeScannerTest { |
65 public class SourceTreeScannerTest extends AbstractTreeScannerTest { |
64 /** |
66 /** |
65 * Main entry point. |
67 * Main entry point. |
66 * If test.src is set, program runs in jtreg mode, and will throw an Error |
68 * If test.src is set, program runs in jtreg mode, and will throw an Error |
79 else |
81 else |
80 System.exit(1); |
82 System.exit(1); |
81 } |
83 } |
82 } |
84 } |
83 |
85 |
84 int test(JCCompilationUnit tree) { |
86 int test(Pair<JavacTask, JCCompilationUnit> taskAndTree) { |
85 return new ScanTester().test(tree); |
87 return new ScanTester().test(taskAndTree.snd); |
86 } |
88 } |
87 |
89 |
88 /** |
90 /** |
89 * Main class for testing operation of tree scanner. |
91 * Main class for testing operation of tree scanner. |
90 * The set of nodes found by the scanner are compared |
92 * The set of nodes found by the scanner are compared |