File tree Expand file tree Collapse file tree
android-core/src/main/java/com/mparticle/networking Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020import java .util .HashMap ;
2121import java .util .List ;
2222import java .util .Map ;
23+ import java .util .HashSet ;
24+ import java .util .Set ;
2325
2426public class NetworkOptions {
2527
2628 Map <Endpoint , DomainMapping > domainMappings = new HashMap <Endpoint , DomainMapping >();
2729 boolean pinningDisabledInDevelopment = false ;
2830 boolean pinningDisabled = false ;
31+ private static Set <Endpoint > loggedDomainTypes = new HashSet <>();
2932
3033 private NetworkOptions () {
3134 }
@@ -144,10 +147,13 @@ public Builder addDomainMapping(@Nullable DomainMapping domain) {
144147 domainMappings = new HashMap <Endpoint , DomainMapping >();
145148 }
146149 if (domainMappings .containsKey (domain .getType ())) {
147- try {
148- Logger .warning ("Duplicate DomainMapping submitted, DomainMapping:\n " + domain .toJson ().toString (4 ) + "\n will overwrite DomainMapping:\n " + domain .toJson ().toString (4 ));
149- } catch (JSONException e ) {
150- e .printStackTrace ();
150+ if (!loggedDomainTypes .contains (domain .getType ())) {
151+ try {
152+ Logger .warning ("Duplicate DomainMapping submitted, DomainMapping:\n " + domain .toJson ().toString (4 ) + "\n will overwrite DomainMapping:\n " + domain .toJson ().toString (4 ));
153+ loggedDomainTypes .add (domain .getType ());
154+ } catch (JSONException e ) {
155+ Logger .error (e );
156+ }
151157 }
152158 }
153159 if (domain .getType () == EVENTS && !domain .isEventsOnly () && !domainMappings .containsKey (ALIAS )) {
You can’t perform that action at this time.
0 commit comments