357358359360361362363364365366
} synchronized(listeners) { int n = listeners.size(); // only one call outside loop for (int i=0; i<n; ++i) { ShapeListener sl = (ShapeListener)listeners.get(i); if (sl!=null) sl.shapeChanged(AbstractShape.this, r); } } }