< prev index next >

src/java.base/share/classes/java/lang/StackTraceElement.java

Print this page

        

*** 64,73 **** --- 64,74 ---- private String moduleName; private String moduleVersion; private String declaringClass; private String methodName; private String fileName; + private String contScopeName; private int lineNumber; private byte format = 0; // Default to show all /** * Creates a stack trace element representing the specified execution
*** 351,365 **** s += "@" + moduleVersion; } } s = s.isEmpty() ? declaringClass : s + "/" + declaringClass; ! return s + "." + methodName + "(" + (isNativeMethod() ? "Native Method)" : (fileName != null && lineNumber >= 0 ? fileName + ":" + lineNumber + ")" : (fileName != null ? ""+fileName+")" : "Unknown Source)"))); } /** * Returns true if the specified object is another * {@code StackTraceElement} instance representing the same execution --- 352,376 ---- s += "@" + moduleVersion; } } s = s.isEmpty() ? declaringClass : s + "/" + declaringClass; ! s = s + "." + methodName + "(" + (isNativeMethod() ? "Native Method)" : (fileName != null && lineNumber >= 0 ? fileName + ":" + lineNumber + ")" : (fileName != null ? ""+fileName+")" : "Unknown Source)"))); + + if (contScopeName != null && isContinuationEntry()) { + s = s + " " + contScopeName; + } + + return s; + } + + private boolean isContinuationEntry() { + return declaringClass.equals(Continuation.class.getName()) && methodName.equals("enter"); } /** * Returns true if the specified object is another * {@code StackTraceElement} instance representing the same execution
*** 396,406 **** Objects.equals(moduleName, e.moduleName) && Objects.equals(moduleVersion, e.moduleVersion) && e.declaringClass.equals(declaringClass) && e.lineNumber == lineNumber && Objects.equals(methodName, e.methodName) && ! Objects.equals(fileName, e.fileName); } /** * Returns a hash code value for this stack trace element. */ --- 407,418 ---- Objects.equals(moduleName, e.moduleName) && Objects.equals(moduleVersion, e.moduleVersion) && e.declaringClass.equals(declaringClass) && e.lineNumber == lineNumber && Objects.equals(methodName, e.methodName) && ! Objects.equals(fileName, e.fileName) && ! Objects.equals(contScopeName, e.contScopeName); } /** * Returns a hash code value for this stack trace element. */
*** 408,417 **** --- 420,430 ---- int result = 31*declaringClass.hashCode() + methodName.hashCode(); result = 31*result + Objects.hashCode(classLoaderName); result = 31*result + Objects.hashCode(moduleName); result = 31*result + Objects.hashCode(moduleVersion); result = 31*result + Objects.hashCode(fileName); + result = 31*result + Objects.hashCode(contScopeName); result = 31*result + lineNumber; return result; }
< prev index next >