powered by Jive Software

Login inconsistency


Just to point out that there seems to be an inconsistency between what the javadocs say and what actually happens in XMPPConnection.login

The javadocs say:

Before logging in (i.e. authenticate) to the server the connection must be connected. For compatibility and easiness of use the connection will automatically connect to the server if not already connected.

While in reality the method throws an IllegalStateException if not connected.

Keep up the good work

I think what it means is that the connection will log in automatically, in case of an unexpected disconnect.

I think the documentation in question is specifically about the behaviour of the login method and doesn’'t have anything to do with any of the new re-connection stuff.

It reads to me as if it means that if you haven’‘t called connect() before login() then it will connect for you (which, as I say, it doesn’'t actually do).

(e.g. by “for compatability” I think they mean with pre-version 3 smack where connection was done within the constructor and no call to connect() was required)

I see. However, this passage is only mentioned in the login with this format


public void login(String username,

String password,

String resource,

boolean sendPresence)

throws XMPPException


XMPPException - if an error occurs.

IllegalStateException - if not connected to the server, or already logged in to the serrver.

Clearly, the IllegalStateException contradicts what is stated. This is from the 3.0.4 documentation.