Community
Participate
Working Groups
Build Identifier: 20110218-0911 The static field org.eclipse.internal.xpand2.pr.util.FSIO.cvSize is initialized with 2000 in line 31 and subsequently incremented in lines 72, 98, 135; However, it is never reset or decremented. If we run the generator with enabled ProtectedRegionResolver long/often enough, cvSize will overflow eventually. This will lead to an NegativeArraySizeException in readSingleFile(), either at line 69 or line 95. Reproducible: Always
Niko, could you propose a solution?
writeSingleFile(Writer,Reader) in this class already states a possible solution. pick some chunksize and use it instead of doing some fancy calculation to determine a chunksize for reading. neither cvNumerOfFilesRead nor cvSize are effectively used.
Created attachment 204749 [details] Testcase showing the error
Created attachment 204750 [details] Proposed fixed version of FSIO
The proposed fix is about 25 % faster than the original implementation.
Thanks for providing the test case and fix. Had to backport the test to Junit3.
Bug resolved before Xpand 1.2 release date => Closing