jeffoffutt / muJava

Mutation system for Java programs, including OO mutation operators.
Apache License 2.0
66 stars 43 forks source link

Bug: Incorrectly generate the original file if source file contains right-shift operators #15

Open MENG2010 opened 6 years ago

MENG2010 commented 6 years ago

Right-shift (>>) and Unsigned Right-shift (>>>) in the source file are replaced with greater-than sign (>) unexpectedly in original file (the file in "original" folder), so the bitwise operation expression becomes an invalid expression, and therefore the original file is incompatible and no mutants will be generated.

----a very simple example---

public class Demo {
    public int rightShift(int num, int bits) {
        int result = num >> bits;
        return results;
    }

    public int leftShift(int num, int bits) {
        int result = num << bits;
        return results;
    }
}

MuJava cannot generate mutants for this demo, due to an error: xxxx/original/Demo.java: error: incompatible types: boolean cannot be converted to int int result = num > bits; ................^