Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RecordNotFoundException

 
mohini lalwani
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try {
// Determine where in the file this record should be.
// note: if this is null the record does not exist
locationInFile = recordNumbers.get(recNo);
if(locationInFile==0L)
{
throw new RecordNotFoundException("Record not found.");
}

recordNumbers is hashmap where key is recNo and value is offset of record

is it right condition to throw RecordNotFoundException ???

pleset let me know
 
satishkumar janakiraman
Ranch Hand
Posts: 334
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Your implementation seems to be okay. As per my understanding, this exception will be thrown when you provide implementation for

The above method requires the record no and will look up into the map. If the record is not available, RecordNotFoundException will be thrown.

I read your earlier posts couple of weeks ago and found the incorrect implementation of readRecord method. Check your implementation again

sat
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic