1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-24 15:22:07 +01:00

Add missing 'synchronized' keywords to Manager.getInstanceFor()

Fixes SMACK-865.
This commit is contained in:
Florian Schmaus 2019-04-14 21:41:59 +02:00
parent 6076a9dfa5
commit 488055948d
8 changed files with 8 additions and 8 deletions

View file

@ -32,7 +32,7 @@ public final class JingleFileTransferManager extends Manager {
super(connection); super(connection);
} }
public static JingleFileTransferManager getInstanceFor(XMPPConnection connection) { public static synchronized JingleFileTransferManager getInstanceFor(XMPPConnection connection) {
JingleFileTransferManager manager = INSTANCES.get(connection); JingleFileTransferManager manager = INSTANCES.get(connection);
if (manager == null) { if (manager == null) {
manager = new JingleFileTransferManager(connection); manager = new JingleFileTransferManager(connection);

View file

@ -51,7 +51,7 @@ public final class ReferenceManager extends Manager {
* @param connection xmpp connection * @param connection xmpp connection
* @return reference manager instance * @return reference manager instance
*/ */
public static ReferenceManager getInstanceFor(XMPPConnection connection) { public static synchronized ReferenceManager getInstanceFor(XMPPConnection connection) {
ReferenceManager manager = INSTANCES.get(connection); ReferenceManager manager = INSTANCES.get(connection);
if (manager == null) { if (manager == null) {
manager = new ReferenceManager(connection); manager = new ReferenceManager(connection);

View file

@ -78,7 +78,7 @@ public final class StableUniqueStanzaIdManager extends Manager {
* @param connection xmpp-connection * @param connection xmpp-connection
* @return manager instance for the connection * @return manager instance for the connection
*/ */
public static StableUniqueStanzaIdManager getInstanceFor(XMPPConnection connection) { public static synchronized StableUniqueStanzaIdManager getInstanceFor(XMPPConnection connection) {
StableUniqueStanzaIdManager manager = INSTANCES.get(connection); StableUniqueStanzaIdManager manager = INSTANCES.get(connection);
if (manager == null) { if (manager == null) {
manager = new StableUniqueStanzaIdManager(connection); manager = new StableUniqueStanzaIdManager(connection);

View file

@ -61,7 +61,7 @@ public final class SpoilerManager extends Manager {
* @param connection xmpp connection * @param connection xmpp connection
* @return SpoilerManager * @return SpoilerManager
*/ */
public static SpoilerManager getInstanceFor(XMPPConnection connection) { public static synchronized SpoilerManager getInstanceFor(XMPPConnection connection) {
SpoilerManager manager = INSTANCES.get(connection); SpoilerManager manager = INSTANCES.get(connection);
if (manager == null) { if (manager == null) {
manager = new SpoilerManager(connection); manager = new SpoilerManager(connection);

View file

@ -48,7 +48,7 @@ public final class JingleTransportMethodManager extends Manager {
super(connection); super(connection);
} }
public static JingleTransportMethodManager getInstanceFor(XMPPConnection connection) { public static synchronized JingleTransportMethodManager getInstanceFor(XMPPConnection connection) {
JingleTransportMethodManager manager = INSTANCES.get(connection); JingleTransportMethodManager manager = INSTANCES.get(connection);
if (manager == null) { if (manager == null) {
manager = new JingleTransportMethodManager(connection); manager = new JingleTransportMethodManager(connection);

View file

@ -38,7 +38,7 @@ public final class JingleIBBTransportManager extends JingleTransportManager<Jing
JingleContentProviderManager.addJingleContentTransportProvider(getNamespace(), new JingleIBBTransportProvider()); JingleContentProviderManager.addJingleContentTransportProvider(getNamespace(), new JingleIBBTransportProvider());
} }
public static JingleIBBTransportManager getInstanceFor(XMPPConnection connection) { public static synchronized JingleIBBTransportManager getInstanceFor(XMPPConnection connection) {
JingleIBBTransportManager manager = INSTANCES.get(connection); JingleIBBTransportManager manager = INSTANCES.get(connection);
if (manager == null) { if (manager == null) {
manager = new JingleIBBTransportManager(connection); manager = new JingleIBBTransportManager(connection);

View file

@ -63,7 +63,7 @@ public final class JingleS5BTransportManager extends JingleTransportManager<Jing
JingleContentProviderManager.addJingleContentTransportProvider(getNamespace(), new JingleS5BTransportProvider()); JingleContentProviderManager.addJingleContentTransportProvider(getNamespace(), new JingleS5BTransportProvider());
} }
public static JingleS5BTransportManager getInstanceFor(XMPPConnection connection) { public static synchronized JingleS5BTransportManager getInstanceFor(XMPPConnection connection) {
JingleS5BTransportManager manager = INSTANCES.get(connection); JingleS5BTransportManager manager = INSTANCES.get(connection);
if (manager == null) { if (manager == null) {
manager = new JingleS5BTransportManager(connection); manager = new JingleS5BTransportManager(connection);

View file

@ -620,7 +620,7 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList
* A XMPP connection * A XMPP connection
* @return a Jingle session * @return a Jingle session
*/ */
public static JingleSession getInstanceFor(XMPPConnection con) { public static synchronized JingleSession getInstanceFor(XMPPConnection con) {
if (con == null) { if (con == null) {
throw new IllegalArgumentException("XMPPConnection cannot be null"); throw new IllegalArgumentException("XMPPConnection cannot be null");
} }