Skip to content

Commit

Permalink
#363 fixed thread safety issue (#364)
Browse files Browse the repository at this point in the history
Co-authored-by: Rob Austin <[email protected]>
  • Loading branch information
2 people authored and JerryShea committed Jul 22, 2023
1 parent 7d8a0f9 commit 204bead
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ public String intern(@NotNull final Bytes bytes, int length)

char[] chars = toCharArray(bytes, position, length);
final int toPlace = s == null || (s2 != null && toggle()) ? h : h2;
interner[toPlace] = StringUtils.newString(chars);
return interner[toPlace];
String result = StringUtils.newString(chars);
interner[toPlace] = result;
return result;
} finally {
bytes.readSkip(length);
}
Expand Down

0 comments on commit 204bead

Please sign in to comment.