8176040: Documentation of java.awt.Rectangle.add(java.awt.Point) is wrong

Reviewed-by: serb, prr
This commit is contained in:
Alexander Zuev 2020-03-09 00:18:23 +03:00
parent bce81496ce
commit 315635ea09

View File

@ -922,7 +922,7 @@ public class Rectangle extends Rectangle2D
* If the specified point must be contained within the new
* {@code Rectangle}, a 1x1 rectangle should be added instead:
* <pre>
* r.add(newx, newy, 1, 1);
* r.add(new Rectangle(newx, newy, 1, 1));
* </pre>
* @param newx the X coordinate of the new point
* @param newy the Y coordinate of the new point
@ -973,7 +973,7 @@ public class Rectangle extends Rectangle2D
* If the specified point must be contained within the new
* {@code Rectangle}, a 1x1 rectangle should be added instead:
* <pre>
* r.add(pt.x, pt.y, 1, 1);
* r.add(new Rectangle(pt, new Dimension(1, 1)));
* </pre>
* @param pt the new {@code Point} to add to this
* {@code Rectangle}