Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Column in DifferenceDescription returned by LicenseCompareHelper.isTextMatchingTemplate is not correct #243

Open
sdheh opened this issue Jun 6, 2024 · 1 comment

Comments

@sdheh
Copy link

sdheh commented Jun 6, 2024

LicenseCompareHelper.isTextMatchingTemplate has the following code

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"

@goneall
Copy link
Member

goneall commented Jun 7, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants