Skip to content

Task is done! - #1269

Open
Seekerfn wants to merge 3 commits into
mate-academy:masterfrom
Seekerfn:master
Open

Task is done!#1269
Seekerfn wants to merge 3 commits into
mate-academy:masterfrom
Seekerfn:master

Conversation

@Seekerfn

Copy link
Copy Markdown

No description provided.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Summary

Your solution has critical violations of explicit checklist requirements that must be fixed before approval. TODO comments remain in multiple files (AuthenticationServiceImpl.java lines 14 and 16, OrderServiceImpl.java lines 16, 17, and 35) - checklist item #4 explicitly requires removing all TODO comments before submission. Additionally, the logger in AuthenticationServiceImpl.java is incorrectly initialized with OrderServiceImpl.class instead of its own class (AuthenticationServiceImpl.class), which breaks proper log categorization. Please remove all TODO comments and correct the logger class references to match their respective files.


✨ 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 Main {

public static void main(String[] args) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checklist item #4 violation: TODO comment still present - the comment on line 14 should be removed as the logging on the next line fulfills this requirement

import mate.academy.service.OrderService;
import mate.academy.service.OrderServiceImpl;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Logger is initialized with wrong class. Should use AuthenticationServiceImpl.class instead of OrderServiceImpl.class for proper log categorization


public static void main(String[] args) {
Logger logger = LogManager.getLogger(OrderServiceImpl.class);
AuthenticationService authenticationService = new AuthenticationServiceImpl();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checklist item #4 violation: TODO comment still present - should be removed as the logging on the next line fulfills this requirement

Comment thread src/main/java/mate/academy/Main.java Outdated
} catch (AuthenticationException e) {
e.printStackTrace();
return;
logger.error("Got problem with user login: " + e);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checklist item #3 violation: Error message uses string concatenation. Use parameter placeholder for better performance: logger.error("Got problem with user login", e)


@Override
public User login(String login, String password) throws AuthenticationException {
//TODO: add corresponding log message about method login was called

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This violates checklist item #4: Remove all TODO comments before submitting solution. The TODO comment here is not needed since the log message is already implemented on line 15.

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

public class OrderServiceImpl implements OrderService {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Logger should use AuthenticationServiceImpl.class, not OrderServiceImpl.class


private static final Logger logger = LogManager.getLogger(OrderServiceImpl.class);

@Override

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remove this TODO comment - the logging is already implemented on line 15


List<Product> products = getAllProductsFromShoppingCart(userId);
Order order = new Order(products, userId);
// NOTE: In production ready code this order identifier should be generated by DB

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Use parameter placeholders instead of string concatenation: logger.error("Got problem with user login", e)


@Override
public Order completeOrder(Long userId) {
// TODO: add log message about method completeOrder was called

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remove this TODO comment - the logging is already implemented on line 17

Product xiaomi = new Product("Xiaomi 12", BigDecimal.valueOf(499));
List<Product> products = List.of(iphone, macBook, xiaomi);
logger.info("Method successfully fetched data");
// TODO: add log message about successful fetched data from DB

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remove this TODO comment

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Summary

Your submission has made progress by removing all TODO comments, but one critical issue remains unresolved that was explicitly flagged in previous reviews. In AuthenticationServiceImpl.java at line 10, the logger is still incorrectly initialized with LogManager.getLogger(OrderServiceImpl.class) instead of LogManager.getLogger(AuthenticationServiceImpl.class). This breaks proper log categorization — each service class should initialize its own logger with its own class reference, not another class's reference. This is checklist item #4 which currently fails. Please fix the logger initialization in AuthenticationServiceImpl.java by changing it to reference its own class. Once this is corrected, your implementation will be ready for approval.


✨ 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

import mate.academy.service.OrderService;
import mate.academy.service.OrderServiceImpl;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The logger is incorrectly referencing OrderServiceImpl.class instead of AuthenticationServiceImpl.class. This breaks proper log categorization and was flagged in the previous review. Change to: LogManager.getLogger(AuthenticationServiceImpl.class)


public class AuthenticationServiceImpl implements AuthenticationService {

private static final Logger logger = LogManager.getLogger(OrderServiceImpl.class);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Logger is incorrectly initialized with OrderServiceImpl.class instead of AuthenticationServiceImpl.class. This breaks proper log categorization - each class should have its own logger referencing itself.

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

public class OrderServiceImpl implements OrderService {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Logger is incorrectly referencing OrderServiceImpl.class instead of AuthenticationServiceImpl.class. Each class should initialize its logger with its own class for proper log categorization. Change to: LogManager.getLogger(AuthenticationServiceImpl.class)

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Summary

Your solution is approved! All previous critical issues have been resolved — AuthenticationServiceImpl.java now correctly initializes its logger with LogManager.getLogger(AuthenticationServiceImpl.class), and all other service classes follow the same pattern. No System.out.println() or e.printStackTrace() calls remain, and your .gitignore properly excludes the logs/ directory. Log messages are informative with proper {} parameterization. Note: log4j2.xml was listed as a changed file but wasn't included in the review context — please verify this configuration file exists with both File and Console appenders configured. This is an educational approval to help you progress while learning — the main implementation is solid and meets all checklist requirements. Keep up the good work!


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

Footnotes

  1. Rate AI review example

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