Skip to content

Commit

Permalink
format code
Browse files Browse the repository at this point in the history
  • Loading branch information
fhoeben committed Dec 26, 2019
1 parent 736a361 commit cfd6b34
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions src/fitnesse/slim/SlimError.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,29 @@ public class SlimError extends RuntimeException {

public SlimError(String s) {
super(s);
this.prettyPrint=false;
this.prettyPrint = false;
}

public SlimError(String s, String tag, boolean prettyPrint) {
super(prettyPrint ? makeSlimMessage(s, tag) : s);
this.prettyPrint = prettyPrint;
}

public SlimError(String s, Throwable throwable) {
super(s, throwable);
this.prettyPrint=false;
this.prettyPrint = false;
}

public SlimError(String s, Throwable throwable, String tag, boolean prettyPrint) {
super(prettyPrint ? makeSlimMessage(s, tag) : s, throwable);
this.prettyPrint=prettyPrint;
}
super(prettyPrint ? makeSlimMessage(s, tag) : s, throwable);
this.prettyPrint = prettyPrint;
}

public SlimError(Throwable e) {
this(e.getClass().getName() + " " + e.getMessage());
}

public static String makeSlimMessage(String msg, String tag){
public static String makeSlimMessage(String msg, String tag) {
StringBuilder sb = new StringBuilder();
sb.append(SlimVersion.PRETTY_PRINT_TAG_START);
if (tag != null && !tag.isEmpty()) {
Expand All @@ -44,13 +44,15 @@ public static String makeSlimMessage(String msg, String tag){
sb.append(SlimVersion.PRETTY_PRINT_TAG_END);
return sb.toString();
}
public static String extractSlimMessage(String msg){

public static String extractSlimMessage(String msg) {
msg = msg.replaceFirst(".*" + SlimVersion.PRETTY_PRINT_TAG_START, "");
msg = msg.replaceFirst(SlimVersion.PRETTY_PRINT_TAG_END, "");
return msg;
}
public static boolean hasSlimMessage(String msg){
return msg.contains(SlimVersion.PRETTY_PRINT_TAG_START) &&

public static boolean hasSlimMessage(String msg) {
return msg.contains(SlimVersion.PRETTY_PRINT_TAG_START) &&
msg.contains(SlimVersion.PRETTY_PRINT_TAG_END);
}
}

0 comments on commit cfd6b34

Please sign in to comment.