Re: Help with NPE in EOCustomObject.willReadRelationship()
Re: Help with NPE in EOCustomObject.willReadRelationship()
- Subject: Re: Help with NPE in EOCustomObject.willReadRelationship()
- From: Peter Vandoros <email@hidden>
- Date: Wed, 29 Apr 2009 14:57:47 +1000
Hi Chuck,
Thanks for responding Chuck :)
Just to be clear, I don't touch the deleted objects in this
notification, I simply had debugging enabled and started getting
errors :)
On 29/04/2009, at 2:40 PM, Chuck Hill wrote:
- The NPE occurs in a debug statement that prints the
NSNotification object passed to my
MyClass.editingContextDidSaveChanges() method before any processing
occurs.
That is not going to have happy results...
What I don't understand is why the deleted objects are part of the
notification if they're not meant to be used at all?
Obviously deleted EO's shouldn't have editingContext()'s, but I
believe that EOCustomObject.eoDescription() should not fire _any_
faults
I don't think that I would agree with that. The information from
firing faults can be very useful. You can certainly re-implement it
to not fire the faults or output something very limited if
editingContext() == null. That is a reasonable suggestion to make
in a bug report.
I should clarify:
EOCustomObject.eoDescription() should not fire _any_ faults _when_ the
EO is in an invalid state (eg. editingContext() == null)
.. and yes, I agree with you that output much more limited should be
used instead.
or EOCustomObject.willReadRelationship() should check to see if
editingContext() is null when 'object' is a fault.
And throw an exception. That is a reasonable suggestion to make in
a bug report.
Technically, it is throwing an exception now :) ... so the only
reasonable exception to throw should again a NPE but with a reason as
to the cause
That would make me nervous. If this method is called when
editingContext() == null, that indicates to me a coding mistake. An
exception seems appropriate and the NPE is not exactly helpful.
I agree with you that it is a mistake when called and editingContext()
== null, but in my case, I am simply printing the NSNotification
object for debugging... that surely shouldn't cause a NPE?
Regards
Peter Vandoros
Software Engineer
Etech Group Pty Ltd
Level 3/21 Victoria St
Melbourne VIC 3000
Australia
Ph: +61 3 9639 9677
Fax: +61 3 9639 9577
----------------------------------
IMPORTANT: This e-mail message and any attachments are confidential
and may be privileged. If received in error, please reply to this
message and destroy all copies and any attachments. You should check
this message and any attachments for viruses or defects. Our liability
is limited to resupplying any affected message or attachments. For
more information about Etech Group, please visit us at http://www.etechgroup.com.au
.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden