Skip to content

update#2513

Open
ded7g wants to merge 3 commits intomate-academy:masterfrom
ded7g:develop
Open

update#2513
ded7g wants to merge 3 commits intomate-academy:masterfrom
ded7g:develop

Conversation

@ded7g
Copy link

@ded7g ded7g commented Jan 14, 2026

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

Great job on setting up the abstract class and the inheritance structure! However, a few changes are needed before this can be approved.

The main issue is in MainApp.java, where the program will crash with an ArrayIndexOutOfBoundsException. The machines array is initialized with a size of 2, but you are adding three machines to it. Please make sure the array is large enough to hold all the machine instances.

Additionally, please address the following:

  • There is a typo in the Buldozer class name; it should be Bulldozer as required by the task.
  • The output messages in the doWork() and stopWork() methods for all machine classes are not informative enough [CHECKLIST ITEM #2]. They should clearly state that the machine has started or stopped its work, for example, Truck started its work.

Fixing these points will get your solution ready for approval. Keep up the great work!


✨ 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

public class Excavator extends Machine {
@Override
public void doWork() {
System.out.println("Excavator 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 #2: 'Write informative messages in methods.' The current message is a bit too literal. A more descriptive message, such as 'Excavator started its work,' would better align with the requirements.


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

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: 'Write informative messages in methods.' Similar to the doWork() method, this message could be more informative. For example, 'Excavator stopped its work.' would be more descriptive.

Comment on lines 5 to 8
Machine[] machines = new Machine[2];
machines[0] = new Buldozer();
machines[1] = new Truck();
machines[2] = new Excavator();

Choose a reason for hiding this comment

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

You have initialized an array with a size of 2, but you are attempting to add three elements to it. This will cause an ArrayIndexOutOfBoundsException when the program tries to execute line 8, as the valid indices are 0 and 1. The array size should be large enough to hold all the machines.

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

public class Buldozer extends Machine {

Choose a reason for hiding this comment

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

There's a typo in the class name. According to the task description, it should be Bulldozer.

public class Buldozer extends Machine {
@Override
public void doWork() {
System.out.println("Buldozer 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 #2: 'Write informative messages in methods'. The message should be more descriptive, for example: "Bulldozer started its work".


@Override
public void stopWork() {
System.out.println("Buldozer stopWork");

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: 'Write informative messages in methods'. The message should be more descriptive, for example: "Bulldozer stopped working".

public class Truck extends Machine {
@Override
public void doWork() {
System.out.println("Truck 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 #2: 'Write informative messages in methods'. The message should be more descriptive, like 'Truck started its work', to clearly indicate the action being performed.


@Override
public void stopWork() {
System.out.println("Truck stopWork");

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: 'Write informative messages in methods'. Similar to the doWork method, this message should be more informative, for example: 'Truck stopped working'.

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.

Sorry, the pull request review was unsuccessful for the following reasons:

Warning

No changes were made in the pull request since the last review. Please make sure that you have added files to the pull request and committed the changes.
[CODE: NCM]

If the issue is within your control, please address it.
The next review attempt will automatically launch in about 1 hour.
If you believe this is an error or need assistance, please contact the support team.

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

Excellent progress on this task! You've successfully fixed the previous issues with the array size and the output messages. However, changes are needed because a core requirement is not yet met. The class for the bulldozer is consistently misspelled as Buldozer instead of Bulldozer. To fix this, please: 1. Rename the file Buldozer.java to Bulldozer.java. 2. Update the class declaration inside the file to public class Bulldozer. 3. Correct the object creation in MainApp.java to new Bulldozer(). 4. Update the strings in the doWork() and stopWork() methods to use "Bulldozer". Once you make this correction, your solution will be ready for approval. You're very close!


✨ 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,13 @@
package core.basesyntax;

public class Buldozer extends Machine {

Choose a reason for hiding this comment

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

The class name is still misspelled. According to the task requirements, it should be Bulldozer. Please also update the filename and the output messages on lines 6 and 11 to reflect this change.

public class MainApp {
public static void main(String[] args) {
Machine[] machines = new Machine[3];
machines[0] = new Buldozer();

Choose a reason for hiding this comment

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

The class name Buldozer has a typo. According to the task requirements, it should be Bulldozer.

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

Excellent work on this submission! You've successfully fixed the critical Bulldozer spelling issue, and the program now works perfectly according to the requirements.

I am approving this solution to help you progress, but please note a minor code style issue for future reference. In src/main/java/core/basesyntax/Machine.java, there are a couple of redundant empty lines after the class declaration and between method declarations. It's a good practice to keep the code clean and avoid unnecessary blank lines [CHECKLIST ITEM #1].

Overall, this is a very solid implementation. Keep up the great work!


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

Footnotes

  1. Rate AI review example

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.

This empty line after the class declaration is redundant. This violates checklist item #1: 'Please don't add redundant empty lines to your code.'

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 empty line between the method declarations is also redundant. This violates checklist item #1: 'Please don't add redundant empty lines to your code.'

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