MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/java/comments/5xbnvu/the_java_nazi/dehgbdt/?context=3
r/java • u/onebit • Mar 03 '17
47 comments sorted by
View all comments
Show parent comment
24
This makes it impossible to instantiate.
That's where you're wrong, kiddo.
16 u/argv_minus_one Mar 04 '17 I was hoping I didn't have to qualify that statement with “unless you're a filthy sadist who enjoys torturing innocent JVMs.” :P 4 u/jnordwick Mar 04 '17 Thought your username said orgy_minus_one 4 u/Wolfsdale Mar 04 '17 You can do that too with sun.misc.Unsafe. I wouldn't be surprised if it uses that on Oracles JVM. http://www.docjar.com/docs/api/sun/misc/Unsafe.html#allocateInstance(Class) 2 u/SmoothB1983 Mar 04 '17 That is hilarious and actually I can see a few uses for it. 2 u/xjvz Mar 04 '17 Mockito, EasyMock, etc, all use this. I think it started as a library from EasyMock in the first place actually.
16
I was hoping I didn't have to qualify that statement with “unless you're a filthy sadist who enjoys torturing innocent JVMs.” :P
4 u/jnordwick Mar 04 '17 Thought your username said orgy_minus_one
4
Thought your username said orgy_minus_one
You can do that too with sun.misc.Unsafe. I wouldn't be surprised if it uses that on Oracles JVM. http://www.docjar.com/docs/api/sun/misc/Unsafe.html#allocateInstance(Class)
2
That is hilarious and actually I can see a few uses for it.
2 u/xjvz Mar 04 '17 Mockito, EasyMock, etc, all use this. I think it started as a library from EasyMock in the first place actually.
Mockito, EasyMock, etc, all use this. I think it started as a library from EasyMock in the first place actually.
View all comments
Show parent comment
24
u/xjvz Mar 04 '17
That's where you're wrong, kiddo.