From 2e11470aee7e6aeab32802f8256cd27191b11bb8 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Sun, 16 Feb 2014 11:01:51 +0100 Subject: [PATCH] Code cleanup: unused imports, values, blocks, etc. --- .../UrlProviderFileInitializer.java | 4 ---- .../smack/proxy/ProxyException.java | 9 +++++--- .../smack/proxy/Socks4ProxySocketFactory.java | 3 +-- .../org/jivesoftware/smack/util/Base64.java | 21 +++++++------------ .../org/jivesoftware/smack/util/Cache.java | 5 +++++ .../smackx/commands/AdHocCommandManager.java | 1 - .../disco/provider/DiscoverInfoProvider.java | 1 - .../smackx/entitycaps/EntityCapsManager.java | 2 -- .../smackx/iqlast/LastActivityManager.java | 9 +++++++- .../ConnectionDetachedPacketCollector.java | 7 ------- .../org/jivesoftware/smackx/muc/RoomInfo.java | 2 -- .../smackx/pubsub/AffiliationsExtension.java | 2 +- .../smackx/pubsub/ConfigurationEvent.java | 2 +- .../smackx/pubsub/ItemDeleteEvent.java | 2 +- .../smackx/pubsub/ItemsExtension.java | 1 + .../jivesoftware/smackx/pubsub/LeafNode.java | 7 +++++++ .../smackx/pubsub/PubSubManager.java | 1 + .../smackx/pubsub/SubscribeForm.java | 1 - .../smackx/pubsub/SubscriptionEvent.java | 2 +- .../smackx/pubsub/SubscriptionsExtension.java | 2 +- .../pubsub/provider/AffiliationsProvider.java | 1 + .../provider/SubscriptionsProvider.java | 1 + .../smackx/shim/packet/HeadersExtension.java | 2 +- .../smackx/shim/provider/HeadersProvider.java | 1 + .../si/provider/StreamInitiationProvider.java | 2 +- .../xdata/provider/DataFormProvider.java | 1 - 26 files changed, 47 insertions(+), 45 deletions(-) diff --git a/core/src/main/java/org/jivesoftware/smack/initializer/UrlProviderFileInitializer.java b/core/src/main/java/org/jivesoftware/smack/initializer/UrlProviderFileInitializer.java index b5e746069..f31559724 100644 --- a/core/src/main/java/org/jivesoftware/smack/initializer/UrlProviderFileInitializer.java +++ b/core/src/main/java/org/jivesoftware/smack/initializer/UrlProviderFileInitializer.java @@ -2,10 +2,6 @@ package org.jivesoftware.smack.initializer; import java.io.IOException; import java.io.InputStream; -import java.net.MalformedURLException; -import java.net.URI; -import java.net.URL; -import java.util.ArrayList; import java.util.Collections; import java.util.LinkedList; import java.util.List; diff --git a/core/src/main/java/org/jivesoftware/smack/proxy/ProxyException.java b/core/src/main/java/org/jivesoftware/smack/proxy/ProxyException.java index 8282b758f..8e0a81775 100644 --- a/core/src/main/java/org/jivesoftware/smack/proxy/ProxyException.java +++ b/core/src/main/java/org/jivesoftware/smack/proxy/ProxyException.java @@ -21,9 +21,12 @@ import java.io.IOException; * * @author Atul Aggarwal */ -public class ProxyException - extends IOException -{ +public class ProxyException extends IOException { + /** + * + */ + private static final long serialVersionUID = 1L; + public ProxyException(ProxyInfo.ProxyType type, String ex, Throwable cause) { super("Proxy Exception " + type.toString() + " : "+ex+", "+cause); diff --git a/core/src/main/java/org/jivesoftware/smack/proxy/Socks4ProxySocketFactory.java b/core/src/main/java/org/jivesoftware/smack/proxy/Socks4ProxySocketFactory.java index 08aadf7f5..492dbefcb 100644 --- a/core/src/main/java/org/jivesoftware/smack/proxy/Socks4ProxySocketFactory.java +++ b/core/src/main/java/org/jivesoftware/smack/proxy/Socks4ProxySocketFactory.java @@ -74,8 +74,7 @@ public class Socks4ProxySocketFactory String proxy_host = proxy.getProxyAddress(); int proxy_port = proxy.getProxyPort(); String user = proxy.getProxyUsername(); - String passwd = proxy.getProxyPassword(); - + try { socket=new Socket(proxy_host, proxy_port); diff --git a/core/src/main/java/org/jivesoftware/smack/util/Base64.java b/core/src/main/java/org/jivesoftware/smack/util/Base64.java index c21cea089..bcb4dc762 100644 --- a/core/src/main/java/org/jivesoftware/smack/util/Base64.java +++ b/core/src/main/java/org/jivesoftware/smack/util/Base64.java @@ -461,7 +461,6 @@ public class Base64 // Isolate options int gzip = (options & GZIP); - int dontBreakLines = (options & DONT_BREAK_LINES); try { @@ -1220,9 +1219,8 @@ public class Base64 private int numSigBytes; // Number of meaningful bytes in the buffer private int lineLength; private boolean breakLines; // Break lines at less than 80 characters - private int options; // Record options used to create the stream. - private byte[] alphabet; // Local copies to avoid extra method calls - private byte[] decodabet; // Local copies to avoid extra method calls + private int options; // Record options used to create the stream. + private byte[] decodabet; // Local copies to avoid extra method calls /** @@ -1267,9 +1265,8 @@ public class Base64 this.buffer = new byte[ bufferLength ]; this.position = -1; this.lineLength = 0; - this.options = options; // Record for later, mostly to determine which alphabet to use - this.alphabet = getAlphabet(options); - this.decodabet = getDecodabet(options); + this.options = options; // Record for later, mostly to determine which alphabet to use + this.decodabet = getDecodabet(options); } // end constructor /** @@ -1457,9 +1454,8 @@ public class Base64 private boolean breakLines; private byte[] b4; // Scratch used in a few places private boolean suspendEncoding; - private int options; // Record for later - private byte[] alphabet; // Local copies to avoid extra method calls - private byte[] decodabet; // Local copies to avoid extra method calls + private int options; // Record for later + private byte[] decodabet; // Local copies to avoid extra method calls /** * Constructs a {@link Base64.OutputStream} in ENCODE mode. @@ -1504,9 +1500,8 @@ public class Base64 this.lineLength = 0; this.suspendEncoding = false; this.b4 = new byte[4]; - this.options = options; - this.alphabet = getAlphabet(options); - this.decodabet = getDecodabet(options); + this.options = options; + this.decodabet = getDecodabet(options); } // end constructor diff --git a/core/src/main/java/org/jivesoftware/smack/util/Cache.java b/core/src/main/java/org/jivesoftware/smack/util/Cache.java index 760f222b3..0227db930 100644 --- a/core/src/main/java/org/jivesoftware/smack/util/Cache.java +++ b/core/src/main/java/org/jivesoftware/smack/util/Cache.java @@ -253,6 +253,7 @@ public class Cache implements Map { return map.containsKey(key); } + @SuppressWarnings("unchecked") public void putAll(Map map) { for (Entry entry : map.entrySet()) { V value = entry.getValue(); @@ -273,6 +274,7 @@ public class Cache implements Map { deleteExpiredEntries(); //noinspection unchecked + @SuppressWarnings("unchecked") CacheObject cacheObject = new CacheObject((V) value); return map.containsValue(cacheObject); @@ -454,6 +456,7 @@ public class Cache implements Map { /** * A count of the number of times the object has been read from cache. */ + @SuppressWarnings("unused") public int readCount = 0; /** @@ -509,6 +512,7 @@ public class Cache implements Map { * * @return the first element of the list. */ + @SuppressWarnings("unused") public LinkedListNode getFirst() { LinkedListNode node = head.next; if (node == head) { @@ -565,6 +569,7 @@ public class Cache implements Map { * @param object the object to add to the end of the list. * @return the node created to wrap the object. */ + @SuppressWarnings("unused") public LinkedListNode addLast(Object object) { LinkedListNode node = new LinkedListNode(object, head, head.previous); node.previous.next = node; diff --git a/extensions/src/main/java/org/jivesoftware/smackx/commands/AdHocCommandManager.java b/extensions/src/main/java/org/jivesoftware/smackx/commands/AdHocCommandManager.java index 7719490b6..f2eb3767e 100755 --- a/extensions/src/main/java/org/jivesoftware/smackx/commands/AdHocCommandManager.java +++ b/extensions/src/main/java/org/jivesoftware/smackx/commands/AdHocCommandManager.java @@ -43,7 +43,6 @@ import java.util.List; import java.util.Map; import java.util.WeakHashMap; import java.util.concurrent.ConcurrentHashMap; -import java.util.logging.Logger; /** * An AdHocCommandManager is responsible for keeping the list of available diff --git a/extensions/src/main/java/org/jivesoftware/smackx/disco/provider/DiscoverInfoProvider.java b/extensions/src/main/java/org/jivesoftware/smackx/disco/provider/DiscoverInfoProvider.java index 88005c9f2..6c423deda 100644 --- a/extensions/src/main/java/org/jivesoftware/smackx/disco/provider/DiscoverInfoProvider.java +++ b/extensions/src/main/java/org/jivesoftware/smackx/disco/provider/DiscoverInfoProvider.java @@ -33,7 +33,6 @@ public class DiscoverInfoProvider implements IQProvider { public IQ parseIQ(XmlPullParser parser) throws Exception { DiscoverInfo discoverInfo = new DiscoverInfo(); boolean done = false; - DiscoverInfo.Feature feature = null; DiscoverInfo.Identity identity = null; String category = ""; String name = ""; diff --git a/extensions/src/main/java/org/jivesoftware/smackx/entitycaps/EntityCapsManager.java b/extensions/src/main/java/org/jivesoftware/smackx/entitycaps/EntityCapsManager.java index 4397654ab..96391a8aa 100644 --- a/extensions/src/main/java/org/jivesoftware/smackx/entitycaps/EntityCapsManager.java +++ b/extensions/src/main/java/org/jivesoftware/smackx/entitycaps/EntityCapsManager.java @@ -23,7 +23,6 @@ import org.jivesoftware.smack.ConnectionListener; import org.jivesoftware.smack.PacketInterceptor; import org.jivesoftware.smack.PacketListener; import org.jivesoftware.smack.SmackConfiguration; -import org.jivesoftware.smack.XMPPConnection; import org.jivesoftware.smack.XMPPException; import org.jivesoftware.smack.packet.IQ; import org.jivesoftware.smack.packet.Packet; @@ -56,7 +55,6 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Queue; -import java.util.Set; import java.util.SortedSet; import java.util.TreeSet; import java.util.WeakHashMap; diff --git a/extensions/src/main/java/org/jivesoftware/smackx/iqlast/LastActivityManager.java b/extensions/src/main/java/org/jivesoftware/smackx/iqlast/LastActivityManager.java index c175973a5..9918689c6 100644 --- a/extensions/src/main/java/org/jivesoftware/smackx/iqlast/LastActivityManager.java +++ b/extensions/src/main/java/org/jivesoftware/smackx/iqlast/LastActivityManager.java @@ -17,7 +17,12 @@ package org.jivesoftware.smackx.iqlast; -import org.jivesoftware.smack.*; +import org.jivesoftware.smack.Connection; +import org.jivesoftware.smack.ConnectionCreationListener; +import org.jivesoftware.smack.PacketCollector; +import org.jivesoftware.smack.PacketListener; +import org.jivesoftware.smack.SmackConfiguration; +import org.jivesoftware.smack.XMPPException; import org.jivesoftware.smack.filter.AndFilter; import org.jivesoftware.smack.filter.IQTypeFilter; import org.jivesoftware.smack.filter.PacketIDFilter; @@ -113,6 +118,8 @@ public class LastActivityManager { // We assume that only a switch to available and chat indicates user activity // since other mode changes could be also a result of some sort of automatism resetIdleTime(); + default: + break; } } }, new PacketTypeFilter(Presence.class)); diff --git a/extensions/src/main/java/org/jivesoftware/smackx/muc/ConnectionDetachedPacketCollector.java b/extensions/src/main/java/org/jivesoftware/smackx/muc/ConnectionDetachedPacketCollector.java index dc058623e..6eae7747a 100644 --- a/extensions/src/main/java/org/jivesoftware/smackx/muc/ConnectionDetachedPacketCollector.java +++ b/extensions/src/main/java/org/jivesoftware/smackx/muc/ConnectionDetachedPacketCollector.java @@ -32,13 +32,6 @@ import org.jivesoftware.smack.packet.Packet; * @author Larry Kirschner */ class ConnectionDetachedPacketCollector { - /** - * Max number of packets that any one collector can hold. After the max is - * reached, older packets will be automatically dropped from the queue as - * new packets are added. - */ - private int maxPackets = SmackConfiguration.getPacketCollectorSize(); - private ArrayBlockingQueue resultQueue; /** diff --git a/extensions/src/main/java/org/jivesoftware/smackx/muc/RoomInfo.java b/extensions/src/main/java/org/jivesoftware/smackx/muc/RoomInfo.java index 6363b9b8c..2782385f3 100644 --- a/extensions/src/main/java/org/jivesoftware/smackx/muc/RoomInfo.java +++ b/extensions/src/main/java/org/jivesoftware/smackx/muc/RoomInfo.java @@ -21,8 +21,6 @@ import org.jivesoftware.smackx.disco.packet.DiscoverInfo; import org.jivesoftware.smackx.xdata.Form; import org.jivesoftware.smackx.xdata.FormField; -import java.util.Iterator; - /** * Represents the room information that was discovered using Service Discovery. It's possible to * obtain information about a room before joining the room but only for rooms that are public (i.e. diff --git a/extensions/src/main/java/org/jivesoftware/smackx/pubsub/AffiliationsExtension.java b/extensions/src/main/java/org/jivesoftware/smackx/pubsub/AffiliationsExtension.java index aa82dcbab..b44b99b33 100644 --- a/extensions/src/main/java/org/jivesoftware/smackx/pubsub/AffiliationsExtension.java +++ b/extensions/src/main/java/org/jivesoftware/smackx/pubsub/AffiliationsExtension.java @@ -24,7 +24,7 @@ import java.util.List; */ public class AffiliationsExtension extends NodeExtension { - protected List items = Collections.EMPTY_LIST; + protected List items = Collections.emptyList(); public AffiliationsExtension() { diff --git a/extensions/src/main/java/org/jivesoftware/smackx/pubsub/ConfigurationEvent.java b/extensions/src/main/java/org/jivesoftware/smackx/pubsub/ConfigurationEvent.java index 67b8304a4..59a2d3135 100644 --- a/extensions/src/main/java/org/jivesoftware/smackx/pubsub/ConfigurationEvent.java +++ b/extensions/src/main/java/org/jivesoftware/smackx/pubsub/ConfigurationEvent.java @@ -49,7 +49,7 @@ public class ConfigurationEvent extends NodeExtension implements EmbeddedPacketE public List getExtensions() { if (getConfiguration() == null) - return Collections.EMPTY_LIST; + return Collections.emptyList(); else return Arrays.asList(((PacketExtension)getConfiguration().getDataFormToSend())); } diff --git a/extensions/src/main/java/org/jivesoftware/smackx/pubsub/ItemDeleteEvent.java b/extensions/src/main/java/org/jivesoftware/smackx/pubsub/ItemDeleteEvent.java index 82ab7dfe9..c10c920e4 100644 --- a/extensions/src/main/java/org/jivesoftware/smackx/pubsub/ItemDeleteEvent.java +++ b/extensions/src/main/java/org/jivesoftware/smackx/pubsub/ItemDeleteEvent.java @@ -23,7 +23,7 @@ import java.util.List; */ public class ItemDeleteEvent extends SubscriptionEvent { - private List itemIds = Collections.EMPTY_LIST; + private List itemIds = Collections.emptyList(); /** * Constructs an ItemDeleteEvent that indicates the the supplied diff --git a/extensions/src/main/java/org/jivesoftware/smackx/pubsub/ItemsExtension.java b/extensions/src/main/java/org/jivesoftware/smackx/pubsub/ItemsExtension.java index c98d93af0..25d21fcbb 100644 --- a/extensions/src/main/java/org/jivesoftware/smackx/pubsub/ItemsExtension.java +++ b/extensions/src/main/java/org/jivesoftware/smackx/pubsub/ItemsExtension.java @@ -124,6 +124,7 @@ public class ItemsExtension extends NodeExtension implements EmbeddedPacketExten return type; } + @SuppressWarnings("unchecked") public List getExtensions() { return (List)getItems(); diff --git a/extensions/src/main/java/org/jivesoftware/smackx/pubsub/LeafNode.java b/extensions/src/main/java/org/jivesoftware/smackx/pubsub/LeafNode.java index dc73302c0..8ccabf7e9 100644 --- a/extensions/src/main/java/org/jivesoftware/smackx/pubsub/LeafNode.java +++ b/extensions/src/main/java/org/jivesoftware/smackx/pubsub/LeafNode.java @@ -63,6 +63,7 @@ public class LeafNode extends Node * * @throws XMPPException */ + @SuppressWarnings("unchecked") public List getItems() throws XMPPException { @@ -84,6 +85,7 @@ public class LeafNode extends Node * * @throws XMPPException */ + @SuppressWarnings("unchecked") public List getItems(String subscriptionId) throws XMPPException { @@ -107,6 +109,7 @@ public class LeafNode extends Node * * @throws XMPPException */ + @SuppressWarnings("unchecked") public List getItems(Collection ids) throws XMPPException { @@ -132,6 +135,7 @@ public class LeafNode extends Node * * @throws XMPPException */ + @SuppressWarnings("unchecked") public List getItems(int maxItems) throws XMPPException { @@ -154,6 +158,7 @@ public class LeafNode extends Node * * @throws XMPPException */ + @SuppressWarnings("unchecked") public List getItems(int maxItems, String subscriptionId) throws XMPPException { @@ -198,6 +203,7 @@ public class LeafNode extends Node * * @param item - The item being sent */ + @SuppressWarnings("unchecked") public void publish(T item) { Collection items = new ArrayList(1); @@ -268,6 +274,7 @@ public class LeafNode extends Node * * @throws XMPPException */ + @SuppressWarnings("unchecked") public void send(T item) throws XMPPException { diff --git a/extensions/src/main/java/org/jivesoftware/smackx/pubsub/PubSubManager.java b/extensions/src/main/java/org/jivesoftware/smackx/pubsub/PubSubManager.java index e44651136..a281ab06c 100644 --- a/extensions/src/main/java/org/jivesoftware/smackx/pubsub/PubSubManager.java +++ b/extensions/src/main/java/org/jivesoftware/smackx/pubsub/PubSubManager.java @@ -149,6 +149,7 @@ final public class PubSubManager * @return the node * @throws XMPPException The node does not exist */ + @SuppressWarnings("unchecked") public T getNode(String id) throws XMPPException { diff --git a/extensions/src/main/java/org/jivesoftware/smackx/pubsub/SubscribeForm.java b/extensions/src/main/java/org/jivesoftware/smackx/pubsub/SubscribeForm.java index 4abef76b4..60900aefa 100644 --- a/extensions/src/main/java/org/jivesoftware/smackx/pubsub/SubscribeForm.java +++ b/extensions/src/main/java/org/jivesoftware/smackx/pubsub/SubscribeForm.java @@ -14,7 +14,6 @@ package org.jivesoftware.smackx.pubsub; import java.text.ParseException; -import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Collection; import java.util.Date; diff --git a/extensions/src/main/java/org/jivesoftware/smackx/pubsub/SubscriptionEvent.java b/extensions/src/main/java/org/jivesoftware/smackx/pubsub/SubscriptionEvent.java index 99f18d5f1..12e180e15 100644 --- a/extensions/src/main/java/org/jivesoftware/smackx/pubsub/SubscriptionEvent.java +++ b/extensions/src/main/java/org/jivesoftware/smackx/pubsub/SubscriptionEvent.java @@ -23,7 +23,7 @@ import java.util.List; */ abstract public class SubscriptionEvent extends NodeEvent { - private List subIds = Collections.EMPTY_LIST; + private List subIds = Collections.emptyList(); /** * Construct an event with no subscription id's. This can diff --git a/extensions/src/main/java/org/jivesoftware/smackx/pubsub/SubscriptionsExtension.java b/extensions/src/main/java/org/jivesoftware/smackx/pubsub/SubscriptionsExtension.java index a28cbe2c9..a32d606b3 100644 --- a/extensions/src/main/java/org/jivesoftware/smackx/pubsub/SubscriptionsExtension.java +++ b/extensions/src/main/java/org/jivesoftware/smackx/pubsub/SubscriptionsExtension.java @@ -23,7 +23,7 @@ import java.util.List; */ public class SubscriptionsExtension extends NodeExtension { - protected List items = Collections.EMPTY_LIST; + protected List items = Collections.emptyList(); /** * Subscriptions to the root node diff --git a/extensions/src/main/java/org/jivesoftware/smackx/pubsub/provider/AffiliationsProvider.java b/extensions/src/main/java/org/jivesoftware/smackx/pubsub/provider/AffiliationsProvider.java index 1d1bf6ea1..7be0aa889 100644 --- a/extensions/src/main/java/org/jivesoftware/smackx/pubsub/provider/AffiliationsProvider.java +++ b/extensions/src/main/java/org/jivesoftware/smackx/pubsub/provider/AffiliationsProvider.java @@ -29,6 +29,7 @@ import org.jivesoftware.smackx.pubsub.AffiliationsExtension; * @author Robin Collier */public class AffiliationsProvider extends EmbeddedExtensionProvider { + @SuppressWarnings("unchecked") @Override protected PacketExtension createReturnExtension(String currentElement, String currentNamespace, Map attributeMap, List content) { diff --git a/extensions/src/main/java/org/jivesoftware/smackx/pubsub/provider/SubscriptionsProvider.java b/extensions/src/main/java/org/jivesoftware/smackx/pubsub/provider/SubscriptionsProvider.java index 38d4106f6..4dac11415 100644 --- a/extensions/src/main/java/org/jivesoftware/smackx/pubsub/provider/SubscriptionsProvider.java +++ b/extensions/src/main/java/org/jivesoftware/smackx/pubsub/provider/SubscriptionsProvider.java @@ -29,6 +29,7 @@ import org.jivesoftware.smackx.pubsub.SubscriptionsExtension; */ public class SubscriptionsProvider extends EmbeddedExtensionProvider { + @SuppressWarnings("unchecked") @Override protected PacketExtension createReturnExtension(String currentElement, String currentNamespace, Map attributeMap, List content) { diff --git a/extensions/src/main/java/org/jivesoftware/smackx/shim/packet/HeadersExtension.java b/extensions/src/main/java/org/jivesoftware/smackx/shim/packet/HeadersExtension.java index fe4b9261b..6b582f729 100644 --- a/extensions/src/main/java/org/jivesoftware/smackx/shim/packet/HeadersExtension.java +++ b/extensions/src/main/java/org/jivesoftware/smackx/shim/packet/HeadersExtension.java @@ -30,7 +30,7 @@ public class HeadersExtension implements PacketExtension { public static final String NAMESPACE = "http://jabber.org/protocol/shim"; - private Collection
headers = Collections.EMPTY_LIST; + private Collection
headers = Collections.emptyList(); public HeadersExtension(Collection
headerList) { diff --git a/extensions/src/main/java/org/jivesoftware/smackx/shim/provider/HeadersProvider.java b/extensions/src/main/java/org/jivesoftware/smackx/shim/provider/HeadersProvider.java index 0849180e2..5748012af 100644 --- a/extensions/src/main/java/org/jivesoftware/smackx/shim/provider/HeadersProvider.java +++ b/extensions/src/main/java/org/jivesoftware/smackx/shim/provider/HeadersProvider.java @@ -29,6 +29,7 @@ import org.jivesoftware.smackx.shim.packet.HeadersExtension; */ public class HeadersProvider extends EmbeddedExtensionProvider { + @SuppressWarnings("unchecked") @Override protected PacketExtension createReturnExtension(String currentElement, String currentNamespace, Map attributeMap, List content) { diff --git a/extensions/src/main/java/org/jivesoftware/smackx/si/provider/StreamInitiationProvider.java b/extensions/src/main/java/org/jivesoftware/smackx/si/provider/StreamInitiationProvider.java index 20c6da5cf..b613179d1 100644 --- a/extensions/src/main/java/org/jivesoftware/smackx/si/provider/StreamInitiationProvider.java +++ b/extensions/src/main/java/org/jivesoftware/smackx/si/provider/StreamInitiationProvider.java @@ -98,7 +98,7 @@ public class StreamInitiationProvider implements IQProvider { Date fileDate = new Date(); if (date != null) { try { - fileDate = StringUtils.parseXEP0082Date(date); + fileDate = StringUtils.parseDate(date); } catch (ParseException e) { // couldn't parse date, use current date-time } diff --git a/extensions/src/main/java/org/jivesoftware/smackx/xdata/provider/DataFormProvider.java b/extensions/src/main/java/org/jivesoftware/smackx/xdata/provider/DataFormProvider.java index 8286d75fd..de4bd01d2 100644 --- a/extensions/src/main/java/org/jivesoftware/smackx/xdata/provider/DataFormProvider.java +++ b/extensions/src/main/java/org/jivesoftware/smackx/xdata/provider/DataFormProvider.java @@ -42,7 +42,6 @@ public class DataFormProvider implements PacketExtensionProvider { public PacketExtension parseExtension(XmlPullParser parser) throws Exception { boolean done = false; - StringBuilder buffer = null; DataForm dataForm = new DataForm(parser.getAttributeValue("", "type")); while (!done) { int eventType = parser.next();