| Modifier and Type | Field and Description |
|---|---|
| private static final int | DEFAULT_MAX_ENTRIES
Size to use is somewhat arbitrary, so let's choose something that's neither too small (low hit ratio) nor too large (waste of memory). |
| public static final InternCache | |
| private final ReentrantLock | lock
As minor optimization let's try to avoid "flush storms", cases where multiple threads might try to concurrently flush the map. |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String |
| DEFAULT_MAX_ENTRIES | back to summary |
|---|---|
| private static final int DEFAULT_MAX_ENTRIES Size to use is somewhat arbitrary, so let's choose something that's neither too small (low hit ratio) nor too large (waste of memory).
One consideration is possible attack via colliding Increased to 200 (from 100) in 2.18 | |
| instance | back to summary |
|---|---|
| public static final InternCache instance | |
| lock | back to summary |
|---|---|
| private final ReentrantLock lock As minor optimization let's try to avoid "flush storms", cases where multiple threads might try to concurrently flush the map. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides java. | |
| InternCache | back to summary |
|---|---|
| public InternCache() | |
| InternCache | back to summary |
|---|---|
| public InternCache(int maxSize, float loadFactor, int concurrency) | |
| intern | back to summary |
|---|---|
| public String intern(String input) | |