T6888367.java revision 553
553N/A * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. 426N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 426N/A * This code is free software; you can redistribute it and/or modify it 426N/A * under the terms of the GNU General Public License version 2 only, as 426N/A * published by the Free Software Foundation. 426N/A * This code is distributed in the hope that it will be useful, but WITHOUT 426N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 426N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 426N/A * version 2 for more details (a copy is included in the LICENSE file that 426N/A * accompanied this code). 426N/A * You should have received a copy of the GNU General Public License version 426N/A * 2 along with this work; if not, write to the Free Software Foundation, 426N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 553N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 553N/A * or visit www.oracle.com if you need additional information or have any 426N/A * @summary classfile library parses signature attributes incorrectly 426N/A * This test is a pretty detailed test both of javac signature generation and classfile 426N/A * signature parsing. The first part of the test tests all the examples given in the 426N/A * second part of the test. Each example comes with one or two annotations, @Desc, @Sig, 426N/A * for the descriptor and signature of the annotated declaration. Annotations are 426N/A * provided whenever the annotated item is expected to have a corresponding value. 426N/A * Each annotation has two argument values. The first arg is the expected value of the 426N/A * purposes in reading the test. The second value is the rendering of the descriptor or 426N/A * signature using a custom Type visitor that explicitly includes an indication of the 426N/A if (d ==
null && s ==
null)
// not a test field or method if no @Desc or @Sig given 426N/A error(
"@Sig annotation found but not Signature attribute");
426N/A error(
"Signature attribute found but no @Sig annotation");
426N/A @
Sig(s=
"LGenClss<LClss;>;", t=
"C{GenClss<C{Clss}>}")
426N/A // methods, return types 426N/A @
Desc(d=
"()LGenClss;", t=
"M{C{GenClss}()}")
426N/A @
Sig(s=
"()LGenClss<LClss;>;", t=
"M{C{GenClss<C{Clss}>}()}")
426N/A @
Desc(d=
"()LGenClss;", t=
"M{C{GenClss}()}")
426N/A @
Sig(s=
"()LGenClss<*>;", t=
"M{C{GenClss<W{?}>}()}")
426N/A @
Desc(d=
"()LGenClss;", t=
"M{C{GenClss}()}")
426N/A @
Sig(s=
"()LGenClss<+LClss;>;", t=
"M{C{GenClss<W{e,C{Clss}}>}()}")
426N/A @
Desc(d=
"()LGenClss;", t=
"M{C{GenClss}()}")
426N/A @
Sig(s=
"()LGenClss<-LClss;>;", t=
"M{C{GenClss<W{s,C{Clss}}>}()}")
426N/A @
Desc(d=
"()LGenClss;", t=
"M{C{GenClss}()}")
426N/A @
Desc(d=
"()LGenClss;", t=
"M{C{GenClss}()}")
426N/A @
Desc(d=
"(LClss;)V", t=
"M{S{void}(C{Clss})}")
426N/A @
Desc(d=
"([I)V", t=
"M{S{void}(A{S{int}})}")
426N/A @
Desc(d=
"([LClss;)V", t=
"M{S{void}(A{C{Clss}})}")
426N/A @
Desc(d=
"(LGenClss;)V", t=
"M{S{void}(C{GenClss})}")
426N/A @
Sig(s=
"(LGenClss<LClss;>;)V", t=
"M{S{void}(C{GenClss<C{Clss}>})}")
426N/A @
Desc(d=
"(LGenClss;)V", t=
"M{S{void}(C{GenClss})}")
426N/A @
Sig(s=
"(LGenClss<*>;)V", t=
"M{S{void}(C{GenClss<W{?}>})}")
426N/A @
Desc(d=
"(LGenClss;)V", t=
"M{S{void}(C{GenClss})}")
426N/A @
Sig(s=
"(LGenClss<+LClss;>;)V", t=
"M{S{void}(C{GenClss<W{e,C{Clss}}>})}")
426N/A @
Desc(d=
"(LGenClss;)V", t=
"M{S{void}(C{GenClss})}")
426N/A @
Sig(s=
"(LGenClss<-LClss;>;)V", t=
"M{S{void}(C{GenClss<W{s,C{Clss}}>})}")
426N/A @
Desc(d=
"(LGenClss;)V", t=
"M{S{void}(C{GenClss})}")
426N/A @
Desc(d=
"(LGenClss;)V", t=
"M{S{void}(C{GenClss})}")
426N/A @
Sig(s=
"LTest$Y<TTY;>.Q<TTY;>;", t=
"C{C{Test$Y<S{TY}>}.Q<S{TY}>}")
426N/A t=
"C{C{C{Test$Y<S{TY}>}.S}.S2<S{TY}>}")