diff --git a/source/org/jivesoftware/smack/SmackConfiguration.java b/source/org/jivesoftware/smack/SmackConfiguration.java index 86d144112..5646b5271 100644 --- a/source/org/jivesoftware/smack/SmackConfiguration.java +++ b/source/org/jivesoftware/smack/SmackConfiguration.java @@ -213,6 +213,6 @@ public final class SmackConfiguration { loaders.add(classLoader); } } - return (ClassLoader[]) loaders.toArray(); + return loaders.toArray(new ClassLoader[loaders.size()]); } } diff --git a/source/org/jivesoftware/smack/provider/ProviderManager.java b/source/org/jivesoftware/smack/provider/ProviderManager.java index d94a8e603..924d1766b 100644 --- a/source/org/jivesoftware/smack/provider/ProviderManager.java +++ b/source/org/jivesoftware/smack/provider/ProviderManager.java @@ -391,7 +391,7 @@ public class ProviderManager { loaders.add(classLoader); } } - return (ClassLoader[]) loaders.toArray(); + return loaders.toArray(new ClassLoader[loaders.size()]); } private ProviderManager() {