File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
utils/src/main/java/datadog/instrument/utils Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -251,6 +251,9 @@ public static ClassNameTrie readFrom(DataInput in) throws IOException {
251251 throw new IOException ("Unexpected file magic " + magic );
252252 }
253253 int trieLength = in .readInt ();
254+ if (trieLength == 0 ) {
255+ return EMPTY_TRIE ;
256+ }
254257 char [] trieData = new char [trieLength ];
255258 for (int i = 0 ; i < trieLength ; i ++) {
256259 byte b = in .readByte ();
@@ -309,10 +312,12 @@ public Builder() {}
309312 * @param trie existing trie
310313 */
311314 public Builder (ClassNameTrie trie ) {
312- trieData = trie .trieData ;
313- trieLength = trieData .length ;
314- longJumps = trie .longJumps ;
315- longJumpCount = null != longJumps ? longJumps .length : 0 ;
315+ if (trie .trieData .length > 1 ) { // non-empty trie (branch count + content)
316+ trieData = trie .trieData ;
317+ trieLength = trieData .length ;
318+ longJumps = trie .longJumps ;
319+ longJumpCount = null != longJumps ? longJumps .length : 0 ;
320+ }
316321 }
317322
318323 /**
You can’t perform that action at this time.
0 commit comments