Fixes JavaDoc comment indentation.
@@ -7,7 +7,6 @@ import lombok.*;
import java.awt.Point;
-@EqualsAndHashCode
@ToString
public class LinePrinter {
/** The character to print the line with. */
@@ -16,24 +15,20 @@ public class LinePrinter {
/**
* Prints one, or more, lines on a tile grid using a set of points.
*
- * The algorithm draws a line from the first point to the second point,
- * then from the second point to the third point, and so on.
+ * The algorithm draws a line from the first point to the second point, then from the second point to the
+ * third point, and so on.
+ *
+ * Does nothing if the grid or points array are null or if the points array has less than 3 elements.
*
* @param grid
* The grid.
*
* @param points
* The points.
- *
- * @throws IllegalArgumentException
- * If there are fewer than two points.
- *
- * @throws NullPointerException
- * If the grid or points array is null.
*/
- public void print(final @NonNull TileGrid grid, final @NonNull Point[] points) {
- if (points.length < 2) {
- throw new IllegalArgumentException("A line requires two points to be drawn.");
+ public void print(final TileGrid grid, final Point[] points) {
+ if (grid == null || points == null || points.length < 2) {
+ return;
}
for (int i = 1 ; i < points.length ; i++) {
