UI counts the lines from 1, so we need to substract one when setting breakpoints
authorJaroslav Tulach <jtulach@netbeans.org>
Wed, 21 May 2014 14:42:59 +0200
changeset 181936bff70295618
parent 18191 d6e7e84e82fb
child 18195 c24c8b83bd60
UI counts the lines from 1, so we need to substract one when setting breakpoints
dew4nb/src/org/netbeans/modules/dew4nb/services/debugger/LineBreakpointProviderJS.java
     1.1 --- a/dew4nb/src/org/netbeans/modules/dew4nb/services/debugger/LineBreakpointProviderJS.java	Fri May 09 17:39:18 2014 +0200
     1.2 +++ b/dew4nb/src/org/netbeans/modules/dew4nb/services/debugger/LineBreakpointProviderJS.java	Wed May 21 14:42:59 2014 +0200
     1.3 @@ -43,7 +43,6 @@
     1.4  package org.netbeans.modules.dew4nb.services.debugger;
     1.5  
     1.6  import java.net.URL;
     1.7 -import java.util.logging.Level;
     1.8  import org.netbeans.api.debugger.Breakpoint;
     1.9  import org.openide.filesystems.FileObject;
    1.10  import org.openide.text.Line;
    1.11 @@ -62,7 +61,7 @@
    1.12          if (file.hasExt("js")) {
    1.13              ClassLoader l = Lookup.getDefault().lookup(ClassLoader.class);
    1.14              Class<?> fl = Class.forName("org.netbeans.modules.javascript2.debug.breakpoints.FutureLine", true, l);
    1.15 -            Line ln = (Line) fl.getConstructor(URL.class, int.class).newInstance(file.toURL(), line);
    1.16 +            Line ln = (Line) fl.getConstructor(URL.class, int.class).newInstance(file.toURL(), line - 1);
    1.17              Class<?> jslb = Class.forName("org.netbeans.modules.javascript2.debug.breakpoints.JSLineBreakpoint", true, l);
    1.18              return (Breakpoint) jslb.getConstructor(Line.class).newInstance(ln);
    1.19          }