jjg@88: /* ohair@554: * Copyright (c) 2008, Oracle and/or its affiliates. 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 ohair@554: * published by the Free Software Foundation. Oracle designates this jjg@88: * particular file as subject to the "Classpath" exception as provided ohair@554: * by Oracle 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: * ohair@554: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ohair@554: * or visit www.oracle.com if you need additional information or have any ohair@554: * 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@349: || !lines[0].trim().startsWith("Classfile") jjg@349: || !lines[1].trim().startsWith("Last modified") jjg@349: || !lines[2].trim().startsWith("MD5")) { jjg@88: System.out.println(sw); jjg@88: throw new Exception("unexpected output"); jjg@88: } jjg@88: } jjg@88: }