Adds final, fixes warnings.

cusax-fix
Lyubomir Marinov 18 years ago
parent c5da7b9b72
commit 5537af0508

@ -127,7 +127,7 @@ public Call createCall(String callee)
*/
public Call createCall(Contact callee) throws OperationFailedException
{
Address toAddress = null;
Address toAddress;
try
{
@ -263,13 +263,12 @@ private synchronized CallSipImpl createOutgoingCall(Address calleeAddress,
// that the media service can choose the most proper local
// address to advertise.
javax.sip.address.URI calleeURI = calleeAddress.getURI();
InetAddress intendedDestination = null;
if (calleeURI.isSipURI())
{
String host = ((SipURI) calleeURI).getHost();
intendedDestination = protocolProvider
InetAddress intendedDestination = protocolProvider
.resolveSipAddress(host).getAddress();
invite.setContent(callSession
.createSdpOffer(intendedDestination),
contentTypeHeader);
@ -2715,7 +2714,7 @@ private boolean sayBye(CallParticipantSipImpl callParticipant)
ArrayList<ViaHeader> viaHeaders =
protocolProvider.getLocalViaHeaders(destination);
bye.setHeader((ViaHeader) viaHeaders.get(0));
bye.setHeader(viaHeaders.get(0));
bye.addHeader(protocolProvider.getSipCommUserAgentHeader());
}
catch (SipException ex)
@ -2914,7 +2913,7 @@ public synchronized void answerCallParticipant(CallParticipant participant)
.setMediaCallSession(callSession);
String sdpOffer = callParticipant.getSdpDescription();
String sdp = null;
String sdp;
// if the offer was in the invite create an sdp answer
if ((sdpOffer != null) && (sdpOffer.length() > 0))
{
@ -3147,10 +3146,7 @@ public boolean isSecure(CallParticipant participant)
CallSession cs
= ((CallSipImpl) participant.getCall()).getMediaCallSession();
if (cs != null)
return cs.getSecureCommunicationStatus();
else
return false;
return (cs != null) && cs.getSecureCommunicationStatus();
}
/**
@ -3166,10 +3162,7 @@ public boolean setSasVerified( CallParticipant participant,
CallSession cs
= ((CallSipImpl) participant.getCall()).getMediaCallSession();
if (cs != null)
return cs.setZrtpSASVerification(isVerified);
else
return false;
return (cs != null) && cs.setZrtpSASVerification(isVerified);
}

@ -11,7 +11,6 @@
import net.java.sip.communicator.service.protocol.event.*;
import net.java.sip.communicator.util.*;
/**
* A representation of a Call. The Call class must only be created by users (i.e.
* telephony protocols) of the PhoneUIService such as a SIP protocol
@ -23,24 +22,24 @@
*/
public abstract class Call
{
private static final Logger logger
= Logger.getLogger(Call.class);
private static final Logger logger = Logger.getLogger(Call.class);
/**
* An identifier uniquely representing the call.
*/
private String callID = null;
private final String callID;
/**
* A list of all listeners currently registered for
* <tt>CallChangeEvent</tt>s
*/
private Vector<CallChangeListener> callListeners
private final List<CallChangeListener> callListeners
= new Vector<CallChangeListener>();
/**
* A reference to the ProtocolProviderService instance that created us.
*/
private ProtocolProviderService protocolProvider = null;
private final ProtocolProviderService protocolProvider;
/**
* If this flag is set to true according to the account properties
@ -57,14 +56,13 @@ public abstract class Call
protected Call(ProtocolProviderService sourceProvider)
{
//create the uid
this.callID = String.valueOf( System.currentTimeMillis())
this.callID = String.valueOf(System.currentTimeMillis())
+ String.valueOf(super.hashCode());
this.protocolProvider = sourceProvider;
AccountID accountID = sourceProvider.getAccountID();
defaultEncryption =
accountID.getAccountPropertyBoolean(
protocolProvider.getAccountID().getAccountPropertyBoolean(
ProtocolProviderFactory.DEFAULT_ENCRYPTION, true);
}
@ -92,11 +90,8 @@ public boolean equals(Object obj)
if(obj == null
|| !(obj instanceof Call))
return false;
if (obj == this
|| ((Call)obj).getCallID().equals( getCallID() ))
return true;
return false;
return (obj == this)
|| ((Call)obj).getCallID().equals(getCallID());
}
/**
@ -180,15 +175,15 @@ protected void fireCallParticipantEvent(CallParticipant sourceCallParticipant,
+ callListeners.size()
+" listeners. event is: " + cpEvent.toString());
Iterator listeners = null;
Iterator<CallChangeListener> listeners;
synchronized(callListeners)
{
listeners = new ArrayList(callListeners).iterator();
listeners = new ArrayList<CallChangeListener>(callListeners).iterator();
}
while(listeners.hasNext())
{
CallChangeListener listener = (CallChangeListener)listeners.next();
CallChangeListener listener = listeners.next();
if(eventID == CallParticipantEvent.CALL_PARTICIPANT_ADDED)
listener.callParticipantAdded(cpEvent);
@ -232,15 +227,15 @@ protected void fireCallChangeEvent( String type,
+ callListeners.size()
+" listeners. event is: " + ccEvent.toString());
Iterator listeners = null;
Iterator<CallChangeListener> listeners;
synchronized(callListeners)
{
listeners = new ArrayList(callListeners).iterator();
listeners = new ArrayList<CallChangeListener>(callListeners).iterator();
}
while(listeners.hasNext())
{
CallChangeListener listener = (CallChangeListener)listeners.next();
CallChangeListener listener = listeners.next();
if(type.equals(CallChangeEvent.CALL_STATE_CHANGE))
listener.callStateChanged(ccEvent);

Loading…
Cancel
Save