langtools/test/tools/javap/T6715767.java
author serb
Thu, 14 Jan 2016 23:14:01 +0300
changeset 35687 78e8e8fea09b
parent 30846 2b3f379840f0
child 36526 3b41f1c69604
permissions -rw-r--r--
8147407: Provide support of WaveExtensible sound format Reviewed-by: prr, amenkov
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
733
b76c4357c649 6715767: javap on java.lang.ClassLoader crashes
jjg
parents:
diff changeset
     1
/*
30730
d3ce7619db2c 8076543: Add @modules as needed to the langtools tests
akulyakh
parents: 5520
diff changeset
     2
 * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
733
b76c4357c649 6715767: javap on java.lang.ClassLoader crashes
jjg
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
b76c4357c649 6715767: javap on java.lang.ClassLoader crashes
jjg
parents:
diff changeset
     4
 *
b76c4357c649 6715767: javap on java.lang.ClassLoader crashes
jjg
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
b76c4357c649 6715767: javap on java.lang.ClassLoader crashes
jjg
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
b76c4357c649 6715767: javap on java.lang.ClassLoader crashes
jjg
parents:
diff changeset
     7
 * published by the Free Software Foundation.
b76c4357c649 6715767: javap on java.lang.ClassLoader crashes
jjg
parents:
diff changeset
     8
 *
b76c4357c649 6715767: javap on java.lang.ClassLoader crashes
jjg
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
b76c4357c649 6715767: javap on java.lang.ClassLoader crashes
jjg
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
b76c4357c649 6715767: javap on java.lang.ClassLoader crashes
jjg
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
b76c4357c649 6715767: javap on java.lang.ClassLoader crashes
jjg
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
b76c4357c649 6715767: javap on java.lang.ClassLoader crashes
jjg
parents:
diff changeset
    13
 * accompanied this code).
b76c4357c649 6715767: javap on java.lang.ClassLoader crashes
jjg
parents:
diff changeset
    14
 *
b76c4357c649 6715767: javap on java.lang.ClassLoader crashes
jjg
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
b76c4357c649 6715767: javap on java.lang.ClassLoader crashes
jjg
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
b76c4357c649 6715767: javap on java.lang.ClassLoader crashes
jjg
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
b76c4357c649 6715767: javap on java.lang.ClassLoader crashes
jjg
parents:
diff changeset
    18
 *
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 733
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 733
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 733
diff changeset
    21
 * questions.
733
b76c4357c649 6715767: javap on java.lang.ClassLoader crashes
jjg
parents:
diff changeset
    22
 */
b76c4357c649 6715767: javap on java.lang.ClassLoader crashes
jjg
parents:
diff changeset
    23
b76c4357c649 6715767: javap on java.lang.ClassLoader crashes
jjg
parents:
diff changeset
    24
/*
b76c4357c649 6715767: javap on java.lang.ClassLoader crashes
jjg
parents:
diff changeset
    25
 * @test
b76c4357c649 6715767: javap on java.lang.ClassLoader crashes
jjg
parents:
diff changeset
    26
 * @bug 6715767
b76c4357c649 6715767: javap on java.lang.ClassLoader crashes
jjg
parents:
diff changeset
    27
 * @summary javap on java.lang.ClassLoader crashes
30846
2b3f379840f0 8074432: Move jdeps and javap to jdk.jdeps module
mchung
parents: 30730
diff changeset
    28
 * @modules jdk.jdeps
733
b76c4357c649 6715767: javap on java.lang.ClassLoader crashes
jjg
parents:
diff changeset
    29
 */
b76c4357c649 6715767: javap on java.lang.ClassLoader crashes
jjg
parents:
diff changeset
    30
b76c4357c649 6715767: javap on java.lang.ClassLoader crashes
jjg
parents:
diff changeset
    31
import java.io.*;
b76c4357c649 6715767: javap on java.lang.ClassLoader crashes
jjg
parents:
diff changeset
    32
b76c4357c649 6715767: javap on java.lang.ClassLoader crashes
jjg
parents:
diff changeset
    33
public class T6715767 {
b76c4357c649 6715767: javap on java.lang.ClassLoader crashes
jjg
parents:
diff changeset
    34
    public static void main(String... args) throws Exception {
b76c4357c649 6715767: javap on java.lang.ClassLoader crashes
jjg
parents:
diff changeset
    35
        new T6715767().run();
b76c4357c649 6715767: javap on java.lang.ClassLoader crashes
jjg
parents:
diff changeset
    36
    }
b76c4357c649 6715767: javap on java.lang.ClassLoader crashes
jjg
parents:
diff changeset
    37
b76c4357c649 6715767: javap on java.lang.ClassLoader crashes
jjg
parents:
diff changeset
    38
    void run() throws Exception {
b76c4357c649 6715767: javap on java.lang.ClassLoader crashes
jjg
parents:
diff changeset
    39
        StringWriter sw = new StringWriter();
b76c4357c649 6715767: javap on java.lang.ClassLoader crashes
jjg
parents:
diff changeset
    40
        PrintWriter pw = new PrintWriter(sw);
b76c4357c649 6715767: javap on java.lang.ClassLoader crashes
jjg
parents:
diff changeset
    41
        String[] args = { "java.lang.ClassLoader" };
b76c4357c649 6715767: javap on java.lang.ClassLoader crashes
jjg
parents:
diff changeset
    42
        int rc = com.sun.tools.javap.Main.run(args, pw);
b76c4357c649 6715767: javap on java.lang.ClassLoader crashes
jjg
parents:
diff changeset
    43
        if (rc != 0 ||
b76c4357c649 6715767: javap on java.lang.ClassLoader crashes
jjg
parents:
diff changeset
    44
            sw.toString().indexOf("at com.sun.tools.javap.JavapTask.run") != -1) {
b76c4357c649 6715767: javap on java.lang.ClassLoader crashes
jjg
parents:
diff changeset
    45
            System.err.println("rc: " + rc);
b76c4357c649 6715767: javap on java.lang.ClassLoader crashes
jjg
parents:
diff changeset
    46
            System.err.println("log:\n" + sw);
b76c4357c649 6715767: javap on java.lang.ClassLoader crashes
jjg
parents:
diff changeset
    47
            throw new Exception("unexpected result");
b76c4357c649 6715767: javap on java.lang.ClassLoader crashes
jjg
parents:
diff changeset
    48
        }
b76c4357c649 6715767: javap on java.lang.ClassLoader crashes
jjg
parents:
diff changeset
    49
    }
b76c4357c649 6715767: javap on java.lang.ClassLoader crashes
jjg
parents:
diff changeset
    50
}
b76c4357c649 6715767: javap on java.lang.ClassLoader crashes
jjg
parents:
diff changeset
    51