- changed status to resolved
Size of child dependency handler in incremental evaluation
When a child is inserted in a list with incremental evaluation enabled, the size of the child handler is smaller than the size of the list, resulting in an ArrayIndexOutOfBoundsException
in src/template/incremental/ASTChange.tt#lines-225
getChild_handler = new $DDGNodeName[i + 1];
must be replaced by
getChild_handler = new $DDGNodeName[(i + 1 > 4 || !(this instanceof $List)) ? i + 1 : 4];
The branch childhandler in our fork contains the fix.
No minimal example for the bug available, sorry.
Comments (5)
-
-
@fors we need a regression test for this issue
-
- changed status to open
Reopening until there is a regression test. I think we should try to add tests before marking an issue as fixed.
-
- changed component to incremental
-
- changed status to resolved
I added a test for this issue and verified that it caused an ArrayIndexOutOfBounds exception without the fix commit and that the commit fixes it: https://bitbucket.org/jastadd/jastadd-test/commits/b386028eb5ab6b63aaabf797322895cd4e807d27
public class Test { public static void main(String[] args) { A a = new A(); a.getBList().insertChild(new B(), 0); a.getBList().insertChild(new B(), 0); a.getBList().insertChild(new B(), 0); } }
- Log in to comment
Fix array size of dependency handler for children in incremental evaluation. Fixes
#300→ <<cset 1c78cccb5689>>