Skip to content

Commit

Permalink
Made RegexBuilderException unchecked (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
markwhitaker authored Mar 13, 2021
1 parent 9b10630 commit 977300b
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 68 deletions.
6 changes: 3 additions & 3 deletions src/main/java/uk/co/mainwave/regextoolbox/RegexBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public RegexBuilder() {
* @return {@link Pattern} as built
* @throws RegexBuilderException An error occurred when building the regex
*/
public Pattern buildRegex(final RegexOptions... options) throws RegexBuilderException {
public Pattern buildRegex(final RegexOptions... options) {
if (openGroupCount == 1) {
throw new RegexBuilderException("A group has been started but not ended", stringBuilder);
}
Expand Down Expand Up @@ -729,7 +729,7 @@ public RegexBuilder startNamedGroup(final String name) {
* @return The current {@link RegexBuilder} object, for method chaining
* @throws RegexBuilderException A group has not been started
*/
public RegexBuilder endGroup() throws RegexBuilderException {
public RegexBuilder endGroup() {
return endGroup(null);
}

Expand All @@ -741,7 +741,7 @@ public RegexBuilder endGroup() throws RegexBuilderException {
* @return The current {@link RegexBuilder} object, for method chaining
* @throws RegexBuilderException A group has not been started
*/
public RegexBuilder endGroup(final RegexQuantifier quantifier) throws RegexBuilderException {
public RegexBuilder endGroup(final RegexQuantifier quantifier) {
if (openGroupCount == 0) {
throw new RegexBuilderException("Cannot call endGroup() until a group has been started with startGroup()",
stringBuilder);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package uk.co.mainwave.regextoolbox;

/**
* Exception thrown by {@link RegexBuilder} methods
* Unchecked exception thrown by {@link RegexBuilder} methods
*/
public final class RegexBuilderException extends Exception {
public final class RegexBuilderException extends RuntimeException {
/**
* The regex string as it currently stands
*/
Expand Down
Loading

0 comments on commit 977300b

Please sign in to comment.