Add Reflect.initValue(Class)
lukaseder opened this issue · 0 comments
lukaseder commented
Sometimes, it's necessary to get an initialisation value for a given Class
reference, i.e. the value that would be present as a default initialisation value after object construction:
class X {
i int;
}
assertEquals(0, new X().i);
There doesn't seem to be a JDK method to do this. Guava has a method, though:
https://stackoverflow.com/q/52988458/521799