Skip to Main Content

Chapter 13: products won't get reviewed

Hi,
I'm doing the Java 11 25th Aniversary Learningpath. And doing the labs, of chapter 13, I encounter that after changing the code to load all the data from files, I see that the product reviews are loaded, but the products aren't actually Rated. While in the video I see that apparently the code from the presenter has ratings for the product.
Now, going through my code, I reviewed several times that my source matches that from the video. And I think it's logical that my products won't get rated. As I understand it, the .Collectors.toMap(product -> product, product -> loadReviews(product) part in the loadAllData() method does combine the product with the reviews list. But the reviews aren't averaging the rewiew ratings into the product.rating.
Do I miss something?

Kind regards,
Martien

Comments
Post Details
Added on Mar 19 2021
3 comments
32 views