1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-12-18 11:01:08 +01:00

Do not have Stanza.getExtension(String, String) return a generic type

Returning a generic would allow for

List<ExtensionElement> list = stanza.getExtension("foo", "bar");

to compile (Note the we are calling getExtension(), not
getExtension*s*()).

Users are encouraged to use the type safe getExtension(Class<? extends
ExtensionElement) variant instead.

Fixes SMACK-825.
This commit is contained in:
Florian Schmaus 2020-04-05 22:10:05 +02:00
parent 62916b8490
commit 07da9ffb48
65 changed files with 207 additions and 121 deletions

View file

@ -361,7 +361,7 @@ public class DataForm implements ExtensionElement {
* @return the DataForm or null
*/
public static DataForm from(StanzaView stanzaView) {
return (DataForm) stanzaView.getExtension(QNAME);
return stanzaView.getExtension(DataForm.class);
}
/**