This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Collection applicantList = null;  RSS feed

 
Higgledy Smith
Ranch Hand
Posts: 193
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I keep getting an exception on the code below. Can someone explain what I am doing wrong?

java.lang.ArrayIndexOutOfBoundsException: 8



[ December 02, 2007: Message edited by: Higgledy Smith ]
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which line of code is causing the exception?
 
Higgledy Smith
Ranch Hand
Posts: 193
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Marc,

I don't know which line I get the error. applicantList contains 4 items which which all hit the System.out.println line cause I see 4 string values in the console but the next thing I know is I get the exception.

This is the code that "loads" the ArrayList:


query.getResultList() returns a List which I cast to ArrayList, don't know if this is the correct way.

Thank you.
Higgledy
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The error message should provide a line number. For example...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!