@@ -20,8 +20,10 @@ public final class InternCache
2020 *<p>
2121 * One consideration is possible attack via colliding {@link String#hashCode};
2222 * because of this, limit to reasonably low setting.
23+ *<p>
24+ * Increased to 200 (from 100) in 2.18
2325 */
24- private final static int MAX_ENTRIES = 180 ;
26+ private final static int DEFAULT_MAX_ENTRIES = 280 ;
2527
2628 public final static InternCache instance = new InternCache ();
2729
@@ -32,7 +34,7 @@ public final class InternCache
3234 */
3335 private final ReentrantLock lock = new ReentrantLock ();
3436
35- public InternCache () { this (MAX_ENTRIES , 0.8f , 4 ); }
37+ public InternCache () { this (DEFAULT_MAX_ENTRIES , 0.8f , 4 ); }
3638
3739 public InternCache (int maxSize , float loadFactor , int concurrency ) {
3840 super (maxSize , loadFactor , concurrency );
@@ -47,7 +49,7 @@ public String intern(String input) {
4749 * possible limitation: just clear all contents. This because otherwise
4850 * we are simply likely to keep on clearing same, commonly used entries.
4951 */
50- if (size () >= MAX_ENTRIES ) {
52+ if (size () >= DEFAULT_MAX_ENTRIES ) {
5153 /* As of 2.18, the limit is not strictly enforced, but we do try to
5254 * clear entries if we have reached the limit. We do not expect to
5355 * go too much over the limit, and if we do, it's not a huge problem.
@@ -56,7 +58,7 @@ public String intern(String input) {
5658 */
5759 if (lock .tryLock ()) {
5860 try {
59- if (size () >= MAX_ENTRIES ) {
61+ if (size () >= DEFAULT_MAX_ENTRIES ) {
6062 clear ();
6163 }
6264 } finally {
0 commit comments