Fixes warnings.

cusax-fix
Lyubomir Marinov 16 years ago
parent dfb0c91c94
commit df7dc66cb5

@ -47,7 +47,8 @@ public class XMLConfigurationStore
/**
* The list of properties currently registered in the configuration service.
*/
private Map<String, Object> properties = new Hashtable<String, Object>();
private Hashtable<String, Object> properties
= new Hashtable<String, Object>();
/**
* Contains the properties that were initially loaded from the configuration
@ -71,25 +72,7 @@ public class XMLConfigurationStore
@SuppressWarnings("unchecked")
private Map<String, Object> cloneProperties()
{
// at the time I'm writing this method we're implementing the
// configuration service through the use of a hashtable. this may very
// well change one day so let's not be presumptuous
if (properties instanceof Hashtable)
return
(Map<String, Object>)
((Hashtable<String, Object>) properties).clone();
if (properties instanceof HashMap)
return
(Map<String, Object>)
((HashMap<String, Object>) properties).clone();
if (properties instanceof TreeMap)
return
(Map<String, Object>)
((TreeMap<String, Object>) properties).clone();
// well you can't say that I didn't try!!!
return new Hashtable<String, Object>(properties);
return (Map<String, Object>) properties.clone();
}
private Document createPropertiesDocument()

@ -176,8 +176,10 @@ private void createDefaultContact(AccountID accountID)
}
@Override
public void modifyAccount(ProtocolProviderService protocolProvider,
Map accountProperties) throws NullPointerException
public void modifyAccount(
ProtocolProviderService protocolProvider,
Map<String, String> accountProperties)
throws NullPointerException
{
// TODO Auto-generated method stub
}

@ -1,3 +1,9 @@
/*
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package net.java.sip.communicator.impl.protocol.icq;
import java.util.*;
@ -26,24 +32,26 @@ public class IcqAccountID
*/
IcqAccountID(String uin, Map<String, String> accountProperties )
{
super(uin, accountProperties,
isAIM(accountProperties) ? ProtocolNames.AIM : ProtocolNames.ICQ,
super(
uin,
accountProperties,
isAIM(accountProperties) ? ProtocolNames.AIM : ProtocolNames.ICQ,
isAIM(accountProperties) ? "aim.com" : "icq.com");
}
/**
* Checks is the provided properties are for icq or aim account
* @param accountProperties account properties for the checked account.
* Checks whether the specified set of account properties describes an AIM
* account.
*
* @param accountProperties the set of account properties to be checked
* whether they describe an AIM account
* @return <tt>true</tt> if <tt>accountProperties</tt> describes an AIM
* account; otherwise, <tt>false</tt>
*/
static boolean isAIM(Map accountProperties)
static boolean isAIM(Map<String, String> accountProperties)
{
Object isAim = accountProperties.get(IS_AIM);
String isAim = accountProperties.get(IS_AIM);
if(isAim != null &&
isAim instanceof String &&
((String)isAim).equalsIgnoreCase("true"))
return true;
else
return false;
return "true".equalsIgnoreCase(isAim);
}
}

@ -469,11 +469,10 @@ public void buddyInfoUpdated(IcbmService service, Screenname buddy,
public void sendAutomaticallyFailed(
IcbmService service,
net.kano.joustsim.oscar.oscar.service.icbm.Message message,
Set triedConversations)
Set<Conversation> triedConversations)
{
logger.debug("sendAutomaticallyFailed message : " + message);
}
}
/**

@ -1163,13 +1163,13 @@ private class JoustSimBosListener implements MainBosServiceListener
* or certificate.
* @param extraInfos List
*/
public void handleYourExtraInfo(List extraInfos)
public void handleYourExtraInfo(List<ExtraInfoBlock> extraInfos)
{
logger.debug("Got extra info: " + extraInfos);
// @xxx we should one day probably do something here, like check
// whether the status message has been changed for example.
for (int i = 0; i < extraInfos.size(); i ++){
ExtraInfoBlock block = (ExtraInfoBlock) extraInfos.get(i);
for (ExtraInfoBlock block : extraInfos)
{
if (block.getType() == ExtraInfoBlock.TYPE_AVAILMSG){
String statusMessage = ExtraInfoData.readAvailableMessage(
block.getExtraData());

@ -192,10 +192,9 @@ public void buddyInfoUpdated(IcbmService service, Screenname buddy,
public void sendAutomaticallyFailed(
IcbmService service,
net.kano.joustsim.oscar.oscar.service.icbm.Message message,
Set triedConversations)
Set<Conversation> triedConversations)
{
}
}
/**
@ -242,7 +241,7 @@ public void sentMessage(Conversation conv, MessageInfo minfo){}
public void sendAutomaticallyFailed(IcbmService service,
net.kano.joustsim.oscar.oscar.
service.icbm.Message message,
Set triedConversations)
Set<Conversation> triedConversations)
{
}
}

@ -844,7 +844,7 @@ public void buddyInfoUpdated(IcbmService service, Screenname buddy,
public void sendAutomaticallyFailed(
IcbmService service,
net.kano.joustsim.oscar.oscar.service.icbm.Message message,
Set triedConversations)
Set<Conversation> triedConversations)
{
}
}

@ -229,8 +229,8 @@ public void processPacket(Packet packet)
logger.debug("GeolocationExtension found from " + from + ":" +
geolocExt.toXML());
Map newGeolocation = GeolocationJabberUtils
.convertExtensionToMap(geolocExt);
Map<String, String> newGeolocation
= GeolocationJabberUtils.convertExtensionToMap(geolocExt);
this.fireGeolocationContactChangeEvent(
from,
@ -244,10 +244,10 @@ public void processPacket(Packet packet)
* @param sourceContact which send a new Geolocation.
* @param newGeolocation the new given Geolocation.
*/
public void fireGeolocationContactChangeEvent(String sourceContact,
Map newGeolocation)
public void fireGeolocationContactChangeEvent(
String sourceContact,
Map<String, String> newGeolocation)
{
logger.debug("Trying to dispatch geolocation contact update for "
+ sourceContact);
@ -264,7 +264,7 @@ public void fireGeolocationContactChangeEvent(String sourceContact,
+ geolocationContactsListeners.size()
+ " evt=" + evt);
GeolocationListener[] listeners = null;
GeolocationListener[] listeners;
synchronized (geolocationContactsListeners)
{
@ -275,9 +275,7 @@ public void fireGeolocationContactChangeEvent(String sourceContact,
}
for (GeolocationListener listener : listeners)
{
listener.contactGeolocationChanged(evt);
}
}
}
}

@ -657,8 +657,8 @@ else if(evt.getNewState() == RegistrationState.UNREGISTERED
//send event notifications saying that all our buddies are
//offline.
Iterator rootContactsIter =
getServerStoredContactListRoot().contacts();
Iterator<Contact> rootContactsIter
= getServerStoredContactListRoot().contacts();
while(rootContactsIter.hasNext())
{
ContactMsnImpl contact

@ -383,7 +383,7 @@ private void changePresenceStatusForAllContacts(
PresenceStatus newStatus)
{
//first set the status for contacts in this group
Iterator childContacts = parent.contacts();
Iterator<Contact> childContacts = parent.contacts();
while(childContacts.hasNext())
{
@ -404,11 +404,11 @@ private void changePresenceStatusForAllContacts(
}
//now call this method recursively for all subgroups
Iterator subgroups = parent.subgroups();
Iterator<ContactGroup> subgroups = parent.subgroups();
while(subgroups.hasNext())
{
ContactGroup subgroup = (ContactGroup)subgroups.next();
ContactGroup subgroup = subgroups.next();
changePresenceStatusForAllContacts(subgroup, newStatus);
}
}
@ -743,7 +743,7 @@ public Contact createUnresolvedContact(
* @return a list of all contacts in other providers' contact lists that
* point to us.
*/
public List findContactsPointingToUs()
public List<Contact> findContactsPointingToUs()
{
List<Contact> contacts = new LinkedList<Contact>();
BundleContext bc = SSHActivator.getBundleContext();
@ -854,14 +854,12 @@ public void registrationStateChanged(RegistrationStateChangeEvent evt)
//offline. The icq protocol does not implement top level buddies
//nor subgroups for top level groups so a simple nested loop
//would be enough.
Iterator groupsIter = getServerStoredContactListRoot()
.subgroups();
Iterator<ContactGroup> groupsIter
= getServerStoredContactListRoot().subgroups();
while (groupsIter.hasNext())
{
ContactGroupSSHImpl group
= (ContactGroupSSHImpl) groupsIter.next();
Iterator contactsIter = group.contacts();
ContactGroup group = groupsIter.next();
Iterator<Contact> contactsIter = group.contacts();
while (contactsIter.hasNext())
{

@ -8,6 +8,8 @@
import java.util.*;
import net.java.sip.communicator.service.protocol.*;
/**
* The Yahoo implementation of the Volatile ContactGroup interface.
*
@ -55,10 +57,12 @@ public String toString()
buff.append(getGroupName());
buff.append(", childContacts="+countContacts()+":[");
Iterator contacts = contacts();
Iterator<Contact> contacts = contacts();
while (contacts.hasNext())
{
ContactYahooImpl contact = (ContactYahooImpl) contacts.next();
Contact contact = contacts.next();
buff.append(contact.toString());
if(contacts.hasNext())
buff.append(", ");

@ -329,7 +329,7 @@ protected void changePresenceStatusForAllContacts(ContactGroup parent,
PresenceStatus newStatus)
{
//first set the status for contacts in this group
Iterator childContacts = parent.contacts();
Iterator<Contact> childContacts = parent.contacts();
while(childContacts.hasNext())
{
@ -350,11 +350,11 @@ protected void changePresenceStatusForAllContacts(ContactGroup parent,
}
//now call this method recursively for all subgroups
Iterator subgroups = parent.subgroups();
Iterator<ContactGroup> subgroups = parent.subgroups();
while(subgroups.hasNext())
{
ContactGroup subgroup = (ContactGroup)subgroups.next();
ContactGroup subgroup = subgroups.next();
changePresenceStatusForAllContacts(subgroup, newStatus);
}
}
@ -720,14 +720,12 @@ public void registrationStateChanged(RegistrationStateChangeEvent evt)
//offline. The Zeroconf protocol does not implement top level buddies
//nor subgroups for top level groups so a simple nested loop
//would be enough.
Iterator groupsIter = getServerStoredContactListRoot()
.subgroups();
Iterator<ContactGroup> groupsIter
= getServerStoredContactListRoot().subgroups();
while (groupsIter.hasNext())
{
ContactGroupZeroconfImpl group
= (ContactGroupZeroconfImpl) groupsIter.next();
Iterator contactsIter = group.contacts();
ContactGroup group = groupsIter.next();
Iterator<Contact> contactsIter = group.contacts();
while (contactsIter.hasNext())
{

@ -574,11 +574,11 @@ private void answerCall(Call call)
= call
.getProtocolProvider()
.getOperationSet(OperationSetBasicTelephony.class);
Iterator peers = call.getCallPeers();
Iterator<? extends CallPeer> peers = call.getCallPeers();
while(peers.hasNext())
{
CallPeer peer = (CallPeer)peers.next();
CallPeer peer = peers.next();
try
{

@ -206,7 +206,7 @@ static void assertGroupEquals( MockContactGroup expectedGroup,
//go over the subgroups and check that they've been all added to the
//meta contact list.
Iterator expectedSubgroups = expectedGroup.subgroups();
Iterator<ContactGroup> expectedSubgroups = expectedGroup.subgroups();
while (expectedSubgroups.hasNext() )
{
MockContactGroup expectedSubGroup
@ -220,14 +220,14 @@ static void assertGroupEquals( MockContactGroup expectedGroup,
expectedSubGroup, actualSubGroup, ignoreEmptyMetaGroups);
}
Iterator actualContactsIter = actualGroup.getChildContacts();
Iterator<MetaContact> actualContactsIter
= actualGroup.getChildContacts();
//check whether every contact in the meta list exists in the source
//mock provider contact list.
while (actualContactsIter.hasNext())
{
MetaContact actualMetaContact
= (MetaContact) actualContactsIter.next();
MetaContact actualMetaContact = actualContactsIter.next();
assertEquals("Number of protocol specific contacts in a MetaContact"
, 1, actualMetaContact.getContactCount());

Loading…
Cancel
Save