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

Decrease memory footprint for AbstractTreeNode #522

Open
wants to merge 3 commits into
base: releases/23.2
Choose a base branch
from

Conversation

csk-bsi
Copy link
Member

@csk-bsi csk-bsi commented Mar 29, 2023

Remove extension and contributions
Lazy create child nodes
287775

@csk-bsi csk-bsi force-pushed the features/csk/23.2/treeNode_extension branch from 4e90f1b to c7ffc70 Compare March 29, 2023 07:20
Remove extension and contributions
Lazy create child nodes
Remove extension and contributions
Lazy create child nodes
Remove extension and contributions
Lazy create child nodes
@csk-bsi csk-bsi force-pushed the features/csk/23.2/treeNode_extension branch from c7ffc70 to c709389 Compare March 29, 2023 14:19
@csk-bsi csk-bsi requested a review from andibur March 30, 2023 06:31
Copy link
Member

@andibur andibur left a comment

Choose a reason for hiding this comment

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

Please check the notes. Currently, the change removes features from page extensions, instead of just removing extension support from tree nodes.

if (callInitializer) {
callInitializer();
}
}

protected void callInitializer() {
if (!isInitialized()) {
interceptInitConfig();
Copy link
Member

Choose a reason for hiding this comment

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

initConfig of a TreeNode is not invoked anymore. I think it is better to create a new non-final method initConfigInternal that is just invoking initConfig(). AbstractPage should override initConfigInternal and invoke AbstractPage.interceptInitConfig(). Remove overridden method AbstractPage.callInitializer().

The pattern with initConfigInternal is already used by AbstractWidget.

catch (Exception t) {
LOG.error("node {} {}", getClass(), getCell().getText(), t);
}
execDecorateCell(m_cell);
Copy link
Member

Choose a reason for hiding this comment

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

Why did you remove the exception-handling? It is not related to extensibility.

@@ -699,8 +621,6 @@ public List<IMenu> getMenus() {

protected List<IMenu> lazyCreateAndInitializeMenus() {
List<Class<? extends IMenu>> declaredMenus = getDeclaredMenus();
List<IMenu> contributedMenus = m_contributionHolder.getContributionsByClass(IMenu.class);
Copy link
Member

Choose a reason for hiding this comment

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

Menu contributions do not work anymore on pages as well. I think this is not intended. Create a new contributeMenusInteral method that returns an empty list on AbstractTreeNode, but that uses the contributionHolder on AbstractPage.

catch (RuntimeException e) {
LOG.warn("Exception while disposing node.", e);
}
disposeInternal();
Copy link
Member

Choose a reason for hiding this comment

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

Did you remove the outer try block by intention? If disposeInternal throws an Error, the disposing flag is not restored anymore.

}

@Override
public void execDecorateCell(TreeNodeDecorateCellChain chain, Cell cell) {
Copy link
Member

Choose a reason for hiding this comment

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

This three extension methods are currently not available on a PageExtension. I thing they should be pushed down.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants