--- a/netbeans/meth/test/jdk/java/dyn/MethodHandleBytecodeTest.java Wed Jun 10 04:17:20 2009 -0700
+++ b/netbeans/meth/test/jdk/java/dyn/MethodHandleBytecodeTest.java Fri Jun 12 23:59:55 2009 -0700
@@ -56,7 +56,7 @@ public class MethodHandleBytecodeTest {
* Test of invoke pseudo-method, of class MethodHandle.
*/
@Test
- public void testToString() {
+ public void testToString() throws Throwable {
System.out.println("invoke toString");
MethodHandle instance = METHODS.findVirtual(
Object.class, "toString", MethodType.make(String.class) );
@@ -67,7 +67,7 @@ public class MethodHandleBytecodeTest {
assertEquals(expResult, result);
}
- private String invokeToString(MethodHandle mh, Object obj) {
+ private String invokeToString(MethodHandle mh, Object obj) throws Throwable {
System.out.println("invoke mh="+mh);
return (String) MethodHandles.invoke_1(mh, obj);
}
--- a/netbeans/meth/test/jdk/java/dyn/MethodHandleDemo.java Wed Jun 10 04:17:20 2009 -0700
+++ b/netbeans/meth/test/jdk/java/dyn/MethodHandleDemo.java Fri Jun 12 23:59:55 2009 -0700
@@ -42,7 +42,7 @@ public class MethodHandleDemo {
if (verbose) System.out.println(x);
}
- public static void main(String... av) {
+ public static void main(String... av) throws Throwable {
assertSame("hello", "hello"); // exercise assertion stuff first
options = java.util.Arrays.asList(av).toString();
@@ -66,7 +66,7 @@ public class MethodHandleDemo {
}
}
- static void test() {
+ static void test() throws Throwable {
Class caller = MethodHandleDemo.class;
Class returnType = String.class;
Class[] signature = {String.class};
@@ -165,7 +165,7 @@ public class MethodHandleDemo {
// JUnit trimmings:
@Test
- public void testMain() {
+ public void testMain() throws Throwable {
main();
}
}
--- a/netbeans/meth/test/jdk/java/dyn/MethodHandleSyntax.java Wed Jun 10 04:17:20 2009 -0700
+++ b/netbeans/meth/test/jdk/java/dyn/MethodHandleSyntax.java Fri Jun 12 23:59:55 2009 -0700
@@ -29,10 +29,10 @@ import java.dyn.*;
public class MethodHandleSyntax {
- public static void main(String... av) {
+ public static void main(String... av) throws Throwable {
test();
}
- static void test() {
+ static void test() throws Throwable {
MethodHandle mh = MethodHandles.lookup().findVirtual(Object.class,
"toString", MethodType.make(String.class));
System.out.println("calling "+mh);
--- a/netbeans/meth/test/jdk/java/dyn/MethodHandlesTest.java Wed Jun 10 04:17:20 2009 -0700
+++ b/netbeans/meth/test/jdk/java/dyn/MethodHandlesTest.java Fri Jun 12 23:59:55 2009 -0700
@@ -51,27 +51,27 @@ public class MethodHandlesTest {
public class MethodHandlesTest {
@Test
- public void testFirst() {
+ public void testFirst() throws Throwable {
// left blank for debugging
testCollectArguments(Object.class, 0, 2);
}
// current failures
@Test @Ignore("failure in call to makeRawRetypeOnly in ToGeneric")
- public void testFail_1() {
+ public void testFail_1() throws Throwable {
testSpreadArguments(int.class, 0, 6);
}
@Test @Ignore("failure in JVM when expanding the stack")
- public void testFail_2() {
+ public void testFail_2() throws Throwable {
// if CONV_OP_IMPLEMENTED_MASK includes OP_SPREAD_ARGS, this crashes:
testSpreadArguments(Object.class, 0, 2);
}
@Test @Ignore("IllArgEx failure in call to ToGeneric.make")
- public void testFail_3() {
+ public void testFail_3() throws Throwable {
testSpreadArguments(int.class, 1, 2);
}
@Test @Ignore("IllArgEx failure in call to ToGeneric.make")
- public void testFail_4() {
+ public void testFail_4() throws Throwable {
testCollectArguments(int.class, 1, 2);
}
@@ -298,7 +298,7 @@ public class MethodHandlesTest {
static boolean DO_MORE_CALLS = false;
@Test
- public void testFindStatic() {
+ public void testFindStatic() throws Throwable {
if (CAN_SKIP_WORKING) return;
startTest("findStatic");
testFindStatic(PubExample.class, void.class, "s0");
@@ -317,15 +317,15 @@ public class MethodHandlesTest {
testFindStatic(false, PRIVATE, Example.class, void.class, "bogus");
}
- void testFindStatic(Class<?> defc, Class<?> ret, String name, Class<?>... params) {
+ void testFindStatic(Class<?> defc, Class<?> ret, String name, Class<?>... params) throws Throwable {
for (Object[] ac : accessCases(defc, name)) {
testFindStatic((Boolean)ac[0], (Lookup)ac[1], defc, ret, name, params);
}
}
- void testFindStatic(Lookup lookup, Class<?> defc, Class<?> ret, String name, Class<?>... params) {
+ void testFindStatic(Lookup lookup, Class<?> defc, Class<?> ret, String name, Class<?>... params) throws Throwable {
testFindStatic(true, lookup, defc, ret, name, params);
}
- void testFindStatic(boolean positive, Lookup lookup, Class<?> defc, Class<?> ret, String name, Class<?>... params) {
+ void testFindStatic(boolean positive, Lookup lookup, Class<?> defc, Class<?> ret, String name, Class<?>... params) throws Throwable {
countTest(positive);
MethodType type = MethodType.make(ret, params);
MethodHandle target = null;
@@ -352,7 +352,7 @@ public class MethodHandlesTest {
}
@Test
- public void testFindVirtual() {
+ public void testFindVirtual() throws Throwable {
if (CAN_SKIP_WORKING) return;
startTest("findVirtual");
testFindVirtual(Example.class, void.class, "v0");
@@ -374,19 +374,19 @@ public class MethodHandlesTest {
testFindVirtual(IntExample.Impl.class, IntExample.class, void.class, "Int/v0");
}
- void testFindVirtual(Class<?> defc, Class<?> ret, String name, Class<?>... params) {
+ void testFindVirtual(Class<?> defc, Class<?> ret, String name, Class<?>... params) throws Throwable {
Class<?> rcvc = defc;
testFindVirtual(rcvc, defc, ret, name, params);
}
- void testFindVirtual(Class<?> rcvc, Class<?> defc, Class<?> ret, String name, Class<?>... params) {
+ void testFindVirtual(Class<?> rcvc, Class<?> defc, Class<?> ret, String name, Class<?>... params) throws Throwable {
for (Object[] ac : accessCases(defc, name)) {
testFindVirtual((Boolean)ac[0], (Lookup)ac[1], rcvc, defc, ret, name, params);
}
}
- void testFindVirtual(Lookup lookup, Class<?> rcvc, Class<?> defc, Class<?> ret, String name, Class<?>... params) {
+ void testFindVirtual(Lookup lookup, Class<?> rcvc, Class<?> defc, Class<?> ret, String name, Class<?>... params) throws Throwable {
testFindVirtual(true, lookup, rcvc, defc, ret, name, params);
}
- void testFindVirtual(boolean positive, Lookup lookup, Class<?> rcvc, Class<?> defc, Class<?> ret, String name, Class<?>... params) {
+ void testFindVirtual(boolean positive, Lookup lookup, Class<?> rcvc, Class<?> defc, Class<?> ret, String name, Class<?>... params) throws Throwable {
countTest(positive);
String methodName = name.substring(1 + name.indexOf('/')); // foo/bar => foo
MethodType type = MethodType.make(ret, params);
@@ -419,7 +419,7 @@ public class MethodHandlesTest {
}
@Test
- public void testFindSpecial() {
+ public void testFindSpecial() throws Throwable {
if (CAN_SKIP_WORKING) return;
startTest("findSpecial");
testFindSpecial(Example.class, void.class, "v0");
@@ -428,12 +428,12 @@ public class MethodHandlesTest {
testFindSpecial(false, PRIVATE, Example.class, void.class, "bogus");
}
- void testFindSpecial(Class<?> defc, Class<?> ret, String name, Class<?>... params) {
+ void testFindSpecial(Class<?> defc, Class<?> ret, String name, Class<?>... params) throws Throwable {
testFindSpecial(true, PRIVATE, defc, ret, name, params);
testFindSpecial(false, PACKAGE, defc, ret, name, params);
testFindSpecial(false, PUBLIC, defc, ret, name, params);
}
- void testFindSpecial(boolean positive, Lookup lookup, Class<?> defc, Class<?> ret, String name, Class<?>... params) {
+ void testFindSpecial(boolean positive, Lookup lookup, Class<?> defc, Class<?> ret, String name, Class<?>... params) throws Throwable {
countTest(positive);
MethodType type = MethodType.make(ret, params);
MethodHandle target = null;
@@ -464,7 +464,7 @@ public class MethodHandlesTest {
}
@Test
- public void testBind() {
+ public void testBind() throws Throwable {
if (CAN_SKIP_WORKING) return;
startTest("bind");
testBind(Example.class, void.class, "v0");
@@ -481,13 +481,13 @@ public class MethodHandlesTest {
testBind(IntExample.Impl.class, void.class, "Int/v0");
}
- void testBind(Class<?> defc, Class<?> ret, String name, Class<?>... params) {
+ void testBind(Class<?> defc, Class<?> ret, String name, Class<?>... params) throws Throwable {
for (Object[] ac : accessCases(defc, name)) {
testBind((Boolean)ac[0], (Lookup)ac[1], defc, ret, name, params);
}
}
- void testBind(boolean positive, Lookup lookup, Class<?> defc, Class<?> ret, String name, Class<?>... params) {
+ void testBind(boolean positive, Lookup lookup, Class<?> defc, Class<?> ret, String name, Class<?>... params) throws Throwable {
countTest(positive);
String methodName = name.substring(1 + name.indexOf('/')); // foo/bar => foo
MethodType type = MethodType.make(ret, params);
@@ -515,7 +515,7 @@ public class MethodHandlesTest {
}
@Test
- public void testUnreflect() {
+ public void testUnreflect() throws Throwable {
if (CAN_SKIP_WORKING) return;
startTest("unreflect");
testUnreflect(Example.class, true, void.class, "s0");
@@ -539,12 +539,12 @@ public class MethodHandlesTest {
testUnreflect(Example.class, false, Object.class, "v2", int.class, int.class);
}
- void testUnreflect(Class<?> defc, boolean isStatic, Class<?> ret, String name, Class<?>... params) {
+ void testUnreflect(Class<?> defc, boolean isStatic, Class<?> ret, String name, Class<?>... params) throws Throwable {
for (Object[] ac : accessCases(defc, name)) {
testUnreflect((Boolean)ac[0], (Lookup)ac[1], defc, isStatic, ret, name, params);
}
}
- void testUnreflect(boolean positive, Lookup lookup, Class<?> defc, boolean isStatic, Class<?> ret, String name, Class<?>... params) {
+ void testUnreflect(boolean positive, Lookup lookup, Class<?> defc, boolean isStatic, Class<?> ret, String name, Class<?>... params) throws Throwable {
countTest(positive);
MethodType type = MethodType.make(ret, params);
Method rmethod = null;
@@ -585,7 +585,7 @@ public class MethodHandlesTest {
}
@Test @Ignore("unimplemented")
- public void testUnreflectSpecial() {
+ public void testUnreflectSpecial() throws Throwable {
Lookup lookup = PRIVATE; // FIXME: test more lookups than this one
startTest("unreflectSpecial");
Method m = null;
@@ -596,7 +596,7 @@ public class MethodHandlesTest {
}
@Test @Ignore("unimplemented")
- public void testUnreflectGetter() {
+ public void testUnreflectGetter() throws Throwable {
Lookup lookup = PRIVATE; // FIXME: test more lookups than this one
startTest("unreflectGetter");
Field f = null;
@@ -607,7 +607,7 @@ public class MethodHandlesTest {
}
@Test @Ignore("unimplemented")
- public void testUnreflectSetter() {
+ public void testUnreflectSetter() throws Throwable {
Lookup lookup = PRIVATE; // FIXME: test more lookups than this one
startTest("unreflectSetter");
Field f = null;
@@ -618,7 +618,7 @@ public class MethodHandlesTest {
}
@Test @Ignore("unimplemented")
- public void testArrayElementGetter() {
+ public void testArrayElementGetter() throws Throwable {
startTest("arrayElementGetter");
Class<?> arrayClass = null;
MethodHandle expResult = null;
@@ -628,7 +628,7 @@ public class MethodHandlesTest {
}
@Test @Ignore("unimplemented")
- public void testArrayElementSetter() {
+ public void testArrayElementSetter() throws Throwable {
startTest("arrayElementSetter");
Class<?> arrayClass = null;
MethodHandle expResult = null;
@@ -665,7 +665,7 @@ public class MethodHandlesTest {
}
@Test
- public void testConvertArguments_pairwise() {
+ public void testConvertArguments_pairwise() throws Throwable {
if (CAN_SKIP_WORKING) return;
startTest("convertArguments/pairwise");
testConvert(Callee.ofType(1), null, "id", int.class);
@@ -674,11 +674,11 @@ public class MethodHandlesTest {
testConvert(Callee.ofType(1), null, "id", short.class);
}
- void testConvert(MethodHandle id, Class<?> rtype, String name, Class<?>... params) {
+ void testConvert(MethodHandle id, Class<?> rtype, String name, Class<?>... params) throws Throwable {
testConvert(true, id, rtype, name, params);
}
- void testConvert(boolean positive, MethodHandle id, Class<?> rtype, String name, Class<?>... params) {
+ void testConvert(boolean positive, MethodHandle id, Class<?> rtype, String name, Class<?>... params) throws Throwable {
countTest(positive);
MethodType idType = id.type();
if (rtype == null) rtype = idType.returnType();
@@ -724,7 +724,7 @@ public class MethodHandlesTest {
}
@Test
- public void testSpreadArguments() {
+ public void testSpreadArguments() throws Throwable {
if (CAN_SKIP_WORKING) return;
startTest("spreadArguments");
for (Class<?> argType : new Class[]{Object.class, Integer.class, int.class}) {
@@ -739,7 +739,7 @@ public class MethodHandlesTest {
}
}
}
- public void testSpreadArguments(Class<?> argType, int pos, int nargs) {
+ public void testSpreadArguments(Class<?> argType, int pos, int nargs) throws Throwable {
countTest();
MethodHandle target = ValueConversions.varargsArray(nargs);
MethodHandle target2 = changeArgTypes(target, argType);
@@ -784,7 +784,7 @@ public class MethodHandlesTest {
}
@Test
- public void testCollectArguments() {
+ public void testCollectArguments() throws Throwable {
if (CAN_SKIP_WORKING) return;
startTest("collectArguments");
for (Class<?> argType : new Class[]{Object.class, Integer.class, int.class}) {
@@ -798,7 +798,7 @@ public class MethodHandlesTest {
}
}
}
- public void testCollectArguments(Class<?> argType, int pos, int nargs) {
+ public void testCollectArguments(Class<?> argType, int pos, int nargs) throws Throwable {
countTest();
// fake up a MH with the same type as the desired adapter:
MethodHandle fake = ValueConversions.varargsArray(nargs);
@@ -823,7 +823,7 @@ public class MethodHandlesTest {
}
@Test
- public void testInsertArguments() {
+ public void testInsertArguments() throws Throwable {
if (CAN_SKIP_WORKING) return;
startTest("insertArguments");
for (int nargs = 0; nargs <= 4; nargs++) {
@@ -835,7 +835,7 @@ public class MethodHandlesTest {
}
}
- void testInsertArguments(int nargs, int pos, int ins) {
+ void testInsertArguments(int nargs, int pos, int ins) throws Throwable {
countTest();
MethodHandle target = ValueConversions.varargsArray(nargs + ins);
Object[] args = randomArgs(target.type().parameterArray());
@@ -857,7 +857,7 @@ public class MethodHandlesTest {
}
@Test
- public void testFoldArguments() {
+ public void testFoldArguments() throws Throwable {
if (CAN_SKIP_WORKING) return;
startTest("foldArguments");
for (int nargs = 0; nargs <= 4; nargs++) {
@@ -869,7 +869,7 @@ public class MethodHandlesTest {
}
}
- void testFoldArguments(int nargs, int pos, int fold) {
+ void testFoldArguments(int nargs, int pos, int fold) throws Throwable {
if (pos != 0) return; // can fold only at pos=0 for now
countTest();
MethodHandle target = ValueConversions.varargsList(1 + nargs);
@@ -894,7 +894,7 @@ public class MethodHandlesTest {
}
@Test
- public void testDropArguments() {
+ public void testDropArguments() throws Throwable {
if (CAN_SKIP_WORKING) return;
startTest("dropArguments");
for (int nargs = 0; nargs <= 4; nargs++) {
@@ -906,7 +906,7 @@ public class MethodHandlesTest {
}
}
- void testDropArguments(int nargs, int pos, int drop) {
+ void testDropArguments(int nargs, int pos, int drop) throws Throwable {
countTest();
MethodHandle target = ValueConversions.varargsArray(nargs);
Object[] args = randomArgs(target.type().parameterArray());
@@ -957,7 +957,7 @@ public class MethodHandlesTest {
}
@Test
- public void testGuardWithTest() {
+ public void testGuardWithTest() throws Throwable {
if (CAN_SKIP_WORKING) return;
startTest("guardWithTest");
for (int nargs = 0; nargs <= 3; nargs++) {
@@ -966,7 +966,7 @@ public class MethodHandlesTest {
testGuardWithTest(nargs, String.class);
}
}
- void testGuardWithTest(int nargs, Class<?> argClass) {
+ void testGuardWithTest(int nargs, Class<?> argClass) throws Throwable {
countTest();
MethodHandle test = PRIVATE.findVirtual(Object.class, "equals", MethodType.make(boolean.class, Object.class));
MethodHandle target = PRIVATE.findStatic(MethodHandlesTest.class, "targetIfEquals", MethodType.makeGeneric(nargs));
@@ -1005,7 +1005,7 @@ public class MethodHandlesTest {
}
@Test
- public void testCatchException() {
+ public void testCatchException() throws Throwable {
if (CAN_SKIP_WORKING) return;
startTest("catchException");
for (int nargs = 2; nargs <= 6; nargs++) {
@@ -1024,7 +1024,7 @@ public class MethodHandlesTest {
return normal;
}
- void testCatchException(Class<?> returnType, Throwable thrown, boolean throwIt, int nargs) {
+ void testCatchException(Class<?> returnType, Throwable thrown, boolean throwIt, int nargs) throws Throwable {
countTest();
Class<? extends Throwable> exType = thrown.getClass();
MethodHandle throwOrReturn
@@ -1051,7 +1051,7 @@ public class MethodHandlesTest {
}
@Test
- public void testThrowException() {
+ public void testThrowException() throws Throwable {
if (CAN_SKIP_WORKING) return;
startTest("throwException");
testThrowException(int.class, new ClassCastException("testing"));
@@ -1059,7 +1059,7 @@ public class MethodHandlesTest {
testThrowException(String.class, new LinkageError("testing"));
}
- void testThrowException(Class<?> returnType, Throwable thrown) {
+ void testThrowException(Class<?> returnType, Throwable thrown) throws Throwable {
countTest();
Class<? extends Throwable> exType = thrown.getClass();
MethodHandle target = MethodHandles.throwException(returnType, exType);
--- a/netbeans/meth/test/sun/dyn/util/ValueConversionsTest.java Wed Jun 10 04:17:20 2009 -0700
+++ b/netbeans/meth/test/sun/dyn/util/ValueConversionsTest.java Fri Jun 12 23:59:55 2009 -0700
@@ -40,7 +40,7 @@ public class ValueConversionsTest {
public class ValueConversionsTest {
@Test
- public void testUnbox() {
+ public void testUnbox() throws Throwable {
System.out.println("unbox");
for (Wrapper w : Wrapper.values()) {
System.out.println(w);
@@ -73,7 +73,7 @@ public class ValueConversionsTest {
}
@Test
- public void testUnboxRaw() {
+ public void testUnboxRaw() throws Throwable {
System.out.println("unboxRaw");
for (Wrapper w : Wrapper.values()) {
if (w == Wrapper.OBJECT) continue; // skip this; no raw form
@@ -103,7 +103,7 @@ public class ValueConversionsTest {
}
@Test
- public void testBox() {
+ public void testBox() throws Throwable {
System.out.println("box");
for (Wrapper w : Wrapper.values()) {
if (w == Wrapper.VOID) continue; // skip this; no unboxed form
@@ -131,7 +131,7 @@ public class ValueConversionsTest {
}
@Test
- public void testBoxRaw() {
+ public void testBoxRaw() throws Throwable {
System.out.println("boxRaw");
for (Wrapper w : Wrapper.values()) {
if (w == Wrapper.VOID) continue; // skip this; no unboxed form
@@ -160,7 +160,7 @@ public class ValueConversionsTest {
}
@Test
- public void testReboxRaw() {
+ public void testReboxRaw() throws Throwable {
System.out.println("reboxRaw");
for (Wrapper w : Wrapper.values()) {
Wrapper pw = Wrapper.forPrimitiveType(w.rawPrimitiveType());
@@ -190,7 +190,7 @@ public class ValueConversionsTest {
}
@Test
- public void testCast() {
+ public void testCast() throws Throwable {
System.out.println("cast");
Class<?>[] types = { Object.class, Serializable.class, String.class, Number.class, Integer.class };
Object[] objects = { new Object(), Boolean.FALSE, "hello", (Long)12L, (Integer)6 };
@@ -226,7 +226,7 @@ public class ValueConversionsTest {
}
@Test
- public void testIdentity() {
+ public void testIdentity() throws Throwable {
System.out.println("identity");
MethodHandle id = ValueConversions.identity();
Object expResult = "foo";
@@ -236,7 +236,7 @@ public class ValueConversionsTest {
}
@Test
- public void testVarargsArray() {
+ public void testVarargsArray() throws Throwable {
System.out.println("varargsArray");
for (int nargs = 0; nargs <= 5; nargs++) {
MethodHandle target = ValueConversions.varargsArray(nargs);
@@ -249,7 +249,7 @@ public class ValueConversionsTest {
}
@Test
- public void testVarargsList() {
+ public void testVarargsList() throws Throwable {
System.out.println("varargsList");
for (int nargs = 0; nargs <= 5; nargs++) {
MethodHandle target = ValueConversions.varargsList(nargs);