Wed, 21 Sep 2011 21:56:53 -0700
7092965: javac should not close processorClassLoader before end of compilation
Reviewed-by: darcy
jjg@88 | 1 | /* |
ohair@554 | 2 | * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. |
jjg@88 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
jjg@88 | 4 | * |
jjg@88 | 5 | * This code is free software; you can redistribute it and/or modify it |
jjg@88 | 6 | * under the terms of the GNU General Public License version 2 only, as |
ohair@554 | 7 | * published by the Free Software Foundation. Oracle designates this |
jjg@88 | 8 | * particular file as subject to the "Classpath" exception as provided |
ohair@554 | 9 | * by Oracle in the LICENSE file that accompanied this code. |
jjg@88 | 10 | * |
jjg@88 | 11 | * This code is distributed in the hope that it will be useful, but WITHOUT |
jjg@88 | 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
jjg@88 | 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
jjg@88 | 14 | * version 2 for more details (a copy is included in the LICENSE file that |
jjg@88 | 15 | * accompanied this code). |
jjg@88 | 16 | * |
jjg@88 | 17 | * You should have received a copy of the GNU General Public License version |
jjg@88 | 18 | * 2 along with this work; if not, write to the Free Software Foundation, |
tbell@242 | 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
jjg@88 | 20 | * |
ohair@554 | 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
ohair@554 | 22 | * or visit www.oracle.com if you need additional information or have any |
ohair@554 | 23 | * questions. |
jjg@88 | 24 | */ |
jjg@88 | 25 | |
jjg@88 | 26 | /* |
jjg@88 | 27 | * @test |
jjg@88 | 28 | * @bug 4884240 |
jjg@88 | 29 | * @summary additional option required for javap |
jjg@88 | 30 | */ |
jjg@88 | 31 | |
jjg@88 | 32 | import java.io.*; |
jjg@88 | 33 | |
jjg@88 | 34 | public class T4884240 { |
jjg@88 | 35 | public static void main(String... args) throws Exception { |
jjg@88 | 36 | new T4884240().run(); |
jjg@88 | 37 | } |
jjg@88 | 38 | |
jjg@88 | 39 | public void run() throws Exception { |
jjg@88 | 40 | StringWriter sw = new StringWriter(); |
jjg@88 | 41 | PrintWriter pw = new PrintWriter(sw); |
jjg@88 | 42 | String[] args = { "-sysinfo", "java.lang.Object" }; |
jjg@88 | 43 | int rc = com.sun.tools.javap.Main.run(args, pw); |
jjg@88 | 44 | if (rc != 0) |
jjg@88 | 45 | throw new Exception("unexpected return code: " + rc); |
jjg@88 | 46 | pw.close(); |
jjg@88 | 47 | String[] lines = sw.toString().split("\n"); |
jjg@88 | 48 | if (lines.length < 3 |
jjg@349 | 49 | || !lines[0].trim().startsWith("Classfile") |
jjg@349 | 50 | || !lines[1].trim().startsWith("Last modified") |
jjg@349 | 51 | || !lines[2].trim().startsWith("MD5")) { |
jjg@88 | 52 | System.out.println(sw); |
jjg@88 | 53 | throw new Exception("unexpected output"); |
jjg@88 | 54 | } |
jjg@88 | 55 | } |
jjg@88 | 56 | } |