bool IsParticipantAttachable(Doctor doc)
{
if (!Session.Attached(doc))
{
Session.Attach(doc); // attach the doctor to the session
return true;
}
else
throw new IllegalSessionStateException("doctor not attachable");
return false;
}
... and now guess what happened to the piece of code that tried to ask the system twice, if a doctor could be attached to a session or not...
No comments:
Post a Comment