mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-12-22 10:37:59 +01:00
[jiveproperties] Use DoOnce utility to log "JavaObject not enabled"
This commit is contained in:
parent
7dc8cc176e
commit
f2c2f45f18
1 changed files with 7 additions and 1 deletions
|
@ -26,6 +26,7 @@ import java.util.logging.Logger;
|
|||
|
||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||
import org.jivesoftware.smack.provider.ExtensionElementProvider;
|
||||
import org.jivesoftware.smack.util.DoOnce;
|
||||
import org.jivesoftware.smack.util.stringencoder.Base64;
|
||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||
|
@ -35,6 +36,8 @@ import org.jivesoftware.smackx.jiveproperties.packet.JivePropertiesExtension;
|
|||
|
||||
public class JivePropertiesExtensionProvider extends ExtensionElementProvider<JivePropertiesExtension> {
|
||||
|
||||
private static final DoOnce LOG_OBJECT_NOT_ENABLED = new DoOnce();
|
||||
|
||||
private static final Logger LOGGER = Logger.getLogger(JivePropertiesExtensionProvider.class.getName());
|
||||
|
||||
/**
|
||||
|
@ -113,7 +116,10 @@ public class JivePropertiesExtensionProvider extends ExtensionElementProvider<Ji
|
|||
}
|
||||
}
|
||||
else {
|
||||
LOGGER.severe("JavaObject is not enabled. Enable with JivePropertiesManager.setJavaObjectEnabled(true)");
|
||||
LOG_OBJECT_NOT_ENABLED.once(
|
||||
() -> LOGGER.severe(
|
||||
"JavaObject is not enabled. Enable with JivePropertiesManager.setJavaObjectEnabled(true)")
|
||||
);
|
||||
}
|
||||
}
|
||||
if (name != null && value != null) {
|
||||
|
|
Loading…
Reference in a new issue