mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-09 09:09:38 +02:00
Xlint all the things
and fix all warnings.
This commit is contained in:
parent
7c5428ab0e
commit
f546d28ad8
50 changed files with 142 additions and 122 deletions
|
@ -217,7 +217,7 @@ public class AgentRoster {
|
|||
Presence presence = null;
|
||||
|
||||
while (it.hasNext()) {
|
||||
p = (Presence)userPresences.get(it.next());
|
||||
p = userPresences.get(it.next());
|
||||
if (presence == null){
|
||||
presence = p;
|
||||
}
|
||||
|
@ -346,7 +346,7 @@ public class AgentRoster {
|
|||
// Fire an event.
|
||||
synchronized (entries) {
|
||||
for (Iterator<String> i = entries.iterator(); i.hasNext();) {
|
||||
String entry = (String)i.next();
|
||||
String entry = i.next();
|
||||
if (entry.equals(key.asBareJidIfPossible())) {
|
||||
fireEvent(EVENT_PRESENCE_CHANGED, packet);
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ public class MacroGroup {
|
|||
Collection<Macro> col = Collections.unmodifiableList(macros);
|
||||
Iterator<Macro> iter = col.iterator();
|
||||
while (iter.hasNext()) {
|
||||
Macro macro = (Macro)iter.next();
|
||||
Macro macro = iter.next();
|
||||
if (macro.getTitle().equalsIgnoreCase(title)) {
|
||||
return macro;
|
||||
}
|
||||
|
@ -68,14 +68,14 @@ public class MacroGroup {
|
|||
}
|
||||
|
||||
public Macro getMacro(int location) {
|
||||
return (Macro)macros.get(location);
|
||||
return macros.get(location);
|
||||
}
|
||||
|
||||
public MacroGroup getMacroGroupByTitle(String title) {
|
||||
Collection<MacroGroup> col = Collections.unmodifiableList(macroGroups);
|
||||
Iterator<MacroGroup> iter = col.iterator();
|
||||
while (iter.hasNext()) {
|
||||
MacroGroup group = (MacroGroup)iter.next();
|
||||
MacroGroup group = iter.next();
|
||||
if (group.getTitle().equalsIgnoreCase(title)) {
|
||||
return group;
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ public class MacroGroup {
|
|||
}
|
||||
|
||||
public MacroGroup getMacroGroup(int location) {
|
||||
return (MacroGroup)macroGroups.get(location);
|
||||
return macroGroups.get(location);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -102,7 +102,7 @@ public class AgentStatus implements ExtensionElement {
|
|||
if (!currentChats.isEmpty()) {
|
||||
buf.append("<current-chats xmlns= \"http://jivesoftware.com/protocol/workgroup\">");
|
||||
for (Iterator<ChatInfo> it = currentChats.iterator(); it.hasNext();) {
|
||||
buf.append(((ChatInfo)it.next()).toXML());
|
||||
buf.append(it.next().toXML());
|
||||
}
|
||||
buf.append("</current-chats>");
|
||||
}
|
||||
|
@ -251,7 +251,7 @@ public class AgentStatus implements ExtensionElement {
|
|||
return agentStatus;
|
||||
}
|
||||
|
||||
private ChatInfo parseChatInfo(XmlPullParser parser) {
|
||||
private static ChatInfo parseChatInfo(XmlPullParser parser) {
|
||||
|
||||
String sessionID = parser.getAttributeValue("", "sessionID");
|
||||
String userID = parser.getAttributeValue("", "userID");
|
||||
|
|
|
@ -75,7 +75,7 @@ public class AgentStatusRequest extends IQ {
|
|||
buf.rightAngleBracket();
|
||||
synchronized (agents) {
|
||||
for (Iterator<Item> i=agents.iterator(); i.hasNext(); ) {
|
||||
Item item = (Item) i.next();
|
||||
Item item = i.next();
|
||||
buf.append("<agent jid=\"").append(item.getJID()).append("\">");
|
||||
if (item.getName() != null) {
|
||||
buf.append("<name xmlns=\""+ AgentInfo.NAMESPACE + "\">");
|
||||
|
|
|
@ -112,7 +112,7 @@ public class QueueDetails implements ExtensionElement {
|
|||
|
||||
synchronized (users) {
|
||||
for (Iterator<QueueUser> i=users.iterator(); i.hasNext(); ) {
|
||||
QueueUser user = (QueueUser)i.next();
|
||||
QueueUser user = i.next();
|
||||
int position = user.getQueuePosition();
|
||||
int timeRemaining = user.getEstimatedRemainingTime();
|
||||
Date timestamp = user.getQueueJoinTimestamp();
|
||||
|
|
|
@ -101,7 +101,7 @@ public class ChatSettings extends IQ {
|
|||
|
||||
public ChatSetting getFirstEntry() {
|
||||
if (settings.size() > 0) {
|
||||
return (ChatSetting)settings.get(0);
|
||||
return settings.get(0);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@ -146,7 +146,7 @@ public class ChatSettings extends IQ {
|
|||
return chatSettings;
|
||||
}
|
||||
|
||||
private ChatSetting parseChatSetting(XmlPullParser parser) throws XmlPullParserException, IOException {
|
||||
private static ChatSetting parseChatSetting(XmlPullParser parser) throws XmlPullParserException, IOException {
|
||||
|
||||
boolean done = false;
|
||||
String key = null;
|
||||
|
|
|
@ -174,7 +174,7 @@ public class MessageEventManager extends Manager {
|
|||
Method method =
|
||||
MessageEventRequestListener.class.getDeclaredMethod(
|
||||
methodName,
|
||||
new Class[] { String.class, String.class, MessageEventManager.class });
|
||||
new Class<?>[] { String.class, String.class, MessageEventManager.class });
|
||||
for (MessageEventRequestListener listener : messageEventRequestListeners) {
|
||||
method.invoke(listener, new Object[] { from, packetID, this });
|
||||
}
|
||||
|
@ -194,7 +194,7 @@ public class MessageEventManager extends Manager {
|
|||
Method method =
|
||||
MessageEventNotificationListener.class.getDeclaredMethod(
|
||||
methodName,
|
||||
new Class[] { String.class, String.class });
|
||||
new Class<?>[] { String.class, String.class });
|
||||
for (MessageEventNotificationListener listener : messageEventNotificationListeners) {
|
||||
method.invoke(listener, new Object[] { from, packetID });
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ public class RosterExchangeProvider extends ExtensionElementProvider<RosterExcha
|
|||
} else if (eventType == XmlPullParser.END_TAG) {
|
||||
if (parser.getName().equals("item")) {
|
||||
// Create packet.
|
||||
remoteRosterEntry = new RemoteRosterEntry(jid, name, (String[]) groupsName.toArray(new String[groupsName.size()]));
|
||||
remoteRosterEntry = new RemoteRosterEntry(jid, name, groupsName.toArray(new String[groupsName.size()]));
|
||||
rosterExchange.addRosterEntry(remoteRosterEntry);
|
||||
}
|
||||
if (parser.getName().equals("x")) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue