Fixes warnings, mostly ones related to raw-type uses.

cusax-fix
Lyubomir Marinov 16 years ago
parent 144a0baee3
commit a6c3303f88

@ -38,7 +38,7 @@ public class OperationSetPersistentPresenceYahooImpl
private String currentStatusMessage = "";
/**
* The presence status that we were last notified of etnering.
* The presence status that we were last notified of entering.
* The initial one is OFFLINE
*/
private PresenceStatus currentStatus = YahooStatusEnum.OFFLINE;
@ -47,7 +47,7 @@ public class OperationSetPersistentPresenceYahooImpl
* Sometimes status changes are received before the contact list is inited
* here we store such events so we can show them correctly
*/
private Hashtable earlyStatusChange = new Hashtable();
// private Hashtable earlyStatusChange = new Hashtable();
/**
* The array list we use when returning from the getSupportedStatusSet()
@ -676,14 +676,11 @@ private void initContactStatuses()
{
YahooGroup[] groups = parentProvider.getYahooSession().getGroups();
for (int i = 0; i < groups.length; i++)
for (YahooGroup item : groups)
{
YahooGroup item = groups[i];
Iterator iter = item.getMembers().iterator();
while(iter.hasNext())
Iterable<YahooUser> members = item.getMembers();
for (YahooUser user : members)
{
YahooUser user = (YahooUser)iter.next();
ContactYahooImpl sourceContact =
ssContactList.findContactById(user.getId());
@ -755,14 +752,12 @@ else if(evt.getNewState() == RegistrationState.UNREGISTERED
//offline. The protocol does not implement top level buddies
//nor subgroups for top level groups so a simple nested loop
//would be enough.
Iterator groupsIter =
Iterator<ContactGroup> groupsIter =
getServerStoredContactListRoot().subgroups();
while(groupsIter.hasNext())
{
ContactGroupYahooImpl group
= (ContactGroupYahooImpl)groupsIter.next();
Iterator contactsIter = group.contacts();
ContactGroup group = groupsIter.next();
Iterator<Contact> contactsIter = group.contacts();
while(contactsIter.hasNext())
{

@ -176,25 +176,6 @@ public String getPreReleaseID()
return PRE_RELEASE_ID;
}
/**
* Compares another <tt>Version</tt> object to this one and returns a
* negative, zero or a positive integer if this version instance represents
* respectively an earlier, same, or later version as the one indicated
* by the <tt>version</tt> parameter.
*
* @param version the <tt>Version</tt> instance that we'd like to compare
* to this one.
*
* @return a negative integer, zero, or a positive integer as this object
* represents a version that is earlier, same, or more recent than the one
* referenced by the <tt>version</tt> parameter.
*/
public int compareTo(Object version)
{
return compareTo((Version)version);
}
/**
* Compares another <tt>Version</tt> object to this one and returns a
* negative, zero or a positive integer if this version instance represents

@ -76,11 +76,11 @@ public String getDescription()
private void initResources( ResourceBundle resourceBundle,
Map<String, String> resources)
{
Enumeration colorKeys = resourceBundle.getKeys();
Enumeration<String> colorKeys = resourceBundle.getKeys();
while (colorKeys.hasMoreElements())
{
String key = (String) colorKeys.nextElement();
String key = colorKeys.nextElement();
String value = resourceBundle.getString(key);
resources.put(key, value);

@ -76,11 +76,11 @@ public String getDescription()
private void initResources( ResourceBundle resourceBundle,
Map<String, String> resources)
{
Enumeration colorKeys = resourceBundle.getKeys();
Enumeration<String> colorKeys = resourceBundle.getKeys();
while (colorKeys.hasMoreElements())
{
String key = (String) colorKeys.nextElement();
String key = colorKeys.nextElement();
String value = resourceBundle.getString(key);
resources.put(key, value);

@ -76,11 +76,11 @@ public String getDescription()
private void initResources( ResourceBundle resourceBundle,
Map<String, String> resources)
{
Enumeration colorKeys = resourceBundle.getKeys();
Enumeration<String> colorKeys = resourceBundle.getKeys();
while (colorKeys.hasMoreElements())
{
String key = (String) colorKeys.nextElement();
String key = colorKeys.nextElement();
String value = resourceBundle.getString(key);
resources.put(key, value);

@ -10,9 +10,9 @@
import java.awt.geom.*;
import java.awt.print.*;
import java.util.List;
import java.util.concurrent.*;
import javax.swing.*;
import javax.swing.plaf.*;
import net.java.sip.communicator.plugin.whiteboard.gui.whiteboardshapes.*;
import net.java.sip.communicator.util.swing.*;
@ -29,7 +29,7 @@ public class WhiteboardPanel
/**
* Shapes to display
*/
private List displayList = new CopyOnWriteArrayList();
private final List<WhiteboardShape> displayList;
/**
* Default grid space
@ -46,7 +46,7 @@ public class WhiteboardPanel
/**
* Parent WhiteboardFrame
*/
private WhiteboardFrame wf;
private final WhiteboardFrame wf;
/**
* WhiteboardPanel constructor.
@ -54,9 +54,8 @@ public class WhiteboardPanel
* @param displayList Shapes to display
* @param wf WhiteboardFrame
*/
public WhiteboardPanel(List displayList, WhiteboardFrame wf)
public WhiteboardPanel(List<WhiteboardShape> displayList, WhiteboardFrame wf)
{
super();
this.wf = wf;
this.displayList = displayList;
affineTrans = new AffineTransform();
@ -109,13 +108,10 @@ public void paintComponent(Graphics g)
}
}
}
WhiteboardShape s;
for (int i = 0; i < displayList.size(); i++)
{
s = (WhiteboardShape) displayList.get(i);
for (WhiteboardShape s : displayList)
s.paint(g, affineTrans);
}
}
finally
{
g.dispose();

@ -12,7 +12,7 @@
*
* @author Emil Ivov
*/
public interface Version extends Comparable
public interface Version extends Comparable<Version>
{
/**
* Returns the version major of the current SIP Communicator version. In an

@ -331,7 +331,7 @@ public void messageTests()
/**
* This matches all written messages, they are minimum 5
*/
Collection rs = metaHistoryService.findByKeyword(
Collection<Object> rs = metaHistoryService.findByKeyword(
new String[]{MessageHistoryService.class.getName()},
testMetaContact, "test");
@ -503,11 +503,11 @@ public void callTests()
* This must match also many calls, as tests are run many times
* but the minimum is 3
*/
Collection rs = metaHistoryService.findByEndDate(
Collection<Object> rs = metaHistoryService.findByEndDate(
new String[]{CallHistoryService.class.getName()},
null,
controlDate2);
Iterator resultIter = getCalls(rs).iterator();
Iterator<?> resultIter = getCalls(rs).iterator();
assertTrue("Calls too few - findByEndDate", rs.size() >= 3);
@ -779,7 +779,7 @@ public void fileTests()
public void metaTests()
{
Collection rs = metaHistoryService.findByStartDate(
Collection<Object> rs = metaHistoryService.findByStartDate(
new String[]{
MessageHistoryService.class.getName(),
FileHistoryService.class.getName(),
@ -918,46 +918,43 @@ public void testPurgeLocalContactListCopy()
metaClService.purgeLocallyStoredContactListCopy();
}
private List<String> getMessages(Collection rs)
private List<String> getMessages(Collection<Object> rs)
{
List<String> result = new Vector<String>();
Iterator iter = rs.iterator();
while (iter.hasNext())
for (Object item : rs)
{
Object item = iter.next();
if(item instanceof MessageDeliveredEvent)
result.add(((MessageDeliveredEvent)item).getSourceMessage().getContent());
result.add(
((MessageDeliveredEvent)item)
.getSourceMessage().getContent());
else if(item instanceof MessageReceivedEvent)
result.add(((MessageReceivedEvent)item).getSourceMessage().getContent());
result.add(
((MessageReceivedEvent)item)
.getSourceMessage().getContent());
}
return result;
}
private List<CallRecord> getCalls(Collection rs)
private List<CallRecord> getCalls(Collection<Object> rs)
{
List<CallRecord> result = new Vector<CallRecord>();
Iterator iter = rs.iterator();
while (iter.hasNext())
{
Object item = iter.next();
for (Object item : rs)
if (item instanceof CallRecord)
result.add((CallRecord) item);
}
return result;
}
private Collection<FileRecord> getFileRecords(Collection rs)
private Collection<FileRecord> getFileRecords(Collection<Object> rs)
{
List<FileRecord> result = new Vector<FileRecord>();
Iterator iter = rs.iterator();
while (iter.hasNext())
{
Object item = iter.next();
for (Object item : rs)
if (item instanceof FileRecord)
result.add((FileRecord) item);
}
return result;
}

@ -8,17 +8,16 @@
import java.util.*;
import org.osgi.framework.*;
import junit.framework.*;
import net.java.sip.communicator.impl.protocol.mock.*;
import net.java.sip.communicator.service.contactlist.*;
import net.java.sip.communicator.service.history.*;
import net.java.sip.communicator.service.history.records.*;
import net.java.sip.communicator.service.msghistory.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.protocol.event.*;
import net.java.sip.communicator.util.*;
import org.osgi.framework.*;
/**
* Tests message history.
* First installs the MoxkProtocolProvider to be able to send some messages
@ -241,7 +240,8 @@ public void readRecords()
/**
* This matches all written messages, they are minimum 5
*/
Collection rs = msgHistoryService.findByKeyword(testMetaContact, "test");
Collection<EventObject> rs
= msgHistoryService.findByKeyword(testMetaContact, "test");
assertTrue("Nothing found findByKeyword ", !rs.isEmpty());
@ -254,7 +254,9 @@ public void readRecords()
*/
rs = msgHistoryService.findByKeyword(testMetaContact, "Test", false);
assertTrue("Nothing found findByKeyword caseINsensitive search", !rs.isEmpty());
assertTrue(
"Nothing found findByKeyword caseINsensitive search",
!rs.isEmpty());
msgs = getMessages(rs);
@ -262,7 +264,9 @@ public void readRecords()
rs = msgHistoryService.findByKeyword(testMetaContact, "Test", true);
assertFalse("Something found by findByKeyword casesensitive search", !rs.isEmpty());
assertFalse(
"Something found by findByKeyword casesensitive search",
!rs.isEmpty());
/**
* This must match also many messages, as tests are run many times
@ -466,7 +470,8 @@ public void readRecordsFromMultiChat()
/**
* This matches all written messages, they are minimum 5
*/
Collection rs = msgHistoryService.findByKeyword(room, "test");
Collection<EventObject> rs
= msgHistoryService.findByKeyword(room, "test");
assertTrue("Nothing found findByKeyword ", !rs.isEmpty());
@ -620,30 +625,31 @@ public void testPurgeLocalContactListCopy()
metaClService.purgeLocallyStoredContactListCopy();
}
private List<String> getMessages(Collection rs)
private List<String> getMessages(Collection<EventObject> rs)
{
List<String> result = new Vector<String>();
Iterator iter = rs.iterator();
while (iter.hasNext())
for (EventObject item : rs)
{
Object item = iter.next();
if(item instanceof MessageDeliveredEvent)
result.add(((MessageDeliveredEvent)item).getSourceMessage().getContent());
else
if(item instanceof MessageReceivedEvent)
result.add(((MessageReceivedEvent)item).getSourceMessage().getContent());
result.add(
((MessageDeliveredEvent)item)
.getSourceMessage().getContent());
else if(item instanceof MessageReceivedEvent)
result.add(
((MessageReceivedEvent)item)
.getSourceMessage().getContent());
}
return result;
}
private List<String> getChatMessages(Collection rs)
private List<String> getChatMessages(Collection<EventObject> rs)
{
List<String> result = new Vector<String>();
Iterator iter = rs.iterator();
while (iter.hasNext())
for (EventObject item : rs)
{
Object item = iter.next();
if(item instanceof ChatRoomMessageDeliveredEvent)
result.add(((ChatRoomMessageDeliveredEvent)item).
getMessage().getContent());
@ -656,20 +662,19 @@ private List<String> getChatMessages(Collection rs)
return result;
}
private void dumpResult(QueryResultSet rs)
{
while (rs.hasNext())
{
HistoryRecord hr = (HistoryRecord)rs.next();
logger.info("----------------------");
for (int i = 0; i < hr.getPropertyNames().length; i++)
{
logger.info(hr.getPropertyNames()[i] + " => " + hr.getPropertyValues()[i]);
}
logger.info("----------------------");
}
}
// private void dumpResult(QueryResultSet rs)
// {
// while (rs.hasNext())
// {
// HistoryRecord hr = (HistoryRecord)rs.next();
// logger.info("----------------------");
//
// for (int i = 0; i < hr.getPropertyNames().length; i++)
// {
// logger.info(hr.getPropertyNames()[i] + " => " + hr.getPropertyValues()[i]);
// }
//
// logger.info("----------------------");
// }
// }
}

@ -92,15 +92,16 @@ protected void tearDown()
private static boolean isLocalInterfaceAddress(InetAddress address)
{
try {
Enumeration intfs = NetworkInterface.getNetworkInterfaces();
Enumeration<NetworkInterface> intfs
= NetworkInterface.getNetworkInterfaces();
while (intfs.hasMoreElements())
{
NetworkInterface intf = (NetworkInterface) intfs.nextElement();
Enumeration addrs = intf.getInetAddresses();
NetworkInterface intf = intfs.nextElement();
Enumeration<InetAddress> addrs = intf.getInetAddresses();
while (addrs.hasMoreElements())
{
try {
InetAddress addr = (InetAddress) addrs.nextElement();
InetAddress addr = addrs.nextElement();
if(addr.equals(address))
return true;
} catch (Exception e)
@ -610,6 +611,7 @@ private InetAddress getStunAddress()
return null;
}
private void initProperties()
{
try
@ -622,8 +624,4 @@ private void initProperties()
}
catch(Exception ex){}
}
}

Loading…
Cancel
Save