• Post Reply Bookmark Topic Watch Topic
  • New Topic

NullPointerException  RSS feed

 
Michael Brewer
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I hope that I'm posting this to the correct forum. I'm getting the following error when trying to instantiate one of my Beans.

Here's the first 16 lines of my Java code:

My assumption is that it is choking on the second use of "new Date()" althought I can't think why using Date() again would return a null. Can anyone provide some pointers?
 
Dave Vick
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Michael
I only count 13 lines of code in the snippet you posted. However, in the code you did post you have this line:
thisDate.setTime(new Date());
did you instantiate the thisDate variable before using it? In the code you posted you declare it but don't actually instantiate it.
 
Michael Brewer
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're not counting empty lines.
Thanks, that was the fix!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!