aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLyubomir Marinov <lyubomir.marinov@jitsi.org>2014-06-08 22:27:36 +0300
committerLyubomir Marinov <lyubomir.marinov@jitsi.org>2014-06-08 22:27:36 +0300
commit30b92dfe536f75f4c343e1ec612565f373279e93 (patch)
treedc45869a5d79d6ae9e5c92672a930daa06c85322 /src
parent65ea40b0ce15d71373bb7613b8f7420541912233 (diff)
downloadjitsi-30b92dfe536f75f4c343e1ec612565f373279e93.zip
jitsi-30b92dfe536f75f4c343e1ec612565f373279e93.tar.gz
jitsi-30b92dfe536f75f4c343e1ec612565f373279e93.tar.bz2
Removes an unnecessary implicit field.
Diffstat (limited to 'src')
-rw-r--r--src/net/java/sip/communicator/plugin/otr/OtrActivator.java63
-rw-r--r--src/net/java/sip/communicator/plugin/otr/ScOtrEngineImpl.java45
2 files changed, 73 insertions, 35 deletions
diff --git a/src/net/java/sip/communicator/plugin/otr/OtrActivator.java b/src/net/java/sip/communicator/plugin/otr/OtrActivator.java
index d474524..11e8d2e 100644
--- a/src/net/java/sip/communicator/plugin/otr/OtrActivator.java
+++ b/src/net/java/sip/communicator/plugin/otr/OtrActivator.java
@@ -23,6 +23,7 @@ import org.jitsi.util.*;
import org.osgi.framework.*;
/**
+ *
* @author George Politis
* @author Pawel Domas
*/
@@ -160,7 +161,7 @@ public class OtrActivator
private static Map<Object, ProtocolProviderFactory>
getProtocolProviderFactories()
{
- ServiceReference[] serRefs = null;
+ ServiceReference[] serRefs;
try
{
// get all registered provider factories
@@ -230,6 +231,7 @@ public class OtrActivator
/*
* Implements ServiceListener#serviceChanged(ServiceEvent).
*/
+ @Override
public void serviceChanged(ServiceEvent serviceEvent)
{
Object sService =
@@ -261,7 +263,6 @@ public class OtrActivator
{
this.handleProviderRemoved((ProtocolProviderService) sService);
}
-
}
/**
@@ -373,19 +374,22 @@ public class OtrActivator
OtrActionHandler.class.getName(),
new SwingOtrActionHandler(), null);
- containerFilter.put(Container.CONTAINER_ID,
- Container.CONTAINER_CHAT_WRITE_PANEL.getID());
- bundleContext.registerService(
- PluginComponentFactory.class.getName(),
- new PluginComponentFactory( Container.CONTAINER_CHAT_WRITE_PANEL)
- {
- protected PluginComponent getPluginInstance()
+ containerFilter.put(Container.CONTAINER_ID,
+ Container.CONTAINER_CHAT_WRITE_PANEL.getID());
+ bundleContext.registerService(
+ PluginComponentFactory.class.getName(),
+ new PluginComponentFactory(Container.CONTAINER_CHAT_WRITE_PANEL)
{
- return new OTRv3OutgoingSessionSwitcher(
- getContainer(), this);
- }
- },
- containerFilter);
+ @Override
+ protected PluginComponent getPluginInstance()
+ {
+ return
+ new OTRv3OutgoingSessionSwitcher(
+ getContainer(),
+ this);
+ }
+ },
+ containerFilter);
}
// If the general configuration form is disabled don't register it.
@@ -399,26 +403,27 @@ public class OtrActivator
ConfigurationForm.SECURITY_TYPE);
// Register the configuration form.
bundleContext.registerService(ConfigurationForm.class.getName(),
- new LazyConfigurationForm(
- "net.java.sip.communicator.plugin.otr.authdialog." +
- "OtrConfigurationPanel",
- getClass().getClassLoader(),
- "plugin.otr.configform.ICON",
- "service.gui.CHAT", 1),
- properties);
+ new LazyConfigurationForm(
+ "net.java.sip.communicator.plugin.otr.authdialog."
+ + "OtrConfigurationPanel",
+ getClass().getClassLoader(),
+ "plugin.otr.configform.ICON",
+ "service.gui.CHAT", 1),
+ properties);
}
}
/*
* Implements BundleActivator#stop(BundleContext).
*/
+ @Override
public void stop(BundleContext bc) throws Exception
{
// Unregister transformation layer.
// start listening for newly register or removed protocol providers
bundleContext.removeServiceListener(this);
- ServiceReference[] protocolProviderRefs = null;
+ ServiceReference[] protocolProviderRefs;
try
{
protocolProviderRefs =
@@ -473,16 +478,20 @@ public class OtrActivator
public static MessageHistoryService getMessageHistoryService()
{
if (messageHistoryService == null)
- messageHistoryService = ServiceUtils.getService(bundleContext,
- MessageHistoryService.class);
+ {
+ messageHistoryService
+ = ServiceUtils.getService(
+ bundleContext,
+ MessageHistoryService.class);
+ }
return messageHistoryService;
}
/**
- * The factory that will be registered in OSGi and will create
- * otr menu instances.
+ * The factory that will be registered in OSGi and will create OTR menu
+ * instances.
*/
- private class OtrPluginComponentFactory
+ private static class OtrPluginComponentFactory
extends PluginComponentFactory
{
OtrPluginComponentFactory(Container c)
diff --git a/src/net/java/sip/communicator/plugin/otr/ScOtrEngineImpl.java b/src/net/java/sip/communicator/plugin/otr/ScOtrEngineImpl.java
index 171fc78..a06b61d 100644
--- a/src/net/java/sip/communicator/plugin/otr/ScOtrEngineImpl.java
+++ b/src/net/java/sip/communicator/plugin/otr/ScOtrEngineImpl.java
@@ -36,9 +36,10 @@ public class ScOtrEngineImpl
ChatLinkClickedListener,
ServiceListener
{
- class ScOtrEngineHost
+ private class ScOtrEngineHost
implements OtrEngineHost
{
+ @Override
public KeyPair getLocalKeyPair(SessionID sessionID)
{
AccountID accountID =
@@ -51,11 +52,13 @@ public class ScOtrEngineImpl
return OtrActivator.scOtrKeyManager.loadKeyPair(accountID);
}
+ @Override
public OtrPolicy getSessionPolicy(SessionID sessionID)
{
return getContactPolicy(getOtrContact(sessionID).contact);
}
+ @Override
public void injectMessage(SessionID sessionID, String messageText)
{
OtrContact otrContact = getOtrContact(sessionID);
@@ -109,6 +112,7 @@ public class ScOtrEngineImpl
imOpSet.sendInstantMessage(contact, resource, message);
}
+ @Override
public void showError(SessionID sessionID, String err)
{
ScOtrEngineImpl.this.showError(sessionID, err);
@@ -504,7 +508,7 @@ public class ScOtrEngineImpl
*/
private final Logger logger = Logger.getLogger(ScOtrEngineImpl.class);
- final OtrEngineHost otrEngineHost = new ScOtrEngineHost();
+ private final OtrEngineHost otrEngineHost = new ScOtrEngineHost();
private final OtrEngine otrEngine;
@@ -519,6 +523,7 @@ public class ScOtrEngineImpl
this.otrEngine.addOtrEngineListener(new OtrEngineListener()
{
+ @Override
public void sessionStatusChanged(SessionID sessionID)
{
OtrContact otrContact = getOtrContact(sessionID);
@@ -696,6 +701,7 @@ public class ScOtrEngineImpl
l.sessionStatusChanged(otrContact);
}
+ @Override
public void multipleInstancesDetected(SessionID sessionID)
{
OtrContact otrContact = getOtrContact(sessionID);
@@ -706,6 +712,7 @@ public class ScOtrEngineImpl
l.multipleInstancesDetected(otrContact);
}
+ @Override
public void outgoingSessionChanged(SessionID sessionID)
{
OtrContact otrContact = getOtrContact(sessionID);
@@ -736,6 +743,7 @@ public class ScOtrEngineImpl
return true;
}
+ @Override
public void addListener(ScOtrEngineListener l)
{
synchronized (listeners)
@@ -745,6 +753,7 @@ public class ScOtrEngineImpl
}
}
+ @Override
public void chatLinkClicked(URI url)
{
String action = url.getPath();
@@ -773,6 +782,7 @@ public class ScOtrEngineImpl
}
}
+ @Override
public void endSession(OtrContact otrContact)
{
SessionID sessionID = getSessionID(otrContact);
@@ -788,6 +798,7 @@ public class ScOtrEngineImpl
}
}
+ @Override
public OtrPolicy getContactPolicy(Contact contact)
{
ProtocolProviderService pps = contact.getProtocolProvider();
@@ -805,6 +816,7 @@ public class ScOtrEngineImpl
return new OtrPolicyImpl(policy);
}
+ @Override
public OtrPolicy getGlobalPolicy()
{
/*
@@ -851,13 +863,15 @@ public class ScOtrEngineImpl
{
cancel(otrContact);
- TimerTask task = new TimerTask() {
- @Override
- public void run()
+ TimerTask task
+ = new TimerTask()
{
- setSessionStatus(otrContact, status);
- }
- };
+ @Override
+ public void run()
+ {
+ setSessionStatus(otrContact, status);
+ }
+ };
timer.schedule(task, SESSION_TIMEOUT);
tasks.put(otrContact, task);
}
@@ -908,6 +922,7 @@ public class ScOtrEngineImpl
l.sessionStatusChanged(contact);
}
+ @Override
public ScSessionStatus getSessionStatus(OtrContact contact)
{
SessionID sessionID = getSessionID(contact);
@@ -932,11 +947,13 @@ public class ScOtrEngineImpl
return scSessionStatusMap.get(sessionID);
}
+ @Override
public boolean isMessageUIDInjected(String mUID)
{
return injectedMessageUIDs.contains(mUID);
}
+ @Override
public void launchHelp()
{
ServiceReference ref =
@@ -953,6 +970,7 @@ public class ScOtrEngineImpl
.getI18NString("plugin.otr.authbuddydialog.HELP_URI"));
}
+ @Override
public void refreshSession(OtrContact otrContact)
{
SessionID sessionID = getSessionID(otrContact);
@@ -967,6 +985,7 @@ public class ScOtrEngineImpl
}
}
+ @Override
public void removeListener(ScOtrEngineListener l)
{
synchronized (listeners)
@@ -979,6 +998,7 @@ public class ScOtrEngineImpl
* Cleans the contactsMap when <tt>ProtocolProviderService</tt>
* gets unregistered.
*/
+ @Override
public void serviceChanged(ServiceEvent ev)
{
Object service
@@ -1029,6 +1049,7 @@ public class ScOtrEngineImpl
}
}
+ @Override
public void setContactPolicy(Contact contact, OtrPolicy policy)
{
ProtocolProviderService pps = contact.getProtocolProvider();
@@ -1048,6 +1069,7 @@ public class ScOtrEngineImpl
l.contactPolicyChanged(contact);
}
+ @Override
public void setGlobalPolicy(OtrPolicy policy)
{
if (policy == null)
@@ -1072,6 +1094,7 @@ public class ScOtrEngineImpl
OperationSetBasicInstantMessaging.DEFAULT_MIME_TYPE);
}
+ @Override
public void startSession(OtrContact otrContact)
{
SessionID sessionID = getSessionID(otrContact);
@@ -1098,6 +1121,7 @@ public class ScOtrEngineImpl
}
}
+ @Override
public String transformReceiving(OtrContact otrContact, String msgText)
{
SessionID sessionID = getSessionID(otrContact);
@@ -1113,6 +1137,7 @@ public class ScOtrEngineImpl
}
}
+ @Override
public String transformSending(OtrContact otrContact, String msgText)
{
SessionID sessionID = getSessionID(otrContact);
@@ -1215,6 +1240,7 @@ public class ScOtrEngineImpl
}
}
+ @Override
public PublicKey getRemotePublicKey(OtrContact otrContact)
{
if (otrContact == null)
@@ -1225,6 +1251,7 @@ public class ScOtrEngineImpl
return session.getRemotePublicKey();
}
+ @Override
public List<Session> getSessionInstances(OtrContact otrContact)
{
if (otrContact == null)
@@ -1233,6 +1260,7 @@ public class ScOtrEngineImpl
return getSession(otrContact).getInstances();
}
+ @Override
public boolean setOutgoingSession(OtrContact contact, InstanceTag tag)
{
if (contact == null)
@@ -1244,6 +1272,7 @@ public class ScOtrEngineImpl
return session.setOutgoingInstance(tag);
}
+ @Override
public Session getOutgoingSession(OtrContact contact)
{
if (contact == null)