You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These invocations can occur in different threads, because com.microsoft.identity.client.PublicClientApplication.create([...]) spawns a new thread on each invocation.
While getEquivalentConfiguredAuthority iterates over the java.util.ArrayList knownAuthorities instance, addKnownAuthorities inserts elements in the same instance. (knownAuthorities is defined static final.)
There is no (effective) synchronization to sequentialize the order of both calls. Hence, iteration and insertion can occur concurrently. This is not supported by java.util.ArrayList. Hence, there is a race condition. With some chance, a java.util.ConcurrentModificationException occurs.
Maybe you want to investigate this, if this is not the intended behavior.
Regards, Luis.
The text was updated successfully, but these errors were encountered:
Hello,
I think I found a race condition in your code:
com.microsoft.identity.client.PublicClientApplication.create(android.content.Context, String, String, String, com.microsoft.identity.client.IPublicClientApplication.ApplicationCreatedListener)
method leads to invocationscom.microsoft.identity.common.java.authorities.Authority.getEquivalentConfiguredAuthority([...])
com.microsoft.identity.common.java.authorities.Authority.addKnownAuthorities([...])
com.microsoft.identity.client.PublicClientApplication.create([...])
spawns a new thread on each invocation.getEquivalentConfiguredAuthority
iterates over thejava.util.ArrayList knownAuthorities
instance,addKnownAuthorities
inserts elements in the same instance. (knownAuthorities
is definedstatic final
.)java.util.ArrayList
. Hence, there is a race condition. With some chance, ajava.util.ConcurrentModificationException
occurs.Maybe you want to investigate this, if this is not the intended behavior.
Regards, Luis.
The text was updated successfully, but these errors were encountered: