File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/metadata Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -149,26 +149,33 @@ public void setUserId(String identifier) {
149149 */
150150 public Map <String , String > getCustomKeys (Map <String , String > eventKeys ) {
151151 // In case of empty event keys, preserve existing behavior.
152- if (eventKeys .isEmpty ()) { return customKeys .getKeys (); }
152+ if (eventKeys .isEmpty ()) {
153+ return customKeys .getKeys ();
154+ }
153155
154156 // Otherwise merge the event keys with custom keys as appropriate.
155157 Map <String , String > globalKeys = customKeys .getKeys ();
156158 HashMap <String , String > result = new HashMap <>(globalKeys );
159+ int eventKeysOverLimit = 0 ;
157160 for (Map .Entry <String , String > entry : eventKeys .entrySet ()) {
158161 String sanitizedKey = KeysMap .sanitizeString (entry .getKey (), MAX_ATTRIBUTE_SIZE );
159162 if (result .size () < MAX_ATTRIBUTES || result .containsKey (sanitizedKey )) {
160163 String sanitizedValue = KeysMap .sanitizeString (entry .getValue (), MAX_ATTRIBUTE_SIZE );
161164 result .put (sanitizedKey , sanitizedValue );
162- continue ;
165+ } else {
166+ eventKeysOverLimit ++;
163167 }
168+ }
164169
170+ if (eventKeysOverLimit > 0 ) {
165171 Logger .getLogger ()
166172 .w (
167- "Ignored entry \" "
168- + entry . getKey ()
169- + "\" when adding event specific keys. Maximum allowable: "
173+ "Ignored"
174+ + eventKeysOverLimit
175+ + " keys when adding event specific keys. Maximum allowable: "
170176 + MAX_ATTRIBUTE_SIZE );
171177 }
178+
172179 return Collections .unmodifiableMap (result );
173180 }
174181
You can’t perform that action at this time.
0 commit comments