Re: nullPointerException in abstract class
- From: Mark Space <markspace@xxxxxxxxxxxxxx>
- Date: Sun, 30 Sep 2007 02:08:00 GMT
Matt Humphrey wrote:
I don't see how the line you've marked could cause a NullPointerException. Furthermore, if it did, it would certainly stop the program at that point.
The program might continue running if the exception is being caught somewhere else. This method would certainly terminate, however.
Looking at the source for Date(), it calls System.currentTimeMillis() to set a default date. Maybe the platform you have doesn't support currentTimeMillis() (it's a native method), or is having some error related to it?
I would try initializing birthDate with something besides the default constructor, see if that makes a different. Also, you might want to add some logging and error trapping. If the current error message isn't enough to allow you to figure out whats going on, add some of your own.
You could try birthDate = new Date( 0L ); which will avoid calling the native method, plus any overhead it has.
.
- References:
- nullPointerException in abstract class
- From: OldPro
- Re: nullPointerException in abstract class
- From: Matt Humphrey
- nullPointerException in abstract class
- Prev by Date: Re: java beginnings
- Next by Date: Re: data transport
- Previous by thread: Re: nullPointerException in abstract class
- Next by thread: Re: nullPointerException in abstract class
- Index(es):
Relevant Pages
|