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

Data Class - FBN

 
Akshay Sharma
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can I go about changing the signature of the lock method.
Actually I wanted it to return me a boolean signifying whether lock could be obtained or not.
 
Ganesh Jung
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
You're doing bodgitt&scarper?
You can't change the signature, but you can throw a RecordNotFoundException or a RuntimeException. I've derived an Exception class from RuntimeException.
hth,
Ganesh
 
Akshay Sharma
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No I am doing FBN.
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12014
220
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Akshay
I wouldn't change it. The instructions tell us that it must block until the lock is granted. Therefore if an exception wasn't thrown, and the method has returned, logically the lock must have been granted.
Regards, Andrew
 
Akshay Sharma
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Andrew, I missed it the assignment says that teh request should block.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic