-
Notifications
You must be signed in to change notification settings - Fork 36
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
Redesign the match within text #224
Conversation
Signed-off-by: Gary O'Neall <gary@sourceauditor.com>
@pmonks - Feel free to take a look and let me know if you see any improvements. It removes a lot of the code and is much less complex in terms of code complexity metrics. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good @goneall! I added some comments inline, but none of them are "showstoppers" - more like just observations of the code from a potential user's perspective (I was trying to put myself in the shoes of someone who might want to use this class without using LicenseCompareHelper
).
[edit] oh and should there be a unit test class for this new class? One that would exercise the new class with specific fake "templates" that exercise different tricky parts of regex construction?
src/main/java/org/spdx/utility/compare/TemplateRegexGenerator.java
Outdated
Show resolved
Hide resolved
src/main/java/org/spdx/utility/compare/TemplateRegexGenerator.java
Outdated
Show resolved
Hide resolved
src/main/java/org/spdx/utility/compare/TemplateRegexGenerator.java
Outdated
Show resolved
Hide resolved
src/main/java/org/spdx/utility/compare/TemplateRegexGenerator.java
Outdated
Show resolved
Hide resolved
src/main/java/org/spdx/utility/compare/TemplateRegexGenerator.java
Outdated
Show resolved
Hide resolved
src/main/java/org/spdx/utility/compare/TemplateRegexGenerator.java
Outdated
Show resolved
Hide resolved
Also addresses review comments Signed-off-by: Gary O'Neall <gary@sourceauditor.com>
@pmonks Request for an opinion on this PR. There are a few methods in the Do you think it is safe to delete? Here's the list of methods in
I've also done some further refactoring, so please take another look. The code should also be working, so if you could run a pass of your local tests (performance etc.) on this branch you may catch something I missed. |
@goneall rushing out the door, so can't do a deep dive, but perhaps we could just I should be able to run the full test suite tonight. |
@goneall I ran the existing unit tests with the "run slow tests" environment variable turned on, and got this promising result:
So it's passing all of the existing tests, though I can't recall how well that exercises some of the bugs that we believe were fixed via the improved regexes in v1.1.9. I'll try to take a look at that next week, if you don't beat me to it (it seems like merging this change and releasing a v1.1.10 or whatever is kind of time sensitive, given the misbehaviour with the |
Oh and I also re-ran my little timing test (using the Results of that test:
|
Signed-off-by: Gary O'Neall <gary@sourceauditor.com>
This is currently a work in progress redesign of the match license / expression within text.
It creates a new class
TemplexRegexGenerator
which replaces much of the static methods and optional filtering class of the previous implementation.There is currently one unit test failing, so it is not quite ready to merge.