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