Program: 10149
Project: 10149
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public void execute(final ScriptEntry scriptEntry) throws CommandExecutionException {
  final List<dEntity> entities=(List<dEntity>)scriptEntry.getObject("String_Node_Str");
  final Duration duration=(Duration)scriptEntry.getObject("String_Node_Str");
  final Duration frequency=(Duration)scriptEntry.getObject("String_Node_Str");
  final Element yaw=(Element)scriptEntry.getObject("String_Node_Str");
  final Element pitch=(Element)scriptEntry.getObject("String_Node_Str");
  boolean cancel=scriptEntry.hasObject("String_Node_Str");
  final boolean infinite=scriptEntry.hasObject("String_Node_Str");
  dB.report(scriptEntry,getName(),(cancel ? aH.debugObj("String_Node_Str",cancel) : "String_Node_Str") + aH.debugObj("String_Node_Str",entities.toString()) + (infinite ? aH.debugObj("String_Node_Str","String_Node_Str") : duration.debug())+ frequency.debug()+ yaw.debug()+ pitch.debug());
  for (  dEntity entity : entities) {
    if (cancel) {
      rotatingEntities.remove(entity.getUUID());
    }
 else {
      rotatingEntities.add(entity.getUUID());
    }
  }
  if (cancel) {
    return;
  }
  BukkitRunnable task=new BukkitRunnable(){
    int ticks=0;
    int maxTicks=duration.getTicksAsInt();
    Collection<dEntity> unusedEntities=new LinkedList<dEntity>();
    @Override public void run(){
      if (entities.isEmpty()) {
        scriptEntry.setFinished(true);
        this.cancel();
      }
 else       if (infinite || ticks < maxTicks) {
        for (        dEntity entity : entities) {
          if (entity.isSpawned() && rotatingEntities.contains(entity.getUUID())) {
            NMSHandler.getInstance().getEntityHelper().rotate(entity.getBukkitEntity(),NMSHandler.getInstance().getEntityHelper().normalizeYaw(entity.getLocation().getYaw() + yaw.asFloat()),entity.getLocation().getPitch() + pitch.asFloat());
          }
 else {
            rotatingEntities.remove(entity.getUUID());
            unusedEntities.add(entity);
          }
        }
        if (!unusedEntities.isEmpty()) {
          for (          dEntity unusedEntity : unusedEntities) {
            entities.remove(unusedEntity);
          }
          unusedEntities.clear();
        }
        ticks=(int)(ticks + frequency.getTicks());
      }
 else {
        scriptEntry.setFinished(true);
        this.cancel();
      }
    }
  }
;
  task.runTaskTimer(DenizenAPI.getCurrentInstance(),0,frequency.getTicks());
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public void execute(final ScriptEntry scriptEntry) throws CommandExecutionException {
  final List<dEntity> entities=new ArrayList<dEntity>((List<dEntity>)scriptEntry.getObject("String_Node_Str"));
  final Duration duration=(Duration)scriptEntry.getObject("String_Node_Str");
  final Duration frequency=(Duration)scriptEntry.getObject("String_Node_Str");
  final Element yaw=(Element)scriptEntry.getObject("String_Node_Str");
  final Element pitch=(Element)scriptEntry.getObject("String_Node_Str");
  boolean cancel=scriptEntry.hasObject("String_Node_Str");
  final boolean infinite=scriptEntry.hasObject("String_Node_Str");
  dB.report(scriptEntry,getName(),(cancel ? aH.debugObj("String_Node_Str",cancel) : "String_Node_Str") + aH.debugObj("String_Node_Str",entities.toString()) + (infinite ? aH.debugObj("String_Node_Str","String_Node_Str") : duration.debug())+ frequency.debug()+ yaw.debug()+ pitch.debug());
  for (  dEntity entity : entities) {
    if (cancel) {
      rotatingEntities.remove(entity.getUUID());
    }
 else {
      rotatingEntities.add(entity.getUUID());
    }
  }
  if (cancel) {
    return;
  }
  BukkitRunnable task=new BukkitRunnable(){
    int ticks=0;
    int maxTicks=duration.getTicksAsInt();
    Collection<dEntity> unusedEntities=new LinkedList<dEntity>();
    @Override public void run(){
      if (entities.isEmpty()) {
        scriptEntry.setFinished(true);
        this.cancel();
      }
 else       if (infinite || ticks < maxTicks) {
        for (        dEntity entity : entities) {
          if (entity.isSpawned() && rotatingEntities.contains(entity.getUUID())) {
            NMSHandler.getInstance().getEntityHelper().rotate(entity.getBukkitEntity(),NMSHandler.getInstance().getEntityHelper().normalizeYaw(entity.getLocation().getYaw() + yaw.asFloat()),entity.getLocation().getPitch() + pitch.asFloat());
          }
 else {
            rotatingEntities.remove(entity.getUUID());
            unusedEntities.add(entity);
          }
        }
        if (!unusedEntities.isEmpty()) {
          for (          dEntity unusedEntity : unusedEntities) {
            entities.remove(unusedEntity);
          }
          unusedEntities.clear();
        }
        ticks=(int)(ticks + frequency.getTicks());
      }
 else {
        scriptEntry.setFinished(true);
        this.cancel();
      }
    }
  }
;
  task.runTaskTimer(DenizenAPI.getCurrentInstance(),0,frequency.getTicks());
}