rjust / defects4j

A Database of Real Faults and an Experimental Infrastructure to Enable Controlled Experiments in Software Engineering Research
MIT License
684 stars 297 forks source link

Unable to Apply Ground Truth Patch #587

Open danielding110 opened 6 days ago

danielding110 commented 6 days ago

After checking out Cli-18, I attempted to apply the ground truth patch provided in the defects4j repo. I switched the - to + in order for the patch to patch the buggy code. After that, I ran with the following command: patch src/java/org/apache/commons/cli/PosixParser.java 18.src.patch Which failed with the following messages: patch: **** malformed patch at line 21: - }

Similar problem happens to other multi-hunk problems like Time-3, but the patch works fine for single hunk bugs like Cli-27.

mernst commented 4 days ago

Possibly you made an error during one of the manual steps (but it is hard to know without seeing all your files). To exclude this as a possibility, and to make it easier for the maintainers to reproduce your problem, could you please provide a set of commands that can be cut-and-pasted into a terminal? It would start with git clone https://github.com/rjust/defects4j.git. Thanks in advance.

mernst commented 4 days ago

Also, instead of editing the patch file, you can use the --reverse comand-line argument to patch.