Open sdheh opened 3 weeks ago
LicenseCompareHelper.isTextMatchingTemplate has the following code
LicenseCompareHelper.isTextMatchingTemplate
compareTemplateOutputHandler = new CompareTemplateOutputHandler(removeLineSeparators(removeCommentChars(compareText)));
The column returned if there is a difference in a line from which comment chars were removed is wrong because it refers to the transformed text.
Example:
String licenseText = "// a b"; String template = "a"; System.out.println(LicenseCompareHelper.isTextMatchingTemplate(template, licenseText).getDifferenceMessage());
returns Additional text found after the end of the expected license text starting at line #1 column #3 "b"
Additional text found after the end of the expected license text starting at line #1 column #3 "b"
Thanks again @sdheh for the analysis.
Pull requests are welcome - otherwise I'll look into a fix after finishing the SPDX 3.0 upgrade work.
LicenseCompareHelper.isTextMatchingTemplate
has the following codeThe column returned if there is a difference in a line from which comment chars were removed is wrong because it refers to the transformed text.
Example:
returns
Additional text found after the end of the expected license text starting at line #1 column #3 "b"