<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    A BufferedImage is a single always writable Tile.<br>
    <br>
    The method that is most questionable is releaseWritableTile(int,
    int) being a no-op.<br>
    It doesn't even throw an AAIOB if you pass in something other than
    (0,0)<br>
    It probably should have a clause<br>
    <br>
    "This method is a no-op and immediately returns without checking the
    passed values<br>
    since a BufferedImage has only a single tile which is always
    writable."<br>
    <br>
    The observer methods could also benefit from doc that observers will
    never be added or<br>
    removed (no-op methods) since there will never any events to
    dispatch.<br>
    So there's no point in adding real support for listeners.<br>
    <br>
    I think the doc on isTileWritable is well-intentioned but not
    well-worded.<br>
    <br>
    -phil<br>
    <br>
    <br>
    <div class="moz-cite-prefix">On 4/12/23 3:08 AM, Martin Desruisseaux
      wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:43709e12-9664-84ed-b4ef-348edd78f24d@geomatys.com">
      
      <p>Hello all</p>
      <p>BufferedImage implements WritableRenderedImage, but the javadoc
        of all WritableRenderedImage methods are inconsistent with
        implementation:</p>
      <ul>
        <li>getWritableTile(…) said "All registered TileObservers are
          notified when a tile goes from having no writers to having one
          writer" but the implementation doesn't do that.</li>
        <li>releaseWritableTile(…) said "All registered TileObservers
          are notified when a tile goes from having one writer to having
          no writers" but the implementation does nothing.</li>
        <li>isTileWritable(…) said "throws
          ArrayIndexOutOfBoundsException if both tileX and tileY are not
          equal to 0" but the implementation throws
          IllegalArgumentException is *either* tileX or tileY is not 0.</li>
        <li>addTileObserver(…) and removeTileObserver(…) are no-op, but
          the javadoc don't said that.<br>
        </li>
      </ul>
      <p>Should the javadoc be updated for saying that most methods are
        actually no-op, or should the implementation be updated with
        real support of listeners? Or should BufferedImage be considered
        as permanently checkout out for writing, in which case the
        current javadoc is not wrong (except above-cited throws clause)
        but a note about the "permanently checkout-out" behavior would
        be helpfui?<br>
      </p>
      <p>    Martin</p>
      <p><br>
      </p>
    </blockquote>
    <br>
  </body>
</html>