Created
August 31, 2011 03:25
-
-
Save fff/1182750 to your computer and use it in GitHub Desktop.
None.hash code was changed by java.reflection
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
object TestNone { | |
def main(args: Array[String]) { | |
//first none | |
val none1 = None | |
//create by reflection | |
val constructor = classOf[None$].getDeclaredConstructor(); | |
constructor.setAccessible(true); | |
val none2 = constructor.newInstance() | |
//new none | |
val none3 = None | |
printf("None is None?%s", none1 == none3) //None is None?false | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment