Use of synchronized methods in components

Rod Widdowson rdw at steadingsoftware.com
Wed May 7 03:17:55 EDT 2014


> Just curious, why "egregious" ? Why is synchronized on setId() so bad ?

Because it also checks and throws if the ID is non-null in doinitialize, &
(IIRC) doesn't allow setting after initialization.  So it is enforcing the
contract that Scott mentioned, but also being synchronized.  Belt and Braces
as we would say (I though you guys say Belt + Suspenders which is something
*very* different in the UK :-)

>> My guess was because it's sitting so high in the class hierarchy,

That too.  Its hit all the time.



More information about the dev mailing list