Skip to content
This repository was archived by the owner on Aug 27, 2022. It is now read-only.
/ lanai Public archive

Commit 315635e

Browse files
author
Alexander Zuev
committedMar 8, 2020
8176040: Documentation of java.awt.Rectangle.add(java.awt.Point) is wrong
Reviewed-by: serb, prr
1 parent bce8149 commit 315635e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/java.desktop/share/classes/java/awt/Rectangle.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,7 @@ public Rectangle union(Rectangle r) {
922922
* If the specified point must be contained within the new
923923
* {@code Rectangle}, a 1x1 rectangle should be added instead:
924924
* <pre>
925-
* r.add(newx, newy, 1, 1);
925+
* r.add(new Rectangle(newx, newy, 1, 1));
926926
* </pre>
927927
* @param newx the X coordinate of the new point
928928
* @param newy the Y coordinate of the new point
@@ -973,7 +973,7 @@ public void add(int newx, int newy) {
973973
* If the specified point must be contained within the new
974974
* {@code Rectangle}, a 1x1 rectangle should be added instead:
975975
* <pre>
976-
* r.add(pt.x, pt.y, 1, 1);
976+
* r.add(new Rectangle(pt, new Dimension(1, 1)));
977977
* </pre>
978978
* @param pt the new {@code Point} to add to this
979979
* {@code Rectangle}

0 commit comments

Comments
 (0)