diff options
author | Lyubomir Marinov <lyubomir.marinov@jitsi.org> | 2010-07-25 15:48:34 +0000 |
---|---|---|
committer | Lyubomir Marinov <lyubomir.marinov@jitsi.org> | 2010-07-25 15:48:34 +0000 |
commit | 17a69a6954e814b1b8a136a5d741a2182c230baf (patch) | |
tree | ec96f8947a98fd7230be0489669cb831fe3900ab /src/net/java/sip/communicator | |
parent | 37b03cd101eefb17694f39a625bacb909eecb3cb (diff) | |
download | jitsi-17a69a6954e814b1b8a136a5d741a2182c230baf.zip jitsi-17a69a6954e814b1b8a136a5d741a2182c230baf.tar.gz jitsi-17a69a6954e814b1b8a136a5d741a2182c230baf.tar.bz2 |
Fixes a few warnings. Removes a seemingly-unnecessary field.
Diffstat (limited to 'src/net/java/sip/communicator')
9 files changed, 56 insertions, 64 deletions
diff --git a/src/net/java/sip/communicator/impl/neomedia/codec/EncodingConfiguration.java b/src/net/java/sip/communicator/impl/neomedia/codec/EncodingConfiguration.java index 5af2191..c371123 100644 --- a/src/net/java/sip/communicator/impl/neomedia/codec/EncodingConfiguration.java +++ b/src/net/java/sip/communicator/impl/neomedia/codec/EncodingConfiguration.java @@ -10,7 +10,6 @@ import java.io.*; import java.util.*; import javax.media.*; -import javax.media.format.*; import net.java.sip.communicator.impl.neomedia.*; import net.java.sip.communicator.impl.neomedia.format.*; @@ -46,6 +45,10 @@ public class EncodingConfiguration */ public static final boolean G729 = false; + /** + * The name of the class implementing the Speex resampler which is to + * override the default JMF resampler. + */ private static final String SPEEX_RESAMPLER = "net.java.sip.communicator.impl.neomedia.codec.audio.speex.SpeexResampler"; diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/ContactJabberImpl.java b/src/net/java/sip/communicator/impl/protocol/jabber/ContactJabberImpl.java index 6f3bb3f..6cb403e 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/ContactJabberImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/ContactJabberImpl.java @@ -25,12 +25,6 @@ public class ContactJabberImpl private String jid = null; /** - * Determines whether or not this Contact instance represents the user used - * by this protocol provider to connect to the service. - */ - private boolean isLocal = false; - - /** * The image of the contact. */ private byte[] image = null; @@ -45,7 +39,7 @@ public class ContactJabberImpl * A reference to the ServerStoredContactListImpl * instance that created us. */ - private ServerStoredContactListJabberImpl ssclCallback = null; + private final ServerStoredContactListJabberImpl ssclCallback; /** * Whether or not this contact is being stored by the server. @@ -61,7 +55,7 @@ public class ContactJabberImpl /** * Used to store contact id when creating unresolved contacts. */ - private String tempId = null; + private final String tempId; /** * The current status message of this contact. @@ -86,6 +80,7 @@ public class ContactJabberImpl if(rosterEntry != null) this.jid = rosterEntry.getUser(); + this.tempId = null; this.ssclCallback = ssclCallback; this.isPersistent = isPersistent; this.isResolved = isResolved; @@ -137,7 +132,8 @@ public class ContactJabberImpl */ public boolean isLocal() { - return isLocal; + // TODO Auto-generated method stub + return false; } /** diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/OutgoingFileTransferJabberImpl.java b/src/net/java/sip/communicator/impl/protocol/jabber/OutgoingFileTransferJabberImpl.java index 27af2b8..d95dc6f 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/OutgoingFileTransferJabberImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/OutgoingFileTransferJabberImpl.java @@ -231,16 +231,17 @@ public class OutgoingFileTransferJabberImpl return; ThumbnailIQ thumbnailIQ = (ThumbnailIQ) packet; + String thumbnailIQCid = thumbnailIQ.getCid(); + XMPPConnection connection = protocolProvider.getConnection(); - if (thumbnailIQ.getCid() != null - && thumbnailIQ.getCid().equals(thumbnailElement.getCid())) + if ((thumbnailIQCid != null) + && thumbnailIQCid.equals(thumbnailElement.getCid())) { ThumbnailedFile thumbnailedFile = (ThumbnailedFile) file; - ThumbnailIQ thumbnailResponse = new ThumbnailIQ( thumbnailIQ.getTo(), thumbnailIQ.getFrom(), - thumbnailIQ.getCid(), + thumbnailIQCid, thumbnailedFile.getThumbnailMimeType(), thumbnailedFile.getThumbnailData(), IQ.Type.RESULT); @@ -249,18 +250,15 @@ public class OutgoingFileTransferJabberImpl logger.debug("Send thumbnail response to the receiver: " + thumbnailResponse.toXML()); - protocolProvider.getConnection() - .sendPacket(thumbnailResponse); + connection.sendPacket(thumbnailResponse); } else { // RETURN <item-not-found/> } - if (protocolProvider.getConnection() != null) - { - protocolProvider.getConnection().removePacketListener(this); - } + if (connection != null) + connection.removePacketListener(this); } } } diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java b/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java index de48399..a80dc86 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java @@ -654,10 +654,11 @@ public class ProtocolProviderServiceJabberImpl //during feature registration so we'd better do it here so that //our first presence update would contain a caps with the right //features. - String name = System.getProperty("sip-communicator.application.name", - "SIP Communicator "); - - name += System.getProperty("sip-communicator.version","SVN"); + String name + = System.getProperty( + "sip-communicator.application.name", + "SIP Communicator ") + + System.getProperty("sip-communicator.version","SVN"); ServiceDiscoveryManager.setIdentityName(name); @@ -670,7 +671,7 @@ public class ProtocolProviderServiceJabberImpl discoveryManager.removeFeature( "http://jabber.org/protocol/commands"); - // Add features the SIP Communicator supports in plus of smack. + // Add features SIP Communicator supports in addition to smack. for(String feature : supportedFeatures) { if (!discoveryManager.includesFeature(feature)) @@ -689,7 +690,7 @@ public class ProtocolProviderServiceJabberImpl connection.disconnect(); connectionListener = null; connection = null; - // make it null as it also holds reference to the old connection + // make it null as it also holds a reference to the old connection // will be created again on new connection discoveryManager = null; } @@ -872,7 +873,7 @@ public class ProtocolProviderServiceJabberImpl OperationSetInstantMessageTransform.class, new OperationSetInstantMessageTransformImpl()); - // Include features we're supporting in plus of the four that + // Include features we're supporting in addition to the four // included by smack itself: // http://jabber.org/protocol/si/profile/file-transfer // http://jabber.org/protocol/si @@ -1194,7 +1195,7 @@ public class ProtocolProviderServiceJabberImpl * @return <code>true</code> if the list of features is supported, otherwise * returns <code>false</code> */ - public boolean isFeatureListSupported(String jid, String[] features) + public boolean isFeatureListSupported(String jid, String... features) { boolean isFeatureListSupported = true; @@ -1236,7 +1237,7 @@ public class ProtocolProviderServiceJabberImpl */ public boolean isFeatureSupported(String jid, String feature) { - return isFeatureListSupported(jid, new String[]{feature}); + return isFeatureListSupported(jid, feature); } /** diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/ScServiceDiscoveryManager.java b/src/net/java/sip/communicator/impl/protocol/jabber/ScServiceDiscoveryManager.java index a670b27..a37eb3b 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/ScServiceDiscoveryManager.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/ScServiceDiscoveryManager.java @@ -34,8 +34,8 @@ public class ScServiceDiscoveryManager * The <tt>Logger</tt> used by the <tt>ScServiceDiscoveryManager</tt> * class and its instances for logging output. */ - private static final Logger logger = Logger - .getLogger(ScServiceDiscoveryManager.class.getName()); + private static final Logger logger + = Logger.getLogger(ScServiceDiscoveryManager.class); /** * A flag that indicates whether we are currently storing non-caps @@ -51,7 +51,7 @@ public class ScServiceDiscoveryManager * currently unused. we'll start using this when we start querying for * client capabilities. */ - private Map<String, DiscoverInfo> nonCapsCache + private final Map<String, DiscoverInfo> nonCapsCache = new ConcurrentHashMap<String, DiscoverInfo>(); /** @@ -119,7 +119,6 @@ public class ScServiceDiscoveryManager connection.addPacketInterceptor(this, capsPacketFilter); - initFeatures(); } @@ -143,7 +142,6 @@ public class ScServiceDiscoveryManager discoveryManager.addFeature(feature); } updateEntityCapsVersion(); - } /** @@ -325,9 +323,9 @@ public class ScServiceDiscoveryManager } /** - * Returns a list of the indentities defined in the node. For - * example, the x-command protocol must provide an identity of - * category automation and type command-node for each command. + * Returns a list of the identities defined in the node. For example, the + * x-command protocol must provide an identity of category automation and + * type command-node for each command. * * @return a list of the Identities defined in the node. */ @@ -433,7 +431,8 @@ public class ScServiceDiscoveryManager */ public boolean supportsFeature(String jid, String feature) { - DiscoverInfo info = null; + DiscoverInfo info; + try { info = this.discoverInfo(jid); @@ -445,9 +444,6 @@ public class ScServiceDiscoveryManager return false; } - if(info != null && info .containsFeature(feature)) - return true; - else - return false; + return ((info != null) && info.containsFeature(feature)); } } diff --git a/src/net/java/sip/communicator/impl/protocol/ssh/SSHFileTransferDaemon.java b/src/net/java/sip/communicator/impl/protocol/ssh/SSHFileTransferDaemon.java index 1c5e81f..65e9c7e 100644 --- a/src/net/java/sip/communicator/impl/protocol/ssh/SSHFileTransferDaemon.java +++ b/src/net/java/sip/communicator/impl/protocol/ssh/SSHFileTransferDaemon.java @@ -13,13 +13,13 @@ package net.java.sip.communicator.impl.protocol.ssh; import java.io.*; -import com.jcraft.jsch.*; - +import net.java.sip.communicator.service.gui.*; import net.java.sip.communicator.service.protocol.*; import net.java.sip.communicator.util.Logger; +import com.jcraft.jsch.*; + /** - * * @author Shobhit Jindal */ public class SSHFileTransferDaemon @@ -246,21 +246,16 @@ public class SSHFileTransferDaemon opSetPersPresence.changeContactPresenceStatus( sshContact, oldStatus); - } /** * Check for error in reading stream of remote machine * - * @return 0 for success - * @return 1 for error - * @return 2 for fatal error - * @return -1 otherwise - * + * @return 0 for success, 1 for error, 2 for fatal error, -1 otherwise * @throws IOException when the network goes down */ private int checkAck(InputStream inputStream) - throws IOException + throws IOException { int result = inputStream.read(); @@ -278,12 +273,16 @@ public class SSHFileTransferDaemon buffer.append((char)ch); }while(ch != '\n'); - - ppService.getUIService().getPopupDialog().showMessagePopupDialog( - buffer.toString(), - "File Transfer Error: " + sshContact.getDisplayName(), - ppService.getUIService().getPopupDialog().ERROR_MESSAGE); - + + ProtocolProviderServiceSSHImpl + .getUIService() + .getPopupDialog() + .showMessagePopupDialog( + buffer.toString(), + "File Transfer Error: " + + sshContact.getDisplayName(), + PopupDialog.ERROR_MESSAGE); + logger.error(buffer.toString()); } @@ -458,8 +457,5 @@ public class SSHFileTransferDaemon instantMessaging.createMessage( this.file.getName() + " downloaded from Server"), sshContact); - - } - } diff --git a/src/net/java/sip/communicator/service/neomedia/AbstractMediaStream.java b/src/net/java/sip/communicator/service/neomedia/AbstractMediaStream.java index 7c32f6f..ed9e465 100644 --- a/src/net/java/sip/communicator/service/neomedia/AbstractMediaStream.java +++ b/src/net/java/sip/communicator/service/neomedia/AbstractMediaStream.java @@ -74,7 +74,9 @@ public abstract class AbstractMediaStream * @param encoding * @param clockRate * @param channels - * @return + * @return <tt>true</tt> if the specified <tt>format</tt> has specific + * values for its properties <tt>mediaType</tt>, <tt>encoding</tt>, + * <tt>clockRate</tt> and <tt>channels</tt>; otherwise, <tt>false</tt> */ public static boolean matches( MediaFormat format, diff --git a/src/net/java/sip/communicator/service/neomedia/AudioMediaStream.java b/src/net/java/sip/communicator/service/neomedia/AudioMediaStream.java index 09e6445..17e9af0 100644 --- a/src/net/java/sip/communicator/service/neomedia/AudioMediaStream.java +++ b/src/net/java/sip/communicator/service/neomedia/AudioMediaStream.java @@ -6,7 +6,6 @@ */ package net.java.sip.communicator.service.neomedia; -import net.java.sip.communicator.impl.neomedia.audiolevel.*; import net.java.sip.communicator.service.neomedia.event.*; /** diff --git a/src/net/java/sip/communicator/service/neomedia/event/RTCPFeedbackEvent.java b/src/net/java/sip/communicator/service/neomedia/event/RTCPFeedbackEvent.java index e0b00de..f2fe199 100644 --- a/src/net/java/sip/communicator/service/neomedia/event/RTCPFeedbackEvent.java +++ b/src/net/java/sip/communicator/service/neomedia/event/RTCPFeedbackEvent.java @@ -14,7 +14,8 @@ import java.util.*; * * @author Sebastien Vincent */ -public class RTCPFeedbackEvent extends EventObject +public class RTCPFeedbackEvent + extends EventObject { /** * Transport layer type (payload type). |