Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8157892

StackFrame::getFileName returns null when a source file exists for native methods

    XMLWordPrintable

Details

    • b122
    • Verified

    Description

      StackFrame::getFileName implementation incorrectly assumes that native methods do not have source file.

      Trivial fix.

      diff --git a/src/java.base/share/classes/java/lang/StackFrameInfo.java b/src/java.base/share/classes/java/lang/StackFrameInfo.java
      --- a/src/java.base/share/classes/java/lang/StackFrameInfo.java
      +++ b/src/java.base/share/classes/java/lang/StackFrameInfo.java
      @@ -87,9 +87,6 @@
       
           @Override
           public String getFileName() {
      - if (isNativeMethod())
      - return null;
      -
               return toStackTraceElement().getFileName();
           }

      Attachments

        Activity

          People

            mchung Mandy Chung
            mchung Mandy Chung
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: