Thu, 25 Aug 2011 17:18:25 -0700
Added tag jdk8-b02 for changeset b3c059de2a61
jjg@406 | 1 | /* |
jjg@406 | 2 | * Copyright 2009 Google, Inc. All Rights Reserved. |
jjg@406 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
jjg@406 | 4 | * |
jjg@406 | 5 | * This code is free software; you can redistribute it and/or modify it |
jjg@406 | 6 | * under the terms of the GNU General Public License version 2 only, as |
jjg@406 | 7 | * published by the Free Software Foundation. |
jjg@406 | 8 | * |
jjg@406 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
jjg@406 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
jjg@406 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
jjg@406 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
jjg@406 | 13 | * accompanied this code). |
jjg@406 | 14 | * |
jjg@406 | 15 | * You should have received a copy of the GNU General Public License version |
jjg@406 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
jjg@406 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
jjg@406 | 18 | * |
ohair@554 | 19 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
ohair@554 | 20 | * or visit www.oracle.com if you need additional information or have any |
ohair@554 | 21 | * questions. |
jjg@406 | 22 | */ |
jjg@406 | 23 | |
jjg@406 | 24 | /* |
jjg@406 | 25 | * @test |
jjg@406 | 26 | * @bug 6709246 |
jjg@406 | 27 | * @summary Class-cast exception when annotation type is missing. |
jjg@406 | 28 | * @library ../../lib |
jjg@406 | 29 | */ |
jjg@406 | 30 | |
jjg@406 | 31 | import java.io.IOException; |
jjg@406 | 32 | import com.sun.javadoc.RootDoc; |
jjg@406 | 33 | import com.sun.javadoc.ClassDoc; |
jjg@406 | 34 | import com.sun.javadoc.AnnotationDesc; |
jjg@406 | 35 | |
jjg@406 | 36 | public class Main extends Tester.Doclet { |
jjg@406 | 37 | |
jjg@406 | 38 | private static final Tester tester = new Tester("Main", "somepackage"); |
jjg@406 | 39 | |
jjg@406 | 40 | public static void main(String... args) throws Exception { |
jjg@406 | 41 | tester.run(); |
jjg@406 | 42 | } |
jjg@406 | 43 | |
jjg@406 | 44 | public static boolean start(RootDoc root) { |
jjg@406 | 45 | for (ClassDoc d : root.classes()) { |
jjg@406 | 46 | for (AnnotationDesc a : d.annotations()) { |
jjg@406 | 47 | System.out.println(a.annotationType()); |
jjg@406 | 48 | } |
jjg@406 | 49 | } |
jjg@406 | 50 | return true; |
jjg@406 | 51 | } |
jjg@406 | 52 | } |