private static void changeSpawnpoint(final IDbgpSession session, IScriptSpawnpoint spawnpoint)
     throws DbgpException, CoreException {
   final IDbgpSpawnpointCommands commands =
       (IDbgpSpawnpointCommands) session.get(IDbgpSpawnpointCommands.class);
   if (commands != null) {
     final String id = spawnpoint.getId(session);
     if (id != null) {
       commands.updateSpawnpoint(id, spawnpoint.isEnabled());
     }
   }
 }
 protected void removeSpawnpoint(final IDbgpSession session, IScriptSpawnpoint spawnpoint)
     throws DbgpException, CoreException {
   final IDbgpSpawnpointCommands commands =
       (IDbgpSpawnpointCommands) session.get(IDbgpSpawnpointCommands.class);
   if (commands != null) {
     final String id = spawnpoint.getId(session);
     if (id != null) {
       commands.removeSpawnpoint(id);
       spawnpoint.setId(session, null);
     }
   }
 }
 private void addSpawnpoint(final IDbgpSession session, IScriptSpawnpoint spawnpoint)
     throws DbgpException, CoreException {
   if (!target.supportsBreakpoint(spawnpoint)) return;
   final IDbgpSpawnpointCommands commands =
       (IDbgpSpawnpointCommands) session.get(IDbgpSpawnpointCommands.class);
   final IDbgpSpawnpoint p =
       commands.setSpawnpoint(
           bpPathMapper.map(spawnpoint.getResourceURI()),
           spawnpoint.getLineNumber(),
           spawnpoint.isEnabled());
   if (p != null) {
     spawnpoint.setId(session, p.getId());
   }
 }