aoqi@0: /* aoqi@0: * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. aoqi@0: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. aoqi@0: * aoqi@0: * This code is free software; you can redistribute it and/or modify it aoqi@0: * under the terms of the GNU General Public License version 2 only, as aoqi@0: * published by the Free Software Foundation. aoqi@0: * aoqi@0: * This code is distributed in the hope that it will be useful, but WITHOUT aoqi@0: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or aoqi@0: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License aoqi@0: * version 2 for more details (a copy is included in the LICENSE file that aoqi@0: * accompanied this code). aoqi@0: * aoqi@0: * You should have received a copy of the GNU General Public License version aoqi@0: * 2 along with this work; if not, write to the Free Software Foundation, aoqi@0: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. aoqi@0: * aoqi@0: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA aoqi@0: * or visit www.oracle.com if you need additional information or have any aoqi@0: * questions. aoqi@0: */ aoqi@0: aoqi@0: import java.util.*; aoqi@0: aoqi@0: @interface ExpectInterfaces { aoqi@0: String value(); aoqi@0: } aoqi@0: aoqi@0: @interface ExpectSupertype { aoqi@0: String value(); aoqi@0: } aoqi@0: aoqi@0: interface OK { aoqi@0: void m(); aoqi@0: } aoqi@0: aoqi@0: class InvalidSource { aoqi@0: /* aoqi@0: * The following annotations contain a simple description of the expected aoqi@0: * representation of the superclass and superinterfaces of the corresponding aoqi@0: * elements. aoqi@0: * The strings contain a comma-separated list of descriptions. aoqi@0: * Descriptions are composed as follows: aoqi@0: * A leading "!:" indicates the type mirror has kind ERROR. aoqi@0: * "empty" means that the corresponding element has no enclosed elements. aoqi@0: * "clss", "intf" and "tvar" indicate the name refers to a class, interface aoqi@0: * or type variable. Each is followed by the declared name of the element. aoqi@0: * "pkg" indicates the name of a package element. aoqi@0: * An enclosing element is shown in parentheses. aoqi@0: * A trailing "!" indicates that the element's type has kind ERROR. aoqi@0: */ aoqi@0: aoqi@0: @ExpectSupertype("!:empty clss A!") aoqi@0: class TestClassMissingClassA extends A { } aoqi@0: aoqi@0: @ExpectSupertype("!:empty clss (pkg A).B!") aoqi@0: class TestClassMissingClassAB extends A.B { } aoqi@0: aoqi@0: @ExpectSupertype("!:empty clss (pkg java.util).A!") aoqi@0: class TestClassMissingClass_juA extends java.util.A { } aoqi@0: aoqi@0: @ExpectSupertype("!:empty clss A!") aoqi@0: class TestClassTMissingClassAT extends A { } aoqi@0: aoqi@0: @ExpectInterfaces("!:empty intf A!") aoqi@0: class TestClassMissingIntfA implements A { } aoqi@0: aoqi@0: @ExpectInterfaces("!:empty intf (pkg A).B!") aoqi@0: class TestClassMissingIntfAB implements A.B { } aoqi@0: aoqi@0: @ExpectInterfaces("!:empty intf A!, intf OK") aoqi@0: abstract class TestClassMissingIntfAOK implements A, OK { } aoqi@0: aoqi@0: @ExpectInterfaces("intf OK, !:empty intf A!") aoqi@0: abstract class TestClassOKMissingIntfA implements OK, A { } aoqi@0: aoqi@0: @ExpectInterfaces("!:empty intf A!, !:empty intf B!") aoqi@0: class TestClassMissingIntfA_B implements A, B { } aoqi@0: aoqi@0: @ExpectInterfaces("!:empty intf A!") aoqi@0: interface TestIntfMissingIntfA extends A { } aoqi@0: aoqi@0: @ExpectInterfaces("!:empty intf A!, intf OK") aoqi@0: interface TestIntfMissingIntfAOK extends A, OK { } aoqi@0: aoqi@0: @ExpectInterfaces("intf OK, !:empty intf A!") aoqi@0: interface TestIntfOKMissingIntfA extends OK, A { } aoqi@0: aoqi@0: @ExpectInterfaces("!:empty intf A!, !:empty intf B!") aoqi@0: interface TestIntfMissingIntfAB extends A, B { } aoqi@0: aoqi@0: @ExpectInterfaces("!:empty intf A!") aoqi@0: class TestClassTMissingIntfAT implements A { } aoqi@0: aoqi@0: @ExpectInterfaces("!:empty intf A!, !:empty intf B!") aoqi@0: class TestClassTMissingIntfAT_B implements A, B { } aoqi@0: aoqi@0: @ExpectInterfaces("!:empty intf A!") aoqi@0: interface TestIntfTMissingIntfAT extends A { } aoqi@0: aoqi@0: @ExpectInterfaces("!:empty intf A!, !:empty intf B!") aoqi@0: interface TestIntfTMissingIntfAT_B extends A, B { } aoqi@0: aoqi@0: @ExpectInterfaces("intf (pkg java.util).List") aoqi@0: abstract class TestClassListMissingX implements List { } aoqi@0: } aoqi@0: