Fix file name matching in commit_delta to perform substring matching
commit_delta predicate was matching the entire file name against the given regex while other predicates (commit_edits, commit_message_matches) performed substring matching. It was inconsistent that for commit_delta we needed to write something like: commit_delta('.*\.java') to match all *.java files, while for commit_edits we needed: commit_edits('\.java$', '...'). to match the same set of (Java) files. Change-Id: Ib3360684d570539522bfad7b8df2d99734e7157e Signed-off-by: Sasa Zivkov <sasa.zivkov@sap.com>
This commit is contained in:
@@ -110,8 +110,8 @@ public class PRED_commit_delta_4 extends Predicate.P4 {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (regex.matcher(newName).matches() ||
|
||||
(oldName != null && regex.matcher(oldName).matches())) {
|
||||
if (regex.matcher(newName).find() ||
|
||||
(oldName != null && regex.matcher(oldName).find())) {
|
||||
SymbolTerm changeSym = getTypeSymbol(changeType);
|
||||
SymbolTerm newSym = SymbolTerm.create(newName);
|
||||
SymbolTerm oldSym = Prolog.Nil;
|
||||
|
Reference in New Issue
Block a user