I want to know if there is a way to recover a reference "manually" of the this$0
, in other words, to the outer class in a nested class?
This means references to any method or attribute of the outer class using the name or methodOuterClass()
or OuterClass.this.Method()
result in a NullPointerException
.
Due to the problems listed below, e.g. Gson, construct objects without reference to the outer class. It is possible to repair this after the object has being created?
References
GSON does not deserialize reference to outer class
using member of outer class in a inner class makes null exception?