aspose file tools*
The moose likes Java in General and the fly likes Question for java guru Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply locked New topic
Author

Question for java guru

Richard Walter
Greenhorn

Joined: May 26, 2001
Posts: 22
HOping someone could tell if execution i catch statement blocks remain synchronised, as in the following code?
synchronise (object) {
try {

//do something

} catch (Exception1 e1) {
//do soemthing here
//is it still synchronised

} catch (Exception1 e1) {
//do soemthing here
//is it still synchronised

}
}

Would be gratefull if you could also point me to an official source that clarifies this. Also, are ther any general issues, best practices etc.. to conisder in the above code example??
Thanks,
Richard Walter
Maciej Kolodziej
Greenhorn

Joined: Feb 11, 2002
Posts: 26
Hi,
Everything inside synchronized block is synchronized and so are the catch statements.


MK
Maciej Kolodziej
Greenhorn

Joined: Feb 11, 2002
Posts: 26
And oh, You wanted some source. I recommend Thinking in Java second edition. Synchronization is described in chapter 14.
Ajith Kallambella
Sheriff

Joined: Mar 17, 2000
Posts: 5782
I am closing this discussion. Please refer to this duplicate thread for answers and continued conversation.
[ February 15, 2002: Message edited by: Ajith Kallambella ]

Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Question for java guru