source("TestHarness.bsh");

/*
	This test case looks at binding of classes to their loose environment.
	visibility of vars in enclosing the scope of the class.
*/

flag=false;

outerMethod() { print("outerMethod"); return 42; }

class MyClass16 extends Thread 
{
	static boolean sflag=false;
	static int sint = 1;
	public void run() 
{ 
		assert( outerMethod() == 42 );
		print("enter run flag="+flag); 
		sflag=true; flag=true; 
		assert( sint == 1 );
		sint=2;
		assert( sint == 2 );
		assert( MyClass16.sint == 2 );
	}
}

assert( MyClass16.sflag == false );
assert( flag == false );

thread = new MyClass16();
thread.start();
thread.join();

assert( flag == true );
assert( MyClass16.sint == 2 );
assert( MyClass16.sflag == true );

complete();
