jdk/src/share/classes/java/lang/Throwable.java
changeset 2947 b0135c99348e
parent 2 90ce3da70b43
child 4666 085aef3c09ff
equal deleted inserted replaced
2946:f95752c3204a 2947:b0135c99348e
   643     }
   643     }
   644 
   644 
   645     /**
   645     /**
   646      * Returns the number of elements in the stack trace (or 0 if the stack
   646      * Returns the number of elements in the stack trace (or 0 if the stack
   647      * trace is unavailable).
   647      * trace is unavailable).
   648      */
   648      *
   649     private native int getStackTraceDepth();
   649      * package-protection for use by SharedSecrets.
       
   650      */
       
   651     native int getStackTraceDepth();
   650 
   652 
   651     /**
   653     /**
   652      * Returns the specified element of the stack trace.
   654      * Returns the specified element of the stack trace.
       
   655      *
       
   656      * package-protection for use by SharedSecrets.
   653      *
   657      *
   654      * @param index index of the element to return.
   658      * @param index index of the element to return.
   655      * @throws IndexOutOfBoundsException if <tt>index &lt; 0 ||
   659      * @throws IndexOutOfBoundsException if <tt>index &lt; 0 ||
   656      *         index &gt;= getStackTraceDepth() </tt>
   660      *         index &gt;= getStackTraceDepth() </tt>
   657      */
   661      */
   658     private native StackTraceElement getStackTraceElement(int index);
   662     native StackTraceElement getStackTraceElement(int index);
   659 
   663 
   660     private synchronized void writeObject(java.io.ObjectOutputStream s)
   664     private synchronized void writeObject(java.io.ObjectOutputStream s)
   661         throws IOException
   665         throws IOException
   662     {
   666     {
   663         getOurStackTrace();  // Ensure that stackTrace field is initialized.
   667         getOurStackTrace();  // Ensure that stackTrace field is initialized.