The pattern
if (now > deadline) break;
wait(deadline - now);
is insufficient in case "now == deadline" because the result would be
wait() being called with 0, which would mean "wait until
notified". Thus, the timeout would become infinite.
Smack's previous entity caps implementation assumed that an entity lost
its entity caps feature as soon as a presence without caps from that
entity was received. But according to XEP-0115 § 8.4, this is a
perfectly normal optimization technique. We now reset the caps state
after an available presence becomes unavailable.
Also introduce PresenceEventListener, which is required for this
feature.
Also make Roster.preApprove() take a BareJid as argument.
Fixes SMACK-723.
If such an exception ever happes when running a integration, then the
framework should not abort, but instead log the exception so that other
information is also logged.
as otherwhise the reflective invokation will eventually throw an
Exception like
Exception in thread "main" java.lang.NullPointerException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.igniterealtime.smack.inttest.SmackIntegrationTestFramework.runTests(SmackIntegrationTestFramework.java:412)
at org.igniterealtime.smack.inttest.SmackIntegrationTestFramework.run(SmackIntegrationTestFramework.java:163)
at org.igniterealtime.smack.inttest.SmackIntegrationTestFramework.main(SmackIntegrationTestFramework.java:89)
:smack-integration-test:run FAILED