-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Labels
Description
TODO
Enhance the matching logic to handle: OR, AND. Until now, we got from the execution of the maven command to query openrewrite resources a List that we add to the table of the results of a Rule. Unfortunately, we don't handle properly the cases where a user uses part of the query:
condition: query1 OR query2 OR query3 ...
condition: query1 AND query2 AND query3 ...
The existing code should be review to perform what it is described hereafter:
- Add a new boolean field part of the MigrationTask class to set if match succeeded or failed
- Return part of the execution of the queries: simple, withOR, withAND a boolean value indication if the match succeeded or not and set the boolean value of the MatchingTask
Such an information should be added here
for (Rule rule : rules) {
Map<String, List<Rewrite>> results = RewriteService.executeRewriteCmd(config, rule); // Return also the match value
tasks.put(
rule.ruleID(),
new MigrationTask()
.withRule(rule)
.withRewriteResults(results.get(rule.ruleID()))
.withInstruction(rule.instructions())
);
}
- Use when we display the results: ascii or populate the json the
match valueof the MatchingTask instead of checking the size of the results. - Review the logic of the RewriteService class and method: executeRewriteCmd to handle properly
OR,AND