View | Details | Raw Unified | Return to bug 183395 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/compiler/regression/TryStatementTest.java (+44 lines)
Lines 5444-5449 Link Here
5444
		assertTrue(false);
5444
		assertTrue(false);
5445
	}	
5445
	}	
5446
}
5446
}
5447
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=183395
5448
public void test059() {
5449
	this.runNegativeTest(
5450
		new String[] {
5451
			"X.java",
5452
			"public class X {\n" + 
5453
			"    public static void main(String[] args) {\n" + 
5454
			"    	try {\n" + 
5455
			"    		System.out.println(args.length);\n" + 
5456
			"    	} catch(Exception[] e) {\n" + 
5457
			"    		// ignore\n" + 
5458
			"    	}\n" + 
5459
			"    }\n" + 
5460
			"}" 
5461
		},
5462
		"----------\n" + 
5463
		"1. ERROR in X.java (at line 5)\n" + 
5464
		"	} catch(Exception[] e) {\n" + 
5465
		"	        ^^^^^^^^^^^\n" + 
5466
		"No exception of type Exception[] can be thrown; an exception type must be a subclass of Throwable\n" + 
5467
		"----------\n");
5468
}
5469
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=183395
5470
public void test060() {
5471
	this.runNegativeTest(
5472
		new String[] {
5473
			"X.java",
5474
			"public class X {\n" + 
5475
			"    public static void main(String[] args) {\n" + 
5476
			"    	try {\n" + 
5477
			"    		System.out.println(args.length);\n" + 
5478
			"    	} catch(int e) {\n" + 
5479
			"    		// ignore\n" + 
5480
			"    	}\n" + 
5481
			"    }\n" + 
5482
			"}" 
5483
		},
5484
		"----------\n" + 
5485
		"1. ERROR in X.java (at line 5)\n" + 
5486
		"	} catch(int e) {\n" + 
5487
		"	        ^^^\n" + 
5488
		"No exception of type int can be thrown; an exception type must be a subclass of Throwable\n" + 
5489
		"----------\n");
5490
}
5447
public static Class testClass() {
5491
public static Class testClass() {
5448
	return TryStatementTest.class;
5492
	return TryStatementTest.class;
5449
}
5493
}

Return to bug 183395