Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jv-lottery-solution #1765

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

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

Thank you for your hard work on this project! There are a few critical issues that need to be addressed before we can approve the pull request. The most important ones are:

  1. Enum Naming Convention: The enum color should be renamed to Color to adhere to Java naming conventions. This is crucial for maintaining consistency and readability in your code.

  2. Static Method Usage: The getRandomColor() method in ColorSupplier is currently static, which goes against the checklist requirements. It's recommended to use an instance method instead, which will improve the design and flexibility of your code.

These changes are necessary to ensure that the code meets the core requirements and functions as expected. Once these issues are resolved, your code will be in great shape! Keep up the great work, and don't hesitate to reach out if you have any questions or need further assistance. 😊

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

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

public class ColorSupplier {
public String getRandomColor() {
return null;
public static color getRandomColor() {

Choose a reason for hiding this comment

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

The return type color should be capitalized to Color to match Java naming conventions for enums. Ensure the enum is defined as Color in your project.

public class ColorSupplier {
public String getRandomColor() {
return null;
public static color getRandomColor() {

Choose a reason for hiding this comment

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

Avoid using static methods as per the checklist. Consider creating an instance of ColorSupplier and using an instance method instead.

public class Lottery {
private static final Random RANDOM = new Random();
public Ball getRandomBall() {
color randomColor = ColorSupplier.getRandomColor();

Choose a reason for hiding this comment

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

The type color should be capitalized to Color to match Java naming conventions for enums. Ensure the enum is defined as Color in your project.

public class Lottery {
private static final Random RANDOM = new Random();
public Ball getRandomBall() {
color randomColor = ColorSupplier.getRandomColor();

Choose a reason for hiding this comment

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

Avoid using static methods as per the checklist. Consider creating an instance of ColorSupplier and using an instance method instead.

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

public enum color { RED, BLUE, GREEN, YELLOW, ORANGE, PURPLE, WHITE, BLACK;

Choose a reason for hiding this comment

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

Rename the enum color to Color to follow Java naming conventions for types, which use PascalCase.

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: 7]

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

@VitalikK5 VitalikK5 closed this Feb 7, 2025
@VitalikK5 VitalikK5 reopened this Feb 7, 2025
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.

Great job on addressing the previous issues! 🎉 Your code now adheres to the task requirements and constraints. The Application, Ball, Color, ColorSupplier, and Lottery classes are all well-implemented. The Color enum follows Java naming conventions, and the ColorSupplier class correctly uses an instance method for getRandomColor().

While the code is approved, ensure that the Lottery class and its getRandomBall() method are implemented correctly to avoid runtime errors. Also, double-check that the Ball constructor accepts a String for the color.

Keep up the good work, and remember to review the comments to improve your code further. Address any critical issues in future projects to enhance your coding skills. Keep learning and growing! 🚀

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

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