shrBadihi / ARDiff_Equiv_Checking

ARDiff Repository (implementation and benchmark)
MIT License
3 stars 4 forks source link

Unable to Compile modifyfiles Output #9

Open 374954417 opened 15 hours ago

374954417 commented 15 hours ago

I ran into an issue when executing the program with the following code snippet. After adding curly braces {}, I found that the output generated by modifyfiles fails to compile. It seems that the changes introduced by adding the braces caused the code to become syntactically incorrect or incompatible with the expected structure.

Could you please help identify why the addition of curly braces is causing the output to fail? Here are the relevant code changes and the error message:

package demo.benchmarks.Airy.MAX.Eq;

import java.util.Collections;
import java.util.List;

public class newV{

    public static double snippet(double a, double b) {
        if (b < a)
            return a+1;
        else
            return b;
    }
}
package demo.benchmarks.Airy.MAX.Eq;

import java.util.Collections;
import java.util.List;

public class oldV{

    public static double snippet(double a, double b) {
        if (b > a){
            return b;
        }else{
            return a;
        }
    }
}

image

Thank you for your help!

374954417 commented 15 hours ago

The modified file in the instrumented folder looks like this:

package demo.benchmarks.Airy.MAX.Eq.instrumented;
import equiv.checking.symbex.UnInterpreted;
import java.util.Collections;
import java.util.List;
public class newV{
    public static double snippet(double a, double b) {
        if (b < a)
            return a+1;
        else
else{
            return a;
        }
            return b;
    }
}

package demo.benchmarks.Airy.MAX.Eq.instrumented;
import equiv.checking.symbex.UnInterpreted;
import java.util.Collections;
import java.util.List;
public class oldV{
    public static double snippet(double a, double b) {
        if (b > a){
            return a+1;
            return b;
        }else{
            return a;
        }
    }
}
shrBadihi commented 12 hours ago

The issue lies in GumTree, the tool used to detect syntactical changes between two versions, which struggles with certain cases. It should perform well when both versions consistently use or omit braces.