Skip to content

Commit

Permalink
升级为 2022.1.1 版本,并使编译通过
Browse files Browse the repository at this point in the history
  • Loading branch information
mrzhqiang committed Sep 24, 2022
1 parent 8b70e35 commit 18e02fa
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 16 deletions.
1 change: 0 additions & 1 deletion helper-dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
<properties>
<!-- Dependencies versions -->
<cassandra-driver.version>3.6.0</cassandra-driver.version>
<!-- todo cv into helper -->
<commons-lang3.version>3.9</commons-lang3.version>
<config.version>1.3.3</config.version>
<ebean.version>11.22.9</ebean.version>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.github.mrzhqiang.helper.javafx.ui;

import com.github.mrzhqiang.helper.StackTraces;
import com.github.mrzhqiang.helper.Exceptions;
import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
import javafx.scene.control.Alert;
Expand Down Expand Up @@ -62,11 +62,11 @@ public static Alert warn(String message, @Nullable String content) {
return alert;
}

public static Alert error(Throwable error) {
public static Alert error(Exception error) {
return error(error.toString(), error);
}

public static Alert error(@Nullable String message, Throwable cause) {
public static Alert error(@Nullable String message, Exception cause) {
Preconditions.checkNotNull(cause, "cause == null");

String errorMsg = Strings.isNullOrEmpty(message) ? DEFAULT_ERROR_MESSAGE : message;
Expand All @@ -75,7 +75,7 @@ public static Alert error(@Nullable String message, Throwable cause) {
Alert alert = new Alert(Alert.AlertType.ERROR);
alert.setTitle("错误");
alert.setHeaderText(errorMsg);
alert.setContentText(StackTraces.of(cause));
alert.setContentText(Exceptions.ofTrace(cause));

return alert;
}
Expand Down
1 change: 0 additions & 1 deletion helper-third/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
<modules>
<module>helper-third-api</module>
<module>helper-third-core</module>
<module>helper-third-core</module>
</modules>

<build>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.github.mrzhqiang.helper;

import static org.junit.Assert.assertNotEquals;
import org.junit.Test;

public class ExceptionsTest {

@Test
public void of() {
String runtime = Exceptions.ofTrace(new RuntimeException("runtime"));
String nullPointer = Exceptions.ofTrace(new NullPointerException("null"));
assertNotEquals(runtime, nullPointer);
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package com.github.mrzhqiang.helper;

import org.junit.Test;

import static org.junit.Assert.assertNotEquals;
import org.junit.Test;

public class StackTracesTest {

Expand All @@ -12,11 +11,4 @@ public void ofCurrent() {
String secondTrace = StackTraces.ofCurrent();
assertNotEquals(firstTrace, secondTrace);
}

@Test
public void of() {
String runtime = StackTraces.of(new RuntimeException("runtime"));
String nullPointer = StackTraces.of(new NullPointerException("null"));
assertNotEquals(runtime, nullPointer);
}
}
}

0 comments on commit 18e02fa

Please sign in to comment.