1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-22 12:02:05 +01:00

[jiveproperties] Use DoOnce utility to log "JavaObject not enabled"

This commit is contained in:
Florian Schmaus 2021-11-01 19:27:22 +01:00
parent 7dc8cc176e
commit f2c2f45f18

View file

@ -26,6 +26,7 @@ import java.util.logging.Logger;
import org.jivesoftware.smack.packet.XmlEnvironment; import org.jivesoftware.smack.packet.XmlEnvironment;
import org.jivesoftware.smack.provider.ExtensionElementProvider; import org.jivesoftware.smack.provider.ExtensionElementProvider;
import org.jivesoftware.smack.util.DoOnce;
import org.jivesoftware.smack.util.stringencoder.Base64; import org.jivesoftware.smack.util.stringencoder.Base64;
import org.jivesoftware.smack.xml.XmlPullParser; import org.jivesoftware.smack.xml.XmlPullParser;
import org.jivesoftware.smack.xml.XmlPullParserException; import org.jivesoftware.smack.xml.XmlPullParserException;
@ -35,6 +36,8 @@ import org.jivesoftware.smackx.jiveproperties.packet.JivePropertiesExtension;
public class JivePropertiesExtensionProvider extends ExtensionElementProvider<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()); private static final Logger LOGGER = Logger.getLogger(JivePropertiesExtensionProvider.class.getName());
/** /**
@ -113,7 +116,10 @@ public class JivePropertiesExtensionProvider extends ExtensionElementProvider<Ji
} }
} }
else { 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) { if (name != null && value != null) {