aspose file tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Removing RecordNotFoundException from subclass Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Groovy Fundamentals video training course this week in the Groovy forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Removing RecordNotFoundException from subclass" Watch "Removing RecordNotFoundException from subclass" New topic
Author

Removing RecordNotFoundException from subclass

Jonathan Elkharrat
Ranch Hand

Joined: Dec 31, 2008
Posts: 170

i think the RecordNotFoundException in the writing methods is not necessary and here's why:

since the lock method already check that the record exist, and the writing methods
make sure the record is locked, that mean one thing ---> the record exist!

just making a point..


SCJP 5, SCWCD 5, SCBCD 5
Roel De Nijs
Sheriff

Joined: Jul 19, 2004
Posts: 6855
    
  24



But you are not the first one, that point is already made several times (I made the same remark more than 2 years ago, and not onlt for the write methods, but also for unlock-method )


SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
OCAJP 7
Jonathan Elkharrat
Ranch Hand

Joined: Dec 31, 2008
Posts: 170

now that you mention it, it's quite contradictory to have a RecordNotFoundException in the unlock method.
suppose someone lock a record, delete it and then call the unlock.
i just found a bug in my code now thanks to you
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Removing RecordNotFoundException from subclass