In the successful case this is logging the end user's password in plaintext.  Probably just shouldn't do that, but if this class is going to do that, it should have an emphatic warning to that effect in e.g. the class JavaDoc.