1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-25 15:52:06 +01:00

Correctly name provider INSTANCE fields

and make them 'final' where possible.
This commit is contained in:
Florian Schmaus 2019-02-23 23:57:31 +01:00
parent 5f7cfd04bd
commit 3bdc1d30b1
3 changed files with 12 additions and 4 deletions

View file

@ -23,7 +23,11 @@ import org.xmlpull.v1.XmlPullParser;
public class OriginIdProvider extends ExtensionElementProvider<OriginIdElement> { public class OriginIdProvider extends ExtensionElementProvider<OriginIdElement> {
public static final OriginIdProvider TEST_INSTANCE = new OriginIdProvider(); public static final OriginIdProvider INSTANCE = new OriginIdProvider();
// TODO: Remove in Smack 4.4.
@Deprecated
public static final OriginIdProvider TEST_INSTANCE = INSTANCE;
@Override @Override
public OriginIdElement parse(XmlPullParser parser, int initialDepth) throws Exception { public OriginIdElement parse(XmlPullParser parser, int initialDepth) throws Exception {

View file

@ -23,7 +23,11 @@ import org.xmlpull.v1.XmlPullParser;
public class StanzaIdProvider extends ExtensionElementProvider<StanzaIdElement> { public class StanzaIdProvider extends ExtensionElementProvider<StanzaIdElement> {
public static StanzaIdProvider TEST_INSTANCE = new StanzaIdProvider(); public static final StanzaIdProvider INSTANCE = new StanzaIdProvider();
// TODO: Remove in Smack 4.4.
@Deprecated
public static final StanzaIdProvider TEST_INSTANCE = INSTANCE;
@Override @Override
public StanzaIdElement parse(XmlPullParser parser, int initialDepth) throws Exception { public StanzaIdElement parse(XmlPullParser parser, int initialDepth) throws Exception {

View file

@ -43,7 +43,7 @@ public class StableUniqueStanzaIdTest extends SmackTestSuite {
assertEquals("alice@wonderland.lit", element.getBy()); assertEquals("alice@wonderland.lit", element.getBy());
assertXMLEqual(xml, element.toXML(null).toString()); assertXMLEqual(xml, element.toXML(null).toString());
StanzaIdElement parsed = StanzaIdProvider.TEST_INSTANCE.parse(TestUtils.getParser(xml)); StanzaIdElement parsed = StanzaIdProvider.INSTANCE.parse(TestUtils.getParser(xml));
assertEquals(element.getId(), parsed.getId()); assertEquals(element.getId(), parsed.getId());
assertEquals(element.getBy(), parsed.getBy()); assertEquals(element.getBy(), parsed.getBy());
} }
@ -55,7 +55,7 @@ public class StableUniqueStanzaIdTest extends SmackTestSuite {
assertEquals("de305d54-75b4-431b-adb2-eb6b9e546013", element.getId()); assertEquals("de305d54-75b4-431b-adb2-eb6b9e546013", element.getId());
assertXMLEqual(xml, element.toXML(null).toString()); assertXMLEqual(xml, element.toXML(null).toString());
OriginIdElement parsed = OriginIdProvider.TEST_INSTANCE.parse(TestUtils.getParser(xml)); OriginIdElement parsed = OriginIdProvider.INSTANCE.parse(TestUtils.getParser(xml));
assertEquals(element.getId(), parsed.getId()); assertEquals(element.getId(), parsed.getId());
} }