Commits the patch of Sebastien Vincent provided on the dev mailing list in an e-mail with the subject "[Patch] Warnings" which fixes multiple warnings about unnecessary casts, missing or incorrect javadocs.

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

@ -106,10 +106,11 @@ public Collection<CallRecord> findByStartDate(Date startDate)
History history = this.getHistory(null, null);
HistoryReader reader = history.getReader();
addHistorySearchProgressListeners(reader, 1);
QueryResultSet rs = reader.findByStartDate(startDate);
QueryResultSet<HistoryRecord> rs
= reader.findByStartDate(startDate);
while (rs.hasNext())
{
HistoryRecord hr = (HistoryRecord) rs.next();
HistoryRecord hr = rs.next();
result.add(convertHistoryRecordToCallRecord(hr));
}
removeHistorySearchProgressListeners(reader);
@ -154,10 +155,10 @@ public Collection<CallRecord> findByEndDate(Date endDate) throws RuntimeExceptio
History history = this.getHistory(null, null);
HistoryReader reader = history.getReader();
addHistorySearchProgressListeners(reader, 1);
QueryResultSet rs = reader.findByEndDate(endDate);
QueryResultSet<HistoryRecord> rs = reader.findByEndDate(endDate);
while (rs.hasNext())
{
HistoryRecord hr = (HistoryRecord) rs.next();
HistoryRecord hr = rs.next();
result.add(convertHistoryRecordToCallRecord(hr));
}
removeHistorySearchProgressListeners(reader);
@ -204,10 +205,11 @@ public Collection<CallRecord> findByPeriod(Date startDate, Date endDate) throws
History history = this.getHistory(null, null);
HistoryReader reader = history.getReader();
addHistorySearchProgressListeners(reader, 1);
QueryResultSet rs = reader.findByPeriod(startDate, endDate);
QueryResultSet<HistoryRecord> rs
= reader.findByPeriod(startDate, endDate);
while (rs.hasNext())
{
HistoryRecord hr = (HistoryRecord) rs.next();
HistoryRecord hr = rs.next();
result.add(convertHistoryRecordToCallRecord(hr));
}
removeHistorySearchProgressListeners(reader);
@ -250,10 +252,11 @@ public Collection<CallRecord> findLast(int count) throws RuntimeException
{
// the default ones
History history = this.getHistory(null, null);
QueryResultSet rs = history.getReader().findLast(count);
QueryResultSet<HistoryRecord> rs
= history.getReader().findLast(count);
while (rs.hasNext())
{
HistoryRecord hr = (HistoryRecord) rs.next();
HistoryRecord hr = rs.next();
result.add(convertHistoryRecordToCallRecord(hr));
}
}
@ -281,11 +284,11 @@ public Collection<CallRecord> findByPeer(String address)
History history = this.getHistory(null, null);
HistoryReader reader = history.getReader();
addHistorySearchProgressListeners(reader, 1);
QueryResultSet rs =
reader.findByKeyword(address, "callParticipantIDs");
QueryResultSet<HistoryRecord> rs
= reader.findByKeyword(address, "callParticipantIDs");
while (rs.hasNext())
{
HistoryRecord hr = (HistoryRecord) rs.next();
HistoryRecord hr = rs.next();
result.add(convertHistoryRecordToCallRecord(hr));
}
removeHistorySearchProgressListeners(reader);
@ -679,9 +682,8 @@ private void handleProviderAdded(ProtocolProviderService provider)
logger.debug("Adding protocol provider " + provider.getProtocolName());
// check whether the provider has a basic telephony operation set
OperationSetBasicTelephony opSetTelephony =
(OperationSetBasicTelephony) provider
.getOperationSet(OperationSetBasicTelephony.class);
OperationSetBasicTelephony opSetTelephony
= provider.getOperationSet(OperationSetBasicTelephony.class);
if (opSetTelephony != null)
{
@ -701,9 +703,8 @@ private void handleProviderAdded(ProtocolProviderService provider)
*/
private void handleProviderRemoved(ProtocolProviderService provider)
{
OperationSetBasicTelephony opSetTelephony =
(OperationSetBasicTelephony) provider
.getOperationSet(OperationSetBasicTelephony.class);
OperationSetBasicTelephony opSetTelephony
= provider.getOperationSet(OperationSetBasicTelephony.class);
if (opSetTelephony != null)
{

@ -210,9 +210,8 @@ public void stop(BundleContext bc)
//stop listening to all currently installed providers
for (ProtocolProviderService pp : currentlyInstalledProviders.values())
{
OperationSetPersistentPresence opSetPersPresence
= (OperationSetPersistentPresence)pp
.getOperationSet(OperationSetPersistentPresence.class);
OperationSetPersistentPresence opSetPersPresence =
pp.getOperationSet(OperationSetPersistentPresence.class);
if(opSetPersPresence !=null)
{
@ -226,8 +225,8 @@ public void stop(BundleContext bc)
else
{
//check if a non persistent presence operation set exists.
OperationSetPresence opSetPresence = (OperationSetPresence)pp
.getOperationSet(OperationSetPresence.class);
OperationSetPresence opSetPresence =
pp.getOperationSet(OperationSetPresence.class);
if(opSetPresence != null)
{
@ -357,8 +356,7 @@ private void addNewContactToMetaContact( ProtocolProviderService provider,
throws MetaContactListException
{
OperationSetPersistentPresence opSetPersPresence =
(OperationSetPersistentPresence) provider
.getOperationSet(OperationSetPersistentPresence.class);
provider.getOperationSet(OperationSetPersistentPresence.class);
if (opSetPersPresence == null)
{
/** @todo handle non-persistent presence operation sets as well */
@ -507,8 +505,7 @@ private ContactGroup resolveProtoPath(ProtocolProviderService protoProvider,
}
OperationSetPersistentPresence opSetPersPresence =
(OperationSetPersistentPresence) protoProvider
.getOperationSet(OperationSetPersistentPresence.class);
protoProvider.getOperationSet(OperationSetPersistentPresence.class);
//if persistent presence is not supported - just bail
//we should have verified this earlier anyway
@ -884,8 +881,9 @@ public void moveContact(Contact contact,
currentParentMetaContact.removeProtoContact(contact);
//get a persistent presence operation set
OperationSetPersistentPresence opSetPresence =
(OperationSetPersistentPresence) contact.getProtocolProvider()
OperationSetPersistentPresence opSetPresence
= contact
.getProtocolProvider()
.getOperationSet(OperationSetPersistentPresence.class);
if (opSetPresence == null)
@ -985,9 +983,10 @@ public void moveMetaContact(MetaContact metaContact,
.getProtocolProvider(), (MetaContactGroupImpl) newMetaGroup);
//get a persistent or non persistent presence operation set
OperationSetPersistentPresence opSetPresence =
(OperationSetPersistentPresence) protoContact
.getProtocolProvider().getOperationSet(
OperationSetPersistentPresence opSetPresence
= protoContact
.getProtocolProvider()
.getOperationSet(
OperationSetPersistentPresence.class);
if (opSetPresence == null)
@ -1034,8 +1033,9 @@ public void removeContact(Contact contact) throws MetaContactListException
//updating and/or removing the corresponding meta contact would happen
//once a confirmation event is received from the underlying protocol
//provider
OperationSetPresence opSetPresence =
(OperationSetPresence) contact.getProtocolProvider()
OperationSetPresence opSetPresence
= contact
.getProtocolProvider()
.getOperationSet(OperationSetPresence.class);
//in case the provider only has a persistent operation set:
@ -1139,9 +1139,10 @@ public void removeMetaContactGroup(
{
ContactGroup protoGroup = protoGroups.next();
OperationSetPersistentPresence opSetPersPresence =
(OperationSetPersistentPresence) protoGroup
.getProtocolProvider().getOperationSet(
OperationSetPersistentPresence opSetPersPresence
= protoGroup
.getProtocolProvider()
.getOperationSet(
OperationSetPersistentPresence.class);
if (opSetPersPresence == null)
@ -1614,8 +1615,7 @@ private synchronized void handleProviderAdded(
// check whether the provider has a persistent presence op set
OperationSetPersistentPresence opSetPersPresence =
(OperationSetPersistentPresence) provider
.getOperationSet(OperationSetPersistentPresence.class);
provider.getOperationSet(OperationSetPersistentPresence.class);
this.currentlyInstalledProviders.put(
provider.getAccountID().getAccountUniqueID(),
@ -1673,9 +1673,8 @@ private void handleProviderRemoved(
remove(provider.getAccountID().getAccountUniqueID());
//get the root group for the provider so that we could remove it.
OperationSetPersistentPresence persPresOpSet
= (OperationSetPersistentPresence)provider
.getOperationSet(OperationSetPersistentPresence.class);
OperationSetPersistentPresence persPresOpSet =
provider.getOperationSet(OperationSetPersistentPresence.class);
//ignore if persistent presence is not supported.
if(persPresOpSet == null)
@ -2708,8 +2707,8 @@ ContactGroup loadStoredContactGroup(MetaContactGroupImpl containingMetaGroup,
//get the presence op set
ProtocolProviderService sourceProvider =
currentlyInstalledProviders.get(accountID);
OperationSetPersistentPresence presenceOpSet =
(OperationSetPersistentPresence) sourceProvider
OperationSetPersistentPresence presenceOpSet
= sourceProvider
.getOperationSet(OperationSetPersistentPresence.class);
ContactGroup newProtoGroup = presenceOpSet.createUnresolvedContactGroup(
@ -2758,8 +2757,8 @@ void loadStoredMetaContact(
//mc
ProtocolProviderService sourceProvider =
currentlyInstalledProviders.get(accountID);
OperationSetPersistentPresence presenceOpSet =
(OperationSetPersistentPresence) sourceProvider
OperationSetPersistentPresence presenceOpSet
= sourceProvider
.getOperationSet(OperationSetPersistentPresence.class);
for (MclStorageManager.StoredProtoContactDescriptor contactDescriptor

@ -387,8 +387,8 @@ public void addProtocolSupportedOperationSets(
}
// Obtain the ad-hoc multi user chat operation set.
OperationSetAdHocMultiUserChat adHocMultiChatOpSet =
(OperationSetAdHocMultiUserChat) protocolProvider
OperationSetAdHocMultiUserChat adHocMultiChatOpSet
= protocolProvider
.getOperationSet(OperationSetAdHocMultiUserChat.class);
if (adHocMultiChatOpSet != null)
@ -403,13 +403,11 @@ public void addProtocolSupportedOperationSets(
// Obtain file transfer operation set.
OperationSetFileTransfer fileTransferOpSet
= (OperationSetFileTransfer) protocolProvider
.getOperationSet(OperationSetFileTransfer.class);
= protocolProvider.getOperationSet(OperationSetFileTransfer.class);
if (fileTransferOpSet != null)
{
fileTransferOpSet.addFileTransferListener(
getContactListPanel());
fileTransferOpSet.addFileTransferListener(getContactListPanel());
}
}

@ -82,18 +82,15 @@ public void addAccount(ProtocolProviderService pps)
}
else
{
OperationSetPresence presence =
(OperationSetPresence) pps
.getOperationSet(OperationSetPresence.class);
OperationSetPresence selectedPresence =
(OperationSetPresence) selectedProvider
.getOperationSet(OperationSetPresence.class);
OperationSetPresence presence
= pps.getOperationSet(OperationSetPresence.class);
OperationSetPresence selectedPresence
= selectedProvider.getOperationSet(OperationSetPresence.class);
if (presence != null
&& selectedPresence != null
&& (selectedPresence.getPresenceStatus().getStatus() < presence
.getPresenceStatus().getStatus()))
&& (selectedPresence.getPresenceStatus().getStatus()
< presence.getPresenceStatus().getStatus()))
{
setSelected(pps);
}

@ -260,7 +260,7 @@ public CreateCallThread(ProtocolProviderService protocolProvider,
public void run()
{
OperationSetBasicTelephony telephonyOpSet
= (OperationSetBasicTelephony) protocolProvider
= protocolProvider
.getOperationSet(OperationSetBasicTelephony.class);
/*
@ -326,8 +326,7 @@ public void run()
{
CallPeer peer = peers.next();
OperationSetBasicTelephony telephony =
(OperationSetBasicTelephony) pps
.getOperationSet(OperationSetBasicTelephony.class);
pps.getOperationSet(OperationSetBasicTelephony.class);
try
{
@ -363,8 +362,7 @@ public CreateConferenceCallThread(
public void run()
{
OperationSetTelephonyConferencing confOpSet
= (OperationSetTelephonyConferencing) protocolProvider
.getOperationSet(OperationSetTelephonyConferencing.class);
= protocolProvider.getOperationSet(OperationSetTelephonyConferencing.class);
/*
* XXX If we are here and we just discover that

@ -419,18 +419,15 @@ private void sendDtmfTone(DTMFTone dtmfTone)
while (callPeers.hasNext())
{
CallPeer peer = callPeers.next();
if (peer.getProtocolProvider()
.getOperationSet(OperationSetDTMF.class) != null)
{
OperationSetDTMF dtmfOpSet
= (OperationSetDTMF) peer.getProtocolProvider()
= peer
.getProtocolProvider()
.getOperationSet(OperationSetDTMF.class);
if (dtmfOpSet != null)
dtmfOpSet.sendDTMF(peer, dtmfTone);
}
}
}
catch (NullPointerException e1)
{
logger.error("Failed to send a DTMF tone.", e1);

@ -122,7 +122,7 @@ public void actionPerformed(ActionEvent evt)
if (call != null)
{
OperationSetBasicTelephony telephony =
(OperationSetBasicTelephony) call.getProtocolProvider()
call.getProtocolProvider()
.getOperationSet(OperationSetBasicTelephony.class);
Iterator<? extends CallPeer> peers = call.getCallPeers();

@ -93,7 +93,7 @@ public void run()
private void doRun()
{
OperationSetVideoTelephony telephony = (OperationSetVideoTelephony)
OperationSetVideoTelephony telephony =
call.getProtocolProvider()
.getOperationSet(OperationSetVideoTelephony.class);

@ -290,7 +290,7 @@ private OperationSetVideoTelephony addVideoListener()
return null;
final OperationSetVideoTelephony telephony =
(OperationSetVideoTelephony) call.getProtocolProvider()
call.getProtocolProvider()
.getOperationSet(OperationSetVideoTelephony.class);
if (telephony == null)
return null;

@ -505,7 +505,7 @@ private void createSecurityPanel(CallPeerSecurityOnEvent event)
if (callPeer != null)
{
OperationSetSecureTelephony secure
= (OperationSetSecureTelephony) callPeer
= callPeer
.getProtocolProvider().getOperationSet(
OperationSetSecureTelephony.class);
@ -548,7 +548,7 @@ protected Component createTransferCallButton()
if (callPeer != null)
{
OperationSetAdvancedTelephony telephony =
(OperationSetAdvancedTelephony) callPeer.getProtocolProvider()
callPeer.getProtocolProvider()
.getOperationSet(OperationSetAdvancedTelephony.class);
if (telephony != null)

@ -53,7 +53,7 @@ public ReceivedCallDialog(Call call)
this.initComponents();
OperationSetBasicTelephony telephonyOpSet
= (OperationSetBasicTelephony) call.getProtocolProvider()
= call.getProtocolProvider()
.getOperationSet(OperationSetBasicTelephony.class);
telephonyOpSet.addCallListener(this);

@ -65,8 +65,9 @@ public void actionPerformed(ActionEvent e)
if (call != null)
{
OperationSetSecureTelephony secure
= (OperationSetSecureTelephony) call
.getProtocolProvider().getOperationSet(
= call
.getProtocolProvider()
.getOperationSet(
OperationSetSecureTelephony.class);
if (secure != null)

@ -89,7 +89,7 @@ private void actionPerformed(ActionListener listener, ActionEvent evt)
if (call != null)
{
OperationSetAdvancedTelephony telephony =
(OperationSetAdvancedTelephony) call.getProtocolProvider()
call.getProtocolProvider()
.getOperationSet(OperationSetAdvancedTelephony.class);
if (telephony != null)
@ -222,7 +222,7 @@ private CallPeer findCallPeer(String address)
{
ProtocolProviderService service = (ProtocolProviderService)
bundleContext.getService(serviceReference);
OperationSetBasicTelephony telephony = (OperationSetBasicTelephony)
OperationSetBasicTelephony telephony =
service.getOperationSet(telephonyClass);
if (telephony != null)

@ -650,8 +650,7 @@ public ChatRoomWrapper createChatRoom(
ChatRoomWrapper chatRoomWrapper = null;
OperationSetMultiUserChat groupChatOpSet
= (OperationSetMultiUserChat) protocolProvider
.getOperationSet(OperationSetMultiUserChat.class);
= protocolProvider.getOperationSet(OperationSetMultiUserChat.class);
// If there's no group chat operation set we have nothing to do here.
if (groupChatOpSet == null)
@ -661,10 +660,9 @@ public ChatRoomWrapper createChatRoom(
try
{
Map<String, Object> members = new Hashtable<String, Object>();
OperationSetPersistentPresence opSet =
(OperationSetPersistentPresence)
protocolProvider.getOperationSet(
OperationSetPersistentPresence.class);
OperationSetPersistentPresence opSet
= protocolProvider
.getOperationSet(OperationSetPersistentPresence.class);
for(String contact : contacts)
{
@ -733,7 +731,7 @@ public AdHocChatRoomWrapper createAdHocChatRoom(
AdHocChatRoomWrapper chatRoomWrapper = null;
OperationSetAdHocMultiUserChat groupChatOpSet
= (OperationSetAdHocMultiUserChat) protocolProvider
= protocolProvider
.getOperationSet(OperationSetAdHocMultiUserChat.class);
// If there's no group chat operation set we have nothing to do here.
@ -746,7 +744,6 @@ public AdHocChatRoomWrapper createAdHocChatRoom(
{
List<Contact> members = new LinkedList<Contact>();
OperationSetPersistentPresence opSet =
(OperationSetPersistentPresence)
protocolProvider.getOperationSet(
OperationSetPersistentPresence.class);
@ -1645,7 +1642,7 @@ private static class FindRoomTask
public ChatRoom doInBackground()
{
OperationSetMultiUserChat groupChatOpSet
= (OperationSetMultiUserChat) chatRoomProvider
= chatRoomProvider
.getProtocolProvider().getOperationSet(
OperationSetMultiUserChat.class);
@ -1687,7 +1684,7 @@ public List<String> doInBackground()
return null;
OperationSetMultiUserChat groupChatOpSet
= (OperationSetMultiUserChat) protocolProvider
= protocolProvider
.getOperationSet(OperationSetMultiUserChat.class);
if (groupChatOpSet == null)

@ -149,8 +149,7 @@ public HistoryWindow(Object historyContact)
Contact protoContact = protoContacts.next();
OperationSetBasicInstantMessaging basicInstantMessaging
= (OperationSetBasicInstantMessaging)
protoContact
= protoContact
.getProtocolProvider()
.getOperationSet(
OperationSetBasicInstantMessaging.class);

@ -155,8 +155,7 @@ public void contactClicked(ContactListEvent evt)
= defaultContact.getProtocolProvider();
OperationSetBasicInstantMessaging
defaultIM = (OperationSetBasicInstantMessaging)
defaultProvider.getOperationSet(
defaultIM = defaultProvider.getOperationSet(
OperationSetBasicInstantMessaging.class);
ProtocolProviderService protoContactProvider;
@ -177,8 +176,7 @@ public void contactClicked(ContactListEvent evt)
protoContactProvider = contact.getProtocolProvider();
protoContactIM = (OperationSetBasicInstantMessaging)
protoContactProvider.getOperationSet(
protoContactIM = protoContactProvider.getOperationSet(
OperationSetBasicInstantMessaging.class);
if(protoContactIM != null

@ -46,7 +46,7 @@ public ContactListTransferHandler(DefaultContactList contactList)
* @param t the data to import
* @return <tt>true</tt> if the data was inserted into the component;
* <tt>false</tt>, otherwise
* @see TransferHandler#importData(JComponent. Transferable)
* @see TransferHandler#importData(JComponent, Transferable)
*/
@SuppressWarnings("unchecked") //taken care of
public boolean importData(JComponent comp, Transferable t)

@ -162,9 +162,7 @@ public void registrationStateChanged(RegistrationStateChangeEvent evt)
* to do anything useful can be prevented.
*/
final OperationSetServerStoredAccountInfo accountInfoOpSet
= (OperationSetServerStoredAccountInfo)
protocolProvider
.getOperationSet(
= protocolProvider.getOperationSet(
OperationSetServerStoredAccountInfo.class);

@ -68,8 +68,7 @@ public PresenceStatusMenu(ProtocolProviderService protocolProvider)
this.protocolProvider = protocolProvider;
this.presence
= (OperationSetPresence) protocolProvider
.getOperationSet(OperationSetPresence.class);
= protocolProvider.getOperationSet(OperationSetPresence.class);
this.statusIterator = this.presence.getSupportedStatusSet();

@ -1341,8 +1341,7 @@ public static ImageIcon getAccountStatusImage(ProtocolProviderService pps)
ImageIcon statusIcon;
OperationSetPresence presence
= (OperationSetPresence) pps
.getOperationSet(OperationSetPresence.class);
= pps.getOperationSet(OperationSetPresence.class);
Image statusImage;
if (presence != null)

@ -138,7 +138,7 @@ public void mouseClicked(MouseEvent e)
if (e.getClickCount() > 1)
{
Object[] metaContacts
= (Object[]) selectedContactList.getSelectedValues();
= selectedContactList.getSelectedValues();
moveContactsFromRightToLeft(metaContacts);
}
@ -189,8 +189,7 @@ public void mouseClicked(MouseEvent e)
{
public void actionPerformed(ActionEvent e)
{
Object[] metaContacts
= (Object[]) contactList.getSelectedValues();
Object[] metaContacts = contactList.getSelectedValues();
if (metaContacts != null && metaContacts.length > 0)
moveContactsFromLeftToRight(metaContacts);
@ -201,8 +200,7 @@ public void actionPerformed(ActionEvent e)
{
public void actionPerformed(ActionEvent e)
{
Object[] metaContacts
= (Object[]) selectedContactList.getSelectedValues();
Object[] metaContacts = selectedContactList.getSelectedValues();
if (metaContacts != null && metaContacts.length > 0)
moveContactsFromRightToLeft(metaContacts);

@ -484,7 +484,7 @@ public void cleanup()
* The data output stream calls this method to transform outgoing
* packets.
*
* @see PacketTransformer#transform(net.java.sip.communicator.impl.media.transform.RawPacket)
* @see PacketTransformer#transform(RawPacket)
*/
public RawPacket transform(RawPacket pkt)
{
@ -521,7 +521,7 @@ public RawPacket transform(RawPacket pkt)
* The input data stream calls this method to transform
* incoming packets.
*
* @see PacketTransformer#reverseTransform(net.java.sip.communicator.impl.media.transform.RawPacket)
* @see PacketTransformer#reverseTransform(RawPacket)
*/
public RawPacket reverseTransform(RawPacket pkt)
{

@ -1064,8 +1064,7 @@ private void handleProviderAdded(ProtocolProviderService provider)
// check whether the provider has a basic im operation set
OperationSetBasicInstantMessaging opSetIm =
(OperationSetBasicInstantMessaging) provider
.getOperationSet(OperationSetBasicInstantMessaging.class);
provider.getOperationSet(OperationSetBasicInstantMessaging.class);
if (opSetIm != null)
{
@ -1077,8 +1076,7 @@ private void handleProviderAdded(ProtocolProviderService provider)
}
OperationSetMultiUserChat opSetMultiUChat =
(OperationSetMultiUserChat) provider
.getOperationSet(OperationSetMultiUserChat.class);
provider.getOperationSet(OperationSetMultiUserChat.class);
if (opSetMultiUChat != null)
{
@ -1108,8 +1106,7 @@ private void handleProviderAdded(ProtocolProviderService provider)
private void handleProviderRemoved(ProtocolProviderService provider)
{
OperationSetBasicInstantMessaging opSetIm =
(OperationSetBasicInstantMessaging) provider
.getOperationSet(OperationSetBasicInstantMessaging.class);
provider.getOperationSet(OperationSetBasicInstantMessaging.class);
if (opSetIm != null)
{
@ -1117,8 +1114,7 @@ private void handleProviderRemoved(ProtocolProviderService provider)
}
OperationSetMultiUserChat opSetMultiUChat =
(OperationSetMultiUserChat) provider
.getOperationSet(OperationSetMultiUserChat.class);
provider.getOperationSet(OperationSetMultiUserChat.class);
if (opSetMultiUChat != null)
{

@ -93,8 +93,8 @@ public Object getMenu()
private void addAccount(ProtocolProviderService protocolProvider)
{
OperationSetPresence presence
= (OperationSetPresence)
protocolProvider.getOperationSet(OperationSetPresence.class);
= protocolProvider.getOperationSet(OperationSetPresence.class);
boolean swing = (menu instanceof JComponent);
if (presence == null)
@ -157,8 +157,8 @@ private void removeAccount(ProtocolProviderService protocolProvider)
* addAccount(ProtocolProviderService).
*/
OperationSetPresence presence
= (OperationSetPresence)
protocolProvider.getOperationSet(OperationSetPresence.class);
= protocolProvider.getOperationSet(OperationSetPresence.class);
if (presence != null)
presence.removeProviderPresenceStatusListener(this);
else

@ -313,7 +313,7 @@ private void handleCallEvent(int type, CallEvent callEvent)
private void putOnHold(Call call)
{
OperationSetBasicTelephony telephony =
(OperationSetBasicTelephony) call.getProtocolProvider()
call.getProtocolProvider()
.getOperationSet(OperationSetBasicTelephony.class);
if (telephony != null)
@ -396,7 +396,7 @@ private void serviceChanged(ServiceEvent serviceEvent)
if (service instanceof ProtocolProviderService)
{
OperationSetBasicTelephony telephony =
(OperationSetBasicTelephony) ((ProtocolProviderService) service)
((ProtocolProviderService) service)
.getOperationSet(OperationSetBasicTelephony.class);
if (telephony != null)

@ -279,7 +279,7 @@ public MessageDeliveryFailedEvent postFacebookChatMessage(
/**
* Promotes the incoming message to the GUI
*
* @see FacebookIncomingMessageListener#onIncomingChatMessage(FacebookMessage)
* @see FacebookSessionListener#onIncomingChatMessage(FacebookMessage)
*/
public void onIncomingChatMessage(FacebookMessage msg)
{
@ -290,8 +290,7 @@ public void onIncomingChatMessage(FacebookMessage msg)
/**
* Promotes the incoming notification to the GUI
*
* @see FacebookIncomingMessageListener#onIncomingTypingNotification(String,
* int)
* @see FacebookSessionListener#onIncomingTypingNotification(String, int)
*/
public void onIncomingTypingNotification(String buddyUid, int state)
{

@ -62,7 +62,7 @@ public class FacebookBuddyList
/**
* Init the cache and the parent adapter.
*
* @param adapter
* @param session the Facebook session
*/
public FacebookBuddyList(FacebookSession session)
{
@ -110,8 +110,7 @@ public FacebookUser getMyMetaInfo()
/**
* Get our buddy who has the given id from the cache.
*
* @param contactID
* the id we wanna look up
* @param uid the id we want to look up
* @return the buddy who has the given id
* @throws FacebookErrorException
* @throws IOException

@ -17,12 +17,12 @@
/**
* This poller checks for new messages in Facebook servers and notifies to the
* registered {@link FacebookIncomingMessageListener listeners} if a new
* registered {@link FacebookSessionListener listeners} if a new
* {@link FacebookMessage} is found.<br>
* Registered {@link FacebookIncomingMessageListener listeners} are notified
* upon arrival of both messages from other buddies and own messages.<br>
* It's responsibility of the {@link FacebookIncomingMessageListener listeners}
* to discard undesired notifications, e.g. own messages.
* Registered {@link FacebookSessionListener listeners} are notified upon
* arrival of both messages from other buddies and own messages.<br>
* It's the responsibility of the {@link FacebookSessionListener listeners} to
* discard undesired notifications, e.g. own messages.
*
* @author Edgar Poce
*/

@ -45,7 +45,6 @@ public FacebookOutgoingChatMessage(FacebookSession session)
* Only one message can be sent at a time for a given
* {@link FacebookSession}
*
* @return true if the message was sent successfully
* @throws BrokenFacebookProtocolException
* @throws IOException
*/

@ -167,8 +167,7 @@ public void run()
/**
* Invoked by the facebook adapter when we got messages from the server.
*
* @param message
* @param from
* @param fbmsg the received Facebook instant message
*/
public void receivedInstantMessage(FacebookMessage fbmsg)
{

@ -377,7 +377,7 @@ public void leave()
{
Map.Entry<String, Contact> memberEntry = membersSet.next();
Contact participant = (Contact) memberEntry.getValue();
Contact participant = memberEntry.getValue();
fireParticipantPresenceEvent(participant,
AdHocChatRoomParticipantPresenceChangeEvent.CONTACT_LEFT,

@ -107,8 +107,8 @@ public String getDisplayName()
if (call != null)
{
ProtocolProviderService pps = call.getProtocolProvider();
OperationSetPresence opSetPresence = (OperationSetPresence) pps
.getOperationSet(OperationSetPresence.class);
OperationSetPresence opSetPresence
= pps.getOperationSet(OperationSetPresence.class);
Contact cont = opSetPresence.findContactByID(getAddress());
if (cont != null)
@ -243,8 +243,8 @@ public ProtocolProviderService getProtocolProvider()
public Contact getContact()
{
ProtocolProviderService pps = call.getProtocolProvider();
OperationSetPresence opSetPresence = (OperationSetPresence) pps
.getOperationSet(OperationSetPresence.class);
OperationSetPresence opSetPresence
= pps.getOperationSet(OperationSetPresence.class);
return opSetPresence.findContactByID(getAddress());
}

@ -63,8 +63,9 @@ public OperationSetGeolocationJabberImpl(
{
this.jabberProvider = provider;
this.opsetprez = (OperationSetPersistentPresence)
provider.getOperationSet(OperationSetPersistentPresence.class);
this.opsetprez
= provider
.getOperationSet(OperationSetPersistentPresence.class);
this.jabberProvider.addRegistrationStateChangeListener(
new RegistrationStateListener());

@ -63,7 +63,7 @@ public class OperationSetMultiUserChatJabberImpl
jabberProvider.addRegistrationStateChangeListener(providerRegListener);
OperationSetPersistentPresence presenceOpSet
= (OperationSetPersistentPresence) jabberProvider
= jabberProvider
.getOperationSet(OperationSetPersistentPresence.class);
presenceOpSet.addSubscriptionListener(this);

@ -151,8 +151,7 @@ public void handleUri(String uri)
}
OperationSetPresence presenceOpSet
= (OperationSetPresence) provider
.getOperationSet(OperationSetPresence.class);
= provider.getOperationSet(OperationSetPresence.class);
try
{

@ -710,7 +710,8 @@ public boolean equals(Object obj)
public OperationSetPersistentPresence
getParentPresenceOperationSet()
{
return (OperationSetPersistentPresence)parentProvider
return
parentProvider
.getOperationSet(OperationSetPersistentPresence.class);
}
@ -724,7 +725,8 @@ public boolean equals(Object obj)
public OperationSetBasicInstantMessaging
getParentBasicInstantMessagingOperationSet()
{
return (OperationSetBasicInstantMessaging)parentProvider
return
parentProvider
.getOperationSet(OperationSetBasicInstantMessaging.class);
}
@ -738,8 +740,7 @@ public boolean equals(Object obj)
public OperationSetFileTransfer
getFileTransferOperationSet()
{
return (OperationSetFileTransfer)parentProvider
.getOperationSet(OperationSetFileTransfer.class);
return parentProvider.getOperationSet(OperationSetFileTransfer.class);
}

@ -369,7 +369,6 @@ public void rejectInvitation(AdHocChatRoomInvitation invitation,
* @param targetChatRoom the room that invitation refers to
* @param inviter the inviter that sent the invitation
* @param reason the reason why the inviter sent the invitation
* @param password the password to use when joining the room
*/
public void fireInvitationEvent(AdHocChatRoom targetChatRoom,
String inviter, String reason)

@ -109,8 +109,8 @@ public AccountDetailsPanel(ProtocolProviderService protocolProvider)
this.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
// this.setPreferredSize(new Dimension(500, 400));
accountInfoOpSet =
(OperationSetServerStoredAccountInfo) protocolProvider
accountInfoOpSet
= protocolProvider
.getOperationSet(OperationSetServerStoredAccountInfo.class);
this.protocolProvider = protocolProvider;
@ -489,10 +489,11 @@ else if (detail instanceof TimeZoneDetail)
OperationSetWebContactInfo.class) != null)
{
final String urlString
= ((OperationSetWebContactInfo) protocolProvider
.getOperationSet(OperationSetWebContactInfo.class))
= protocolProvider
.getOperationSet(OperationSetWebContactInfo.class)
.getWebContactInfo(
protocolProvider.getAccountID().getAccountAddress())
protocolProvider
.getAccountID().getAccountAddress())
.toString();
JLabel webInfoLabel = new JLabel("Click to see web info: ");

@ -57,8 +57,7 @@ public void run()
PresenceStatus lastState
= lastStates.get(protocolProviderService);
OperationSetPresence presence
= (OperationSetPresence)
protocolProviderService
= protocolProviderService
.getOperationSet(
OperationSetPresence.class);
try
@ -84,8 +83,7 @@ public void run()
: AutoAwayActivator.getProtocolProviders())
{
OperationSetPresence presence
= (OperationSetPresence)
protocolProviderService
= protocolProviderService
.getOperationSet(
OperationSetPresence.class);

@ -158,8 +158,8 @@ private void handleProviderAdded(ProtocolProviderService provider)
logger.debug("Adding protocol provider " + provider.getProtocolName());
// check whether the provider has a basic im operation set
OperationSetBasicInstantMessaging opSetIm =
(OperationSetBasicInstantMessaging) provider
OperationSetBasicInstantMessaging opSetIm
= provider
.getOperationSet(OperationSetBasicInstantMessaging.class);
if (opSetIm != null)
@ -172,9 +172,8 @@ private void handleProviderAdded(ProtocolProviderService provider)
}
// check whether the provider has a sms operation set
OperationSetSmsMessaging opSetSms =
(OperationSetSmsMessaging) provider
.getOperationSet(OperationSetSmsMessaging.class);
OperationSetSmsMessaging opSetSms
= provider.getOperationSet(OperationSetSmsMessaging.class);
if (opSetSms != null)
{
@ -185,9 +184,8 @@ private void handleProviderAdded(ProtocolProviderService provider)
logger.trace("Service did not have a sms op. set.");
}
OperationSetMultiUserChat opSetMultiUChat =
(OperationSetMultiUserChat) provider
.getOperationSet(OperationSetMultiUserChat.class);
OperationSetMultiUserChat opSetMultiUChat
= provider.getOperationSet(OperationSetMultiUserChat.class);
if (opSetMultiUChat != null)
{
@ -210,18 +208,16 @@ private void handleProviderAdded(ProtocolProviderService provider)
*/
private void handleProviderRemoved(ProtocolProviderService provider)
{
OperationSetBasicInstantMessaging opSetIm =
(OperationSetBasicInstantMessaging) provider
.getOperationSet(OperationSetBasicInstantMessaging.class);
OperationSetBasicInstantMessaging opSetIm
= provider.getOperationSet(OperationSetBasicInstantMessaging.class);
if (opSetIm != null)
{
opSetIm.removeMessageListener(this);
}
OperationSetMultiUserChat opSetMultiUChat =
(OperationSetMultiUserChat) provider
.getOperationSet(OperationSetMultiUserChat.class);
OperationSetMultiUserChat opSetMultiUChat
= provider.getOperationSet(OperationSetMultiUserChat.class);
if (opSetMultiUChat != null)
{

@ -349,8 +349,7 @@ public void handleProviderAdded(ProtocolProviderService provider)
// check whether the provider has a basic telephony operation set
OperationSetBasicTelephony opSetTelephony =
(OperationSetBasicTelephony) provider
.getOperationSet(OperationSetBasicTelephony.class);
provider.getOperationSet(OperationSetBasicTelephony.class);
if (opSetTelephony != null)
{
@ -360,7 +359,6 @@ public void handleProviderAdded(ProtocolProviderService provider)
{
logger.trace("Service did not have a basic telephony op. set.");
}
}
/**
@ -372,8 +370,7 @@ public void handleProviderAdded(ProtocolProviderService provider)
private void handleProviderRemoved(ProtocolProviderService provider)
{
OperationSetBasicTelephony opSetTelephony =
(OperationSetBasicTelephony) provider
.getOperationSet(OperationSetBasicTelephony.class);
provider.getOperationSet(OperationSetBasicTelephony.class);
if (opSetTelephony != null)
{
@ -574,9 +571,9 @@ private void waitForCallEnd(Call call)
private void answerCall(Call call)
{
OperationSetBasicTelephony telephony
= (OperationSetBasicTelephony)call
.getProtocolProvider().getOperationSet(
OperationSetBasicTelephony.class);
= call
.getProtocolProvider()
.getOperationSet(OperationSetBasicTelephony.class);
Iterator peers = call.getCallPeers();
while(peers.hasNext())
@ -607,9 +604,9 @@ private void answerCall(Call call)
private void hangupCall(Call call)
{
OperationSetBasicTelephony telephony
= (OperationSetBasicTelephony)call
.getProtocolProvider().getOperationSet(
OperationSetBasicTelephony.class);
= call
.getProtocolProvider()
.getOperationSet(OperationSetBasicTelephony.class);
logger.info("Max Message Length Reached, Mailbox is"
+" disconnecting the call");
Iterator<? extends CallPeer> callPeers = call.getCallPeers();

@ -176,8 +176,8 @@ public void start(BundleContext bc) throws Exception
private void handleProviderAdded(ProtocolProviderService provider)
{
OperationSetInstantMessageTransform opSetMessageTransform =
(OperationSetInstantMessageTransform) provider
OperationSetInstantMessageTransform opSetMessageTransform
= provider
.getOperationSet(OperationSetInstantMessageTransform.class);
if (opSetMessageTransform != null)
@ -244,8 +244,8 @@ public void stop(BundleContext bc) throws Exception
private void handleProviderRemoved(ProtocolProviderService provider)
{
// check whether the provider has a basic im operation set
OperationSetInstantMessageTransform opSetMessageTransform =
(OperationSetInstantMessageTransform) provider
OperationSetInstantMessageTransform opSetMessageTransform
= provider
.getOperationSet(OperationSetInstantMessageTransform.class);
if (opSetMessageTransform != null)

@ -109,8 +109,7 @@ public static List<OperationSetWhiteboarding> getWhiteboardOperationSets()
= (ProtocolProviderService) bundleContext.getService(serRef);
OperationSetWhiteboarding opSet
= (OperationSetWhiteboarding)
protocolProvider
= protocolProvider
.getOperationSet(OperationSetWhiteboarding.class);
if(opSet != null)

@ -59,9 +59,10 @@ public WhiteboardSessionManager()
*/
public void initWhiteboard (final Contact contact)
{
opSetWb = (OperationSetWhiteboarding)
contact.getProtocolProvider().
getOperationSet(OperationSetWhiteboarding.class);
opSetWb
= contact
.getProtocolProvider()
.getOperationSet(OperationSetWhiteboarding.class);
if (opSetWb == null)
{

@ -46,7 +46,7 @@ protected void setUp() throws Exception
fixture.setUp();
OperationSetPersistentPresence opSetPresence =
(OperationSetPersistentPresence) fixture.mockProvider
fixture.mockProvider
.getOperationSet(OperationSetPersistentPresence.class);
mockGroup = (MockContactGroup)opSetPresence

@ -190,8 +190,8 @@ public void testPartialContactListRestauration()
//verify that contents of the meta contact list matches contents of
//the mock provider we removed.
ContactGroup oldProtoRoot =
((OperationSetPersistentPresence) fixture.mockProvider
.getOperationSet(OperationSetPersistentPresence.class))
fixture.mockProvider
.getOperationSet(OperationSetPersistentPresence.class)
.getServerStoredContactListRoot();
fixture.assertGroupEquals(
@ -203,8 +203,8 @@ public void testPartialContactListRestauration()
//verify that the new mock provider has created unresolved contacts
//for all contacts in the meta cl.
ContactGroup newProtoRoot =
((OperationSetPersistentPresence) fixture.replacementMockPr
.getOperationSet(OperationSetPersistentPresence.class))
fixture.replacementMockPr
.getOperationSet(OperationSetPersistentPresence.class)
.getServerStoredContactListRoot();
assertEquals("Newly loaded provider does not match the old one."
@ -240,21 +240,21 @@ public void testCompleteContactListRestauration()
//Get references to the root groups of the 2 providers we removed
ContactGroup oldProtoMockP1Root =
((OperationSetPersistentPresence) fixture.mockP1
.getOperationSet(OperationSetPersistentPresence.class))
fixture.mockP1
.getOperationSet(OperationSetPersistentPresence.class)
.getServerStoredContactListRoot();
ContactGroup oldProtoMockP2Root =
((OperationSetPersistentPresence) fixture.mockP2
.getOperationSet(OperationSetPersistentPresence.class))
fixture.mockP2
.getOperationSet(OperationSetPersistentPresence.class)
.getServerStoredContactListRoot();
//verify that contacts tnat unresolved contacts that have been created
//inside that the replacement mock providers match those in the
//providers we removed.
ContactGroup newProtoMockP1Root =
((OperationSetPersistentPresence) fixture.replacementMockP1
.getOperationSet(OperationSetPersistentPresence.class))
fixture.replacementMockP1
.getOperationSet(OperationSetPersistentPresence.class)
.getServerStoredContactListRoot();
assertEquals("Newly loaded provider does not match the old one."
@ -262,8 +262,8 @@ public void testCompleteContactListRestauration()
, newProtoMockP1Root);
ContactGroup newProtoMockP2Root =
((OperationSetPersistentPresence) fixture.replacementMockP2
.getOperationSet(OperationSetPersistentPresence.class))
fixture.replacementMockP2
.getOperationSet(OperationSetPersistentPresence.class)
.getServerStoredContactListRoot();
assertEquals("Newly loaded provider does not match the old one."

@ -74,7 +74,7 @@ private Message createMessage(Contact contact, Message message,
String action)
{
OperationSetBasicInstantMessaging imOpSet =
(OperationSetBasicInstantMessaging) contact.getProtocolProvider()
contact.getProtocolProvider()
.getOperationSet(OperationSetBasicInstantMessaging.class);
return imOpSet.createMessage("__" + action + "__"
+ message.getContent());

@ -147,8 +147,7 @@ public void testRegister()
// This message is supposed to be offline message and as one is tested
// in TestOperationSetBasicInstantMessaging.testReceiveOfflineMessages()
OperationSetBasicInstantMessaging opSetBasicIM =
(OperationSetBasicInstantMessaging) fixture.provider
.getOperationSet(OperationSetBasicInstantMessaging.class);
fixture.provider.getOperationSet(OperationSetBasicInstantMessaging.class);
fixture.offlineMsgCollector.register(opSetBasicIM);
//give time for the AIM server to notify everyone of our arrival

@ -71,10 +71,10 @@ public void testCreateCancelCall()
throws ParseException, OperationFailedException
{
OperationSetBasicTelephony basicTelephonyP1
= (OperationSetBasicTelephony)fixture.provider1.getOperationSet(
= fixture.provider1.getOperationSet(
OperationSetBasicTelephony.class);
OperationSetBasicTelephony basicTelephonyP2
= (OperationSetBasicTelephony)fixture.provider2.getOperationSet(
= fixture.provider2.getOperationSet(
OperationSetBasicTelephony.class);
CallEventCollector call1Listener
@ -299,10 +299,10 @@ public void testCreateRejectCall()
throws ParseException, OperationFailedException
{
OperationSetBasicTelephony basicTelephonyP1
= (OperationSetBasicTelephony)fixture.provider1.getOperationSet(
= fixture.provider1.getOperationSet(
OperationSetBasicTelephony.class);
OperationSetBasicTelephony basicTelephonyP2
= (OperationSetBasicTelephony)fixture.provider2.getOperationSet(
= fixture.provider2.getOperationSet(
OperationSetBasicTelephony.class);
CallEventCollector call1Listener
@ -534,10 +534,10 @@ public void aTestCreateAnswerHangupCall()
throws ParseException, OperationFailedException
{
OperationSetBasicTelephony basicTelephonyP1
= (OperationSetBasicTelephony)fixture.provider1.getOperationSet(
= fixture.provider1.getOperationSet(
OperationSetBasicTelephony.class);
OperationSetBasicTelephony basicTelephonyP2
= (OperationSetBasicTelephony)fixture.provider2.getOperationSet(
= fixture.provider2.getOperationSet(
OperationSetBasicTelephony.class);
CallEventCollector call1Listener

@ -70,10 +70,10 @@ public void testCreateCancelCall()
throws ParseException, OperationFailedException
{
OperationSetBasicTelephony basicTelephonyP1
= (OperationSetBasicTelephony)fixture.provider1.getOperationSet(
= fixture.provider1.getOperationSet(
OperationSetBasicTelephony.class);
OperationSetBasicTelephony basicTelephonyP2
= (OperationSetBasicTelephony)fixture.provider2.getOperationSet(
= fixture.provider2.getOperationSet(
OperationSetBasicTelephony.class);
CallEventCollector call1Listener
@ -300,10 +300,10 @@ public void testCreateRejectCall()
throws ParseException, OperationFailedException
{
OperationSetBasicTelephony basicTelephonyP1
= (OperationSetBasicTelephony)fixture.provider1.getOperationSet(
= fixture.provider1.getOperationSet(
OperationSetBasicTelephony.class);
OperationSetBasicTelephony basicTelephonyP2
= (OperationSetBasicTelephony)fixture.provider2.getOperationSet(
= fixture.provider2.getOperationSet(
OperationSetBasicTelephony.class);
CallEventCollector call1Listener
@ -537,10 +537,10 @@ public void aTestCreateAnswerHangupCall()
throws ParseException, OperationFailedException
{
OperationSetBasicTelephony basicTelephonyP1
= (OperationSetBasicTelephony)fixture.provider1.getOperationSet(
= fixture.provider1.getOperationSet(
OperationSetBasicTelephony.class);
OperationSetBasicTelephony basicTelephonyP2
= (OperationSetBasicTelephony)fixture.provider2.getOperationSet(
= fixture.provider2.getOperationSet(
OperationSetBasicTelephony.class);
CallEventCollector call1Listener

Loading…
Cancel
Save