Need a sort strategy for UPDATE changes
- Dominant language
- Java
- Stars
- 1
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Description
UPDATE changes can include updating operators and operands of a faulty line. If applying UPDATE changes of operators may generate better patches. For example,
* Closure-62 creates different candidate patches
1. By using an operator UPDATE:
by confixplus type: update
location code: null
location value: <=
1 diff --git a a
2 --- src/com/google/javascript/jscomp/LightweightMessageFormatter.java
3 +++ src/com/google/javascript/jscomp/LightweightMessageFormatter.java
4 @@ -95,7 +95,7 @@ public class LightweightMessageFormatter extends AbstractMessageFormatter {
5 // charno == sourceExpert.length() means something is missing
6 // at the end of the line
7 if (excerpt.equals(LINE)
8 - && 0 <= charno && charno < sourceExcerpt.length()) {
9 + && 0 <= charno && charno <= sourceExcerpt.length()) {
10 for (int i = 0; i < charno; i++) {
11 char c = sourceExcerpt.charAt(i);
12 if (Character.isWhitespace(c)) {
13
2. By using an operand update
type: update
location code: var0
location value: var0
1 diff --git a a
2 --- src/com/google/javascript/jscomp/LightweightMessageFormatter.java
3 +++ src/com/google/javascript/jscomp/LightweightMessageFormatter.java
4 @@ -95,7 +95,7 @@ public class LightweightMessageFormatter extends AbstractMessageFormatter {
5 // charno == sourceExpert.length() means something is missing
6 // at the end of the line
7 if (excerpt.equals(LINE)
8 - && 0 <= charno && charno < sourceExcerpt.length()) {
9 + && 0 <= charno && error.lineNumber < sourceExcerpt.length()) {
10 for (int i = 0; i < charno; i++) {
11 char c = sourceExcerpt.charAt(i);
12 if (Character.isWhitespace(c)) {
13
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.