testmycode / tmc-netbeans

Test My Code NetBeans plugin
GNU General Public License v2.0
19 stars 18 forks source link

TMC-NetBeans sends patches with invalid indexes #93

Open kennyhei opened 9 years ago

kennyhei commented 9 years ago

For example when processing with tmc-snapshot-api

/hy/participants/MDE0MDI0NjE2/courses/azIwMTQtdGlyYS1wYWph/exercises/dmlpa2tvOS05LjMuUmF0c3U/snapshots

An event with the timestamp 1396209053341 contains the following patch data:

@@ -1916,238 +1916,8 @@

-%0A        if (i %3C 0 %7C%7C j %3C 0 %7C%7C i %3E 7 %7C%7C j %3E 7 %7C%7C visited%5Bi%5D%5Bj%5D) %7B%0A            %0A            return 0;%0A        %7D%0A        if ( M%5Bi%5D%5Bj%5D == 2 %7C%7C visited%5Bi%5D%5Bj%5D)%7B%0A            visited%5Bi%5D%5Bj%5D = true;%0A            return 1;%0A        %7D%0A        
 %0A%0A  

For some reason the file content is same before and after the patch is applied. The example query contains multiple instances of such unapplied patches.

One common nominator between all of these failing patches is that they all are multi-character deletes.

Perhaps patches should be validated before sending them.