diffj icon indicating copy to clipboard operation
diffj copied to clipboard

Differ crashing with java.lang.IndexOutOfBoundsException when adding line to constructor

Open shpelda opened this issue 11 years ago • 0 comments

Hello, please apply following, and run the test: https://gist.github.com/shpelda/9177654

diffj will crash with

java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at java.util.ArrayList.rangeCheck(Unknown Source) at java.util.ArrayList.get(Unknown Source) at org.incava.diffj.code.StatementList.getRangeAt(StatementList.java:50) at org.incava.diffj.code.StatementListDifferenceAdd.getFromRange(StatementListDifferenceAdd.java:22) at org.incava.diffj.code.StatementListDifferenceDelta.process(StatementListDifferenceDelta.java:23) at org.incava.diffj.code.StatementListDifference.execute(StatementListDifference.java:18) at org.incava.diffj.code.Block.compareCodeNew(Block.java:55) at org.incava.diffj.code.Block.compareCode(Block.java:42) at org.incava.diffj.function.Ctor.compareCode(Ctor.java:45) at org.incava.diffj.function.Ctor.diff(Ctor.java:31)

Note that assertion in junit is invalid. i just need a way to reproduce the crash.

shpelda avatar Feb 23 '14 21:02 shpelda