Skip to content

Conversation

@yuliia-trandopolos
Copy link

No description provided.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Review Summary

I am requesting changes because some core requirements are not met and checklist rules are violated.

Critical issues to fix:

  • MainApp: You must call both doWork() and stopWork() for each machine within the same loop iteration. Currently they’re called in separate loops, which doesn’t follow the task requirement. Update the loop to iterate once and call both methods for the current Machine (e.g., for (Machine m : machines) { m.doWork(); m.stopWork(); }).
  • Console messages: In Bulldozer.stopWork() and both Excavator methods, the phrases are ungrammatical (e.g., “stopped to working” / “started to working”). Replace with clear English that identifies the machine, such as “Bulldozer stopped working.” and “Excavator started working.” This is required by the checklist.

Minor/style (please fix as well):

  • Remove redundant empty lines: after package and after class declarations in Truck.java, Bulldozer.java, and Excavator.java, and between methods where present. The checklist explicitly disallows extra blank lines after class or method signatures.

You’ve correctly implemented the abstract class and subclass structure—nice work. After addressing the loop and message wording, this should be ready to approve.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

@@ -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.

This line is a redundant empty line after the package/before the class declaration. The checklist explicitly says: "Please don't add redundant empty lines to your code. We don't need them after class declaration or method signature." Remove this extra blank line so the class declaration immediately follows the package statement. See checklist for guidance .

package core.basesyntax;

public class Bulldozer extends Machine {

Choose a reason for hiding this comment

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

This blank line immediately follows the class declaration (public class Bulldozer extends Machine {). The checklist requires avoiding redundant empty lines after class declaration: "Please don't add redundant empty lines to your code. We don't need them after class declaration or method signature." Remove this empty line so the first member/annotation appears directly after the class opening. See checklist .


@Override
public void stopWork() {
System.out.println("Bulldozer stopped to working");

Choose a reason for hiding this comment

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

The console message here is grammatically incorrect: System.out.println("Bulldozer stopped to working");. This violates the checklist item: "Write informative messages in methods. - Use English only and make messages informative - The message should indicate what type of Machine is working right now Truck, Bulldozer or Excavator." Please change it to a clear English message that identifies the machine, for example: System.out.println("Bulldozer stopped working");. See the checklist for the exact requirement and this file for the current line .


@Override
public void doWork() {
System.out.println("Excavator started to working.");

Choose a reason for hiding this comment

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

This message is grammatically incorrect and violates the checklist requirement: "Write informative messages in methods. - Use English only and make messages informative - The message should indicate what type of Machine is working right now Truck, Bulldozer or Excavator." Change the text "Excavator started to working." to a clear English message, for example: "Excavator started working." so it correctly indicates the machine and action.


@Override
public void stopWork() {
System.out.println("Excavator stopped to working.");

Choose a reason for hiding this comment

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

This message is grammatically incorrect and violates the checklist requirement: "Write informative messages in methods. - Use English only and make messages informative - The message should indicate what type of Machine is working right now Truck, Bulldozer or Excavator." Change the text "Excavator stopped to working." to a clear English message, for example: "Excavator stopped working." so it correctly indicates the machine and action.

package core.basesyntax;

public class Excavator extends Machine {

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 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." Remove the blank line at this location so the first member (annotation/field/method) follows the class declaration without an extra empty line.

public void doWork() {
System.out.println("Excavator started to working.");
}

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 end of the first method and the @Override of the next method. This also violates: "Please don't add redundant empty lines to your code. We don't need them after class declaration or method signature." Remove the blank line here to keep methods compact and consistent with the checklist guidance.

Comment on lines 7 to 15
for (Machine machine : machines) {
machine.doWork();
}

System.out.println("---All machines finished their tasks---");

for (Machine machine : machines) {
machine.stopWork();
}

Choose a reason for hiding this comment

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

This does not follow the task instruction to call both methods per element. The description requires: "In the MainApp class create a Machine array with Truck, Bulldozer, and Excavator and call methods doWork() and stopWork() in a loop."

Currently you call doWork() for all machines in one loop and stopWork() for all machines in a separate loop (lines shown). Instead, iterate once and call both methods for the current Machine, for example:

for (Machine machine : machines) {
    machine.doWork();
    machine.stopWork();
}

This ensures each machine has both methods invoked in the same iteration, as required.

@@ -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.

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 unnecessary blank line after the package declaration. It's redundant and not needed (line 2).

package core.basesyntax;

public class Truck extends Machine {

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: "Please don't add redundant empty lines to your code. We don't need them after class declaration or method signature." Remove the redundant blank line immediately after the class declaration (line 4).

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Review Summary

I’m requesting changes because core requirements and checklist items are not fully met. The MainApp currently uses two separate loops for doWork() and stopWork(), which violates the requirement to call both methods for each machine within the same loop iteration; replace the two loops with one that calls m.doWork(); m.stopWork(); per element. In Bulldozer and Excavator, console messages are ungrammatical and must clearly identify the machine type [CHECKLIST ITEM #2]; update them to messages like "Bulldozer stopped working." and "Excavator started/stopped working." so output is clear and consistent. Several files (Bulldozer.java, Excavator.java, Machine.java, Truck.java) contain redundant blank lines after the package, class declarations, and between methods [CHECKLIST ITEM #1]; remove those extra lines to keep formatting compact. Once these are fixed, the implementation should meet both the functional and style requirements. Good job on creating the class hierarchy, using public overrides, and leveraging a Machine[] for polymorphism—just a few adjustments left to align with the task and checklist.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example


@Override
public void stopWork() {
System.out.println("Bulldozer stopped to working");

Choose a reason for hiding this comment

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

This violates checklist item #2: "Messages printed by methods must be in English and informative, identifying the specific Machine type (Truck, Bulldozer, Excavator)." The string is ungrammatical — replace it with a correct message such as:

System.out.println("Bulldozer stopped working.");

This ensures the message is clear, grammatical, and matches the required format.

@@ -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.

This violates checklist item #1: "Avoid redundant empty lines after class declarations and method signatures; keep formatting compact." Remove the redundant blank line after the package statement to keep formatting compact.

package core.basesyntax;

public class Bulldozer extends Machine {

Choose a reason for hiding this comment

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

This violates checklist item #1: "Avoid redundant empty lines after class declarations and method signatures; keep formatting compact." Remove the redundant blank line immediately after the class declaration so the @Override annotation follows the class header without an extra empty line.

public void doWork() {
System.out.println("Bulldozer started working");
}

Choose a reason for hiding this comment

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

This violates checklist item #1: "Avoid redundant empty lines after class declarations and method signatures; keep formatting compact." Remove the blank line between the first method block and the next @Override to avoid unnecessary vertical spacing between methods.


@Override
public void doWork() {
System.out.println("Excavator started to working.");

Choose a reason for hiding this comment

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

This print statement uses incorrect English. It violates the requirement: "Messages printed by methods must be in English and informative, identifying the specific Machine type (Truck, Bulldozer, Excavator). [CHECKLIST ITEM #2]".

Consider replacing the string with: "Excavator started working." so the message is grammatically correct and identifies the machine.

@@ -0,0 +1,8 @@
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 redundant blank line immediately after the package statement. This violates checklist item #1: "Avoid redundant empty lines after class declarations and method signatures; keep formatting compact. [CHECKLIST ITEM #1]" Remove the empty line at line 2 so the package declaration is followed directly by the class declaration or imports (if any).

package core.basesyntax;

public abstract class Machine {

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 right after the class declaration. This violates checklist item #1: "Avoid redundant empty lines after class declarations and method signatures; keep formatting compact. [CHECKLIST ITEM #1]" Remove the empty line at line 4 so the class body starts immediately after the declaration.

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 two abstract method declarations. This violates checklist item #1: "Avoid redundant empty lines after class declarations and method signatures; keep formatting compact. [CHECKLIST ITEM #1]" Remove the empty line at line 6 so the method declarations are adjacent and the class remains compact.

Comment on lines 7 to 15
for (Machine machine : machines) {
machine.doWork();
}

System.out.println("---All machines finished their tasks---");

for (Machine machine : machines) {
machine.stopWork();
}

Choose a reason for hiding this comment

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

The current code iterates twice: one loop calls doWork() and later another loop calls stopWork(). This violates the task requirement: "In the MainApp class create a Machine array with Truck, Bulldozer, and Excavator and call methods doWork() and stopWork() in a loop." Quote from the task description: "In the MainApp class create a Machine array with Truck, Bulldozer, and Excavator and call methods doWork() and stopWork() in a loop." You should instead use a single loop that, for each Machine m, calls m.doWork(); followed immediately by m.stopWork();. After that single loop you can print the "All machines finished" message. Concrete suggestion: replace the two separate for loops with:

for (Machine m : machines) {
    m.doWork();
    m.stopWork();
}
System.out.println("---All machines finished their tasks---");

This change ensures the behavior required by the task description and preserves polymorphic usage of Machine references.

Comment on lines 2 to 9

public class Truck extends Machine {

@Override
public void doWork() {
System.out.println("Truck started working.");
}

Choose a reason for hiding this comment

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

This violates checklist item #1: "Please don't add redundant empty lines to your code." Remove the blank lines after the package declaration and after the class/method signatures to keep the formatting compact (specifically remove the empty lines at lines 2, 4, and 9).

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Review Summary

Here is my approval to help you continue progressing while learning. Functionally, your solution is solid: Machine is abstract with two public methods, subclasses (Truck, Bulldozer, Excavator) override them correctly, and MainApp uses a single loop to call doWork() then stopWork() on each instance.

Issues to fix next (style):

  • [CHECKLIST ITEM #1] Remove redundant empty lines:
    • src/main/java/core/basesyntax/Bulldozer.java: delete the blank line after the package statement and the extra blank line between doWork() and stopWork() (around line 7).
    • src/main/java/core/basesyntax/Excavator.java: remove the blank line after package and the extra blank line between the two methods.
    • src/main/java/core/basesyntax/Machine.java: remove the blank line after package and the blank line between the two abstract method declarations.
    • src/main/java/core/basesyntax/Truck.java: remove the blank line after package and the blank line between methods.

Why this matters: keeping files compact improves readability and follows the project style rules. Hint: configure your IDE formatter to collapse multiple blank lines and avoid empty lines after class/method signatures. Great work on the class hierarchy and clear English messages—fixing the formatting will make it excellent.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

@@ -0,0 +1,13 @@
package core.basesyntax;

Choose a reason for hiding this comment

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

This violates checklist item #1: "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 after the package declaration so the file begins directly with the class declaration.

public void doWork() {
System.out.println("Bulldozer started working.");
}

Choose a reason for hiding this comment

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

This violates checklist item #1: "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 between the two methods (after } on line 7) so there is no extra blank line between doWork() and stopWork().

@@ -0,0 +1,13 @@
package core.basesyntax;

Choose a reason for hiding this comment

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

This violates checklist item #1: "Please don't add redundant empty lines to your code." Remove the blank line after the package declaration so the package statement is immediately followed by the class declaration.

public void doWork() {
System.out.println("Excavator started working.");
}

Choose a reason for hiding this comment

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

This violates checklist item #1: "Please don't add redundant empty lines to your code." Remove the unnecessary blank line between the doWork() and stopWork() methods to keep formatting compact and consistent.

@@ -0,0 +1,7 @@
package core.basesyntax;

Choose a reason for hiding this comment

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

This violates checklist item #1: "Please don't add redundant empty lines to your code. We don't need them after class declaration or method signature." Remove the redundant blank line after the package statement so the package is immediately followed by the class declaration.


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.

This violates checklist item #1: "Please don't add redundant empty lines to your code. We don't need them after class declaration or method signature." Remove the redundant blank line between the two method declarations so the methods follow each other without extra empty lines.

@@ -0,0 +1,13 @@
package core.basesyntax;

Choose a reason for hiding this comment

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

This violates checklist item #1: "Please don't add redundant empty lines to your code. We don't need them after class declaration or method signature." Remove the blank line after the package statement so the package is immediately followed by the class declaration.

public void doWork() {
System.out.println("Truck started working.");
}

Choose a reason for hiding this comment

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

This violates checklist item #1: "Please don't add redundant empty lines to your code. We don't need them after class declaration or method signature." Remove the blank line between the two method blocks so the methods are adjacent without an extra empty line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants