forked from NLthijs48/AreaShop
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial work on compiling against 1.20.6
- Loading branch information
Showing
7 changed files
with
67 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
areashop-interface/src/main/java/me/wiefferink/areashop/interfaces/ExceptionUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package me.wiefferink.areashop.interfaces; | ||
|
||
import javax.annotation.Nonnull; | ||
import java.io.PrintWriter; | ||
import java.io.StringWriter; | ||
|
||
public class ExceptionUtil { | ||
|
||
private ExceptionUtil() { | ||
throw new IllegalStateException("Cannot instantiate static utility class"); | ||
} | ||
|
||
@Nonnull | ||
public static String getStackTrace(@Nonnull Throwable throwable) { | ||
// Taken from Commons lang 3 | ||
final StringWriter writer = new StringWriter(); | ||
throwable.printStackTrace(new PrintWriter(writer, true)); | ||
return writer.toString(); | ||
} | ||
|
||
@Nonnull | ||
public static String dumpCurrentStack() { | ||
return getStackTrace(new Exception()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters