Minor: CodegenContext.isContextWithUninitializedThis()
This commit is contained in:
@@ -348,11 +348,15 @@ public abstract class CodegenContext<T extends DeclarationDescriptor> {
|
|||||||
return parentContext;
|
return parentContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isContextWithUninitializedThis() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public CodegenContext getEnclosingClassContext() {
|
public CodegenContext getEnclosingClassContext() {
|
||||||
CodegenContext cur = getParentContext();
|
CodegenContext cur = getParentContext();
|
||||||
while (cur != null) {
|
while (cur != null) {
|
||||||
if (cur instanceof ConstructorContext && !(((ConstructorContext) cur).isThisInitialized())) {
|
if (cur.isContextWithUninitializedThis()) {
|
||||||
// If the current context is a constructor with uninitialized 'this',
|
// If the current context is a constructor with uninitialized 'this',
|
||||||
// skip it and the corresponding class context
|
// skip it and the corresponding class context
|
||||||
CodegenContext parent = cur.getParentContext();
|
CodegenContext parent = cur.getParentContext();
|
||||||
|
|||||||
@@ -59,6 +59,11 @@ public class ConstructorContext extends MethodContext {
|
|||||||
this.thisInitialized = thisInitialized;
|
this.thisInitialized = thisInitialized;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isContextWithUninitializedThis() {
|
||||||
|
return !isThisInitialized();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "Constructor: " + (isThisInitialized() ? "" : "UNINITIALIZED ") + getContextDescriptor();
|
return "Constructor: " + (isThisInitialized() ? "" : "UNINITIALIZED ") + getContextDescriptor();
|
||||||
|
|||||||
Reference in New Issue
Block a user