jjg@330: /* ohair@554: * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. jjg@330: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. jjg@330: * jjg@330: * This code is free software; you can redistribute it and/or modify it jjg@330: * under the terms of the GNU General Public License version 2 only, as jjg@330: * published by the Free Software Foundation. jjg@330: * jjg@330: * This code is distributed in the hope that it will be useful, but WITHOUT jjg@330: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or jjg@330: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License jjg@330: * version 2 for more details (a copy is included in the LICENSE file that jjg@330: * accompanied this code). jjg@330: * jjg@330: * You should have received a copy of the GNU General Public License version jjg@330: * 2 along with this work; if not, write to the Free Software Foundation, jjg@330: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. jjg@330: * 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@330: */ jjg@330: jjg@330: import java.io.*; jjg@330: jjg@330: /* jjg@330: * @test jjg@330: * @bug 6863746 jjg@330: * @summary javap should not scan ct.sym by default jjg@330: */ jjg@330: jjg@330: public class T6863746 { jjg@330: public static void main(String... args) throws Exception{ jjg@330: new T6863746().run(); jjg@330: } jjg@330: jjg@330: public void run() throws Exception { jjg@330: String[] args = { "-c", "java.lang.Object" }; jjg@330: StringWriter sw = new StringWriter(); jjg@330: PrintWriter pw = new PrintWriter(sw); jjg@330: int rc = com.sun.tools.javap.Main.run(args, pw); jjg@330: pw.close(); jjg@330: String out = sw.toString(); jjg@330: System.out.println(out); jjg@330: String[] lines = out.split("\n"); jjg@330: // If ct.sym is being read, the output does not include jjg@330: // Code attributes, so check for Code attributes as a jjg@330: // way of detecting that ct.sym is not being used. jjg@330: if (lines.length < 50 || out.indexOf("Code:") == -1) jjg@330: throw new Exception("unexpected output from javap"); jjg@330: } jjg@330: }