< prev index next >

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

Print this page
rev 13118 : [mq]: backout-stackw

@@ -22,12 +22,10 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
 
 package java.lang;
-import sun.misc.VM;
-
 import  java.io.*;
 import  java.util.*;
 
 /**
  * The {@code Throwable} class is the superclass of all errors and

@@ -778,15 +776,11 @@
      * @see     java.lang.Throwable#printStackTrace()
      */
     public synchronized Throwable fillInStackTrace() {
         if (stackTrace != null ||
             backtrace != null /* Out of protocol state */ ) {
-            if (backtrace == null && StackStreamFactory.useStackTrace(this)) {
-                backtrace = StackStreamFactory.makeStackTrace(this);
-            } else {
                 fillInStackTrace(0);
-            }
             stackTrace = UNASSIGNED_STACK;
         }
         return this;
     }
 

@@ -823,18 +817,14 @@
     private synchronized StackTraceElement[] getOurStackTrace() {
         // Initialize stack trace field with information from
         // backtrace if this is the first call to this method
         if (stackTrace == UNASSIGNED_STACK ||
             (stackTrace == null && backtrace != null) /* Out of protocol state */) {
-            if (backtrace instanceof StackStreamFactory.StackTrace) {
-                stackTrace = ((StackStreamFactory.StackTrace)backtrace).getStackTraceElements();
-            } else {
                 int depth = getStackTraceDepth();
                 stackTrace = new StackTraceElement[depth];
-                for (int i = 0; i < depth; i++)
+            for (int i=0; i < depth; i++)
                     stackTrace[i] = getStackTraceElement(i);
-            }
         } else if (stackTrace == null) {
             return UNASSIGNED_STACK;
         }
         return stackTrace;
     }
< prev index next >