Browse Source

InvalidPatternException: Add constructor that takes Throwable

Change-Id: Idadec0abc1c6d76f19f51a65a4b45df444c20486
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
stable-4.10
David Pursehouse 7 years ago
parent
commit
06bab95e00
  1. 17
      org.eclipse.jgit/src/org/eclipse/jgit/errors/InvalidPatternException.java
  2. 6
      org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/Strings.java

17
org.eclipse.jgit/src/org/eclipse/jgit/errors/InvalidPatternException.java

@ -66,6 +66,23 @@ public class InvalidPatternException extends Exception {
this.pattern = pattern;
}
/**
* Constructor for InvalidPatternException
*
* @param message
* explains what was wrong with the pattern.
* @param pattern
* the invalid pattern.
* @param cause
* the cause.
* @since 4.10
*/
public InvalidPatternException(String message, String pattern,
Throwable cause) {
this(message, pattern);
initCause(cause);
}
/**
* Get the invalid pattern
*

6
org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/Strings.java

@ -442,12 +442,10 @@ public class Strings {
try {
return Pattern.compile(sb.toString());
} catch (PatternSyntaxException e) {
InvalidPatternException patternException = new InvalidPatternException(
throw new InvalidPatternException(
MessageFormat.format(JGitText.get().invalidIgnoreRule,
pattern),
pattern);
patternException.initCause(e);
throw patternException;
pattern, e);
}
}

Loading…
Cancel
Save