Rectangle inside; synchronized(this) { inside = insideAllocation; if (inside == null) { inside = new Rectangle(); insideAllocation = inside; } } inside.x = alloc.x + left; inside.y = alloc.y + top; inside.width = alloc.width - left - right; inside.height = alloc.height - top - bottom;
Rectangle inside = insideAllocation; inside.x = alloc.x + getLeftInset(); inside.y = alloc.y + getTopInset(); inside.width = alloc.width - getLeftInset() - getRightInset(); inside.height = alloc.height - getTopInset() - getBottomInset();
  protected Rectangle getInsideAllocation(Shape a)  {    if (a == null)      return null;    Rectangle alloc = a.getBounds();    // Initialize the inside allocation rectangle. This is done inside    // a synchronized block in order to avoid multiple threads creating    // this instance simultanously.    Rectangle inside;    synchronized(this)      {        inside = insideAllocation;        if (inside == null)          {            inside = new Rectangle();            insideAllocation = inside;          }      }    inside.x = alloc.x + left;    inside.y = alloc.y + top;    inside.width = alloc.width - left - right;    inside.height = alloc.height - top - bottom;    return inside;  }