[ 
https://issues.apache.org/jira/browse/NETBEANS-5319?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17278743#comment-17278743
 ] 

Martin Entlicher commented on NETBEANS-5319:
--------------------------------------------

This is a result of keeping unsaved changes in NetBeans backend.

Debugger does not care what's being edited in the editor. Debugger cares about 
what's saved on disk, because you debug what's on disk and not what's in the 
editor.

We have a code like this in the debugger:
{code:java}
LineCookie lineCookie = dataObject.getLookup().lookup(LineCookie.class);
Line.Set lineSet = lineCookie.getLineSet();
int editorBreakpointLine = ...
int realBreakpointLine = 
lineSet.getOriginalLineNumber(lineSet.getCurrent(editorBreakpointLine));
{code}

The {{realBreakpointLine}} is always {{0}} for files created through VSCode. 
NetBeans has changes in memory which it an not save due to local modifications 
on disk from VSCode.

> Not able to submit breakpoint LineBreakpoint to added java file
> ---------------------------------------------------------------
>
>                 Key: NETBEANS-5319
>                 URL: https://issues.apache.org/jira/browse/NETBEANS-5319
>             Project: NetBeans
>          Issue Type: Bug
>          Components: vscode
>    Affects Versions: 12.3
>         Environment: Ubuntu 20.04, GraalVM 21.0 Jdk8.
>            Reporter: Martin Balin
>            Assignee: Martin Entlicher
>            Priority: Major
>             Fix For: 12.3
>
>
> VSNB ext 12.3.286 and GraalVM Micronaut ext.
> Create MN project based on Maven.
> Add new controller class, e.g. HelloController.java. place a breakpoint into 
> valid line. Save it.
> Run debugger using F5.
> Following error is printed to debug output:
>  
> {code:java}
> --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ demom ---
> Changes detected - recompiling the module!
> Compiling 1 source file to /home/martin/Development/demom/target/test-classes
> User program running
> Not able to submit breakpoint LineBreakpoint HelloController.java : 15, 
> reason: The breakpoint is set outside of any class.
> Invalid LineBreakpoint HelloController.java : 15
> {code}
> It happens even after forced workspace compilation.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to