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

Making RegExp implementation configurable #176

Merged
merged 7 commits into from
May 14, 2018
Merged

Making RegExp implementation configurable #176

merged 7 commits into from
May 14, 2018

Conversation

erosb
Copy link
Contributor

@erosb erosb commented May 10, 2018

This PR partially reverts #147 , fixes the regression reported in #156 and #157 .

The issue was that the RE2J library doesn't support all possible regular expressions that java.util.regex does (at least not the ones ontaining lookaheads).

This is solved by

  • creating an abstraction layer of regexp solutions, this is the org.everit.json.schema.regexp package
  • making the implementation configurable via the SchemaLoaderBuilder#regexpFactory(RegexpFactory) method
  • the default implementation uses the java.util.regex.Pattern class, so backward-compatibility is restored
  • people who need re2j can use the RE2JRegexpFactory implementation

erosb added 6 commits May 9, 2018 23:07
…ry` implementations

 * making `RegexpFactory` implementation configurable via `SchemaLoaderBuilder#regexpFactory()` method (default: JavaUtil)
 * storing the `RegexpFactory` reference in `LoaderConfig`
 * changing `StringSchemaLoader` to use the factory via `LoaderConfig#regexpFactory`
 * changed `IssueTest` infrastructure to be able to set the `RegexpFactory` to be used in the given test
 * changed test of #147 to use `RE2JRegexpFactory`
@coveralls
Copy link

coveralls commented May 10, 2018

Coverage Status

Coverage increased (+0.07%) to 92.269% when pulling e2dc337 on issue156 into d2433be on master.

@erosb erosb merged commit ccec5c0 into master May 14, 2018
@erosb erosb deleted the issue156 branch May 14, 2018 10:48
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

Successfully merging this pull request may close these issues.

3 participants