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

Popular posts from this blog

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -