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

Run example code throws NullPointerException #3

Closed
morningman opened this issue Mar 8, 2021 · 1 comment · Fixed by #4
Closed

Run example code throws NullPointerException #3

morningman opened this issue Mar 8, 2021 · 1 comment · Fixed by #4
Assignees
Labels

Comments

@morningman
Copy link
Contributor

    public static void main(String[] args) throws Exception {
        SimpleTreeNode rootNode = new SimpleTreeNode("I'm the root!");
        rootNode.addChild(new SimpleTreeNode("I'm a child..."));
        rootNode.addChild(new SimpleTreeNode("I'm an other child..."));
        new TraditionalTreePrinter().print(new BorderTreeNodeDecorator(rootNode));
    }

Throws:

Exception in thread "main" java.lang.NullPointerException
	at org.apache.doris.common.treeprinter.TraditionalTreePrinter$DefaultAligner.alignChildren(TraditionalTreePrinter.java:266)
	at org.apache.doris.common.treeprinter.TraditionalTreePrinter.print(TraditionalTreePrinter.java:74)
	at org.apache.doris.common.treeprinter.AbstractTreePrinter.print(AbstractTreePrinter.java:28)
	at cmy.MyTest.main(MyTest.java:43)

The package name is changing to org.apache.doris.common.treeprinter because I need to debug the code in my project.

This is because the AbstractTreeNode class missing equals and hashCode method.
I will submit a PR to fix this.

@davidsusu
Copy link
Owner

Thank you for your contribution. I will publish it to the maven central soon.

@davidsusu davidsusu added the bug label Sep 11, 2022
@davidsusu davidsusu self-assigned this Dec 1, 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 a pull request may close this issue.

2 participants