• Post Reply Bookmark Topic Watch Topic
  • New Topic

when debugging, my code jump to PoolThread  RSS feed

 
majid nakit
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have
List<class1> list1 = null :
// class1 has properties ( String name)
List list2 = null

list1 = object1.method(...);
for(class1 person : list1) {
list2.add(person.getName()); <------ jump to PoolThread
}

is anything wrong in the above code ?
Thanks, your help is appreciated.
 
sreenivasarao mydukuri
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
majid nakit wrote:Hi,

I have
List<class1> list1 = null :
// class1 has properties ( String name)
List list2 = null

list1 = object1.method(...);
for(class1 person : list1) {
list2.add(person.getName()); <------ jump to PoolThread
}

is anything wrong in the above code ?
Thanks, your help is appreciated.



Hi majid nakit,

your code is right ,
you forgot to initialize list variables that is the problem please observe the fallowing attached code,

List<class1> list1 = new ArrayList<class1>();
// class1 has properties ( String name)
List<String > list2 =new ArrayList<String>();;
class1 c=new class1();
c.setName("MSR");
list1.add(c);
//list1 = object1.method(...);
for(class1 person : list1) {
System.out.println("testing");
list2.add(person.getName()); //<------ jump to PoolThread
}
System.out.println(list2);
 
majid nakit
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks ,
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!