java - Can anyone help me to find what is wrong in below code? -
i not getting updated list method passed references
list<person> beans = new arraylist<person>(); boolean alreadypresent = ispersonpresentonsolr(solrserver, beans); // beans.size() 0 boolean ispersonpresentonsolr(solrserver solrserver, list<person> beans) { queryresponse response = solrserver.query(solrqry); beans = response.getbeans(person.class); //beans.size() 5 }
you should not do
beans = response.getbeans(person.class); // lost reference of object. c++ way, //but not works java
you should do
list<person> newbeans = response.getbeans(person.class); beans.addall(newbeans);
Comments
Post a Comment