langtools/test/tools/javac/tree/8067914/NukeExtraCast.java
author alanb
Thu, 17 Mar 2016 19:04:28 +0000
changeset 36526 3b41f1c69604
parent 30730 d3ce7619db2c
child 36778 e04318f39f92
permissions -rw-r--r--
8142968: Module System implementation Summary: Initial integration of JEP 200, JEP 260, JEP 261, and JEP 282 Reviewed-by: jjg, jlahoda, vromero, mcimadamore, bpatel, ksrini, darcy, anazarov, dfuchs Contributed-by: alan.bateman@oracle.com, alex.buckley@oracle.com, jonathan.gibbons@oracle.com, karen.kinnear@oracle.com, mandy.chung@oracle.com, mark.reinhold@oracle.com, jan.lahoda@oracle.com, vicente.romero@oracle.com, andreas.lundblad@oracle.com, andrey.x.nazarov@oracle.com, chris.hegarty@oracle.com, erik.joelsson@oracle.com, kumar.x.srinivasan@oracle.com, sundararajan.athijegannathan@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
28339
fa0685d84b74 8067914: Redundant type cast nodes in AST (follow up from JDK-8043741)
mcimadamore
parents:
diff changeset
     1
/*
30730
d3ce7619db2c 8076543: Add @modules as needed to the langtools tests
akulyakh
parents: 28339
diff changeset
     2
 * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
28339
fa0685d84b74 8067914: Redundant type cast nodes in AST (follow up from JDK-8043741)
mcimadamore
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
fa0685d84b74 8067914: Redundant type cast nodes in AST (follow up from JDK-8043741)
mcimadamore
parents:
diff changeset
     4
 *
fa0685d84b74 8067914: Redundant type cast nodes in AST (follow up from JDK-8043741)
mcimadamore
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
fa0685d84b74 8067914: Redundant type cast nodes in AST (follow up from JDK-8043741)
mcimadamore
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
fa0685d84b74 8067914: Redundant type cast nodes in AST (follow up from JDK-8043741)
mcimadamore
parents:
diff changeset
     7
 * published by the Free Software Foundation.
fa0685d84b74 8067914: Redundant type cast nodes in AST (follow up from JDK-8043741)
mcimadamore
parents:
diff changeset
     8
 *
fa0685d84b74 8067914: Redundant type cast nodes in AST (follow up from JDK-8043741)
mcimadamore
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
fa0685d84b74 8067914: Redundant type cast nodes in AST (follow up from JDK-8043741)
mcimadamore
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
fa0685d84b74 8067914: Redundant type cast nodes in AST (follow up from JDK-8043741)
mcimadamore
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
fa0685d84b74 8067914: Redundant type cast nodes in AST (follow up from JDK-8043741)
mcimadamore
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
fa0685d84b74 8067914: Redundant type cast nodes in AST (follow up from JDK-8043741)
mcimadamore
parents:
diff changeset
    13
 * accompanied this code).
fa0685d84b74 8067914: Redundant type cast nodes in AST (follow up from JDK-8043741)
mcimadamore
parents:
diff changeset
    14
 *
fa0685d84b74 8067914: Redundant type cast nodes in AST (follow up from JDK-8043741)
mcimadamore
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
fa0685d84b74 8067914: Redundant type cast nodes in AST (follow up from JDK-8043741)
mcimadamore
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
fa0685d84b74 8067914: Redundant type cast nodes in AST (follow up from JDK-8043741)
mcimadamore
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
fa0685d84b74 8067914: Redundant type cast nodes in AST (follow up from JDK-8043741)
mcimadamore
parents:
diff changeset
    18
 *
fa0685d84b74 8067914: Redundant type cast nodes in AST (follow up from JDK-8043741)
mcimadamore
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
fa0685d84b74 8067914: Redundant type cast nodes in AST (follow up from JDK-8043741)
mcimadamore
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
fa0685d84b74 8067914: Redundant type cast nodes in AST (follow up from JDK-8043741)
mcimadamore
parents:
diff changeset
    21
 * questions.
fa0685d84b74 8067914: Redundant type cast nodes in AST (follow up from JDK-8043741)
mcimadamore
parents:
diff changeset
    22
 */
fa0685d84b74 8067914: Redundant type cast nodes in AST (follow up from JDK-8043741)
mcimadamore
parents:
diff changeset
    23
fa0685d84b74 8067914: Redundant type cast nodes in AST (follow up from JDK-8043741)
mcimadamore
parents:
diff changeset
    24
/*
fa0685d84b74 8067914: Redundant type cast nodes in AST (follow up from JDK-8043741)
mcimadamore
parents:
diff changeset
    25
 * @test
fa0685d84b74 8067914: Redundant type cast nodes in AST (follow up from JDK-8043741)
mcimadamore
parents:
diff changeset
    26
 * @bug 8067914
fa0685d84b74 8067914: Redundant type cast nodes in AST (follow up from JDK-8043741)
mcimadamore
parents:
diff changeset
    27
 * @summary Redunant type cast nodes in AST (follow up from JDK-8043741)
fa0685d84b74 8067914: Redundant type cast nodes in AST (follow up from JDK-8043741)
mcimadamore
parents:
diff changeset
    28
 * @library /tools/lib
30730
d3ce7619db2c 8076543: Add @modules as needed to the langtools tests
akulyakh
parents: 28339
diff changeset
    29
 * @modules jdk.compiler/com.sun.tools.javac.api
d3ce7619db2c 8076543: Add @modules as needed to the langtools tests
akulyakh
parents: 28339
diff changeset
    30
 *          jdk.compiler/com.sun.tools.javac.file
d3ce7619db2c 8076543: Add @modules as needed to the langtools tests
akulyakh
parents: 28339
diff changeset
    31
 *          jdk.compiler/com.sun.tools.javac.main
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 30730
diff changeset
    32
 *          jdk.jdeps/com.sun.tools.javap
28339
fa0685d84b74 8067914: Redundant type cast nodes in AST (follow up from JDK-8043741)
mcimadamore
parents:
diff changeset
    33
 * @build ToolBox
fa0685d84b74 8067914: Redundant type cast nodes in AST (follow up from JDK-8043741)
mcimadamore
parents:
diff changeset
    34
 * @run compile -XD-printsource T8067914.java
fa0685d84b74 8067914: Redundant type cast nodes in AST (follow up from JDK-8043741)
mcimadamore
parents:
diff changeset
    35
 * @run main NukeExtraCast
fa0685d84b74 8067914: Redundant type cast nodes in AST (follow up from JDK-8043741)
mcimadamore
parents:
diff changeset
    36
 */
fa0685d84b74 8067914: Redundant type cast nodes in AST (follow up from JDK-8043741)
mcimadamore
parents:
diff changeset
    37
fa0685d84b74 8067914: Redundant type cast nodes in AST (follow up from JDK-8043741)
mcimadamore
parents:
diff changeset
    38
import java.nio.file.Path;
fa0685d84b74 8067914: Redundant type cast nodes in AST (follow up from JDK-8043741)
mcimadamore
parents:
diff changeset
    39
import java.nio.file.Paths;
fa0685d84b74 8067914: Redundant type cast nodes in AST (follow up from JDK-8043741)
mcimadamore
parents:
diff changeset
    40
import java.util.List;
fa0685d84b74 8067914: Redundant type cast nodes in AST (follow up from JDK-8043741)
mcimadamore
parents:
diff changeset
    41
fa0685d84b74 8067914: Redundant type cast nodes in AST (follow up from JDK-8043741)
mcimadamore
parents:
diff changeset
    42
public class NukeExtraCast {
fa0685d84b74 8067914: Redundant type cast nodes in AST (follow up from JDK-8043741)
mcimadamore
parents:
diff changeset
    43
fa0685d84b74 8067914: Redundant type cast nodes in AST (follow up from JDK-8043741)
mcimadamore
parents:
diff changeset
    44
    public static void main(String[] args) throws Exception {
fa0685d84b74 8067914: Redundant type cast nodes in AST (follow up from JDK-8043741)
mcimadamore
parents:
diff changeset
    45
        ToolBox tb = new ToolBox();
fa0685d84b74 8067914: Redundant type cast nodes in AST (follow up from JDK-8043741)
mcimadamore
parents:
diff changeset
    46
        Path path1 = Paths.get(ToolBox.testClasses, "E.java");
fa0685d84b74 8067914: Redundant type cast nodes in AST (follow up from JDK-8043741)
mcimadamore
parents:
diff changeset
    47
        List<String> file1 = tb.readAllLines(path1);
fa0685d84b74 8067914: Redundant type cast nodes in AST (follow up from JDK-8043741)
mcimadamore
parents:
diff changeset
    48
fa0685d84b74 8067914: Redundant type cast nodes in AST (follow up from JDK-8043741)
mcimadamore
parents:
diff changeset
    49
        Path path2 = Paths.get(ToolBox.testSrc, "E.out");
fa0685d84b74 8067914: Redundant type cast nodes in AST (follow up from JDK-8043741)
mcimadamore
parents:
diff changeset
    50
        List<String> file2 = tb.readAllLines(path2);
fa0685d84b74 8067914: Redundant type cast nodes in AST (follow up from JDK-8043741)
mcimadamore
parents:
diff changeset
    51
        tb.checkEqual(file1, file2);
fa0685d84b74 8067914: Redundant type cast nodes in AST (follow up from JDK-8043741)
mcimadamore
parents:
diff changeset
    52
    }
fa0685d84b74 8067914: Redundant type cast nodes in AST (follow up from JDK-8043741)
mcimadamore
parents:
diff changeset
    53
fa0685d84b74 8067914: Redundant type cast nodes in AST (follow up from JDK-8043741)
mcimadamore
parents:
diff changeset
    54
}