Skip to content

Commit

Permalink
Change name regexp to be consistent with the rest
Browse files Browse the repository at this point in the history
  • Loading branch information
arturobernalg committed Feb 7, 2023
1 parent a45f2dc commit 94cdc01
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ public abstract class AbstractJdbcDatabase implements Database {
private static final String TIMESTAMP_REGEX = "^\\d{4}\\-\\d{2}\\-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d+$";
private static final Pattern TIMESTAMP_PATTERN = Pattern.compile(TIMESTAMP_REGEX);

private static final String TIMES_REGEX = "^\\d{2}:\\d{2}:\\d{2}$";
private static final Pattern TIME_PATTERN = Pattern.compile(TIMES_REGEX);
private static final String TIME_REGEX = "^\\d{2}:\\d{2}:\\d{2}$";
private static final Pattern TIME_PATTERN = Pattern.compile(TIME_REGEX);

private static final String NAME_WITH_DESC_REGEX = "(?i).*\\s+DESC";
private static final Pattern NAME_WITH_DESC_PATTERN = Pattern.compile(NAME_WITH_DESC_REGEX);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ public class FormattedSqlChangeLogParser implements ChangeLogParser {
private static final String SINGLE_QUOTE_RESULT_REGEX = "^(?:expectedResult:)?'([^']+)' (.*)";
private static final String DOUBLE_QUOTE_RESULT_REGEX = "^(?:expectedResult:)?\"([^\"]+)\" (.*)";

private static final Pattern[] PATTERNS = new Pattern[]{
private static final Pattern[] WORD_AND_QUOTING_PATTERNS = new Pattern[]{
Pattern.compile(WORD_RESULT_REGEX, Pattern.CASE_INSENSITIVE),
Pattern.compile(SINGLE_QUOTE_RESULT_REGEX, Pattern.CASE_INSENSITIVE),
Pattern.compile(DOUBLE_QUOTE_RESULT_REGEX, Pattern.CASE_INSENSITIVE)
Expand Down Expand Up @@ -711,7 +711,7 @@ protected boolean supportsExtension(String changelogFile){
}

private SqlPrecondition parseSqlCheckCondition(String body) throws ChangeLogParseException{
for (Pattern pattern : PATTERNS) {
for (Pattern pattern : WORD_AND_QUOTING_PATTERNS) {
Matcher matcher = pattern.matcher(body);
if (matcher.matches() && (matcher.groupCount() == 2)) {
SqlPrecondition p = new SqlPrecondition();
Expand Down

0 comments on commit 94cdc01

Please sign in to comment.