[jsemver] 78/95: Override UnexpectedCharacterException constructor

Alexandre Viau reazem-guest at moszumanska.debian.org
Mon Feb 16 14:58:32 UTC 2015


This is an automated email from the git hooks/post-receive script.

reazem-guest pushed a commit to branch master
in repository jsemver.

commit 4ffac6d39faf37e8d4edb4619f6ef8eff3963a0b
Author: Zafar Khaja <zafarkhaja at gmail.com>
Date:   Fri Jan 31 18:34:22 2014 +0400

    Override UnexpectedCharacterException constructor
    
    Override the constructor to accept the unexpected character
    and optionally the expected character types.
---
 .../zafarkhaja/semver/UnexpectedCharacterException.java   | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/github/zafarkhaja/semver/UnexpectedCharacterException.java b/src/main/java/com/github/zafarkhaja/semver/UnexpectedCharacterException.java
index 52c6c0e..485d7c6 100644
--- a/src/main/java/com/github/zafarkhaja/semver/UnexpectedCharacterException.java
+++ b/src/main/java/com/github/zafarkhaja/semver/UnexpectedCharacterException.java
@@ -48,8 +48,8 @@ public class UnexpectedCharacterException extends ParseException {
     private final CharType[] expected;
 
     /**
-     * Constructs a {@code UnexpectedCharacterException} instance
-     * with the unexpected character and the expected types.
+     * Constructs a {@code UnexpectedCharacterException} instance with
+     * the wrapped {@code UnexpectedElementException} exception.
      *
      * @param cause the wrapped exception
      */
@@ -59,6 +59,17 @@ public class UnexpectedCharacterException extends ParseException {
     }
 
     /**
+     * Constructs a {@code UnexpectedCharacterException} instance
+     * with the unexpected character and the expected types.
+     *
+     * @param cause the wrapped exception
+     */
+    UnexpectedCharacterException(Character unexpected, CharType... expected) {
+        this.unexpected = unexpected;
+        this.expected = expected;
+    }
+
+    /**
      * Gets the unexpected character.
      *
      * @return the unexpected character

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/jsemver.git



More information about the pkg-java-commits mailing list