test/tools/javap/T6715767.java

Tue, 25 May 2010 15:54:51 -0700

author
ohair
date
Tue, 25 May 2010 15:54:51 -0700
changeset 554
9d9f26857129
parent 52
3cb4fb6e0720
child 2525
2eb010b6cb22
permissions
-rw-r--r--

6943119: Rebrand source copyright notices
Reviewed-by: darcy

jjg@52 1 /*
ohair@554 2 * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
jjg@52 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
jjg@52 4 *
jjg@52 5 * This code is free software; you can redistribute it and/or modify it
jjg@52 6 * under the terms of the GNU General Public License version 2 only, as
jjg@52 7 * published by the Free Software Foundation.
jjg@52 8 *
jjg@52 9 * This code is distributed in the hope that it will be useful, but WITHOUT
jjg@52 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
jjg@52 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
jjg@52 12 * version 2 for more details (a copy is included in the LICENSE file that
jjg@52 13 * accompanied this code).
jjg@52 14 *
jjg@52 15 * You should have received a copy of the GNU General Public License version
jjg@52 16 * 2 along with this work; if not, write to the Free Software Foundation,
jjg@52 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
jjg@52 18 *
ohair@554 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@554 20 * or visit www.oracle.com if you need additional information or have any
ohair@554 21 * questions.
jjg@52 22 */
jjg@52 23
jjg@52 24 /*
jjg@52 25 * @test
jjg@52 26 * @bug 6715767
jjg@52 27 * @summary javap on java.lang.ClassLoader crashes
jjg@52 28 */
jjg@52 29
jjg@52 30 import java.io.*;
jjg@52 31
jjg@52 32 public class T6715767 {
jjg@52 33 public static void main(String... args) throws Exception {
jjg@52 34 new T6715767().run();
jjg@52 35 }
jjg@52 36
jjg@52 37 void run() throws Exception {
jjg@52 38 StringWriter sw = new StringWriter();
jjg@52 39 PrintWriter pw = new PrintWriter(sw);
jjg@52 40 String[] args = { "java.lang.ClassLoader" };
jjg@52 41 int rc = com.sun.tools.javap.Main.run(args, pw);
jjg@52 42 if (rc != 0 ||
jjg@52 43 sw.toString().indexOf("at com.sun.tools.javap.JavapTask.run") != -1) {
jjg@52 44 System.err.println("rc: " + rc);
jjg@52 45 System.err.println("log:\n" + sw);
jjg@52 46 throw new Exception("unexpected result");
jjg@52 47 }
jjg@52 48 }
jjg@52 49 }
jjg@52 50

mercurial