Skip to content

Commit

Permalink
Update JVMUtil.java
Browse files Browse the repository at this point in the history
  • Loading branch information
Linchen-Xu committed Nov 8, 2023
1 parent 81bdafe commit 0bf308c
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,12 @@ private static void getThreadDumpString(final OutputStream stream, ThreadInfo th
String jstackMaxLineStr = System.getProperty(CommonConstants.DUBBO_JSTACK_MAXLINE);
if (StringUtils.isNotEmpty(jstackMaxLineStr)) {
try {
printStackDepth = Math.min(stackTrace.length, Integer.parseInt(jstackMaxLineStr));
if (printStackDepth < 0) {
int specifiedDepth = Integer.parseInt(jstackMaxLineStr);
if (specifiedDepth < 0) {
// if set to a negative number, print all lines instead
printStackDepth = stackTrace.length;
specifiedDepth = stackTrace.length;
}
printStackDepth = Math.min(stackTrace.length, specifiedDepth);
} catch (Exception ignore) {
}
}
Expand Down

0 comments on commit 0bf308c

Please sign in to comment.