mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-10 17:49:38 +02:00
Lint fixes: Remove dead code, etc.
- make method static when possible - remove never thrown Exception declarations - other fixes
This commit is contained in:
parent
83b84c5bd3
commit
c6594aec2f
18 changed files with 48 additions and 65 deletions
|
@ -66,11 +66,12 @@ public class BookmarkManager {
|
|||
BookmarkManager manager = bookmarkManagerMap.get(connection);
|
||||
if (manager == null) {
|
||||
manager = new BookmarkManager(connection);
|
||||
bookmarkManagerMap.put(connection, manager);
|
||||
}
|
||||
return manager;
|
||||
}
|
||||
|
||||
private PrivateDataManager privateDataManager;
|
||||
private final PrivateDataManager privateDataManager;
|
||||
private Bookmarks bookmarks;
|
||||
private final Object bookmarkLock = new Object();
|
||||
|
||||
|
@ -80,9 +81,8 @@ public class BookmarkManager {
|
|||
*
|
||||
* @param connection the connection for persisting and retrieving bookmarks.
|
||||
*/
|
||||
private BookmarkManager(XMPPConnection connection) throws XMPPException, SmackException {
|
||||
private BookmarkManager(XMPPConnection connection) {
|
||||
privateDataManager = PrivateDataManager.getInstanceFor(connection);
|
||||
bookmarkManagerMap.put(connection, this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -142,7 +142,7 @@ public class ChatStateManager extends Manager {
|
|||
return false;
|
||||
}
|
||||
|
||||
private void fireNewChatState(Chat chat, ChatState state) {
|
||||
private static void fireNewChatState(Chat chat, ChatState state) {
|
||||
for (ChatMessageListener listener : chat.getListeners()) {
|
||||
if (listener instanceof ChatStateListener) {
|
||||
((ChatStateListener) listener).stateChanged(chat, state);
|
||||
|
|
|
@ -574,7 +574,7 @@ public class AdHocCommandManager extends Manager {
|
|||
* @param condition the condition of the error.
|
||||
* @throws NotConnectedException
|
||||
*/
|
||||
private IQ respondError(AdHocCommandData response,
|
||||
private static IQ respondError(AdHocCommandData response,
|
||||
XMPPError.Condition condition) {
|
||||
return respondError(response, new XMPPError(condition));
|
||||
}
|
||||
|
|
|
@ -31,6 +31,7 @@ import java.util.logging.Level;
|
|||
import java.util.logging.Logger;
|
||||
|
||||
import org.jivesoftware.smack.SmackException;
|
||||
import org.jivesoftware.smack.SmackException.NoResponseException;
|
||||
import org.jivesoftware.smack.XMPPException.XMPPErrorException;
|
||||
|
||||
|
||||
|
@ -193,10 +194,20 @@ public class IncomingFileTransfer extends FileTransfer {
|
|||
try {
|
||||
inputStream = streamNegotiatorTask.get(15, TimeUnit.SECONDS);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
throw new SmackException("Interruption while executing", e);
|
||||
}
|
||||
catch (ExecutionException e) {
|
||||
final Throwable cause = e.getCause();
|
||||
if (cause instanceof XMPPErrorException) {
|
||||
throw (XMPPErrorException) cause;
|
||||
}
|
||||
if (cause instanceof InterruptedException) {
|
||||
throw (InterruptedException) cause;
|
||||
}
|
||||
if (cause instanceof NoResponseException) {
|
||||
throw (NoResponseException) cause;
|
||||
}
|
||||
if (cause instanceof SmackException) {
|
||||
throw (SmackException) cause;
|
||||
}
|
||||
throw new SmackException("Error in execution", e);
|
||||
}
|
||||
catch (TimeoutException e) {
|
||||
|
|
|
@ -87,9 +87,7 @@ public abstract class StreamNegotiator {
|
|||
}
|
||||
|
||||
protected final IQ initiateIncomingStream(final XMPPConnection connection, StreamInitiation initiation)
|
||||
// CHECKSTYLE:OFF
|
||||
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
// CHECKSTYLE:ON
|
||||
throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
final StreamInitiation response = createInitiationAccept(initiation,
|
||||
getNamespaces());
|
||||
|
||||
|
|
|
@ -47,16 +47,6 @@ public class PubSub extends IQ
|
|||
setType(type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the XML element name of the extension sub-packet root element.
|
||||
*
|
||||
* @return the XML element name of the stanza(/packet) extension.
|
||||
*/
|
||||
@SuppressWarnings("static-method")
|
||||
public String getElementName() {
|
||||
return ELEMENT;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public <PE extends ExtensionElement> PE getExtension(PubSubElementType elem)
|
||||
{
|
||||
|
|
|
@ -19,7 +19,6 @@ package org.jivesoftware.smackx.xdatalayout.provider;
|
|||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import org.jivesoftware.smack.SmackException;
|
||||
import org.jivesoftware.smackx.xdatalayout.packet.DataLayout;
|
||||
import org.jivesoftware.smackx.xdatalayout.packet.DataLayout.DataFormLayoutElement;
|
||||
import org.jivesoftware.smackx.xdatalayout.packet.DataLayout.Fieldref;
|
||||
|
@ -37,8 +36,7 @@ import org.xmlpull.v1.XmlPullParserException;
|
|||
*/
|
||||
public class DataLayoutProvider {
|
||||
|
||||
public static DataLayout parse(XmlPullParser parser) throws XmlPullParserException, IOException,
|
||||
SmackException {
|
||||
public static DataLayout parse(XmlPullParser parser) throws XmlPullParserException, IOException {
|
||||
DataLayout dataLayout = new DataLayout(parser.getAttributeValue("", "label"));
|
||||
parseLayout(dataLayout.getPageLayout(), parser);
|
||||
return dataLayout;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue