I thought Java had short circuit evaluation, yet this line is still throwing a null pointer exception:
if( (perfectAgent != null) && (perfectAgent.ge
There are three references other than perfectAgent that could be null:
Break up the statement or run it in a debugger.