jjg@528: /* jjg@528: * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. jjg@528: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. jjg@528: * jjg@528: * This code is free software; you can redistribute it and/or modify it jjg@528: * under the terms of the GNU General Public License version 2 only, as jjg@528: * published by the Free Software Foundation. jjg@528: * jjg@528: * This code is distributed in the hope that it will be useful, but WITHOUT jjg@528: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or jjg@528: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License jjg@528: * version 2 for more details (a copy is included in the LICENSE file that jjg@528: * accompanied this code). jjg@528: * jjg@528: * You should have received a copy of the GNU General Public License version jjg@528: * 2 along with this work; if not, write to the Free Software Foundation, jjg@528: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. jjg@528: * jjg@528: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, jjg@528: * CA 95054 USA or visit www.sun.com if you need additional information or jjg@528: * have any questions. jjg@528: */ jjg@528: jjg@528: /* jjg@528: * @test jjg@528: * @bug 6937244 jjg@528: * @summary fields display with JVMS names, not Java names jjg@528: */ jjg@528: jjg@528: import java.io.*; jjg@528: jjg@528: public class T6937244 { jjg@528: public static void main(String[] args) throws Exception { jjg@528: new T6937244().run(); jjg@528: } jjg@528: jjg@528: void run() throws Exception { jjg@528: StringWriter sw = new StringWriter(); jjg@528: PrintWriter pw = new PrintWriter(sw); jjg@528: String[] args = { "java.lang.String" }; jjg@528: int rc = com.sun.tools.javap.Main.run(args, pw); jjg@528: pw.close(); jjg@528: String out = sw.toString(); jjg@528: System.err.println(out); jjg@528: if (rc != 0) jjg@528: throw new Exception("unexpected exit from javap: " + rc); jjg@528: for (String line: out.split("[\r\n]+")) { jjg@528: if (line.contains("CASE_INSENSITIVE_ORDER")) { jjg@528: if (line.matches("\\s*\\Qpublic static final java.util.Comparator CASE_INSENSITIVE_ORDER;\\E\\s*")) jjg@528: return; jjg@528: throw new Exception("declaration not shown as expected"); jjg@528: } jjg@528: } jjg@528: throw new Exception("declaration of CASE_INSENSITIVE_ORDER not found"); jjg@528: } jjg@528: } jjg@528: