-
Notifications
You must be signed in to change notification settings - Fork 998
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
First solution, basic tasks solved #1014
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work on implementing the features and adhering to the checklist requirements! 👍 However, there are a few areas that need some attention to ensure the code is robust and maintainable. Specifically, consider handling potential exceptions more gracefully when parsing product information, optimizing instance creation by checking the map first, and refining exception messages for better clarity. Keep up the good work, and with these adjustments, your code will be even stronger! 💪
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
…replaced Map into separate class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there! 👋 It looks like you've done a great job overall, but there are a few critical issues that need addressing before we can merge your Pull Request. Specifically, there are some potential bugs related to object instantiation and exception handling that could affect the functionality of your code. Also, don't forget to add the @Target
annotation to your custom annotations for clarity on their usage. Keep up the good work, and once these issues are resolved, your code will be in great shape! 🚀
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
src/main/java/mate.academy/service/impl/ProductServiceImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/mate.academy/service/impl/ProductServiceImpl.java
Outdated
Show resolved
Hide resolved
…target annotation, changed order in getInstatnce() method, gathered exceptions in ReflectiveOperationException
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work on your Pull Request! 🎉 Your use of annotations and dependency injection is on point. Remember to include unit tests for singleton functionality, as they are essential for verifying your code's correctness outside of the main application flow. Keep up the good work, and always aim to refine and improve your code! 👍
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
// Please test your Injector here. Feel free to push this class as a part of your solution | ||
Injector injector = Injector.getInjector(); | ||
ProductService productService = null; | ||
ProductService productService = (ProductService) injector.getInstance(ProductService.class); | ||
|
||
// Checking the singleton pattern (on AI mentor request) | ||
Injector injectorSecond = Injector.getInjector(); | ||
if (!injector.equals(injectorSecond)) { | ||
throw new RuntimeException("The singleton pattern doesn't work correctly"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not necessary to test the singleton pattern functionality within the main method of the application. This should be covered by dedicated unit tests.
No description provided.