pattern = pattern + ".*"; //$NON-NLS-1$ final String p = rawEncoding ? forceToRaw(pattern) : pattern; compiledPattern = Pattern.compile(p, flags).matcher(""); //$NON-NLS-1$
/** {@inheritDoc} */ @Override public boolean include(RevWalk walker, RevCommit cmit) throws MissingObjectException, IncorrectObjectTypeException, IOException { return compiledPattern.reset(text(cmit)).matches(); }
/** {@inheritDoc} */ @Override public boolean include(RevWalk walker, RevCommit cmit) throws MissingObjectException, IncorrectObjectTypeException, IOException { return compiledPattern.reset(text(cmit)).matches(); }
/** * Construct a new pattern matching filter. * * @param pattern * text of the pattern. Callers may want to surround their * pattern with ".*" on either end to allow matching in the * middle of the string. * @param innerString * should .* be wrapped around the pattern of ^ and $ are * missing? Most users will want this set. * @param rawEncoding * should {@link #forceToRaw(String)} be applied to the pattern * before compiling it? * @param flags * flags from {@link Pattern} to control how matching performs. */ protected PatternMatchRevFilter(String pattern, final boolean innerString, final boolean rawEncoding, final int flags) { if (pattern.length() == 0) throw new IllegalArgumentException(JGitText.get().cannotMatchOnEmptyString); patternText = pattern; if (innerString) { if (!pattern.startsWith("^") && !pattern.startsWith(".*")) //$NON-NLS-1$ //$NON-NLS-2$ pattern = ".*" + pattern; //$NON-NLS-1$ if (!pattern.endsWith("$") && !pattern.endsWith(".*")) //$NON-NLS-1$ //$NON-NLS-2$ pattern = pattern + ".*"; //$NON-NLS-1$ } final String p = rawEncoding ? forceToRaw(pattern) : pattern; compiledPattern = Pattern.compile(p, flags).matcher(""); //$NON-NLS-1$ }
@Override public boolean include(final RevWalk walker, final RevCommit cmit) throws MissingObjectException, IncorrectObjectTypeException, IOException { return compiledPattern.reset(text(cmit)).matches(); }
pattern = pattern + ".*"; //$NON-NLS-1$ final String p = rawEncoding ? forceToRaw(pattern) : pattern; compiledPattern = Pattern.compile(p, flags).matcher(""); //$NON-NLS-1$
/** {@inheritDoc} */ @Override public boolean include(RevWalk walker, RevCommit cmit) throws MissingObjectException, IncorrectObjectTypeException, IOException { return compiledPattern.reset(text(cmit)).matches(); }
pattern = pattern + ".*"; //$NON-NLS-1$ final String p = rawEncoding ? forceToRaw(pattern) : pattern; compiledPattern = Pattern.compile(p, flags).matcher(""); //$NON-NLS-1$