ArrayIndexOutOfBoundsException in SourceFileWriter
I observed that o.o.f.cecilia.adl.file.SourceFileWriter raises an ArrayIndexOutOfBoundsException in the following case:
- I generate a file foo containing "toto titi"
- I modify the code generator so that it contains lesser amount of characters while its content is equal to the beginning of the old one (e.g. "toto")
- I try to regenerate the file foo while the old one is not removed.
I observed that SourceFileWriter compares to content to be written to the file already generated in order to avoid touching the target file if the content to be generated is unchanged. But, if the amount of characters to be generated on the second round are lesser than what is already found in the file then the inPos value on line 100 goes further than what it is allowed to go.
I guess, the loop beginning on line 99 should test the value of inPos against cs.length in order to stop the comparison loop before the illegal access is performed.