Program: 187502
Project: 187502
Buggy source:
public void schedule(){
  if (myPet.getStatus() == MyPet.PetState.Here && isActive() && active && selectedBuffs.size() != 0 && --beaconTimer <= 0) {
    beaconTimer=2;
    double range=this.range * myPet.getHungerValue() / 100.;
    if (range < 0.7) {
      active=false;
      selectedBuffs.clear();
    }
    if (selectedBuffs.size() > selectableBuffs) {
      int usableBuff=0;
      for (      int buff : selectedBuffs) {
        if (buffLevel.get(buff) > 0) {
          usableBuff=buff;
        }
      }
      selectedBuffs.clear();
      if (usableBuff != 0) {
        selectedBuffs.add(usableBuff);
      }
    }
    if (selectedBuffs.size() == 0) {
      return;
    }
    BukkitUtil.playParticleEffect(myPet.getLocation().add(0,1,0),EnumParticle.SPELL_WITCH,0.2F,0.2F,0.2F,0.1F,5,20);
    List<Player> members=null;
    if (PARTY_SUPPORT && reciever == BeaconReciever.Party) {
      members=PartyManager.getPartyMembers(getMyPet().getOwner().getPlayer());
    }
    targetLoop:     for (    Object entityObj : this.myPet.getCraftPet().getHandle().world.a(EntityHuman.class,myPet.getCraftPet().getHandle().getBoundingBox().grow(range,range,range))) {
      EntityHuman entityHuman=(EntityHuman)entityObj;
      if (!entityHuman.getBukkitEntity().equals(Bukkit.getPlayer(entityHuman.getName()))) {
        continue;
      }
      int amplification;
switch (reciever) {
case Owner:
        if (!myPet.getOwner().equals(entityHuman)) {
          continue targetLoop;
        }
 else {
          for (          int buff : selectedBuffs) {
            amplification=buffLevel.get(buff) - 1;
            if (entityHuman.hasEffect(buff)) {
              MobEffect effect=entityHuman.getEffect(buffEffectLists.get(buff));
              effect.a(new MobEffect(buff,duration * 20,amplification,true,false));
              entityHuman.updateEffects=true;
            }
 else {
              entityHuman.addEffect(new MobEffect(buff,duration * 20,amplification,true,false));
            }
          }
          BukkitUtil.playParticleEffect(entityHuman.getBukkitEntity().getLocation().add(0,1,0),EnumParticle.SPELL_INSTANT,0.2F,0.2F,0.2F,0.1F,5,20);
          break targetLoop;
        }
case Everyone:
      for (      int buff : selectedBuffs) {
        amplification=buffLevel.get(buff) - 1;
        if (entityHuman.hasEffect(buff)) {
          MobEffect effect=entityHuman.getEffect(buffEffectLists.get(buff));
          effect.a(new MobEffect(buff,duration * 20,amplification,true,false));
          entityHuman.updateEffects=true;
        }
 else {
          entityHuman.addEffect(new MobEffect(buff,duration * 20,amplification,true,false));
        }
      }
    BukkitUtil.playParticleEffect(entityHuman.getBukkitEntity().getLocation().add(0,1,0),EnumParticle.SPELL_INSTANT,0.2F,0.2F,0.2F,0.1F,5,20);
  break;
case Party:
if (PARTY_SUPPORT && members != null) {
  if (entityHuman.getBukkitEntity() instanceof Player && members.contains(entityHuman.getBukkitEntity())) {
    for (    int buff : selectedBuffs) {
      amplification=buffLevel.get(buff) - 1;
      if (entityHuman.hasEffect(buff)) {
        MobEffect effect=entityHuman.getEffect(buffEffectLists.get(buff));
        effect.a(new MobEffect(buff,duration * 20,amplification,true,false));
        entityHuman.updateEffects=true;
      }
 else {
        entityHuman.addEffect(new MobEffect(buff,duration * 20,amplification,true,false));
      }
    }
    BukkitUtil.playParticleEffect(entityHuman.getBukkitEntity().getLocation().add(0,1,0),EnumParticle.SPELL_INSTANT,0.2F,0.2F,0.2F,0.1F,5,20);
  }
  break;
}
 else {
  reciever=BeaconReciever.Owner;
  break targetLoop;
}
}
}
if (HUNGER_DECREASE_TIME > 0 && hungerDecreaseTimer-- < 0) {
myPet.setHungerValue(myPet.getHungerValue() - 1);
hungerDecreaseTimer=HUNGER_DECREASE_TIME;
}
}
}

Fixed version (ground truth):
public void schedule(){
  if (myPet.getStatus() == MyPet.PetState.Here && isActive() && active && selectedBuffs.size() != 0 && --beaconTimer <= 0) {
    beaconTimer=2;
    double range=this.range * myPet.getHungerValue() / 100.;
    if (range < 0.7) {
      active=false;
      selectedBuffs.clear();
    }
    if (selectedBuffs.size() > selectableBuffs) {
      int usableBuff=0;
      for (      int buff : selectedBuffs) {
        if (buffLevel.get(buff) > 0) {
          usableBuff=buff;
        }
      }
      selectedBuffs.clear();
      if (usableBuff != 0) {
        selectedBuffs.add(usableBuff);
      }
    }
    if (selectedBuffs.size() == 0) {
      return;
    }
    BukkitUtil.playParticleEffect(myPet.getLocation().add(0,1,0),EnumParticle.SPELL_WITCH,0.2F,0.2F,0.2F,0.1F,5,20);
    List<Player> members=null;
    if (PARTY_SUPPORT && reciever == BeaconReciever.Party) {
      members=PartyManager.getPartyMembers(getMyPet().getOwner().getPlayer());
    }
    targetLoop:     for (    Object entityObj : this.myPet.getCraftPet().getHandle().world.a(EntityHuman.class,myPet.getCraftPet().getHandle().getBoundingBox().grow(range,range,range))) {
      EntityHuman entityHuman=(EntityHuman)entityObj;
      if (!entityHuman.getBukkitEntity().equals(Bukkit.getPlayer(entityHuman.getName()))) {
        continue;
      }
      int amplification;
switch (reciever) {
case Owner:
        if (!myPet.getOwner().equals(entityHuman)) {
          continue targetLoop;
        }
 else {
          for (          int buff : selectedBuffs) {
            amplification=buffLevel.get(buff) - 1;
            entityHuman.addEffect(new MobEffect(buff,duration * 20,amplification,true,false));
          }
          BukkitUtil.playParticleEffect(entityHuman.getBukkitEntity().getLocation().add(0,1,0),EnumParticle.SPELL_INSTANT,0.2F,0.2F,0.2F,0.1F,5,20);
          break targetLoop;
        }
case Everyone:
      for (      int buff : selectedBuffs) {
        amplification=buffLevel.get(buff) - 1;
        entityHuman.addEffect(new MobEffect(buff,duration * 20,amplification,true,false));
      }
    BukkitUtil.playParticleEffect(entityHuman.getBukkitEntity().getLocation().add(0,1,0),EnumParticle.SPELL_INSTANT,0.2F,0.2F,0.2F,0.1F,5,20);
  break;
case Party:
if (PARTY_SUPPORT && members != null) {
  if (entityHuman.getBukkitEntity() instanceof Player && members.contains(entityHuman.getBukkitEntity())) {
    for (    int buff : selectedBuffs) {
      amplification=buffLevel.get(buff) - 1;
      entityHuman.addEffect(new MobEffect(buff,duration * 20,amplification,true,false));
    }
    BukkitUtil.playParticleEffect(entityHuman.getBukkitEntity().getLocation().add(0,1,0),EnumParticle.SPELL_INSTANT,0.2F,0.2F,0.2F,0.1F,5,20);
  }
  break;
}
 else {
  reciever=BeaconReciever.Owner;
  break targetLoop;
}
}
}
if (HUNGER_DECREASE_TIME > 0 && hungerDecreaseTimer-- < 0) {
myPet.setHungerValue(myPet.getHungerValue() - 1);
hungerDecreaseTimer=HUNGER_DECREASE_TIME;
}
}
}