getPrevious ObjectMethod being used but does not exist in the code
------------------------------------------------------------------
Key: LOG4PHP-150
URL: https://issues.apache.org/jira/browse/LOG4PHP-150
Project: Log4php
Issue Type: Bug
Components: Code
Affects Versions: 2.1
Reporter: Karan Jain
In renderers/LoggerRendererException.php line 34, a call is made to
$o->getPrevious() whereas this method does not exist. I assume $o is an object
for LoggerLoggingEvent which does not contain this function.
I did a search on the trunk as well and did not find this function defined
anywhere.
[root@localhost trunk]# find -iname '*.php' | xargs grep 'getPrevious'
./src/test/php/renderers/LoggerRendererExceptionTest.php: public
function getPrevious() {
./src/test/php/LoggerThrowableInformationTest.php: public function
getPrevious() {
./src/main/php/renderers/LoggerRendererException.php: if
(method_exists($o, 'getPrevious') && $o->getPrevious() !== null) {
./src/main/php/renderers/LoggerRendererException.php: $strRep
.= PHP_EOL.'Caused by: '.$this->render($o->getPrevious());
./src/main/php/appenders/LoggerAppenderMongoDB.php: if
(method_exists($ex, 'getPrevious') && $ex->getPrevious() !== null) {
./src/main/php/appenders/LoggerAppenderMongoDB.php:
$array['innerException'] = $this->formatThrowable($ex->getPrevious());
The code fragment where this is being used is -
if (method_exists($o, 'getPrevious') && $o->getPrevious() !== null) {
$strRep .= PHP_EOL.'Caused by:
'.$this->render($o->getPrevious());
}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira