File: undeclaredthrowable.bsh

package info (click to toggle)
bsh 2.0b4-15
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 4,212 kB
  • sloc: java: 23,430; xml: 4,500; sh: 139; makefile: 30
file content (28 lines) | stat: -rw-r--r-- 512 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/java bsh.Interpreter

source("TestHarness.bsh");

import bsh.*;
if ( Capabilities.canGenerateInterfaces() ) 
{
	i=new Interpreter();
	r=i.eval(
		"return new Runnable() {"
		+"void run() { throw new EvalError(\"foo\"); } }");
	try {
		r.run();
	} catch ( e ) {
		super.ue=e;
		assert( e instanceof java.lang.reflect.UndeclaredThrowableException );
	}
} 

/*
make sure it properly prints the nested exception... 

import bsh.TargetError;
te=new TargetError( "undec throw", ue );
print(te);
*/

complete();