/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 4853450 5014539 5034991
* @summary Tests AnnotationValue methods.
* @library ../../lib
* @compile -source 1.5 AnnoVal.java
*/
}
"i Integer 2",
"l Long 4294967296",
"d Double 3.14",
"b Boolean true",
"c Character @",
"s String sigh",
// The following results reflect some implementation details.
"k ClassTypeImpl java.lang.Boolean",
"kb PrimitiveTypeImpl boolean",
"ka ArrayTypeImpl java.lang.Boolean[]",
"kab ArrayTypeImpl int[][]",
"w ClassTypeImpl java.lang.Long",
"e EnumConstantDeclarationImpl TYPE",
"sa ArrayList [\"up\", \"down\"]",
"a AnnotationMirrorImpl @AT1"})
l = 1024 * 1024 * 1024 * 4L,
d = 3.14,
b = true,
c = '@',
s = "sigh",
k = Boolean.class,
kb = boolean.class,
kab = int[][].class, // "
w = Long.class,
a = @AT1)
e.getKey().getSimpleName(),
val));
}
return res;
}
"int i 2",
"long l 4294967296L",
"double d 3.14",
"boolean b true",
"char c '@'",
"java.lang.String s \"sigh\"",
"java.lang.Class k java.lang.Boolean.class",
"java.lang.Class kb boolean.class",
"java.lang.Class ka java.lang.Boolean[].class",
"java.lang.Class kab int[][].class",
"java.lang.Class<? extends java.lang.Number> w java.lang.Long.class",
"java.lang.annotation.ElementType e java.lang.annotation.ElementType.TYPE",
"java.lang.String[] sa {\"up\", \"down\"}",
"AT1 a @AT1"})
e.getKey().getReturnType(),
e.getKey().getSimpleName(),
}
return res;
}
"byte b 0x0b",
"float f 3.0f",
"double nan 0.0/0.0",
"double hi 1.0/0.0",
"float lo -1.0f/0.0f",
"char newline '\\n'",
"char ff '\\u00ff'",
"java.lang.String s \"\\\"high\\tlow\\\"\"",
"java.lang.String smiley \"\\u263a\""})
@AT3(b = 11,
f = 3,
newline = '\n',
ff = '\u00FF',
s = "\"high\tlow\"",
smiley = "\u263A")
e.getKey().getReturnType(),
e.getKey().getSimpleName(),
}
return res;
}
/**
* Returns the simple name of an object's class.
*/
return (o == null)
? "null"
}
}
/*
* Annotations used for testing.
*/
@interface AT1 {
}
@interface AT2 {
int i();
long l();
double d();
boolean b();
char c();
String s();
Class k();
AT1 a();
}
@interface AT3 {
byte b();
float f();
double nan();
double hi();
float lo();
char newline();
char ff();
String s();
}