Bug 270

Summary: I found that the result of each recommended movie is incorrect. The company list of each movie has the same value. Different movie produced by different companies. I think the array list to store company object is using wrongly.
Product: Movie Recommendation System Reporter: Fung Lam <funlam6-c>
Component: Movie Recommendation SystemAssignee: David Leung <davidltk123>
Status: RESOLVED FIXED    
Severity: major    
Priority: High    
Version: unspecified   
Hardware: PC   
OS: Windows   
Attachments: screenshot of output

Description Fung Lam 2018-11-29 23:46:15 HKT
Created attachment 23 [details]
screenshot of output

Steps to reproduce:
Run the programme.
Input the valid answer.
For example: 
Search "avatar", Prefer Genre “1”, Prefer Country “1”, Prefer Language “1”, Prefer years “1998-2018”, Prefer runtimes “80-200”.
Compare the expected result and the actual result.


Expected result:
best 1 movie

Production Companies:
[id: 289 name: Ingenious_Film_Partners, id: 306 name: Twentieth_Century_Fox_Film_Corporation, id: 444 name: Dune_Entertainment]...

best 2 movie
Production Companies:
[id: 264 name: Studio_Babelsberg, id: 420 name: Marvel_Studios, id: 3036 name: Walt_Disney_Studios_Motion_Pictures, id: 84424 name: Vita-Ray_Dutch_Productions_(III)]...

best 3 movie
Production Companies:
[id: 2 name: Walt_Disney_Pictures, id: 130 name: Jerry_Bruckheimer_Films, id: 20478 name: Moving_Picture_Company_(MPC)]

Actual result:
best 1 movie
Production Companies:
[id: 289 name: Ingenious_Film_Partners, id: 306 name: Twentieth_Century_Fox_Film_Corporation, id: 444 name: Dune_Entertainment]...

best 2 movie
Production Companies:
[id: 289 name: Ingenious_Film_Partners, id: 306 name: Twentieth_Century_Fox_Film_Corporation, id: 444 name: Dune_Entertainment]...

best 3 movie
Production Companies:
[id: 289 name: Ingenious_Film_Partners, id: 306 name: Twentieth_Century_Fox_Film_Corporation, id: 444 name: Dune_Entertainment]...
Comment 1 Fung Lam 2018-11-29 23:55:08 HKT
I found that the JsonToCompany class uses the same array list to store company objects for all movie, hence they have the same value. Now I have changed the code and create different array list store the related company information to each movie. The output is correct now.