Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<version>1.0-SNAPSHOT</version>

<properties>
<jdk.version>17</jdk.version>
<jdk.version>11</jdk.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.checkstyle.plugin.version>3.1.1</maven.checkstyle.plugin.version>
Expand Down
12 changes: 12 additions & 0 deletions src/main/java/core/basesyntax/MainApp.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
package core.basesyntax;

import core.basesyntax.models.Bulldozer;
import core.basesyntax.models.Excavator;
import core.basesyntax.models.Machine;
import core.basesyntax.models.Truck;

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 here. This violates the checklist item: "Please don't add redundant empty lines to your code." Consider removing this blank line to keep the file formatting consistent with the project's style guide .

public class MainApp {
public static void main(String[] args) {
Machine[] machines = new Machine[] {new Bulldozer(), new Excavator(), new Truck()};

for (Machine machine : machines) {
machine.doWork();
machine.stopWork();
}
}
}
13 changes: 13 additions & 0 deletions src/main/java/core/basesyntax/models/Bulldozer.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package core.basesyntax.models;

Choose a reason for hiding this comment

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

This violates checklist item "Please don't add redundant empty lines to your code." Consider removing the blank line here; there is no need for an empty line after the package declaration.

public class Bulldozer extends Machine {
@Override
public void doWork() {
System.out.println("Bulldozer started its work");
}

Choose a reason for hiding this comment

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

This violates checklist item "Please don't add redundant empty lines to your code." Consider removing this blank line between method implementations to keep the file concise and consistent with the project's style guidance.

@Override
public void stopWork() {
System.out.println("Bulldozer stopped working");
}
}
13 changes: 13 additions & 0 deletions src/main/java/core/basesyntax/models/Excavator.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package core.basesyntax.models;

Choose a reason for hiding this comment

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

This violates checklist item: "Please don't add redundant empty lines to your code." The blank line at line 2 (between the package declaration and the class declaration) is unnecessary — please remove it to match the requested style guidance (checklist) .

public class Excavator extends Machine{
@Override
public void doWork() {
System.out.println("Excavator started its work");
}

Choose a reason for hiding this comment

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

This violates checklist item: "Please don't add redundant empty lines to your code." The blank line at line 8 (between the end of doWork() and the next @Override) is redundant — please remove it to keep the code compact and consistent with the checklist guidance (checklist) .

@Override
public void stopWork() {
System.out.println("Excavator stopped working");
}
}
7 changes: 7 additions & 0 deletions src/main/java/core/basesyntax/models/Machine.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package core.basesyntax.models;

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 before the class declaration. This violates the checklist item: "Please don't add redundant empty lines to your code. We don't need them after class declaration or method signature." Consider removing this blank line so the package and class declaration are adjacent (no extra empty line) .

public abstract class Machine {
public abstract void doWork();

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 doWork() and stopWork() method signatures. This violates the checklist item: "Please don't add redundant empty lines to your code. We don't need them after class declaration or method signature." Remove the empty line so the two abstract methods appear consecutively without extra spacing .

public abstract void stopWork();
}
13 changes: 13 additions & 0 deletions src/main/java/core/basesyntax/models/Truck.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package core.basesyntax.models;

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. This violates the checklist item: "Please don't add redundant empty lines to your code." Consider removing this blank line to keep the file tidy and consistent with the project's style guide.

public class Truck extends Machine {
@Override
public void doWork() {
System.out.println("Truck started its work");
}

Choose a reason for hiding this comment

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

This blank line between methods is redundant. This violates the checklist item: "Please don't add redundant empty lines to your code." Remove the empty line between the end of doWork() and the @Override for stopWork() to follow the style guidance.

@Override
public void stopWork() {
System.out.println("Truck stopped working");
}
}
Loading