diff --git a/smack-core/src/main/java/org/jivesoftware/smack/packet/Stanza.java b/smack-core/src/main/java/org/jivesoftware/smack/packet/Stanza.java index 833ff041a..e55f746da 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/packet/Stanza.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/packet/Stanza.java @@ -338,7 +338,7 @@ public abstract class Stanza implements StanzaView, TopLevelStreamElement { /** * Returns the first extension of this stanza that has the given namespace. *
- * When possible, use {@link #getExtension(String, String)} instead. + * When possible, use {@link #getExtensionElement(String, String)} instead. *
* * @param namespace the namespace of the extension that is desired. @@ -358,7 +358,7 @@ public abstract class Stanza implements StanzaView, TopLevelStreamElement { * @param namespace the XML element namespace of the extension. * @return the extension, ornull
if it doesn't exist.
*/
- public final ExtensionElement getExtension(String elementName, String namespace) {
+ public final ExtensionElement getExtensionElement(String elementName, String namespace) {
if (namespace == null) {
return null;
}
diff --git a/smack-experimental/src/main/java/org/jivesoftware/smackx/carbons/packet/CarbonExtension.java b/smack-experimental/src/main/java/org/jivesoftware/smackx/carbons/packet/CarbonExtension.java
index 6fb49ce39..960922d07 100644
--- a/smack-experimental/src/main/java/org/jivesoftware/smackx/carbons/packet/CarbonExtension.java
+++ b/smack-experimental/src/main/java/org/jivesoftware/smackx/carbons/packet/CarbonExtension.java
@@ -114,9 +114,9 @@ public class CarbonExtension implements ExtensionElement {
* @return a Carbon if available, null otherwise.
*/
public static CarbonExtension from(Message msg) {
- CarbonExtension cc = (CarbonExtension) msg.getExtension(Direction.received.name(), NAMESPACE);
+ CarbonExtension cc = (CarbonExtension) msg.getExtensionElement(Direction.received.name(), NAMESPACE);
if (cc == null)
- cc = (CarbonExtension) msg.getExtension(Direction.sent.name(), NAMESPACE);
+ cc = (CarbonExtension) msg.getExtensionElement(Direction.sent.name(), NAMESPACE);
return cc;
}
diff --git a/smack-experimental/src/main/java/org/jivesoftware/smackx/hints/element/NoCopyHint.java b/smack-experimental/src/main/java/org/jivesoftware/smackx/hints/element/NoCopyHint.java
index 393fe55fe..a29ae0473 100644
--- a/smack-experimental/src/main/java/org/jivesoftware/smackx/hints/element/NoCopyHint.java
+++ b/smack-experimental/src/main/java/org/jivesoftware/smackx/hints/element/NoCopyHint.java
@@ -48,7 +48,7 @@ public final class NoCopyHint extends MessageProcessingHint {
}
public static NoCopyHint from(Message message) {
- return (NoCopyHint) message.getExtension(ELEMENT, NAMESPACE);
+ return (NoCopyHint) message.getExtensionElement(ELEMENT, NAMESPACE);
}
public static boolean hasHint(Message message) {
diff --git a/smack-experimental/src/main/java/org/jivesoftware/smackx/hints/element/NoPermanentStoreHint.java b/smack-experimental/src/main/java/org/jivesoftware/smackx/hints/element/NoPermanentStoreHint.java
index 63aea7699..4b0bc7100 100644
--- a/smack-experimental/src/main/java/org/jivesoftware/smackx/hints/element/NoPermanentStoreHint.java
+++ b/smack-experimental/src/main/java/org/jivesoftware/smackx/hints/element/NoPermanentStoreHint.java
@@ -48,7 +48,7 @@ public final class NoPermanentStoreHint extends MessageProcessingHint {
}
public static NoPermanentStoreHint from(Message message) {
- return (NoPermanentStoreHint) message.getExtension(ELEMENT, NAMESPACE);
+ return (NoPermanentStoreHint) message.getExtensionElement(ELEMENT, NAMESPACE);
}
public static boolean hasHint(Message message) {
diff --git a/smack-experimental/src/main/java/org/jivesoftware/smackx/hints/element/NoStoreHint.java b/smack-experimental/src/main/java/org/jivesoftware/smackx/hints/element/NoStoreHint.java
index 72bc4ff44..b6b9e2a25 100644
--- a/smack-experimental/src/main/java/org/jivesoftware/smackx/hints/element/NoStoreHint.java
+++ b/smack-experimental/src/main/java/org/jivesoftware/smackx/hints/element/NoStoreHint.java
@@ -48,7 +48,7 @@ public final class NoStoreHint extends MessageProcessingHint {
}
public static NoStoreHint from(Message message) {
- return (NoStoreHint) message.getExtension(ELEMENT, NAMESPACE);
+ return (NoStoreHint) message.getExtensionElement(ELEMENT, NAMESPACE);
}
public static boolean hasHint(Message message) {
diff --git a/smack-experimental/src/main/java/org/jivesoftware/smackx/mam/element/MamElements.java b/smack-experimental/src/main/java/org/jivesoftware/smackx/mam/element/MamElements.java
index 540ffe774..034245a5a 100644
--- a/smack-experimental/src/main/java/org/jivesoftware/smackx/mam/element/MamElements.java
+++ b/smack-experimental/src/main/java/org/jivesoftware/smackx/mam/element/MamElements.java
@@ -140,7 +140,7 @@ public class MamElements {
}
public static MamResultExtension from(Message message) {
- return (MamResultExtension) message.getExtension(ELEMENT, NAMESPACE);
+ return (MamResultExtension) message.getExtensionElement(ELEMENT, NAMESPACE);
}
}
diff --git a/smack-experimental/src/main/java/org/jivesoftware/smackx/muclight/element/MUCLightElements.java b/smack-experimental/src/main/java/org/jivesoftware/smackx/muclight/element/MUCLightElements.java
index ba14e5f62..33861b29e 100644
--- a/smack-experimental/src/main/java/org/jivesoftware/smackx/muclight/element/MUCLightElements.java
+++ b/smack-experimental/src/main/java/org/jivesoftware/smackx/muclight/element/MUCLightElements.java
@@ -233,7 +233,7 @@ public abstract class MUCLightElements {
}
public static ConfigurationsChangeExtension from(Message message) {
- return (ConfigurationsChangeExtension) message.getExtension(ConfigurationsChangeExtension.ELEMENT, ConfigurationsChangeExtension.NAMESPACE);
+ return (ConfigurationsChangeExtension) message.getExtensionElement(ConfigurationsChangeExtension.ELEMENT, ConfigurationsChangeExtension.NAMESPACE);
}
}
diff --git a/smack-experimental/src/main/java/org/jivesoftware/smackx/sid/element/OriginIdElement.java b/smack-experimental/src/main/java/org/jivesoftware/smackx/sid/element/OriginIdElement.java
index 10282b70b..585be47a6 100644
--- a/smack-experimental/src/main/java/org/jivesoftware/smackx/sid/element/OriginIdElement.java
+++ b/smack-experimental/src/main/java/org/jivesoftware/smackx/sid/element/OriginIdElement.java
@@ -82,7 +82,7 @@ public class OriginIdElement extends StableAndUniqueIdElement {
* @return origin-id element
*/
public static OriginIdElement getOriginId(Message message) {
- return (OriginIdElement) message.getExtension(OriginIdElement.ELEMENT, StableUniqueStanzaIdManager.NAMESPACE);
+ return (OriginIdElement) message.getExtensionElement(OriginIdElement.ELEMENT, StableUniqueStanzaIdManager.NAMESPACE);
}
@Override
diff --git a/smack-experimental/src/test/java/org/jivesoftware/smackx/spoiler/SpoilerTest.java b/smack-experimental/src/test/java/org/jivesoftware/smackx/spoiler/SpoilerTest.java
index 33104f575..165c4be40 100644
--- a/smack-experimental/src/test/java/org/jivesoftware/smackx/spoiler/SpoilerTest.java
+++ b/smack-experimental/src/test/java/org/jivesoftware/smackx/spoiler/SpoilerTest.java
@@ -44,7 +44,7 @@ public class SpoilerTest extends SmackTestSuite {
Message message = StanzaBuilder.buildMessage().build();
SpoilerElement.addSpoiler(message);
- SpoilerElement empty = (SpoilerElement) message.getExtension(SpoilerElement.ELEMENT, SpoilerManager.NAMESPACE_0);
+ SpoilerElement empty = (SpoilerElement) message.getExtensionElement(SpoilerElement.ELEMENT, SpoilerManager.NAMESPACE_0);
assertNull(empty.getHint());
assertNull(empty.getLanguage());
@@ -63,7 +63,7 @@ public class SpoilerTest extends SmackTestSuite {
Message message = StanzaBuilder.buildMessage().build();
SpoilerElement.addSpoiler(message, "Love story end");
- SpoilerElement withHint = (SpoilerElement) message.getExtension(SpoilerElement.ELEMENT, SpoilerManager.NAMESPACE_0);
+ SpoilerElement withHint = (SpoilerElement) message.getExtensionElement(SpoilerElement.ELEMENT, SpoilerManager.NAMESPACE_0);
assertEquals("Love story end", withHint.getHint());
assertNull(withHint.getLanguage());
@@ -83,7 +83,7 @@ public class SpoilerTest extends SmackTestSuite {
Message message = StanzaBuilder.buildMessage().build();
SpoilerElement.addSpoiler(message, "de", "Der Kuchen ist eine Lüge!");
- SpoilerElement i18nHint = (SpoilerElement) message.getExtension(SpoilerElement.ELEMENT, SpoilerManager.NAMESPACE_0);
+ SpoilerElement i18nHint = (SpoilerElement) message.getExtensionElement(SpoilerElement.ELEMENT, SpoilerManager.NAMESPACE_0);
assertEquals("Der Kuchen ist eine Lüge!", i18nHint.getHint());
assertEquals("de", i18nHint.getLanguage());
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/bob/element/BoBExtension.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/bob/element/BoBExtension.java
index a0ee8af9e..442474fa1 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/bob/element/BoBExtension.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/bob/element/BoBExtension.java
@@ -91,7 +91,7 @@ public class BoBExtension extends XHTMLExtension {
}
public static BoBExtension from(Message message) {
- return (BoBExtension) message.getExtension(ELEMENT, NAMESPACE);
+ return (BoBExtension) message.getExtensionElement(ELEMENT, NAMESPACE);
}
}
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/Occupant.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/Occupant.java
index babce3829..3e8884c64 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/Occupant.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/Occupant.java
@@ -53,7 +53,7 @@ public class Occupant {
}
Occupant(Presence presence) {
- MUCUser mucUser = (MUCUser) presence.getExtension("x",
+ MUCUser mucUser = (MUCUser) presence.getExtensionElement("x",
"http://jabber.org/protocol/muc#user");
MUCItem item = mucUser.getItem();
this.jid = item.getJid();
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/Node.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/Node.java
index 2a43636b2..88decd520 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/Node.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/Node.java
@@ -686,7 +686,7 @@ public abstract class Node {
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
public void processStanza(Stanza packet) {
- EventElement event = (EventElement) packet.getExtension("event", PubSubNamespace.event.getXmlns());
+ EventElement event = (EventElement) packet.getExtensionElement("event", PubSubNamespace.event.getXmlns());
ItemsExtension itemsElem = (ItemsExtension) event.getEvent();
ItemPublishEvent eventItems = new ItemPublishEvent(itemsElem.getNode(), itemsElem.getItems(), getSubscriptionIds(packet), DelayInformationManager.getDelayTimestamp(packet));
// TODO: Use AsyncButOrdered (with Node as Key?)
@@ -710,7 +710,7 @@ public abstract class Node {
@Override
public void processStanza(Stanza packet) {
// CHECKSTYLE:OFF
- EventElement event = (EventElement) packet.getExtension("event", PubSubNamespace.event.getXmlns());
+ EventElement event = (EventElement) packet.getExtensionElement("event", PubSubNamespace.event.getXmlns());
List