public AsmField getAccessedField() { if (accessedFieldComputed) return accessedField; if (accessedFieldBeingComputed) { // Do not set accessedField here, because the pending computeAccessedField() will overwrite it // anyway accessedFieldIsThisMethodRecursive = true; return null; } else { accessedFieldBeingComputed = true; // Prevents infinite recursion on recursive methods. computeAccessedField(); if (accessedFieldIsThisMethodRecursive) { // We already returned null previously during the computation, so we must return null for // consistency accessedField = null; } accessedFieldComputed = true; accessedFieldBeingComputed = false; return accessedField; } }