diff options
author | David Pursehouse <david.pursehouse@gmail.com> | 2017-12-19 14:02:34 +0900 |
---|---|---|
committer | David Pursehouse <david.pursehouse@gmail.com> | 2017-12-19 23:27:53 +0900 |
commit | 06bab95e00891b40c4afe65f29e5969fc9df4f2a (patch) | |
tree | a906207636333a077b37e8b2e52baf1f0dff9b31 /org.eclipse.jgit | |
parent | 0f1c160aa7302266136389c4e7b2ece30fc38675 (diff) | |
download | jgit-06bab95e00891b40c4afe65f29e5969fc9df4f2a.tar.gz jgit-06bab95e00891b40c4afe65f29e5969fc9df4f2a.zip |
InvalidPatternException: Add constructor that takes Throwable
Change-Id: Idadec0abc1c6d76f19f51a65a4b45df444c20486
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/errors/InvalidPatternException.java | 17 | ||||
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/Strings.java | 6 |
2 files changed, 19 insertions, 4 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/errors/InvalidPatternException.java b/org.eclipse.jgit/src/org/eclipse/jgit/errors/InvalidPatternException.java index a78a6d2ac5..949c4ff88b 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/errors/InvalidPatternException.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/errors/InvalidPatternException.java @@ -67,6 +67,23 @@ public class InvalidPatternException extends Exception { } /** + * 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 * * @return the invalid pattern. diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/Strings.java b/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/Strings.java index 8828931eef..4d33395d4f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/Strings.java +++ b/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); } } |