T6587786.java revision 2933:49d207bf704d
1223328Sgavin/* 2223328Sgavin * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. 379971Sobrien * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 479971Sobrien * 579971Sobrien * This code is free software; you can redistribute it and/or modify it 679971Sobrien * under the terms of the GNU General Public License version 2 only, as 779971Sobrien * published by the Free Software Foundation. 879971Sobrien * 979971Sobrien * This code is distributed in the hope that it will be useful, but WITHOUT 1079971Sobrien * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1179971Sobrien * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1279971Sobrien * version 2 for more details (a copy is included in the LICENSE file that 1379971Sobrien * accompanied this code). 1479971Sobrien * 1579971Sobrien * You should have received a copy of the GNU General Public License version 16121966Smikeh * 2 along with this work; if not, write to the Free Software Foundation, 1779971Sobrien * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1879971Sobrien * 1979971Sobrien * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2079971Sobrien * or visit www.oracle.com if you need additional information or have any 2179971Sobrien * questions. 2279971Sobrien */ 2379971Sobrien 2479971Sobrien/* 2579971Sobrien * @test 2679971Sobrien * @bug 6587786 2779971Sobrien * @summary Javap throws error : "ERROR:Could not find <classname>" for JRE classes 2879971Sobrien * @modules jdk.compiler 2979971Sobrien */ 3079971Sobrien 3179971Sobrienimport java.io.*; 3279971Sobrien 33223328Sgavinpublic class T6587786 { 34223328Sgavin public static void main(String[] args) throws Exception { 35223328Sgavin new T6587786().run(); 36223328Sgavin } 37116424Smikeh 38116424Smikeh public void run() throws IOException { 39116424Smikeh javap("com.sun.javadoc.Doc", "com.sun.crypto.provider.ai"); 40116424Smikeh javap("com.sun.crypto.provider.ai", "com.sun.javadoc.ClassDoc"); 41116424Smikeh } 42223328Sgavin 43116424Smikeh void javap(String... args) { 44116424Smikeh StringWriter sw = new StringWriter(); 4579971Sobrien PrintWriter out = new PrintWriter(sw); 46116424Smikeh //sun.tools.javap.Main.entry(args); 47116424Smikeh int rc = com.sun.tools.javap.Main.run(args, out); 48116424Smikeh if (rc != 0) 49116424Smikeh throw new Error("javap failed. rc=" + rc); 50116424Smikeh out.close(); 51116424Smikeh System.out.println(sw.toString()); 52116424Smikeh } 53116424Smikeh} 54116424Smikeh