Skip to content
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

History Servlet returning same entry many times #10

Closed
njscholfield opened this issue Apr 16, 2017 · 1 comment
Closed

History Servlet returning same entry many times #10

njscholfield opened this issue Apr 16, 2017 · 1 comment
Assignees

Comments

@njscholfield
Copy link
Collaborator

When I call the history servlet it just returns the last entry saved in the database for the user over and over again.

[
  {"UID":-1,"Title":"Pittsburgh, PA 15213, USA","Latitude":"40.4379259","Id":130,"Longitude":"-79.9556424","Date":"Sun Apr 16 00:00:00 EDT 2000","Name":"TestAccount"},
  {"UID":-1,"Title":"Pittsburgh, PA 15213, USA","Latitude":"40.4379259","Id":130,"Longitude":"-79.9556424","Date":"Sun Apr 16 00:00:00 EDT 2000","Name":"TestAccount"},
  {"UID":-1,"Title":"Pittsburgh, PA 15213, USA","Latitude":"40.4379259","Id":130,"Longitude":"-79.9556424","Date":"Sun Apr 16 00:00:00 EDT 2000","Name":"TestAccount"}
]

It returned more than 3 copies though. I think it is returning the right number of things, but they are all identical...

Obviously it should be returning each of the elements the elements in the database for the user instead.

@erl67
Copy link
Owner

erl67 commented Apr 16, 2017

Fixed, the JsonArray was only seeing the memory pointer of the same JsonObject, changed so that the JsonObject is created new each time inside the iteration loop of HistoryList

@erl67 erl67 closed this as completed Apr 16, 2017
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

No branches or pull requests

2 participants