Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions src/main/java/core/basesyntax/Circle.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package core.basesyntax;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file has an empty line immediately before the class declaration. This violates the checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Please remove the blank line so the class starts directly after the package declaration.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the redundant empty line after the package declaration. The checklist notes: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file begins with an empty line right after the package declaration. The checklist requires: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Please remove this redundant blank line (delete line 2).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant empty line after package declaration. The checklist requires not to begin class/method implementation with an empty line—remove this blank line so the class declaration follows the package statement directly.

public class Circle extends Figure {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates the requirement that callers must be able to obtain a figure's area. The description states: "we can obtain the area of any figure and are able to draw it." You currently compute and store the area in the protected field but do not expose it via a public getArea() method or an area-specific interface. Add public float getArea() (or an AreaCalculator interface) so other code can retrieve the area. See Figure.java which holds the protected area field.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class extends the abstract Figure, which is being used to provide behavior. The checklist explicitly says: "Don't use abstract classes to set behavior for classes". Prefer moving behavior into interfaces (e.g., an Area interface for area calculation) and have concrete figures implement those interfaces instead of relying on an abstract class for behavior.

private final int radius;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an empty line immediately before the constructor. The checklist requires: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove this redundant blank line so the constructor starts without a leading empty line.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's an unnecessary empty line before the constructor. The checklist requires: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Please remove the empty line at line 5.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant empty line before the constructor. Remove this empty line so the constructor starts immediately after the field declarations (checklist: don't begin method implementation with an empty line).

public Circle(int radius, String color) {
this.radius = radius;
this.color = color;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an empty line between the constructor and the overridden draw method. The checklist says: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove this empty line so the method's @OverRide and signature start immediately after the constructor.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant empty line before the @OverRide of draw(). Remove the blank line so the annotation and method start directly after the previous code block (style checklist).

@Override
public void draw() {
System.out.println("Figure: circle, area: " + getArea()
+ " sq. units, radius: " + radius
+ " units, color: " + color);
}

Comment on lines +10 to +17

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are redundant empty lines before/around the overrides and methods (lines 10 and 17). The checklist requires: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove these blank lines so annotations and methods start immediately without a leading empty line.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant empty line before the @OverRide of getArea(). Remove the blank line so the annotation and method start directly after the previous code block (style checklist).

@Override
public float getArea() {
return (float) Math.PI * (radius * radius);
}
}
10 changes: 10 additions & 0 deletions src/main/java/core/basesyntax/Color.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package core.basesyntax;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file contains a leading empty line before the enum declaration. This violates the checklist item: "Don't begin class or method implementation with an empty line." Please remove the redundant empty line so the enum declaration immediately follows the package statement.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file begins with an empty line after the package declaration which violates the checklist: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove the blank line so the enum immediately follows the package statement.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file begins with a redundant empty line after the package declaration. This violates the checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Please remove the empty line at line 2 so the enum starts immediately after the package statement.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file contains a redundant empty line after the package declaration. Per the checklist: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove this blank line so the file starts directly with the enum declaration.

public enum Color {
BLUE,
RED,
GREEN,
YELLOW,
PURPLE,
WHITE
}
11 changes: 11 additions & 0 deletions src/main/java/core/basesyntax/ColorSupplier.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package core.basesyntax;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file contains redundant empty lines before the import and before the class. The checklist states: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Please remove the empty lines so the package/import/class structure has no leading blank lines.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates the checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" There are redundant empty lines at the top of the file (line 2). Remove unnecessary blank lines to comply with the style guidance.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove the blank line after the package declaration (line 2).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file has a redundant empty line immediately after the package declaration. The checklist explicitly says: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Please remove this blank line so the import follows the package declaration directly.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file begins with an empty line immediately after the package declaration. The checklist requires: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove the blank line after package core.basesyntax; so the file starts without an extra empty line .

import java.util.Random;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another redundant blank line exists between the import and the class declaration. The checklist states: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove this blank line as well.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is another redundant blank line after the import (line 4). As above, this breaks: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove this blank line to keep the file tidy.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove the blank line between the import and the class declaration (line 4).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an unnecessary blank line between the import and the class declaration. Remove this empty line to satisfy the checklist requirement to avoid redundant empty lines.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant empty line between the import and the class declaration. Remove this blank line so import java.util.Random; is followed immediately by the class declaration per the checklist guidance about redundant empty lines .

public class ColorSupplier {
private final Random random = new Random();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove the blank line inside the class before the method declaration (line 7).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an empty line immediately before the getRandomColor() method. The checklist states not to begin method implementations with an empty line. Remove this blank line so the method signature follows the field declaration without an intervening blank line.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant empty line before the first member declaration. Delete this blank line so the first field (private final Random random = new Random();) directly follows the class declaration. This adheres to: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" .

public String getRandomColor() {
return Color.values()[random.nextInt(Color.values().length)].name();
}
}
5 changes: 5 additions & 0 deletions src/main/java/core/basesyntax/Drawable.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package core.basesyntax;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the redundant empty line after the package declaration. The checklist says: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a redundant empty line immediately after the package declaration. The checklist requires removing redundant empty lines: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Please remove this blank line so the file begins directly with the interface declaration.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant empty line after package declaration. Per the checklist, remove the blank line so the interface declaration follows the package statement directly.

public interface Drawable {
void draw();
}
14 changes: 14 additions & 0 deletions src/main/java/core/basesyntax/Figure.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package core.basesyntax;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a redundant empty line between the package declaration and the class declaration. The checklist requires: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Please remove the blank line so the class starts immediately after the package declaration.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove the extra blank line(s) before the class declaration and any other redundant empty lines in this file.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the redundant empty line after the package declaration. The checklist states: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)". This is the blank line at line 2.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a redundant empty line immediately after the package declaration. The checklist: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove this blank line.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant empty line after package declaration. The checklist says: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove this blank line so the class declaration follows the package statement directly .

public class Figure implements Drawable {
protected String color;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a redundant empty line between the field declaration and the getArea() method. Remove this empty line to conform with the checklist's guidance about redundant empty lines.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant empty line inside the class before the getArea() method. Remove this empty line so method implementations start immediately after fields/previous members (style checklist requirement) .

public float getArea() {
Comment on lines +3 to +6

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Figure currently contains getArea() implementation (returns 0) instead of providing an area contract via a separate interface. This violates the checklist: "Don't put all behavior into a single interface if the methods are conceptually different from each other." Create a public interface (e.g., AreaCalculator) with public float getArea() and have each concrete figure implement it; remove getArea() from this base class. See Figure.java for the current code.

return 0;
Comment on lines +6 to +7

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The checklist requires separating conceptual behaviors: "Don't put all behavior into a single interface if the methods are conceptually different from each other." Figure currently contains the getArea() implementation instead of using a dedicated area interface. Add a public interface for area (e.g., public interface Area { float getArea(); }) and have figures implement it so getArea() is declared via that interface (checklist requirement 3.1) .

}
Comment on lines +6 to +8

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Providing a default getArea() in the base class places behavior on the class rather than using an interface. The checklist states: "Don't use abstract classes to set behavior for classes" and recommends preferring interfaces for behavior contracts. Move getArea() to a dedicated interface and implement it publicly in concrete figures.


@Override
public void draw() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an empty line immediately before the draw() method body. The checklist requires not to begin method implementations with an empty line. Remove this blank line so the method body starts immediately after the signature.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant empty line between the annotation and method for draw()/or between members — remove to comply with the checklist: "Don't begin class or method implementation with an empty line." .

}
}
33 changes: 33 additions & 0 deletions src/main/java/core/basesyntax/FigureSupplier.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package core.basesyntax;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are redundant empty lines at the top / inside the class (for example the blank line after the package declaration and blank lines between members). The checklist says: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove those blank lines so class/method implementations do not start with an empty line.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates the checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" There are redundant blank lines at the top and inside the class (for example lines 2, 4, 10, 13, 27, 29). Remove these unnecessary empty lines to follow the style rule.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file begins with a redundant empty line after the package declaration. The checklist says: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove the blank line at line 2 so the class starts immediately after the package declaration.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file has a redundant empty line immediately after the package declaration. The checklist says: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Please remove the blank line so the import follows the package declaration directly.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates the checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove the empty line immediately after the package declaration so the class declaration follows the package statement directly.

import java.util.Random;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an unnecessary blank line between the import and the class declaration. Remove this empty line to conform to the checklist requirement to avoid redundant empty lines.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates the checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove the empty line after the import statement so imports and class declaration are contiguous.

public class FigureSupplier {
private static final int MAX_FIGURE_COUNT = 5;
private static final int MAX_PARAMETER = 10;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an empty line immediately before the getRandomColor() method. The checklist states not to begin method implementations with an empty line. Remove this blank line so the method signature follows the field declaration without an intervening blank line.

private static final int DEFAULT_CIRCLE_RADIUS = 10;
private final ColorSupplier colorSupplier = new ColorSupplier();
private final Random random = new Random();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates the checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove the blank line before the getRandomFigure() method body so the method starts immediately after the field declarations.

public Figure getRandomFigure() {
int randomFigure = random.nextInt(MAX_FIGURE_COUNT);
int firstSide = random.nextInt(MAX_PARAMETER) + 1;
int secondSide = random.nextInt(MAX_PARAMETER) + 1;
int height = random.nextInt(MAX_PARAMETER) + 1;
String color = colorSupplier.getRandomColor();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates the checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove the blank line between local variable initialization and the switch return so the code blocks are not separated by unnecessary empty lines.

return switch (randomFigure) {
case 0 -> new Square(firstSide, color);
case 1 -> new Rectangle(firstSide, secondSide, color);
case 2 -> new RightTriangle(firstSide, secondSide, color);
case 3 -> new Circle(firstSide, color);
case 4 -> new IsoscelesTrapezoid(firstSide, secondSide, height, color);
default -> getDefaultFigure();
};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates the checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove the blank line after the switch block (before the method closing brace) to avoid starting the next code block with an empty line.

}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates the checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove the blank line before the getDefaultFigure() method so the method header is not preceded by an empty line.

public Figure getDefaultFigure() {
return new Circle(DEFAULT_CIRCLE_RADIUS, Color.WHITE.name());
}
}
8 changes: 0 additions & 8 deletions src/main/java/core/basesyntax/HelloWorld.java

This file was deleted.

27 changes: 27 additions & 0 deletions src/main/java/core/basesyntax/IsoscelesTrapezoid.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package core.basesyntax;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file begins with a blank line right after the package declaration. This violates the checklist: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Please remove the redundant empty lines so the class declaration follows the package declaration immediately.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant empty line at the top of the file. The checklist explicitly states: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove the blank line 2 to follow the style rule.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an empty line after the package declaration. The checklist says: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove the blank line so the class starts immediately after the package declaration.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a redundant empty line immediately after the package declaration. The checklist explicitly states: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Please remove this blank line.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates the checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove the redundant blank line after the package declaration so the class declaration follows the package statement directly.

public class IsoscelesTrapezoid extends Figure {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class extends the abstract Figure and currently participates in a protected getArea() contract. The checklist states: "Don't use abstract classes to set behavior for classes" and also advises separating behaviors into focused interfaces (e.g., Drawable vs Area). Consider moving getArea() to a public Area interface and make this class implement it to expose area publicly. This will satisfy the requirement that "we can obtain the area of any figure" from the task description.

private final int horizontalSide;
private final int verticalSide;
private final int height;
Comment on lines +4 to +6

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Field names horizontalSide and verticalSide are confusing for an isosceles trapezoid. The class represents a trapezoid so use topBase and bottomBase (or equivalent) to match the domain and formulas. This simplifies correct area calculation and clearer draw output. See lines 4–6.


Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates the checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove the redundant blank line before the constructor so the constructor's declaration is not preceded by an empty line.

public IsoscelesTrapezoid(int horizontalSide, int verticalSide, int height, String color) {
this.horizontalSide = horizontalSide;
this.verticalSide = verticalSide;
this.height = height;
this.color = color;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an unnecessary blank line between the constructor and the @OverRide draw() annotation. Remove this empty line to comply with the checklist instruction not to begin method implementations with an empty line.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates the checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove the redundant blank line before the @OverRide of draw() so the annotation/method start directly after the constructor.

@Override
public void draw() {
System.out.println("Figure: rectangle, area: " + getArea() + " sq. units, horizontal side: "

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

draw() prints the wrong figure type: it prints "Figure: rectangle,..." but this is an isosceles trapezoid. The task requires the draw output include the figure type (see example in description: "Figure: square, area: 25.0 sq. units, side: 5 units, color: blue"). Change the label to "Figure: isosceles trapezoid,...".

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The draw() implementation prints "Figure: rectangle, ..." which is incorrect for this class. The task requires that draw output includes the correct figure type/name and follow the example structure: "Figure: square, area: 25.0 sq. units, side: 5 units, color: blue". Update this line to print the correct type (e.g., "Figure: isosceles trapezoid") and ensure commas/units/color follow the same format as other figures. This violates: "The draw output must include at least: figure type/name, area value, all figure-specific properties with units, and color."

Comment on lines +16 to +17

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates the printing format requirement: "Printing format in draw(): - Must include the word 'Figure: ' followed by the figure type name, 'area: sq. units' and list figure-specific parameters with units 'units', and 'color: ' similar to the provided example." The current draw() prints "Figure: rectangle, ..." which is incorrect for this class. Change the label to "Figure: isosceles trapezoid" and keep the rest of the formatting consistent (area in "sq. units", parameters in "units", then color).

+ horizontalSide + " units, vertical side: "
+ verticalSide + " units, height: "
+ height + " units, color: " + color);
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an extra blank line between draw() and getArea() sections. Remove this redundant empty line to satisfy the style checklist.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates the checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove the redundant blank line before the @OverRide of getArea() so the annotation/method start directly after the previous method.

@Override
public float getArea() {
return (horizontalSide + verticalSide) * (float) height / 2f;
}
}
21 changes: 21 additions & 0 deletions src/main/java/core/basesyntax/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package core.basesyntax;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file contains redundant empty lines (for example immediately after the package declaration). The checklist requires: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Please remove unnecessary blank lines so class/method definitions start without leading empty lines.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates the checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" There is a redundant empty line at line 2. Remove it so the file doesn't start with an unnecessary blank line.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file begins with an empty line right after the package declaration. The checklist states: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Please remove the blank line so the class starts immediately after the package line.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file begins with a redundant empty line after the package declaration. The checklist requires: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Please remove the blank line so the class declaration follows the package declaration directly.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates the checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove the empty line immediately after the package declaration so the class declaration follows the package statement directly.

public class Main {
private static final int MAX_FIGURES_ARRAY = 6;
private static final FigureSupplier figureSupplier = new FigureSupplier();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates the checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" There is an unnecessary blank line at line 6 inside the class. Remove it to comply with the style rule.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an unnecessary empty line between the field declarations and the main method. Remove this empty line to satisfy the checklist requirement: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates the checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove the blank line between the class-level fields and the main method so the method starts immediately after fields.

public static void main(String[] agr) {
Figure[] figures = new Figure[MAX_FIGURES_ARRAY];

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates the checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" There is an unnecessary blank line at line 9 before the first loop. Remove it.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a redundant empty line immediately after the array creation line. Remove this blank line to conform to the checklist's instruction to avoid redundant empty lines.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates the checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove the empty line after the array declaration so the for block begins without a preceding blank line.

for (int i = 0; i < MAX_FIGURES_ARRAY / 2; i++) {
figures[i] = figureSupplier.getRandomFigure();
}
for (int i = MAX_FIGURES_ARRAY / 2; i < MAX_FIGURES_ARRAY; i++) {
figures[i] = figureSupplier.getDefaultFigure();
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates the checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" There is an unnecessary blank line at line 16 before the final loop. Remove it.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an empty line between the second population loop and the final for-each loop. The checklist asks to remove redundant empty lines: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Please remove this blank line.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates the checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove the blank line before the final for loop so the loop starts directly after the preceding code block.

for (Figure allFigures : figures) {
allFigures.draw();
}
}
}
24 changes: 24 additions & 0 deletions src/main/java/core/basesyntax/Rectangle.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package core.basesyntax;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file has an empty line immediately after the package declaration. This violates the checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Please remove the blank line so the class starts directly after the package declaration. {@filecite

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file begins with a redundant empty line after the package declaration. The checklist says: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove the blank line so the class starts immediately after the package declaration.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file begins with an unnecessary empty line after the package declaration. Fix: remove the blank line so the file does not start an implementation with an empty line. This violates the checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates the checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove the blank line immediately after the package declaration so the class declaration follows the package statement without an empty line.

public class Rectangle extends Figure {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates the requirement that callers must be able to obtain the area (add public getArea()). Area is stored in a protected field but there is no public accessor. Add public float getArea() either in the abstract Figure or via an AreaCalculator interface so other code can access the computed area programmatically. See Figure.java for where area is stored.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class extends the abstract Figure, which is being used to provide behavior. This violates the checklist: "Don't use abstract classes to set behavior for classes". The checklist also notes: "All our classes and interfaces should have a single purpose - the draw() and getArea() methods are not conceptually close to each other." Move area behavior into a dedicated interface (e.g., Area with public float getArea()) and have concrete figures implement that interface alongside Drawable instead of relying on an abstract class for behavior.

private final int horizontalSide;
private final int verticalSide;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an empty line before the constructor. The checklist requires: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove this redundant blank line so the constructor starts without a leading empty line. {@filecite

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an empty line immediately before the constructor (line 6). Remove it so the constructor does not begin with an empty line. This violates the checklist: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates the checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove the blank line before the constructor so the constructor header starts directly after the field declarations.

public Rectangle(int horizontalSide, int verticalSide, String color) {
this.horizontalSide = horizontalSide;
this.verticalSide = verticalSide;
this.color = color;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an empty line between the constructor and the @OverRide annotation. The checklist says: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove this empty line so the method starts immediately. {@filecite

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an empty line immediately before the draw() method (line 12). Remove it so the method implementation does not start with a blank line. This violates the checklist: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates the checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove the blank line before the @OverRide draw() annotation so the annotation and method start immediately after the previous block.

@Override
public void draw() {
System.out.println("Figure: rectangle, area: " + getArea() + " sq. units, horizontal side: "
+ horizontalSide + " units, vertical side: "
+ verticalSide + " units, color: " + color);
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an empty line immediately before the getArea() method (line 19). Remove it to comply with: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates the checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove the blank line before the @OverRide getArea() annotation so the annotation and method begin directly after the previous block.

@Override
public float getArea() {
return horizontalSide * verticalSide;
}
}
24 changes: 24 additions & 0 deletions src/main/java/core/basesyntax/RightTriangle.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package core.basesyntax;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an empty line immediately after the package declaration. This violates the checklist: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove redundant empty lines so the class starts directly after the package line.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a redundant empty line right after the package declaration. The checklist requires: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove the blank line so the class starts immediately after the package declaration.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file contains a redundant empty line immediately after the package declaration. The checklist requires: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Please remove the blank line so the file does not start the class with an empty line.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates the checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove the empty line immediately after the package declaration so the class declaration follows the package statement directly.

public class RightTriangle extends Figure {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates the requirement: "All figures must be able to compute their area via a getArea() behavior accessible for any figure instance." The class computes area but does not expose a public getArea() method. Add public float getArea() (or implement an AreaCalculator interface) so callers can obtain the area. Refer to the abstract Figure or an area-specific interface to place this method appropriately.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class extends the abstract Figure which currently carries behavior (getArea). The checklist says: "Don't use abstract classes to set behavior for classes" — move behavioral contracts (area calculation) into a focused interface (e.g., Area) and have concrete figures implement that interface instead of relying on an abstract class for behavior.

private final int firstLeg;
private final int secondLeg;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an empty line between the field declarations and the constructor. The checklist requires: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove this blank line so the constructor follows immediately after the fields.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an unnecessary blank line between the field declarations and the constructor. The checklist requires removing redundant empty lines: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Please remove this blank line.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates the checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove the empty line before the constructor so the constructor starts directly after the field declarations.

public RightTriangle(int firstLeg, int secondLeg, String color) {
this.firstLeg = firstLeg;
this.secondLeg = secondLeg;
this.color = color;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an extra blank line between the constructor and the overridden draw() method. Per the checklist: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove this blank line so the method follows immediately.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates the checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove the empty line before the @OverRide of draw() so the annotation and method start immediately after the previous block.

@Override
public void draw() {
System.out.println("Figure: right triangle, area: " + getArea() + " sq. units, first leg: "
+ firstLeg + " units, second leg: "
+ secondLeg + " units, color: " + color);
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a redundant blank line between the draw() method and the getArea() method. The checklist says: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Please remove this blank line to comply.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates the checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove the empty line before the @OverRide of getArea() so the annotation and method start directly after the preceding code block.

@Override
public float getArea() {
return (float) (firstLeg * secondLeg) / 2;
}
}
22 changes: 22 additions & 0 deletions src/main/java/core/basesyntax/Square.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package core.basesyntax;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file has an empty line right after the package declaration. This violates the checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Please remove the blank line so the class declaration follows the package line immediately.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Violation: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" There is a redundant empty line after the package declaration. Remove the blank line so the class starts immediately after the package statement.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file has a redundant empty line after the package declaration. The checklist requires: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove the blank line so the import/class follows immediately.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant empty line after package declaration. The checklist requires not to begin class/method implementation with an empty line — remove this blank line so the class declaration follows the package statement directly.

public class Square extends Figure {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates the requirement: the description states we must be able to obtain a figure's area: "we can obtain the area of any figure and are able to draw it." You currently compute and store area in the protected field (Figure) but there is no public getArea() (or AreaCalculator interface). Add public float getArea() (or an AreaCalculator interface) so callers can access the area. See Figure.java which holds the protected area.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Violation: "Don't use abstract classes to set behavior for classes" — Square extends Figure which is being used to provide behavior (getArea). The checklist expects behavior to be provided via interfaces rather than abstract classes. Consider moving area behavior into a dedicated interface (e.g., Area) and have Square implement it instead of relying on an abstract superclass.

private final int side;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an empty line between the field declarations and the constructor. The checklist requires: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove this redundant blank line so the constructor starts directly after the fields.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an unnecessary blank line between the field declaration and the constructor. The checklist requires: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove this blank line.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant empty line before the constructor. Remove this blank line so the constructor starts immediately after the field declarations (checklist rule).

public Square(int side, String color) {
this.side = side;
this.color = color;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an empty line between the constructor and the overridden method. Remove this empty line to comply with the checklist: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an empty line immediately after the constructor closing brace and before the @Override draw annotation. The checklist requires: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove this blank line.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant empty line before the @OverRide of draw(). Remove the blank line so the annotation and method start directly after the previous code block (style checklist).

@Override
public void draw() {
System.out.println("Figure: square, area: " + getArea()
+ " sq. units, side: " + side
+ " units, color: " + color);
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an extra blank line between the end of draw() and the @Override getArea() annotation. The checklist requires: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove this blank line.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant empty line before the @OverRide of getArea(). Remove the blank line so the annotation and method start directly after the previous code block (style checklist).

@Override
public float getArea() {
return side * side;
}
}