Add test for java.lang.String#intern()#135
Merged
Merged
Conversation
Member
|
I'll change features as following.
Is it correct? |
Member
Member
Author
|
@memory-agape Probably that should make sense. For clarification,
And, please have a look at #120 as well. |
Member
|
@chitoku-k |
…pool Allow to overwrite the Constant Pool
Member
|
@chitoku-k |
Member
Author
|
OK, I found a ridiculous edge case that isn't covered. Whereas the following prints the expected result, String te = "te";
String st = "st";
String test = te + st;
System.out.println(System.identityHashCode(test)); // => 356573597
test.intern();
System.out.println(System.identityHashCode("test")); // => 356573597the interning does not happen in JVM when a literal has already appeared in that scope: String te = "te";
String st = "st";
String test = te + st;
System.out.println(System.identityHashCode(test)) // => 356573597
// This line is added to make a literal appear before interned
String dummy = "test";
test.intern();
System.out.println(System.identityHashCode("test")); // => JVM: 1735600054, PHPJava: 356573597Adding the failing test... |
Member
|
Very sad (T_T) |
Add FreezableInterface to manage the _Utf8
Member
Author
|
I think this PR finally got ready for reviewing! |
Member
|
@chitoku-k |
m3m0r7
approved these changes
May 10, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The implementation is currently under the progress and this PR aims to add it along with the test.
See also: #120