Skip to content

Commit 32ca3ba

Browse files
douglasclarkegoneall
authored andcommitted
Issue 305: Address incorrect index offset for failed token in differences. Added test cases
1 parent fa7e1a1 commit 32ca3ba

2 files changed

Lines changed: 628 additions & 581 deletions

File tree

src/main/java/org/spdx/utility/compare/CompareTemplateOutputHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ public int match(String[] matchTokens, int startToken, int endToken, String orig
217217
}
218218
nextToken = compareText(textTokens, matchTokens, nextToken, this);
219219
if (nextToken < 0) {
220-
int errorLocation = -nextToken;
220+
int errorLocation = -nextToken - 1;
221221
differences.addDifference(tokenToLocation.get(errorLocation), LicenseTextHelper.getTokenAt(matchTokens, errorLocation),
222222
"Normal text of license does not match", text, null, getLastOptionalDifference());
223223
}

0 commit comments

Comments
 (0)