FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Set source to null when unavailable in StackTrace by playdohface · Pull Request #614 · microsoft/java-debug · GitHub

Set source to null when unavailable in StackTrace - #614

Merged
Changyong Gong (chagong) merged 1 commit into
microsoft:mainfrom
playdohface:unavailable-source-is-null
Nov 24, 2025
Merged

Set source to null when unavailable in StackTrace#614
Changyong Gong (chagong) merged 1 commit into
microsoft:mainfrom
playdohface:unavailable-source-is-null

Conversation

Copy link
Copy Markdown
Contributor

As noted by Mathias Fußenegger (@mfussenegger) in #609 it's probably more correct and in the spirit of the spec to keep the source as null when it is not unavailable instead of setting it to a special value, especially since it would break nvim-dap otherwise.

Copy link
Copy Markdown
Contributor

LGTM.

Changyong Gong (chagong) merged commit b62897e into microsoft:main Nov 24, 2025
4 checks passed
Mathias Fußenegger (mfussenegger) added a commit to mfussenegger/java-debug that referenced this pull request Dec 4, 2025
Follow up to:

- microsoft#614
- microsoft#609

With the change to set the line number to 0 the jdiLineNumber !=
lspFrame.line comparison can evaluate to true:

    dap> lspFrame
    Types$StackFrame@78
      column: 1
      id: 6
      line: 0
      name: "0x000000002f0bc000.invokeVirtual(Object,Object)"
      presentationHint: "subtle"
      source: null

    dap> jdiLineNumber
    -1

`source` being null caused an NPE
Changyong Gong (chagong) added a commit that referenced this pull request Dec 9, 2025
* Fix lspFrame.source NPE on stackTrace request

Follow up to:

- #614
- #609

With the change to set the line number to 0 the jdiLineNumber !=
lspFrame.line comparison can evaluate to true:

    dap> lspFrame
    Types$StackFrame@78
      column: 1
      id: 6
      line: 0
      name: "0x000000002f0bc000.invokeVirtual(Object,Object)"
      presentationHint: "subtle"
      source: null

    dap> jdiLineNumber
    -1

`source` being null caused an NPE

* Fix line number comparison in StackTraceRequestHandler

---------

Co-authored-by: Changyong Gong <shawn.gong@hotmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL