Multiple line breakpoints in single file.
authorDusan Balek <dbalek@netbeans.org>
Fri, 31 Jan 2014 11:21:14 +0100
changeset 181459ad62b2c9ecb
parent 18144 dbbdd23d6343
child 18147 a337983c4e59
Multiple line breakpoints in single file.
dew4nb/src/org/netbeans/modules/dew4nb/services/debugger/SetBreakpointsHandler.java
     1.1 --- a/dew4nb/src/org/netbeans/modules/dew4nb/services/debugger/SetBreakpointsHandler.java	Fri Jan 31 09:46:45 2014 +0100
     1.2 +++ b/dew4nb/src/org/netbeans/modules/dew4nb/services/debugger/SetBreakpointsHandler.java	Fri Jan 31 11:21:14 2014 +0100
     1.3 @@ -86,32 +86,34 @@
     1.4              }
     1.5              final DebuggerManager dbm = DebuggerManager.getDebuggerManager();
     1.6              for (String line : request.getData()) {
     1.7 -                final int separator = line.lastIndexOf(':');    //NOI18N
     1.8 +                final int separator = line.indexOf(':');    //NOI18N
     1.9                  if (separator > 0 && separator < line.length() - 1) {
    1.10 -                    try {
    1.11 -                        final String path = line.substring(0, separator);
    1.12 -                        final String lineStr = line.substring(separator+1);
    1.13 -                        final int lineNo = Integer.parseInt(lineStr);
    1.14 -                        final FileObject file = resolver.resolveFile(new WorkspaceResolver.Context(ctx.getUser(), ctx.getWorkspace(), path));
    1.15 -                        if (file != null) {
    1.16 -                            final LineBreakpoint lb = LineBreakpoint.create(file.toURL().toExternalForm(), lineNo);
    1.17 -                            dbm.addBreakpoint(lb);
    1.18 -                        } else {
    1.19 -                            LOG.log(
    1.20 -                                Level.WARNING,
    1.21 -                                "Ignoring breakpoint in unresolvable file: {0}",   //NOI18N
    1.22 -                                line);
    1.23 +                    final String path = line.substring(0, separator);
    1.24 +                    final FileObject file = resolver.resolveFile(new WorkspaceResolver.Context(ctx.getUser(), ctx.getWorkspace(), path));
    1.25 +                    if (file != null) {
    1.26 +                        final String linesStr = line.substring(separator+1);
    1.27 +                        for (String lineStr : linesStr.split(":")) { //NOI18N
    1.28 +                            try {
    1.29 +                                final int lineNo = Integer.parseInt(lineStr);
    1.30 +                                final LineBreakpoint lb = LineBreakpoint.create(file.toURL().toExternalForm(), lineNo);
    1.31 +                                dbm.addBreakpoint(lb);
    1.32 +                            } catch (NumberFormatException nfe) {
    1.33 +                                LOG.log(
    1.34 +                                    Level.WARNING,
    1.35 +                                    "Ignoring breakpoint(s) with wrong line number: {0}",   //NOI18N
    1.36 +                                    line);
    1.37 +                            }
    1.38                          }
    1.39 -                    } catch (NumberFormatException nfe) {
    1.40 +                    } else {
    1.41                          LOG.log(
    1.42                              Level.WARNING,
    1.43 -                            "Ignoring breakpoint with wrong line number: {0}",   //NOI18N
    1.44 +                            "Ignoring breakpoint(s) in unresolvable file: {0}",   //NOI18N
    1.45                              line);
    1.46                      }
    1.47                  } else {
    1.48                      LOG.log(
    1.49                          Level.WARNING,
    1.50 -                        "Ignoring wrong breakpoint: {0}",   //NOI18N
    1.51 +                        "Ignoring wrong breakpoint(s): {0}",   //NOI18N
    1.52                          line);
    1.53                  }
    1.54              }