Fixes exceptions, a memory leak due to incomplete code.

cusax-fix
Lyubomir Marinov 13 years ago
parent 4a45de57f6
commit f20774433d

@ -169,9 +169,7 @@ public void dispose()
* @throws RuntimeException if the method is not called on the AWT event
* dispatching thread
*/
public void ensureSize(
final Component component,
final int width, final int height)
public void ensureSize(Component component, int width, int height)
{
CallManager.assertIsEventDispatchingThread();
@ -205,10 +203,92 @@ else if (!frame.equals(this))
}
else
{
Dimension frameSize = frame.getSize();
/*
* If there is no callPanel, it is unlikely that this CallDialog
* will be asked to ensureSize. Anyway, support the scenario just in
* case. In light of the absence of a callPanel to guide this
* CallDialog about the preferred size, we do not have much of a
* choice but to trust the method arguments.
*/
if (callPanel != null)
{
/*
* If there is a callPanel, we are likely to get a much better
* estimation about the preferred size by asking the callPanel
* rather than by trusting the method arguments. For example,
* the visual Component displaying the video streaming from the
* local user/peer to the remote peer(s) will think that its
* preferred size is the one to base this Frame's size on but
* that may be misleading because the local video may not be
* displayed with its preferred size even if this Frame's size
* will accommodate it.
*/
/*
* Just asking the callPanel about its preferredSize would've
* been terrificly great. Unfortunately, that is presently
* futile because the callPanel may have a preferredSize while
* we are still required to display visual Components displaying
* video in their non-scaled size. The same goes for any
* Container which is an ancestor of the specified component.
*/
Container ancestor
= findClosestAncestorWithSetPreferredSize(component);
if (ancestor == null)
ancestor = callPanel;
/*
* If the ancestor has a forced preferredSize, its LayoutManager
* may be able to give a good enough estimation.
*/
if (ancestor.isPreferredSizeSet())
{
LayoutManager ancestorLayout = ancestor.getLayout();
if (ancestorLayout != null)
{
Dimension preferredLayoutSize
= ancestorLayout.preferredLayoutSize(ancestor);
if (preferredLayoutSize != null)
{
component = ancestor;
width = preferredLayoutSize.width;
height = preferredLayoutSize.height;
}
}
}
else
{
/*
* If the ancestor doesn't have a preferredSize forced, then
* we may think that it will calculate an appropriate
* preferredSize itself.
*/
Dimension preferredSize = ancestor.getPreferredSize();
if (preferredSize != null)
{
component = ancestor;
width = preferredSize.width;
height = preferredSize.height;
}
}
}
/*
* If the component (which may be an ancestor of the Component
* specified as an argument to the ensureSize method at this point)
* has not been given a size, we will make a mistake if we try to
* use it for the purposes of determining how much this Frame is to
* be enlarged.
*/
Dimension componentSize = component.getSize();
int newFrameWidth
= frameSize.width + width - componentSize.width;
if ((componentSize.width < 1) || (componentSize.height < 1))
return;
Dimension frameSize = frame.getSize();
int newFrameWidth = frameSize.width + width - componentSize.width;
int newFrameHeight
= frameSize.height + height - componentSize.height;
@ -268,6 +348,37 @@ else if (!changeHeight)
}
}
/**
* Finds a <tt>Container</tt> which is an ancestor of a specific
* <tt>Component</tt>, has a set <tt>preferredSize</tt> and is closest to
* the specified <tt>Component</tt> up the ancestor hierarchy.
*
* @param component the <tt>Component</tt> whose ancestor hierarchy is to be
* searched upwards
* @return a <tt>Container</tt>, if any, which is an ancestor of the
* specified <tt>component</tt>, has a set <tt>preferredSize</tt> and is
* closest to the specified <tt>component</tt> up the ancestor hierarchy
*/
private static Container findClosestAncestorWithSetPreferredSize(
Component component)
{
if ((component instanceof Container) && component.isPreferredSizeSet())
return (Container) component;
else
{
Container parent;
while ((parent = component.getParent()) != null)
{
if (parent.isPreferredSizeSet())
return parent;
else
component = parent;
}
return null;
}
}
/**
* Returns the frame of the call window.
*

@ -1948,16 +1948,28 @@ private void updateViewFromModelInEventDispatchThread()
Dimension newPreferredSize = getPreferredSize();
if ((newPreferredSize != null)
&& (newPreferredSize.width
> ((oldPreferredSize == null)
? 0
: oldPreferredSize.width))
&& ((newPreferredSize.height > getHeight())
|| (newPreferredSize.width > getWidth())))
{
ensureSize(
this,
newPreferredSize.width, newPreferredSize.height);
int oldPreferredHeight, oldPreferredWidth;
if (oldPreferredSize == null)
{
oldPreferredHeight = 0;
oldPreferredWidth = 0;
}
else
{
oldPreferredHeight = oldPreferredSize.height;
oldPreferredWidth = oldPreferredSize.width;
}
if ((newPreferredSize.height != oldPreferredHeight)
|| (newPreferredSize.width != oldPreferredWidth))
{
ensureSize(
this,
newPreferredSize.width, newPreferredSize.height);
}
}
}

@ -240,14 +240,6 @@ public OneToOneCallPeerPanel(
if (center != null)
{
/*
* Don't let the center dictate the preferred size because it may
* display large videos. Otherwise, the large video will make this
* panel expand and then the panel's container will show scroll
* bars.
*/
center.setPreferredSize(new Dimension(1, 1));
cnstrnts.fill = GridBagConstraints.BOTH;
cnstrnts.gridx = 0;
cnstrnts.gridy = 1;

@ -7,7 +7,6 @@
package net.java.sip.communicator.impl.gui.main.call.conference;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import java.util.List;
@ -240,82 +239,16 @@ public void paintComponent(Graphics g)
*/
private VideoContainer createVideoContainer()
{
final VideoContainer videoContainer = new VideoContainer(null, true);
videoContainer.setPreferredSize(new Dimension(0, 0));
VideoContainer videoContainer = new VideoContainer(null, true);
GridBagConstraints videoContainerGridBagConstraints
= new GridBagConstraints();
videoContainerGridBagConstraints.fill = GridBagConstraints.BOTH;
videoContainerGridBagConstraints.gridx = 0;
videoContainerGridBagConstraints.gridy = 0;
videoContainerGridBagConstraints.weightx = 0;
videoContainerGridBagConstraints.weightx = 1;
videoContainerGridBagConstraints.weighty = 1;
add(videoContainer, videoContainerGridBagConstraints);
/*
* When the videoContainer is empty i.e. it has nothing to show, don't
* show it.
*/
videoContainer.addContainerListener(
new ContainerListener()
{
public void componentAdded(ContainerEvent e)
{
GridBagLayout layout = (GridBagLayout) getLayout();
boolean videoContainerIsVisible
= (videoContainer.getComponentCount() > 0);
for (Component component : getComponents())
{
GridBagConstraints constraints
= layout.getConstraints(component);
if (videoContainerIsVisible)
{
constraints.weightx
= (component == videoContainer) ? 1 : 0;
}
else
{
constraints.weightx
= (component == videoContainer) ? 0 : 1;
}
layout.setConstraints(component, constraints);
}
/*
* When the first visual/video Component gets added, this
* videoContainer is still not accommodated by the frame
* size because it has just become visible. So try to resize
* the frame to accommodate this videoContainer.
*/
if (e.getID() == ContainerEvent.COMPONENT_ADDED)
{
Dimension preferredSize
= videoContainer.getLayout().preferredLayoutSize(
videoContainer);
if ((preferredSize != null)
&& (preferredSize.width > 0)
&& (preferredSize.height > 0))
{
// ensureSize(
// videoContainer,
// preferredSize.width, preferredSize.height);
}
}
}
public void componentRemoved(ContainerEvent e)
{
/*
* It's all the same with respect to the purpose of this
* ContainerListener.
*/
componentAdded(e);
}
});
return videoContainer;
}
@ -775,6 +708,17 @@ protected ConferenceCallPeerRenderer updateViewFromModel(
return callPeerPanel;
}
/**
* {@inheritDoc}
*
* Temporarily disables the use of <tt>ConferenceParticipantContainer</tt>
* because the functionality implemented in the model at the time of this
* writing does not fully support mapping of visual <tt>Component</tt>s
* displaying video to telephony conference participants (e.g. in telephony
* conferences utilizing the Jitsi VideoBridge server-side technology).
* Instead displays the videos only, does not map videos to participants and
* does not display participants who do not have videos.
*/
@Override
protected void updateViewFromModelInEventDispatchThread()
{
@ -868,7 +812,11 @@ protected void updateViewFromModelInEventDispatchThread()
if (!UIVideoHandler2.isAncestor(videoContainer, video))
{
this.videos.add(video);
videoContainer.add(video, VideoLayout.CENTER_REMOTE);
videoContainer.add(
video,
(video == localVideo)
? VideoLayout.LOCAL
: VideoLayout.CENTER_REMOTE);
}
}
}

@ -40,9 +40,6 @@ public class AddContactDialog
WindowFocusListener,
Skinnable
{
private final Logger logger
= Logger.getLogger(AddContactDialog.class.getName());
private final JLabel accountLabel = new JLabel(
GuiActivator.getResources().getI18NString(
"service.gui.SELECT_ACCOUNT") + ": ");
@ -503,7 +500,8 @@ else if (value instanceof ProtocolProviderService)
/**
* A custom renderer displaying groups in a combo box.
*/
private static class GroupComboRenderer extends DefaultListCellRenderer
private static class GroupComboRenderer
extends DefaultListCellRenderer
{
@Override
public Component getListCellRendererComponent( JList list,
@ -547,11 +545,11 @@ public Component getListCellRendererComponent( JList list,
}
/**
* Brings this window to front.
* Brings this window to the front.
*/
public void bringToFront()
{
super.toFront();
toFront();
}
/**

@ -17,7 +17,7 @@
* @author LITZELMANN Cedric
*/
public class ContactDictImpl
implements Contact
extends AbstractContact
{
private Logger logger = Logger.getLogger(ContactDictImpl.class);
@ -315,28 +315,6 @@ public void setResolved(boolean resolved)
this.isResolved = resolved;
}
/**
* Indicates whether some other object is "equal to" this one which in terms
* of contacts translates to having equal ids. The resolved status of the
* contacts deliberately ignored so that contacts would be declared equal
* even if it differs.
* <p>
* @param obj the reference object with which to compare.
* @return <code>true</code> if this contact has the same id as that of the
* <code>obj</code> argument.
*/
public boolean equals(Object obj)
{
if (obj == null || ! (obj instanceof ContactDictImpl)) {
return false;
}
ContactDictImpl dictContact = (ContactDictImpl) obj;
return this.getAddress().equals(dictContact.getAddress());
}
/**
* Returns the persistent presence operation set that this contact belongs
* to.

@ -19,7 +19,7 @@
* @author Emil Ivov
*/
public class ContactGibberishImpl
implements Contact
extends AbstractContact
{
/**
@ -265,28 +265,6 @@ public void setResolved(boolean resolved)
this.isResolved = resolved;
}
/**
* Indicates whether some other object is "equal to" this one which in terms
* of contacts translates to having equal ids. The resolved status of the
* contacts deliberately ignored so that contacts would be declared equal
* even if it differs.
* <p>
* @param obj the reference object with which to compare.
* @return <code>true</code> if this contact has the same id as that of the
* <code>obj</code> argument.
*/
public boolean equals(Object obj)
{
if (obj == null
|| ! (obj instanceof ContactGibberishImpl))
return false;
ContactGibberishImpl gibberishContact = (ContactGibberishImpl) obj;
return this.getAddress().equals(gibberishContact.getAddress());
}
/**
* Returns the persistent presence operation set that this contact belongs
* to.

@ -8,10 +8,11 @@
/**
* The ICQ implementation of the service.protocol.Contact interface.
*
* @author Emil Ivov
*/
public class ContactIcqImpl
implements Contact
extends AbstractContact
{
Buddy joustSimBuddy = null;
private boolean isLocal = false;
@ -82,37 +83,6 @@ public byte[] getImage()
return image;
}
/**
* Returns a hashCode for this contact. The returned hashcode is actually
* that of the Contact's UIN
* @return the hashcode of this Contact
*/
public int hashCode()
{
return getUIN().hashCode();
}
/**
* Indicates whether some other object is "equal to" this one.
* <p>
*
* @param obj the reference object with which to compare.
* @return <tt>true</tt> if this object is the same as the obj
* argument; <tt>false</tt> otherwise.
*/
public boolean equals(Object obj)
{
if (obj == null
|| !(obj instanceof ContactIcqImpl)
|| !(((ContactIcqImpl)obj).getAddress().equals(getAddress())
&& ((ContactIcqImpl)obj).getProtocolProvider()
== getProtocolProvider()))
return false;
return true;
}
/**
* Returns the joust sim buddy that this Contact is encapsulating.
* @return Buddy

@ -89,11 +89,11 @@ public String getAddress()
*/
public Contact getContact()
{
ProtocolProviderService pps = getCall().getProtocolProvider();
OperationSetPresence opSetPresence
= pps.getOperationSet(OperationSetPresence.class);
OperationSetPresence presence
= getProtocolProvider().getOperationSet(OperationSetPresence.class);
return opSetPresence.findContactByID(getAddress());
return
(presence == null) ? null : presence.findContactByID(getAddress());
}
/**
@ -155,19 +155,18 @@ public boolean isInitiator()
*/
protected void retrieveDiscoverInfo(String calleeURI)
{
DiscoverInfo tmpDiscoverInfo = null;
try
{
tmpDiscoverInfo = this.getCall().getProtocolProvider()
.getDiscoveryManager().discoverInfo(calleeURI);
if(tmpDiscoverInfo != null)
{
this.setDiscoverInfo(tmpDiscoverInfo);
}
DiscoverInfo discoverInfo
= getProtocolProvider().getDiscoveryManager().discoverInfo(
calleeURI);
if(discoverInfo != null)
setDiscoverInfo(discoverInfo);
}
catch (XMPPException ex)
catch (XMPPException xmppex)
{
logger.warn("could not retrieve info for " + calleeURI, ex);
logger.warn("Could not retrieve info for " + calleeURI, xmppex);
}
}

@ -16,7 +16,7 @@
* @author Emil Ivov
*/
public class MockContact
implements Contact
extends AbstractContact
{
private String contactID = null;
private MockProvider parentProvider = null;
@ -215,27 +215,6 @@ public void setResolved(boolean resolved)
this.isResolved = resolved;
}
/**
* Indicates whether some other object is "equal to" this one which in terms
* of contacts translates to having equal ids. The resolved status of the
* contacts deliberately ignored so that contacts would be declared equal
* even if it differs.
* <p>
* @param obj the reference object with which to compare.
* @return <code>true</code> if this contact has the same id as that of the
* <code>obj</code> argument.
*/
public boolean equals(Object obj)
{
if (obj == null
|| ! (obj instanceof MockContact))
return false;
MockContact mockContact = (MockContact) obj;
return this.getAddress().equals(mockContact.getAddress());
}
/**
* Return the current status message of this contact.
*

@ -15,7 +15,7 @@
* @author Damian Minkov
*/
public class ContactMsnImpl
implements Contact
extends AbstractContact
{
private MsnContact contact = null;
private byte[] image = null;
@ -101,36 +101,6 @@ void setImage(byte[] imgBytes)
this.image = imgBytes;
}
/**
* Returns a hashCode for this contact. The returned hashcode is actually
* that of the Contact's Address
* @return the hashcode of this Contact
*/
public int hashCode()
{
return getAddress().hashCode();
}
/**
* Indicates whether some other object is "equal to" this one.
* <p>
*
* @param obj the reference object with which to compare.
* @return <tt>true</tt> if this object is the same as the obj
* argument; <tt>false</tt> otherwise.
*/
public boolean equals(Object obj)
{
if (obj == null
|| !(obj instanceof ContactMsnImpl)
|| !(((ContactMsnImpl)obj).getAddress().equals(getAddress())
&& ((ContactMsnImpl)obj).getProtocolProvider()
== getProtocolProvider()))
return false;
else
return true;
}
/**
* Returns a string representation of this contact, containing most of its
* representative details.

@ -18,7 +18,7 @@
* @author Mihai Balan
*/
public class ContactRssImpl
implements Contact
extends AbstractContact
{
/**
@ -397,37 +397,6 @@ public void setResolved(boolean resolved)
this.isResolved = resolved;
}
/**
* Indicates whether some other object is "equal to" this one which in terms
* of contacts translates to having equal IDs. The resolved status of the
* contacts is deliberately ignored so that contacts would be declared equal
* even if one contact is resolved and the other is not.
* <p>
* @param obj the reference object with which to compare.
* @return <code>true</code> if this contact has the same ID as that of the
* <code>obj</code> argument.
*/
public boolean equals(Object obj)
{
if (obj == null
|| ! (obj instanceof ContactRssImpl))
return false;
ContactRssImpl rssContact = (ContactRssImpl) obj;
return this.getAddress().equals(rssContact.getAddress());
}
/**
* Overrides <tt>hashCode</tt> from <tt>Object</tt> to ensure that
* equal objects have same hashcode
*
* http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html#equals(java.lang.Object)
*/
public int hashCode() {
return getAddress().hashCode();
}
/**
* Returns the persistent presence operation set that this contact belongs
* to.

@ -18,11 +18,6 @@
public class OperationSetIncomingDTMFSipImpl
implements OperationSetIncomingDTMF
{
/**
* The parent provider.
*/
private ProtocolProviderServiceSipImpl provider;
/**
* The send DTMF operation set holding dtmf implementations.
*/
@ -36,8 +31,6 @@ public class OperationSetIncomingDTMFSipImpl
OperationSetIncomingDTMFSipImpl(ProtocolProviderServiceSipImpl provider,
OperationSetDTMFSipImpl opsetDTMFSip)
{
this.provider = provider;
this.opsetDTMFSip = opsetDTMFSip;
}

@ -215,7 +215,7 @@ public class OperationSetPresenceSipImpl
/**
* Watcher status from the watchers info list.
*/
private enum WatcherStatus
private static enum WatcherStatus
{
PENDING("pending"),
ACTIVE("active"),
@ -225,7 +225,7 @@ private enum WatcherStatus
/**
* The value.
*/
private String value;
private final String value;
/**
* Creates <>tt WatcherStatus</tt>

@ -402,9 +402,7 @@ private boolean isContactExists(String contactUri)
for (ContactSipImpl uniqueContact : getUniqueContacts(rootGroup))
{
if (uniqueContact.getUri().equals(contactUri))
{
return true;
}
}
return false;
}
@ -439,9 +437,7 @@ private boolean isContactPersistent(String contactUri)
for (ContactSipImpl contact : getContacts(contactUri))
{
if (contact.isPersistent())
{
return true;
}
}
return false;
}

@ -13,7 +13,6 @@
import javax.net.ssl.*;
import net.java.sip.communicator.impl.protocol.sip.net.*;
import net.java.sip.communicator.util.*;
import net.java.sip.communicator.util.Logger;
import org.jitsi.util.*;

@ -25,7 +25,8 @@
* @author Shobhit Jindal
*/
public class ContactSSHImpl
implements ContactSSH
extends AbstractContact
implements ContactSSH
{
private static final Logger logger
= Logger.getLogger(ContactSSHImpl.class);
@ -679,28 +680,7 @@ public void setResolved(boolean resolved)
{
this.isResolved = resolved;
}
/**
* Indicates whether some other object is "equal to" this one which in terms
* of contacts translates to having equal ids. The resolved status of the
* contacts deliberately ignored so that contacts would be declared equal
* even if it differs.
* <p>
* @param obj the reference object with which to compare.
* @return <code>true</code> if this contact has the same id as that of the
* <code>obj</code> argument.
*/
public boolean equals(Object obj)
{
if (obj == null
|| ! (obj instanceof ContactSSHImpl))
return false;
ContactSSHImpl sshContact = (ContactSSHImpl) obj;
return this.getAddress().equals(sshContact.getAddress());
}
/**
* Returns the persistent presence operation set that this contact belongs
* to.

@ -17,7 +17,7 @@
* @author Emil Ivov
*/
public class ContactYahooImpl
implements Contact
extends AbstractContact
{
private static final Logger logger =
Logger.getLogger(ContactYahooImpl.class);
@ -211,36 +211,6 @@ protected void setImage(byte[] image)
this.image = image;
}
/**
* Returns a hashCode for this contact. The returned hashcode is actually
* that of the Contact's Address
* @return the hashcode of this Contact
*/
public int hashCode()
{
return getAddress().hashCode();
}
/**
* Indicates whether some other object is "equal to" this one.
* <p>
*
* @param obj the reference object with which to compare.
* @return <tt>true</tt> if this object is the same as the obj
* argument; <tt>false</tt> otherwise.
*/
public boolean equals(Object obj)
{
if (obj == null
|| !(obj instanceof ContactYahooImpl)
|| !( ((ContactYahooImpl)obj).getID().equals(getID()) )
&& ((ContactYahooImpl)obj).getProtocolProvider()
== getProtocolProvider())
return false;
else
return true;
}
/**
* Returns a string representation of this contact, containing most of its
* representative details.

@ -24,7 +24,7 @@
* @author Jonathan Martin
*/
public class ContactZeroconfImpl
implements Contact
extends AbstractContact
{
private static final Logger logger
= Logger.getLogger(ContactZeroconfImpl.class);
@ -430,28 +430,6 @@ public void setResolved(boolean resolved)
this.isResolved = resolved;
}
/**
* Indicates whether some other object is "equal to" this one which in terms
* of contacts translates to having equal ids. The resolved status of the
* contacts deliberately ignored so that contacts would be declared equal
* even if it differs.
* <p>
* @param obj the reference object with which to compare.
* @return <code>true</code> if this contact has the same id as that of the
* <code>obj</code> argument.
*/
public boolean equals(Object obj)
{
if (obj == null
|| ! (obj instanceof ContactZeroconfImpl))
return false;
ContactZeroconfImpl zeroconfContact = (ContactZeroconfImpl) obj;
return this.getAddress().equals(zeroconfContact.getAddress());
}
/**
* Returns the persistent presence operation set that this contact belongs
* to.

@ -0,0 +1,69 @@
/*
* Jitsi, the OpenSource Java VoIP and Instant Messaging client.
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package net.java.sip.communicator.service.protocol;
/**
* An abstract base implementation of the {@link Contact} interface which is to
* aid implementers.
*
* @author Lyubomir Marinov
*/
public abstract class AbstractContact
implements Contact
{
@Override
public boolean equals(Object obj)
{
if (obj == null)
return false;
else if (obj == this)
return true;
else if (!obj.getClass().equals(getClass()))
return false;
else
{
Contact contact = (Contact) obj;
ProtocolProviderService protocolProvider
= contact.getProtocolProvider();
ProtocolProviderService thisProtocolProvider
= getProtocolProvider();
if ((protocolProvider == null)
? (thisProtocolProvider == null)
: protocolProvider.equals(thisProtocolProvider))
{
String address = contact.getAddress();
String thisAddress = getAddress();
return
(address == null)
? (thisAddress == null)
: address.equals(thisAddress);
}
else
return false;
}
}
@Override
public int hashCode()
{
int hashCode = 0;
ProtocolProviderService protocolProvider = getProtocolProvider();
if (protocolProvider != null)
hashCode += protocolProvider.hashCode();
String address = getAddress();
if (address != null)
hashCode += address.hashCode();
return hashCode;
}
}

@ -239,10 +239,7 @@ public AutoAnswerThread(CallPeer peer, boolean isVideoCall)
*/
public void run()
{
OperationSetBasicAutoAnswer opSetBasicAutoAnswer
= protocolProvider.getOperationSet(
OperationSetBasicAutoAnswer.class);
OperationSetBasicTelephony opSetBasicTelephony
OperationSetBasicTelephony<?> opSetBasicTelephony
= protocolProvider.getOperationSet(
OperationSetBasicTelephony.class);
OperationSetVideoTelephony opSetVideoTelephony
@ -251,14 +248,14 @@ public void run()
try
{
// If this is a video call and that the user has configured to
// answer it with wideo, then create a video call.
// answer it with video, then create a video call.
if(this.isVideoCall
&& answerWithVideo
&& opSetVideoTelephony != null)
{
opSetVideoTelephony.answerVideoCallPeer(peer);
}
// Else sends only audio to the repote peer (the remote peer is
// Else sends only audio to the remote peer (the remote peer is
// still able to send us its video stream).
else if(opSetBasicTelephony != null)
{
@ -277,6 +274,7 @@ else if(opSetBasicTelephony != null)
*
* @param evt the <tt>CallPeerChangeEvent</tt> instance containing the
*/
@Override
public void peerStateChanged(CallPeerChangeEvent evt)
{
CallPeerState newState = (CallPeerState) evt.getNewValue();

@ -18,7 +18,7 @@
* implementers to provide complete solutions while focusing on
* implementation-specific details.
*
* @author Lubomir Marinov
* @author Lyubomir Marinov
*/
public abstract class AbstractOperationSetBasicInstantMessaging
implements OperationSetBasicInstantMessaging
@ -189,16 +189,22 @@ else if (evt instanceof MessageDeliveryFailedEvent)
{
switch (eventType)
{
case MessageDelivered:
listener.messageDelivered((MessageDeliveredEvent) evt);
break;
case MessageDeliveryFailed:
listener
.messageDeliveryFailed((MessageDeliveryFailedEvent)evt);
break;
case MessageReceived:
listener.messageReceived((MessageReceivedEvent) evt);
break;
case MessageDelivered:
listener.messageDelivered((MessageDeliveredEvent) evt);
break;
case MessageDeliveryFailed:
listener.messageDeliveryFailed(
(MessageDeliveryFailedEvent)evt);
break;
case MessageReceived:
listener.messageReceived((MessageReceivedEvent) evt);
break;
default:
/*
* We either have nothing to do or we do not know what to
* do. Anyway, we'll silence the compiler.
*/
break;
}
}
}
@ -257,7 +263,7 @@ private EventObject messageTransform(EventObject evt, MessageEventType eventType
protocolProvider = ((MessageReceivedEvent)evt).getSourceContact().getProtocolProvider();
break;
default:
return evt;
return evt;
}
OperationSetInstantMessageTransformImpl opSetMessageTransform =
@ -295,6 +301,12 @@ private EventObject messageTransform(EventObject evt, MessageEventType eventType
= transformLayer
.messageReceived((MessageReceivedEvent)evt);
break;
default:
/*
* We either have nothing to do or we do not know what
* to do. Anyway, we'll silence the compiler.
*/
break;
}
}
}

Loading…
Cancel
Save