From: Roland Häder Date: Sat, 25 Feb 2023 11:37:16 +0000 (+0100) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4ad51adc04482dbf57ab222de89d02eec2f83ec3;p=core.git Continued: - tried to fix NPE, still not working? - added debug log - better logging --- diff --git a/framework/main/classes/iterator/registry/class_RegistryIterator.php b/framework/main/classes/iterator/registry/class_RegistryIterator.php index 40e79884..2e94bcf9 100644 --- a/framework/main/classes/iterator/registry/class_RegistryIterator.php +++ b/framework/main/classes/iterator/registry/class_RegistryIterator.php @@ -245,6 +245,7 @@ class RegistryIterator extends BaseIterator implements IteratableRegistry { } // Is current still NULL? + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('REGISTRY-ITERATOR[%s]: registryKey=%s,current[]=%s', $this->key(), $registryKey, gettype($current))); if (is_null($current)) { // This cannot happen and indicates a logic error throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER); @@ -262,7 +263,7 @@ class RegistryIterator extends BaseIterator implements IteratableRegistry { */ public function key () { // Return it - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('REGISTRY-ITERATOR[%s]: EXIT!', $this->key)); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('REGISTRY-ITERATOR: this->key=%s EXIT!', $this->key)); return $this->key; } @@ -313,6 +314,7 @@ class RegistryIterator extends BaseIterator implements IteratableRegistry { } // Yes, then advance to that entry + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('REGISTRY-ITERATOR: Setting this->key from this->registryKeys[%s][%d] ...', $registryType, $nextIndex)); $this->key = $this->registryKeys[$registryType][$nextIndex]; // Trace message @@ -344,6 +346,7 @@ class RegistryIterator extends BaseIterator implements IteratableRegistry { /* UNFINISHED */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: this->key(%d)[%s]=%s,this->valid=%d,this->registryKeys=%s', __METHOD__, __LINE__, strlen($this->key()), gettype($this->key()), $this->key(), intval($this->valid()), print_r($this->registryKeys, TRUE))); } elseif (count($this->registryKeys['instance']) > 0) { // Second instance + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('REGISTRY-ITERATOR: Setting this->key from this->registryKeys[instance][0] ...'); $this->key = $this->registryKeys['instance'][0]; }