jjg@88: /* jjg@88: * Copyright 2008 Sun Microsystems, Inc. All Rights Reserved. jjg@88: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. jjg@88: * jjg@88: * This code is free software; you can redistribute it and/or modify it jjg@88: * under the terms of the GNU General Public License version 2 only, as jjg@88: * published by the Free Software Foundation. Sun designates this jjg@88: * particular file as subject to the "Classpath" exception as provided jjg@88: * by Sun in the LICENSE file that accompanied this code. jjg@88: * jjg@88: * This code is distributed in the hope that it will be useful, but WITHOUT jjg@88: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or jjg@88: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License jjg@88: * version 2 for more details (a copy is included in the LICENSE file that jjg@88: * accompanied this code). jjg@88: * jjg@88: * You should have received a copy of the GNU General Public License version jjg@88: * 2 along with this work; if not, write to the Free Software Foundation, tbell@242: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. jjg@88: * jjg@88: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, jjg@88: * CA 95054 USA or visit www.sun.com if you need additional information or jjg@88: * have any questions. jjg@88: */ jjg@88: jjg@88: /* jjg@88: * @test jjg@88: * @bug 4884240 jjg@88: * @summary additional option required for javap jjg@88: */ jjg@88: jjg@88: import java.io.*; jjg@88: jjg@88: public class T4884240 { jjg@88: public static void main(String... args) throws Exception { jjg@88: new T4884240().run(); jjg@88: } jjg@88: jjg@88: public void run() throws Exception { jjg@88: StringWriter sw = new StringWriter(); jjg@88: PrintWriter pw = new PrintWriter(sw); jjg@88: String[] args = { "-sysinfo", "java.lang.Object" }; jjg@88: int rc = com.sun.tools.javap.Main.run(args, pw); jjg@88: if (rc != 0) jjg@88: throw new Exception("unexpected return code: " + rc); jjg@88: pw.close(); jjg@88: String[] lines = sw.toString().split("\n"); jjg@88: if (lines.length < 3 jjg@88: || !lines[0].startsWith("Classfile") jjg@88: || !lines[1].startsWith("Last modified") jjg@88: || !lines[2].startsWith("MD5")) { jjg@88: System.out.println(sw); jjg@88: throw new Exception("unexpected output"); jjg@88: } jjg@88: } jjg@88: }