Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed a bug that can cause an OutOfBoundsException if debugging is enabled. #247

Merged
merged 1 commit into from
May 5, 2022

Conversation

eikept
Copy link
Collaborator

@eikept eikept commented May 4, 2022

Description of Issue

If debugging is activated in log4j and a model is read that contains a lambda element an OutOfBoundsException is thrown. The reason behind this is that during debugging a tree is drawn for each node in the model when addChild() is called on this node that also displays the unit of the node. To display the unit, the unit needs to be derived first and for lambda nodes, all children are required for this derivation. These children however are not yet present as they're being added by the addChild() method itself.

Fix
The code fragment that draws this tree, if debugging is enabled, was commented out.

@eikept eikept added the bug label May 4, 2022
@eikept eikept linked an issue May 4, 2022 that may be closed by this pull request
@draeger draeger self-requested a review May 5, 2022 09:39
@draeger draeger self-assigned this May 5, 2022
Comment on lines +1824 to +1836
/*
This code for debugging was commented out because it can cause an OutOfBoundsException during
the parsing of a model if it contains a lambda element. The reason for this is that
in astNodeToTree units are derived for the node and for lambda nodes the children
are necessary for this derivation. The children are not yet present however as addChild()
is responsible for adding them.
*/
/*
if (isDebugEnabled) {
logger.debug(" adding child current node: \n" + astNodeToTree(this, "", ""));
logger.debug(" adding child: \n" + astNodeToTree(child, "", ""));
}
*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes a concrete problem but the underlying source still remains. A new tracker item has been created to keep this active. For now, it is solved.

@draeger draeger merged commit a9c1dc8 into master May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error reading file
2 participants