Task is done! - #1269
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
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
|
|
||
| public class Main { | ||
|
|
||
| public static void main(String[] args) { |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
Checklist item #4 violation: TODO comment still present - should be removed as the logging on the next line fulfills this requirement
| } catch (AuthenticationException e) { | ||
| e.printStackTrace(); | ||
| return; | ||
| logger.error("Got problem with user login: " + e); |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
Logger should use AuthenticationServiceImpl.class, not OrderServiceImpl.class
|
|
||
| private static final Logger logger = LogManager.getLogger(OrderServiceImpl.class); | ||
|
|
||
| @Override |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Remove this TODO comment
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
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
| import mate.academy.service.OrderService; | ||
| import mate.academy.service.OrderServiceImpl; | ||
| import org.apache.logging.log4j.LogManager; | ||
| import org.apache.logging.log4j.Logger; |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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! ✨
No description provided.