nus-yam/ex-repair huggingface dataset:
Program: 27908
Project: 27908
Buggy source:
/** 
 * Gets whether or not the creeper has been struck by lightning.
 * @return If the creeper is powered.
 */
boolean isPowered();

Fixed version (ground truth):
/** 
 * Gets whether or not the creeper has been struck by lightning.
 * @return If the creeper is powered
 */
boolean isPowered();
Program: 27909
Project: 27909
Buggy source:
/** 
 * Sets whether or not the creeper has been struck by lightning.
 * @param powered If the creeper should be powered.
 */
void setPowered(boolean powered);

Fixed version (ground truth):
/** 
 * Sets whether or not the creeper has been struck by lightning.
 * @param powered If the creeper should be powered
 */
void setPowered(boolean powered);
Program: 27910
Project: 27910
Buggy source:
/** 
 * Gets if the enderman is currently screaming. <p>This behaviour generally occurs when a player has been targeted due to staring too long.</p>
 * @return If the enderman is screaming.
 */
boolean isScreaming();

Fixed version (ground truth):
/** 
 * Gets if the enderman is currently screaming. <p>This behaviour generally occurs when a player has been targeted due to staring too long.</p>
 * @return If the enderman is screaming
 */
boolean isScreaming();
Program: 27911
Project: 27911
Buggy source:
/** 
 * Sets the   {@link ItemBlock} currently carried by the enderman.
 * @param carriedBlock The carried {@link ItemBlock}.
 */
void setCarriedBlock(ItemBlock carriedBlock);

Fixed version (ground truth):
/** 
 * Sets the   {@link ItemBlock} currently carried by the enderman.
 * @param carriedBlock The carried {@link ItemBlock}
 */
void setCarriedBlock(ItemBlock carriedBlock);
Program: 27912
Project: 27912
Buggy source:
/** 
 * Gets the   {@link ItemBlock} currently carried by the enderman.
 * @return The {@link ItemBlock}, if available.
 */
Optional<ItemBlock> getCarriedBlock();

Fixed version (ground truth):
/** 
 * Gets the   {@link ItemBlock} currently carried by the enderman.
 * @return The {@link ItemBlock}, if available
 */
Optional<ItemBlock> getCarriedBlock();
Program: 27913
Project: 27913
Buggy source:
/** 
 * Sets if the enderman is currently screaming. <p>This behaviour generally occurs when a player has been targeted due to staring too long.</p>
 * @param screaming If the enderman should be screaming.
 */
void setScreaming(boolean screaming);

Fixed version (ground truth):
/** 
 * Sets if the enderman is currently screaming. <p>This behaviour generally occurs when a player has been targeted due to staring too long.</p>
 * @param screaming If the enderman should be screaming
 */
void setScreaming(boolean screaming);
Program: 27914
Project: 27914
Buggy source:
/** 
 * Gets whether or not the spider is currently climbing a wall.
 * @return Whether or not the spider is climbing a wall.
 */
boolean isClimbing();

Fixed version (ground truth):
/** 
 * Gets whether or not the spider is currently climbing a wall.
 * @return Whether or not the spider is climbing a wall
 */
boolean isClimbing();
Program: 27915
Project: 27915
Buggy source:
/** 
 * Sets if this Witch should be aggressive.
 * @param aggressive If the Witch should be aggressive.
 */
void setAggressive(boolean aggressive);

Fixed version (ground truth):
/** 
 * Sets if this Witch should be aggressive.
 * @param aggressive If the Witch should be aggressive
 */
void setAggressive(boolean aggressive);
Program: 27916
Project: 27916
Buggy source:
/** 
 * Gets if this Witch is currently aggressive.
 * @return If the Witch is aggressive.
 */
boolean isAggressive();

Fixed version (ground truth):
/** 
 * Gets if this Witch is currently aggressive.
 * @return If the Witch is aggressive
 */
boolean isAggressive();
Program: 27917
Project: 27917
Buggy source:
/** 
 * Gets the entities currently being targetted by this wither. <p>This list should contain a maximum of 3 entities.</p>
 * @return The Wither's targets.
 */
List<LivingEntity> getTargets();

Fixed version (ground truth):
/** 
 * Gets the entities currently being targetted by this wither. <p>This list should contain a maximum of 3 entities.</p>
 * @return The Wither's targets
 */
List<LivingEntity> getTargets();
Program: 27918
Project: 27918
Buggy source:
/** 
 * Gets the amount of ticks that the Wither should stay invulnerable for.
 * @return The invulnerable time in ticks.
 */
long getInvulnerableTicks();

Fixed version (ground truth):
/** 
 * Gets the amount of ticks that the Wither should stay invulnerable for.
 * @return The invulnerable time in ticks
 */
long getInvulnerableTicks();
Program: 27919
Project: 27919
Buggy source:
/** 
 * Sets the amount of ticks that the Wither should stay invulnerable for.
 * @param invulnerableTicks The invulnerable time in ticks.
 */
void setInvulnerableTicks(long invulnerableTicks);

Fixed version (ground truth):
/** 
 * Sets the amount of ticks that the Wither should stay invulnerable for.
 * @param invulnerableTicks The invulnerable time in ticks
 */
void setInvulnerableTicks(long invulnerableTicks);
Program: 27920
Project: 27920
Buggy source:
/** 
 * Gets if this Zombie is a villager Zombie.
 * @return If the Zombie is a villager Zombie.
 */
boolean isVillagerZombie();

Fixed version (ground truth):
/** 
 * Gets if this Zombie is a villager Zombie.
 * @return If the Zombie is a villager Zombie
 */
boolean isVillagerZombie();
Program: 27921
Project: 27921
Buggy source:
/** 
 * Sets if this Zombie should be a villager Zombie.
 * @param villagerZombie If the Zombie should be a villager Zombie.
 */
void setVillagerZombie(boolean villagerZombie);

Fixed version (ground truth):
/** 
 * Sets if this Zombie should be a villager Zombie.
 * @param villagerZombie If the Zombie should be a villager Zombie
 */
void setVillagerZombie(boolean villagerZombie);
Program: 27922
Project: 27922
Buggy source:
/** 
 * Gets the   {@link Player}s currently online
 * @return a {@link Collection} of online players
 */
Collection<Player> getOnlinePlayers();

Fixed version (ground truth):
/** 
 * Gets the   {@link Player}s currently online
 * @return A {@link Collection} of online players
 */
Collection<Player> getOnlinePlayers();
Program: 27923
Project: 27923
Buggy source:
/** 
 * Creates a new clean   {@link Title} configuration that will reset thecurrently displayed title before displaying the new one.
 * @return A new clean {@link Title} configuration.
 */
Title createTitle();

Fixed version (ground truth):
/** 
 * Creates a new clean   {@link Title} configuration that will reset thecurrently displayed title before displaying the new one.
 * @return A new clean {@link Title} configuration
 */
Title createTitle();
Program: 27924
Project: 27924
Buggy source:
/** 
 * Creates a new empty   {@link Title} configuration that will just updatethe currently displayed title on the client.
 * @return A new empty {@link Title} configuration.
 */
Title updateTitle();

Fixed version (ground truth):
/** 
 * Creates a new empty   {@link Title} configuration that will just updatethe currently displayed title on the client.
 * @return A new empty {@link Title} configuration
 */
Title updateTitle();
Program: 27925
Project: 27925
Buggy source:
/** 
 * Gets the time it takes to dig this block the specified item in ticks.
 * @param itemStack The item to pretend-dig with
 * @return The time in ticks.
 */
int getDigTimeWith(ItemStack itemStack);

Fixed version (ground truth):
/** 
 * Gets the time it takes to dig this block the specified item in ticks.
 * @param itemStack The item to pretend-dig with
 * @return The time in ticks
 */
int getDigTimeWith(ItemStack itemStack);
Program: 27926
Project: 27926
Buggy source:
/** 
 * Gets the time it takes to dig this block with a fist in ticks.
 * @return The time in ticks.
 */
int getDigTime();

Fixed version (ground truth):
/** 
 * Gets the time it takes to dig this block with a fist in ticks.
 * @return The time in ticks
 */
int getDigTime();
Program: 27927
Project: 27927
Buggy source:
/** 
 * Gets the rate at which unoccupied boats decelerate.
 * @return The unoccupied deceleration rate.
 */
double getUnoccupiedDeceleration();

Fixed version (ground truth):
/** 
 * Gets the rate at which unoccupied boats decelerate.
 * @return The unoccupied deceleration rate
 */
double getUnoccupiedDeceleration();
Program: 27928
Project: 27928
Buggy source:
/** 
 * Gets the rate at which occupied boats decelerate.
 * @return The occupied deceleration rate.
 */
double getOccupiedDeceleration();

Fixed version (ground truth):
/** 
 * Gets the rate at which occupied boats decelerate.
 * @return The occupied deceleration rate
 */
double getOccupiedDeceleration();
Program: 27929
Project: 27929
Buggy source:
/** 
 * Gets whether or not the boat is able to move freely on land.
 * @return If the boat can move on land.
 */
boolean getMoveOnLand();

Fixed version (ground truth):
/** 
 * Gets whether or not the boat is able to move freely on land.
 * @return If the boat can move on land
 */
boolean getMoveOnLand();
Program: 27930
Project: 27930
Buggy source:
/** 
 * Gets whether this boat is currently in water.
 * @return If the boat is in water.
 */
boolean isInWater();

Fixed version (ground truth):
/** 
 * Gets whether this boat is currently in water.
 * @return If the boat is in water
 */
boolean isInWater();
Program: 27931
Project: 27931
Buggy source:
/** 
 * Sets the rate at which unoccupied boats decelerate.
 * @param unoccupiedDeceleration The new unoccupied deceleration rate.
 */
void setUnoccupiedDeceleration(double unoccupiedDeceleration);

Fixed version (ground truth):
/** 
 * Sets the rate at which unoccupied boats decelerate.
 * @param unoccupiedDeceleration The new unoccupied deceleration rate
 */
void setUnoccupiedDeceleration(double unoccupiedDeceleration);
Program: 27932
Project: 27932
Buggy source:
/** 
 * Gets whether or not the boat is able to move freely on land.
 * @param moveOnLand If the boat can move on land.
 */
void setMoveOnLand(boolean moveOnLand);

Fixed version (ground truth):
/** 
 * Gets whether or not the boat is able to move freely on land.
 * @param moveOnLand If the boat can move on land
 */
void setMoveOnLand(boolean moveOnLand);
Program: 27933
Project: 27933
Buggy source:
/** 
 * Sets the rate at which occupied boats decelerate.
 * @param occupiedDeceleration The new occupied deceleration rate.
 */
void setOccupiedDeceleration(double occupiedDeceleration);

Fixed version (ground truth):
/** 
 * Sets the rate at which occupied boats decelerate.
 * @param occupiedDeceleration The new occupied deceleration rate
 */
void setOccupiedDeceleration(double occupiedDeceleration);
Program: 27934
Project: 27934
Buggy source:
/** 
 * Gets the maximum speed that this boat is allowed to travel at. Default value is 0.4
 * @return The maximum speed.
 */
double getMaxSpeed();

Fixed version (ground truth):
/** 
 * Gets the maximum speed that this boat is allowed to travel at. Default value is 0.4
 * @return The maximum speed
 */
double getMaxSpeed();
Program: 27935
Project: 27935
Buggy source:
/** 
 * Sets the maximum speed that this boat is allowed to travel at. Default value is 0.4
 * @param maxSpeed The new max speed.
 */
void setMaxSpeed(double maxSpeed);

Fixed version (ground truth):
/** 
 * Sets the maximum speed that this boat is allowed to travel at. Default value is 0.4
 * @param maxSpeed The new max speed
 */
void setMaxSpeed(double maxSpeed);
Program: 27936
Project: 27936
Buggy source:
/** 
 * Gets the rotation as a EulerDirection.
 * @return rotation The rotation as a EulerDirection
 */
EulerDirection getRotation();

Fixed version (ground truth):
/** 
 * Gets the rotation as a EulerDirection.
 * @return The rotation as a EulerDirection
 */
EulerDirection getRotation();
Program: 27937
Project: 27937
Buggy source:
/** 
 * Gets the rotation as a vector. This does not support the roll component of the entity's rotation.
 * @return rotation A possibly, but not necessarily, unit vector
 */
Vector3f getVectorRotation();

Fixed version (ground truth):
/** 
 * Gets the rotation as a vector. This does not support the roll component of the entity's rotation.
 * @return A possibly, but not necessarily, unit vector
 */
Vector3f getVectorRotation();
Program: 27938
Project: 27938
Buggy source:
/** 
 * Mount the entity provided.
 * @param entity The entity to mount.
 */
void mount(Entity entity);

Fixed version (ground truth):
/** 
 * Mount the entity provided.
 * @param entity The entity to mount
 */
void mount(Entity entity);
Program: 27939
Project: 27939
Buggy source:
/** 
 * Gets the entity that is riding this entity.
 * @return The riding entity, if it exists.
 */
Optional<Entity> getRider();

Fixed version (ground truth):
/** 
 * Gets the entity that is riding this entity.
 * @return The riding entity, if it exists
 */
Optional<Entity> getRider();
Program: 27940
Project: 27940
Buggy source:
/** 
 * Gets the position.
 * @return position The position
 */
Vector3d getPosition();

Fixed version (ground truth):
/** 
 * Gets the position.
 * @return The position
 */
Vector3d getPosition();
Program: 27941
Project: 27941
Buggy source:
/** 
 * Simulates the interaction with this object using the given item as if the player had done so.
 * @param itemStack The item
 * @param interactionType The type of interaction performed on this entity
 */
void interactWith(ItemStack itemStack,EntityInteractionType interactionType);

Fixed version (ground truth):
/** 
 * Simulates the interaction with this object using the given item as if the player had done so.
 * @param itemStack       The item
 * @param interactionType The type of interaction performed on this entity
 */
void interactWith(ItemStack itemStack,EntityInteractionType interactionType);
Program: 27942
Project: 27942
Buggy source:
/** 
 * Gets the entity that this entity is riding.
 * @return The entity being ridden, if it exists.
 */
Optional<Entity> getRiding();

Fixed version (ground truth):
/** 
 * Gets the entity that this entity is riding.
 * @return The entity being ridden, if it exists
 */
Optional<Entity> getRiding();
Program: 27943
Project: 27943
Buggy source:
/** 
 * Gets whether or not the minecart is currently on a valid rail block.
 * @return If the cart is on a rail.
 */
boolean isOnRail();

Fixed version (ground truth):
/** 
 * Gets whether or not the minecart is currently on a valid rail block.
 * @return If the cart is on a rail
 */
boolean isOnRail();
Program: 27944
Project: 27944
Buggy source:
/** 
 * Sets the velocity modifier applied when the minecart is not on rails.
 * @param derailedVelocityMod The new derailed velocity modifier.
 */
void setDerailedVelocityMod(Vector3d derailedVelocityMod);

Fixed version (ground truth):
/** 
 * Sets the velocity modifier applied when the minecart is not on rails.
 * @param derailedVelocityMod The new derailed velocity modifier
 */
void setDerailedVelocityMod(Vector3d derailedVelocityMod);
Program: 27945
Project: 27945
Buggy source:
/** 
 * Gets the velocity modifier applied when the minecart is airborne.
 * @return Airborne velocity modifier.
 */
Vector3d getAirborneVelocityMod();

Fixed version (ground truth):
/** 
 * Gets the velocity modifier applied when the minecart is airborne.
 * @return Airborne velocity modifier
 */
Vector3d getAirborneVelocityMod();
Program: 27946
Project: 27946
Buggy source:
/** 
 * Gets whether or not the minecart slows down faster without a passenger.
 * @return If the cart slows when empty.
 */
boolean doesSlowWhenEmpty();

Fixed version (ground truth):
/** 
 * Gets whether or not the minecart slows down faster without a passenger.
 * @return If the cart slows when empty
 */
boolean doesSlowWhenEmpty();
Program: 27947
Project: 27947
Buggy source:
/** 
 * Sets whether or not the minecart slows down faster without a passenger.
 * @param slowWhenEmpty If the cart should slow when emoty.
 */
void setSlowWhenEmpty(boolean slowWhenEmpty);

Fixed version (ground truth):
/** 
 * Sets whether or not the minecart slows down faster without a passenger.
 * @param slowWhenEmpty If the cart should slow when emoty
 */
void setSlowWhenEmpty(boolean slowWhenEmpty);
Program: 27948
Project: 27948
Buggy source:
/** 
 * Gets the velocity modifier applied when the minecart is not on rails.
 * @return Derailed velocity modifier.
 */
Vector3d getDerailedVelocityMod();

Fixed version (ground truth):
/** 
 * Gets the velocity modifier applied when the minecart is not on rails.
 * @return Derailed velocity modifier
 */
Vector3d getDerailedVelocityMod();
Program: 27949
Project: 27949
Buggy source:
/** 
 * Gets the maximum speed that this cart is allowed to travel at. Default value is 0.4
 * @return The maximum speed.
 */
double getMaxSpeed();

Fixed version (ground truth):
/** 
 * Gets the maximum speed that this cart is allowed to travel at. Default value is 0.4
 * @return The maximum speed
 */
double getMaxSpeed();
Program: 27950
Project: 27950
Buggy source:
/** 
 * Sets the maximum speed that this cart is allowed to travel at. Default value is 0.4
 * @param maxSpeed The new max speed.
 */
void setMaxSpeed(double maxSpeed);

Fixed version (ground truth):
/** 
 * Sets the maximum speed that this cart is allowed to travel at. Default value is 0.4
 * @param maxSpeed The new max speed
 */
void setMaxSpeed(double maxSpeed);
Program: 27951
Project: 27951
Buggy source:
/** 
 * Sets the velocity modifier applied when the minecart is airborne.
 * @param airborneVelocityMod The new airborne velocity modifier.
 */
void setAirborneVelocityMod(Vector3d airborneVelocityMod);

Fixed version (ground truth):
/** 
 * Sets the velocity modifier applied when the minecart is airborne.
 * @param airborneVelocityMod The new airborne velocity modifier
 */
void setAirborneVelocityMod(Vector3d airborneVelocityMod);
Program: 27952
Project: 27952
Buggy source:
/** 
 * Sends a   {@link Title} to this player. This is the same as calling{@link Title#send(Player)}.
 * @param title The {@link Title} to send to the player.
 */
void sendTitle(Title title);

Fixed version (ground truth):
/** 
 * Sends a   {@link Title} to this player. This is the same as calling{@link Title#send(Player)}.
 * @param title The {@link Title} to send to the player
 */
void sendTitle(Title title);
Program: 27953
Project: 27953
Buggy source:
/** 
 * Sets the cancelled state of the   {@link Event}.
 * @param cancel the new cancelled state
 */
void setCancelled(boolean cancel);

Fixed version (ground truth):
/** 
 * Sets the cancelled state of the   {@link Event}.
 * @param cancel The new cancelled state
 */
void setCancelled(boolean cancel);
Program: 27954
Project: 27954
Buggy source:
/** 
 * Gets the entity that is being dismounted from.
 * @return The entity that is being dismounted from.
 */
Entity getDismounted();

Fixed version (ground truth):
/** 
 * Gets the entity that is being dismounted from.
 * @return The entity that is being dismounted from
 */
Entity getDismounted();
Program: 27955
Project: 27955
Buggy source:
/** 
 * Gets the entity that is being mounted.
 * @return The entity that is being mounted.
 */
Entity getMounted();

Fixed version (ground truth):
/** 
 * Gets the entity that is being mounted.
 * @return The entity that is being mounted
 */
Entity getMounted();
Program: 27956
Project: 27956
Buggy source:
/** 
 * @return the config folder
 */
public File getConfigurationDirectory();

Fixed version (ground truth):
/** 
 * @return The config folder
 */
public File getConfigurationDirectory();
Program: 27957
Project: 27957
Buggy source:
/** 
 * Returns the yaw component.
 * @return the yaw component
 */
float getYaw();

Fixed version (ground truth):
/** 
 * Returns the yaw component.
 * @return The yaw component
 */
float getYaw();
Program: 27958
Project: 27958
Buggy source:
/** 
 * Returns the pitch component.
 * @return the pitch component
 */
float getPitch();

Fixed version (ground truth):
/** 
 * Returns the pitch component.
 * @return The pitch component
 */
float getPitch();
Program: 27959
Project: 27959
Buggy source:
/** 
 * Converts this Euler Direction into a   {@link Vector3f}. The vector will represent the directions that this direction is facing in x, y, z coordinates, with a length of 1. Roll will be ignored, as it does not contribute to the facing direction.
 * @return the vector representation of this direction
 */
Vector3f toVector();

Fixed version (ground truth):
/** 
 * Converts this Euler Direction into a   {@link Vector3f}. The vector will represent the directions that this direction is facing in x, y, z coordinates, with a length of 1. Roll will be ignored, as it does not contribute to the facing direction.
 * @return The vector representation of this direction
 */
Vector3f toVector();
Program: 27960
Project: 27960
Buggy source:
/** 
 * Returns the roll component.
 * @return the roll component
 */
float getRoll();

Fixed version (ground truth):
/** 
 * Returns the roll component.
 * @return The roll component
 */
float getRoll();
Program: 27961
Project: 27961
Buggy source:
/** 
 * Returns this vector as an array.
 * @return This vector as an array.
 */
double[] toArray();

Fixed version (ground truth):
/** 
 * Returns this vector as an array.
 * @return This vector as an array
 */
double[] toArray();
Program: 27962
Project: 27962
Buggy source:
/** 
 * Returns this vector as an array.
 * @return This vector as an array.
 */
float[] toArray();

Fixed version (ground truth):
/** 
 * Returns this vector as an array.
 * @return This vector as an array
 */
float[] toArray();
Program: 27963
Project: 27963
Buggy source:
/** 
 * Returns this vector as an array.
 * @return This vector as an array.
 */
int[] toArray();

Fixed version (ground truth):
/** 
 * Returns this vector as an array.
 * @return This vector as an array
 */
int[] toArray();
Program: 27964
Project: 27964
Buggy source:
/** 
 * Gets the time it takes to dig this block the specified item in ticks.
 * @return The time in ticks.
 */
int getDigTimeWith(ItemStack itemStack);

Fixed version (ground truth):
/** 
 * Gets the time it takes to dig this block the specified item in ticks.
 * @param itemStack The item to pretend-dig with
 * @return The time in ticks.
 */
int getDigTimeWith(ItemStack itemStack);
Program: 27965
Project: 27965
Buggy source:
/** 
 * Return the default state for this block.
 */
BlockState getDefaultState();

Fixed version (ground truth):
/** 
 * Return the default state for this block.
 * @return The default state
 */
BlockState getDefaultState();
Program: 27966
Project: 27966
Buggy source:
/** 
 * Gets the helmet currently being worn by this entity.
 * @return The helmet, if available.
 */
Optional<ItemStack> getHelmet();

Fixed version (ground truth):
/** 
 * Gets the helmet currently being worn by this entity.
 * @return The helmet, if available
 */
Optional<ItemStack> getHelmet();
Program: 27967
Project: 27967
Buggy source:
/** 
 * Sets the helmet currently being worn by this entity.
 * @param helmet The helmet to put on the entity.
 */
void setHelmet(ItemStack helmet);

Fixed version (ground truth):
/** 
 * Sets the helmet currently being worn by this entity.
 * @param helmet The helmet to put on the entity
 */
void setHelmet(ItemStack helmet);
Program: 27968
Project: 27968
Buggy source:
/** 
 * Sets the leggings currently being worn by this entity.
 * @param leggings The leggings to put on the entity.
 */
void setLeggings(ItemStack leggings);

Fixed version (ground truth):
/** 
 * Sets the leggings currently being worn by this entity.
 * @param leggings The leggings to put on the entity
 */
void setLeggings(ItemStack leggings);
Program: 27969
Project: 27969
Buggy source:
/** 
 * Sets the boots currently being worn by this entity.
 * @param boots The boots to put on the entity.
 */
void setBoots(ItemStack boots);

Fixed version (ground truth):
/** 
 * Sets the boots currently being worn by this entity.
 * @param boots The boots to put on the entity
 */
void setBoots(ItemStack boots);
Program: 27970
Project: 27970
Buggy source:
/** 
 * Sets the chestplate currently being worn by this entity.
 * @param chestplate The chestplate to put on the entity.
 */
void setChestplate(ItemStack chestplate);

Fixed version (ground truth):
/** 
 * Sets the chestplate currently being worn by this entity.
 * @param chestplate The chestplate to put on the entity
 */
void setChestplate(ItemStack chestplate);
Program: 27971
Project: 27971
Buggy source:
/** 
 * Gets the chestplate currently being worn by this entity.
 * @return The chestplate, if available.
 */
Optional<ItemStack> getChestplate();

Fixed version (ground truth):
/** 
 * Gets the chestplate currently being worn by this entity.
 * @return The chestplate, if available
 */
Optional<ItemStack> getChestplate();
Program: 27972
Project: 27972
Buggy source:
/** 
 * Gets the boots currently being worn by this entity.
 * @return The boots, if available.
 */
Optional<ItemStack> getBoots();

Fixed version (ground truth):
/** 
 * Gets the boots currently being worn by this entity.
 * @return The boots, if available
 */
Optional<ItemStack> getBoots();
Program: 27973
Project: 27973
Buggy source:
/** 
 * Gets the leggings currently being worn by this entity.
 * @return The leggings, if available.
 */
Optional<ItemStack> getLeggings();

Fixed version (ground truth):
/** 
 * Gets the leggings currently being worn by this entity.
 * @return The leggings, if available
 */
Optional<ItemStack> getLeggings();
Program: 27974
Project: 27974
Buggy source:
/** 
 * Gets block associated with this cause.
 * @return Block, if available
 */
Optional<Block> getBlock(){
  return Optional.of(block);
}

Fixed version (ground truth):
/** 
 * Gets block associated with this cause.
 * @return Block, if available
 */
public Optional<Block> getBlock(){
  return Optional.of(block);
}
Program: 27975
Project: 27975
Buggy source:
/** 
 * Gets world associated with this cause. If world isn't directly specified, world of entity or block will returned.
 * @return World, if available
 */
Optional<World> getWorld(){
  if (world != null) {
    return Optional.of(this.world);
  }
 else {
    if (entity != null) {
      return entity.getWorld();
    }
 else     if (block != null) {
      return Optional.of((World)block.getLocation().getExtent());
    }
  }
  return Optional.of(world);
}

Fixed version (ground truth):
/** 
 * Gets world associated with this cause. If world isn't directly specified, world of entity or block will returned.
 * @return World, if available
 */
public Optional<World> getWorld(){
  if (world != null) {
    return Optional.of(this.world);
  }
 else {
    if (entity != null) {
      return entity.getWorld();
    }
 else     if (block != null) {
      return Optional.of((World)block.getLocation().getExtent());
    }
  }
  return Optional.of(world);
}
Program: 27976
Project: 27976
Buggy source:
/** 
 * Gets reason for cause.
 */
Reason getReason(){
  return this.reason;
}

Fixed version (ground truth):
/** 
 * Gets reason for cause.
 */
public Reason getReason(){
  return this.reason;
}
Program: 27977
Project: 27977
Buggy source:
/** 
 * Gets entity associated with this cause.
 * @return Entity, if available
 */
Optional<Entity> getEntity(){
  return Optional.of(entity);
}

Fixed version (ground truth):
/** 
 * Gets entity associated with this cause.
 * @return Entity, if available
 */
public Optional<Entity> getEntity(){
  return Optional.of(entity);
}
Program: 27978
Project: 27978
Buggy source:
/** 
 * Gets the   {@link Block} that the player has clicked, returns null if theplayer clicks the air.
 * @return The block
 */
Optional<Block> getBlock();

Fixed version (ground truth):
/** 
 * Gets the   {@link Block} that the player has clicked, if available.
 * @return The block
 */
Optional<Block> getBlock();
Program: 27979
Project: 27979
Buggy source:
public String getClockTime(){
  return getSharedPrefs().getString(getString(R.string.key_clock_time),TimePreference.DEFAULT_TIME_VALUE);
}

Fixed version (ground truth):
public String getClockTime(){
  String[] time=getSharedPrefs().getString(getString(R.string.key_clock_time),TimePreference.DEFAULT_TIME_VALUE).split("String_Node_Str");
  if (!getSharedPrefs().getBoolean(getString(R.string.key_use_24_hour_format),false)) {
    if (Integer.parseInt(time[0]) > 12) {
      time[0]=String.format("String_Node_Str",String.valueOf(Integer.parseInt(time[0]) - 12));
    }
  }
  return String.format("String_Node_Str",time[0],time[1]);
}
Program: 27980
Project: 27980
Buggy source:
protected void updatePrefsSummary(Preference pref){
  if (pref == null) {
    return;
  }
  if (pref instanceof ListPreference) {
    ListPreference lst=(ListPreference)pref;
    String currentValue=lst.getValue();
    int index=lst.findIndexOfValue(currentValue);
    CharSequence[] entries=lst.getEntries();
    CharSequence[] entryValues=lst.getEntryValues();
    if (index >= 0 && index < entries.length) {
      boolean currentValueIsOffOrEmpty=currentValue.equals(entryValues[0]) || currentValue.equals(entryValues[1]);
      if (pref.getKey().equals(getString(R.string.key_signal_3g)) && !currentValueIsOffOrEmpty) {
        pref.setSummary(entries[index] + "String_Node_Str" + getString(R.string.network_icon_info));
      }
 else {
        pref.setSummary(entries[index]);
      }
    }
  }
 else   if (pref instanceof TimePreference) {
    if (pref.getKey().equals(getString(R.string.key_clock_time))) {
      String time=getPreferenceManager().getSharedPreferences().getString(getString(R.string.key_clock_time),TimePreference.DEFAULT_TIME_VALUE);
      pref.setSummary(time);
    }
  }
}

Fixed version (ground truth):
protected void updatePrefsSummary(Preference pref){
  if (pref == null) {
    return;
  }
  if (pref instanceof ListPreference) {
    ListPreference lst=(ListPreference)pref;
    String currentValue=lst.getValue();
    int index=lst.findIndexOfValue(currentValue);
    CharSequence[] entries=lst.getEntries();
    CharSequence[] entryValues=lst.getEntryValues();
    if (index >= 0 && index < entries.length) {
      boolean currentValueIsOffOrEmpty=currentValue.equals(entryValues[0]) || currentValue.equals(entryValues[1]);
      if (pref.getKey().equals(getString(R.string.key_signal_3g)) && !currentValueIsOffOrEmpty) {
        pref.setSummary(entries[index] + "String_Node_Str" + getString(R.string.network_icon_info));
      }
 else {
        pref.setSummary(entries[index]);
      }
    }
  }
 else   if (pref instanceof TimePreference) {
    if (pref.getKey().equals(getString(R.string.key_clock_time))) {
      String time=((TimePreference)pref).getTime();
      pref.setSummary(time);
    }
  }
}
Program: 27981
Project: 27981
Buggy source:
private String toTimeDigits(int i){
  String digit=String.valueOf(i);
  if (i < 10) {
    digit="String_Node_Str" + digit;
  }
  return digit;
}

Fixed version (ground truth):
private String toTimeDigits(String digit){
  if (digit.length() == 1) {
    digit="String_Node_Str" + digit;
  }
  return digit;
}
Program: 27982
Project: 27982
Buggy source:
private void updateTime(){
  if (mTimePicker != null) {
    mLastHour=mTimePicker.getCurrentHour();
    mLastMinute=mTimePicker.getCurrentMinute();
  }
 else {
    String time=getPersistedString(DEFAULT_TIME_VALUE);
    mLastHour=getHour(time);
    mLastMinute=getMinute(time);
  }
  String hourValue=String.valueOf(mLastHour);
  if (mIs24HourFormat) {
    hourValue=toTimeDigits(mLastHour);
  }
 else {
    if (mLastHour > 12) {
      hourValue=String.valueOf(mLastHour - 12);
    }
  }
  String time=hourValue + "String_Node_Str" + toTimeDigits(mLastMinute);
  if (callChangeListener(time)) {
    persistString(time);
  }
}

Fixed version (ground truth):
private void updateTime(){
  if (mTimePicker != null) {
    mLastHour=mTimePicker.getCurrentHour();
    mLastMinute=mTimePicker.getCurrentMinute();
  }
 else {
    String time=getPersistedString(DEFAULT_TIME_VALUE);
    mLastHour=getHour(time);
    mLastMinute=getMinute(time);
  }
  String hourValue=String.valueOf(mLastHour);
  if (mIs24HourFormat) {
    hourValue=toTimeDigits(mLastHour);
  }
 else {
    if (mLastHour > 12) {
      hourValue=toTimeDigits(String.valueOf(mLastHour - 12));
    }
  }
  mTime=hourValue + "String_Node_Str" + toTimeDigits(mLastMinute);
  if (callChangeListener(mTime)) {
    persistString(String.format("String_Node_Str",String.valueOf(mLastHour),toTimeDigits(mLastMinute)));
  }
}
Program: 27983
Project: 27983
Buggy source:
@Override protected void onBindView(View view){
  super.onBindView(view);
  String json=getSharedPreferences().getString(getUserColoursKey(),"String_Node_Str");
  mColours=new Gson().fromJson(json,new TypeToken<ArrayList<Colour>>(){
  }
.getType());
  if (mColours == null) {
    mColours=new ArrayList<Colour>();
    String[] defaultColourNames=getContext().getResources().getStringArray(R.array.default_colour_choices);
    String[] defaultColourValues=getContext().getResources().getStringArray(R.array.default_colour_choice_values);
    for (int i=0; i < defaultColourValues.length; i++) {
      mColours.add(new Colour(defaultColourNames[i],Color.parseColor(defaultColourValues[i])));
    }
  }
  Collections.sort(mColours);
  int value=getPersistedInt(0);
  if (value == 0) {
    value=mColours.get(0).mColourValue;
    setValue(value);
  }
  setColourValue((ImageView)view.findViewById(R.id.colour_view),value);
  ((TextView)view.findViewById(R.id.colour_name)).setText(getTitle());
}

Fixed version (ground truth):
@Override protected void onBindView(View view){
  super.onBindView(view);
  String json=getSharedPreferences().getString(getUserColoursKey(),"String_Node_Str");
  mColours=new Gson().fromJson(json,new TypeToken<ArrayList<Colour>>(){
  }
.getType());
  if (mColours == null) {
    mColours=new ArrayList<Colour>();
    String[] defaultColourNames=getContext().getResources().getStringArray(R.array.default_colour_choices);
    String[] defaultColourValues=getContext().getResources().getStringArray(R.array.default_colour_choice_values);
    for (int i=0; i < defaultColourValues.length; i++) {
      mColours.add(new Colour(defaultColourNames[i],Color.parseColor(defaultColourValues[i])));
    }
  }
  Collections.sort(mColours);
  int value=getPersistedInt(0);
  if (value == 0) {
    value=mColours.get(0).mColourValue;
    setValue(value);
  }
  setColourValue((ImageView)view.findViewById(R.id.colour_view),value);
}
Program: 27984
Project: 27984
Buggy source:
private void init(){
  setWidgetLayoutResource(R.layout.colour_preference_row);
}

Fixed version (ground truth):
private void init(){
  setWidgetLayoutResource(R.layout.colour_preference);
}
Program: 27985
Project: 27985
Buggy source:
@Override protected void onBindView(View view){
  super.onBindView(view);
  String json=getSharedPreferences().getString(getUserColoursKey(),"String_Node_Str");
  mColours=new Gson().fromJson(json,new TypeToken<ArrayList<Colour>>(){
  }
.getType());
  if (mColours == null) {
    mColours=new ArrayList<Colour>();
    String[] defaultColourNames=getContext().getResources().getStringArray(R.array.default_colour_choices);
    String[] defaultColourValues=getContext().getResources().getStringArray(R.array.default_colour_choice_values);
    for (int i=0; i < defaultColourValues.length; i++) {
      mColours.add(new Colour(defaultColourNames[i],Color.parseColor(defaultColourValues[i])));
    }
  }
  Collections.sort(mColours);
  int value=getPersistedInt(0);
  if (value == 0) {
    value=mColours.get(0).mColourValue;
    setValue(value);
  }
  setColourValue((ImageView)view.findViewById(R.id.colour_view),value);
  ((TextView)view.findViewById(R.id.colour_name)).setText(getTitle());
}

Fixed version (ground truth):
@Override protected void onBindView(View view){
  super.onBindView(view);
  String json=getSharedPreferences().getString(getUserColoursKey(),"String_Node_Str");
  mColours=new Gson().fromJson(json,new TypeToken<ArrayList<Colour>>(){
  }
.getType());
  if (mColours == null) {
    mColours=new ArrayList<Colour>();
    String[] defaultColourNames=getContext().getResources().getStringArray(R.array.default_colour_choices);
    String[] defaultColourValues=getContext().getResources().getStringArray(R.array.default_colour_choice_values);
    for (int i=0; i < defaultColourValues.length; i++) {
      mColours.add(new Colour(defaultColourNames[i],Color.parseColor(defaultColourValues[i])));
    }
  }
  Collections.sort(mColours);
  int value=getPersistedInt(0);
  if (value == 0) {
    value=mColours.get(0).mColourValue;
    setValue(value);
  }
  setColourValue((ImageView)view.findViewById(R.id.colour_view),value);
}
Program: 27986
Project: 27986
Buggy source:
private void init(){
  setWidgetLayoutResource(R.layout.colour_preference_row);
}

Fixed version (ground truth):
private void init(){
  setWidgetLayoutResource(R.layout.colour_preference);
}
Program: 27987
Project: 27987
Buggy source:
private void addAnimator(AnimatorBundle... animators){
  boolean added=true;
  for (  AnimatorBundle animator : animators) {
    added&=mSetAnimatorBundles.add(animator);
  }
  if (!added) {
    throw new IllegalArgumentException("String_Node_Str");
  }
}

Fixed version (ground truth):
private void addAnimator(AnimatorBundle... animators){
  for (  AnimatorBundle animator : animators) {
    if (!mSetAnimatorBundles.add(animator)) {
      throw new IllegalArgumentException("String_Node_Str" + animator.mTypeAnimation + "String_Node_Str");
    }
  }
}
Program: 27988
Project: 27988
Buggy source:
protected void animateOnScroll(float boundedRatioTranslationY,float translationY){
  if (mLastTranslationApplied == boundedRatioTranslationY) {
    return;
  }
  mLastTranslationApplied=boundedRatioTranslationY;
  for (  AnimatorBuilder.AnimatorBundle animatorBundle : mSetAnimatorBundles) {
    float interpolatedTranslation=animatorBundle.mInterpolator == null ? boundedRatioTranslationY : animatorBundle.mInterpolator.getInterpolation(boundedRatioTranslationY);
    float valueAnimation=animatorBundle.mFromValue + (animatorBundle.mDelta * interpolatedTranslation);
switch (animatorBundle.mTypeAnimation) {
case SCALEX:
      StikkyCompat.setScaleX(animatorBundle.mView,valueAnimation);
    break;
case SCALEY:
  StikkyCompat.setScaleY(animatorBundle.mView,valueAnimation);
break;
case SCALEXY:
StikkyCompat.setScaleX(animatorBundle.mView,valueAnimation);
StikkyCompat.setScaleY(animatorBundle.mView,valueAnimation);
break;
case FADE:
StikkyCompat.setAlpha(animatorBundle.mView,valueAnimation);
break;
case TRANSLATIONX:
StikkyCompat.setTranslationX(animatorBundle.mView,valueAnimation);
break;
case TRANSLATIONY:
StikkyCompat.setTranslationY(animatorBundle.mView,valueAnimation);
break;
case PARALLAX:
StikkyCompat.setTranslationY(animatorBundle.mView,animatorBundle.mDelta * translationY);
break;
}
}
}

Fixed version (ground truth):
protected void animateOnScroll(float boundedRatioTranslationY,float translationY){
  if (mLastTranslationApplied == boundedRatioTranslationY) {
    return;
  }
  mLastTranslationApplied=boundedRatioTranslationY;
  for (  AnimatorBuilder.AnimatorBundle animatorBundle : mSetAnimatorBundles) {
    float interpolatedTranslation=animatorBundle.mInterpolator == null ? boundedRatioTranslationY : animatorBundle.mInterpolator.getInterpolation(boundedRatioTranslationY);
    float valueAnimation=animatorBundle.mFromValue + (animatorBundle.mDelta * interpolatedTranslation);
switch (animatorBundle.mTypeAnimation) {
case SCALEX:
      StikkyCompat.setScaleX(animatorBundle.mView,valueAnimation);
    break;
case SCALEY:
  StikkyCompat.setScaleY(animatorBundle.mView,valueAnimation);
break;
case SCALEXY:
StikkyCompat.setScaleX(animatorBundle.mView,valueAnimation);
StikkyCompat.setScaleY(animatorBundle.mView,valueAnimation);
break;
case FADE:
StikkyCompat.setAlpha(animatorBundle.mView,valueAnimation);
break;
case TRANSLATIONX:
StikkyCompat.setTranslationX(animatorBundle.mView,valueAnimation);
break;
case TRANSLATIONY:
StikkyCompat.setTranslationY(animatorBundle.mView,valueAnimation - translationY);
break;
case PARALLAX:
StikkyCompat.setTranslationY(animatorBundle.mView,animatorBundle.mDelta * translationY);
break;
}
}
}
Program: 27989
Project: 27989
Buggy source:
@Override public void onScroll(int scrolledY){
  StikkyCompat.setTranslationY(getHeader(),Math.max(scrolledY,getMaxTranslation()));
  mTranslationRatio=calculateTranslationRatio(scrolledY);
}

Fixed version (ground truth):
@Override public void onScroll(int scrolledY){
  StikkyCompat.setTranslationY(mHeader,Math.max(scrolledY,getMaxTranslation()));
  mTranslationRatio=calculateTranslationRatio(scrolledY);
}
Program: 27990
Project: 27990
Buggy source:
/** 
 * Called by the   {@link it.carlom.stikkyheader.core.StikkyHeader} to set the {@link HeaderAnimator} up
 */
void setupAnimator(final View header,final int minHeightHeader,final int heightHeader,final int maxTranslation){
  this.mHeader=header;
  this.mMinHeightHeader=minHeightHeader;
  this.mHeightHeader=heightHeader;
  this.mMaxTranslation=maxTranslation;
  onAnimatorAttached();
  mHeader.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener(){
    @Override public void onGlobalLayout(){
      mHeader.getViewTreeObserver().removeGlobalOnLayoutListener(this);
      onAnimatorReady();
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Called by the   {@link it.carlom.stikkyheader.core.StikkyHeader} to set the {@link HeaderAnimator} up
 */
void setupAnimator(final View header,final int minHeightHeader){
  this.mHeader=header;
  this.mMinHeightHeader=minHeightHeader;
  onAnimatorAttached();
  mHeader.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener(){
    @Override public void onGlobalLayout(){
      mHeader.getViewTreeObserver().removeGlobalOnLayoutListener(this);
      onAnimatorReady();
    }
  }
);
}
Program: 27991
Project: 27991
Buggy source:
protected void measureHeaderHeight(){
  int height=mHeader.getHeight();
  if (height == 0) {
    mHeader.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener(){
      @Override public void onGlobalLayout(){
        mHeader.getViewTreeObserver().removeGlobalOnLayoutListener(this);
        int height=mHeader.getHeight();
        setHeightHeader(height);
      }
    }
);
  }
 else {
    setHeightHeader(height);
  }
}

Fixed version (ground truth):
protected void measureHeaderHeight(){
  int height=mHeader.getHeight();
  if (height == 0) {
    final ViewGroup.LayoutParams lp=mHeader.getLayoutParams();
    if (lp != null) {
      height=lp.height;
    }
    if (height <= 0) {
      mHeader.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener(){
        @Override public void onGlobalLayout(){
          mHeader.getViewTreeObserver().removeGlobalOnLayoutListener(this);
          int height=mHeader.getHeight();
          setHeightHeader(height);
        }
      }
);
      return;
    }
  }
  setHeightHeader(height);
}
Program: 27992
Project: 27992
Buggy source:
protected void setupAnimator(){
  mHeaderAnimator.setupAnimator(mHeader,mMinHeightHeader,mHeightHeader,mMaxHeaderTranslation);
}

Fixed version (ground truth):
protected void setupAnimator(){
  mHeaderAnimator.setupAnimator(mHeader,mMinHeightHeader);
}
Program: 27993
Project: 27993
Buggy source:
private int calculateScrollYList(){
  View c=mListView.getChildAt(0);
  if (c == null) {
    return 0;
  }
  int firstVisiblePosition=mListView.getFirstVisiblePosition();
  int top=c.getTop();
  int headerHeight=0;
  if (firstVisiblePosition >= 1) {
    headerHeight=mHeightHeader;
  }
  return -top + firstVisiblePosition * c.getHeight() + headerHeight;
}

Fixed version (ground truth):
private int calculateScrollYList(){
  View c=mListView.getChildAt(0);
  if (c == null) {
    return 0;
  }
  int firstVisiblePosition=mListView.getFirstVisiblePosition();
  int headerHeight=0;
  if (firstVisiblePosition >= 1) {
    headerHeight=mHeightHeader;
  }
  return -c.getTop() + firstVisiblePosition * c.getHeight() + headerHeight;
}
Program: 27994
Project: 27994
Buggy source:
private void init(){
  measureHeaderHeight();
  setupAnimator();
  setupOnScrollListener();
}

Fixed version (ground truth):
private void init(){
  setupAnimator();
  measureHeaderHeight();
}
Program: 27995
Project: 27995
Buggy source:
@Override protected void setHeightHeader(int heightHeader){
  super.setHeightHeader(heightHeader);
  setupItemDecorator();
}

Fixed version (ground truth):
@Override protected void setHeightHeader(int heightHeader){
  super.setHeightHeader(heightHeader);
  setupItemDecorator();
  setupOnScrollListener();
}
Program: 27996
Project: 27996
Buggy source:
private void setupItemDecorator(){
  final RecyclerView.LayoutManager layoutManager=mRecyclerView.getLayoutManager();
  if (layoutManager instanceof GridLayoutManager) {
    int orientation=((GridLayoutManager)layoutManager).getOrientation();
switch (orientation) {
case LinearLayoutManager.VERTICAL:
      mRecyclerView.addItemDecoration(new RecyclerView.ItemDecoration(){
        @Override public void getItemOffsets(        Rect outRect,        View view,        RecyclerView parent,        RecyclerView.State state){
          super.getItemOffsets(outRect,view,parent,state);
          int position=parent.getChildLayoutPosition(view);
          if (position < ((GridLayoutManager)layoutManager).getSpanCount()) {
            outRect.top=mHeightHeader;
          }
        }
      }
);
    break;
case LinearLayoutManager.HORIZONTAL:
  break;
}
}
 else if (layoutManager instanceof LinearLayoutManager) {
int orientation=((LinearLayoutManager)layoutManager).getOrientation();
switch (orientation) {
case LinearLayoutManager.VERTICAL:
mRecyclerView.addItemDecoration(new RecyclerView.ItemDecoration(){
  @Override public void getItemOffsets(  Rect outRect,  View view,  RecyclerView parent,  RecyclerView.State state){
    super.getItemOffsets(outRect,view,parent,state);
    int position=parent.getChildLayoutPosition(view);
    if (position == 0) {
      outRect.top=mHeightHeader;
    }
  }
}
);
break;
case LinearLayoutManager.HORIZONTAL:
break;
}
}
}

Fixed version (ground truth):
private void setupItemDecorator(){
  final RecyclerView.LayoutManager layoutManager=mRecyclerView.getLayoutManager();
  if (layoutManager instanceof GridLayoutManager) {
    int orientation=((GridLayoutManager)layoutManager).getOrientation();
switch (orientation) {
case LinearLayoutManager.VERTICAL:
      mRecyclerView.addItemDecoration(new RecyclerView.ItemDecoration(){
        @Override public void getItemOffsets(        Rect outRect,        View view,        RecyclerView parent,        RecyclerView.State state){
          super.getItemOffsets(outRect,view,parent,state);
          int position=parent.getChildAdapterPosition(view);
          if (position < ((GridLayoutManager)layoutManager).getSpanCount()) {
            outRect.top=mHeightHeader;
          }
        }
      }
);
    break;
case LinearLayoutManager.HORIZONTAL:
  throw new IllegalStateException("String_Node_Str");
}
}
 else if (layoutManager instanceof LinearLayoutManager) {
int orientation=((LinearLayoutManager)layoutManager).getOrientation();
switch (orientation) {
case LinearLayoutManager.VERTICAL:
mRecyclerView.addItemDecoration(new RecyclerView.ItemDecoration(){
  @Override public void getItemOffsets(  Rect outRect,  View view,  RecyclerView parent,  RecyclerView.State state){
    super.getItemOffsets(outRect,view,parent,state);
    if (parent.getChildAdapterPosition(view) == 0) {
      outRect.top=mHeightHeader;
    }
  }
}
);
break;
case LinearLayoutManager.HORIZONTAL:
throw new IllegalStateException("String_Node_Str");
}
}
}
Program: 27997
Project: 27997
Buggy source:
private void setupOnScrollListener(){
  mRecyclerView.setOnScrollListener(new OnScrollListenerRecycler());
}

Fixed version (ground truth):
private void setupOnScrollListener(){
  if (mOnScrollerListenerStikky != null) {
    mRecyclerView.removeOnScrollListener(mOnScrollerListenerStikky);
  }
  mScrolledY=Integer.MIN_VALUE;
  mOnScrollerListenerStikky=new OnScrollListenerStikky();
  mRecyclerView.addOnScrollListener(mOnScrollerListenerStikky);
}
Program: 27998
Project: 27998
Buggy source:
@Override public void onScrolled(RecyclerView recyclerView,int dx,int dy){
  super.onScrolled(recyclerView,dx,dy);
  mScrolledY+=dy;
  mHeaderAnimator.onScroll(-mScrolledY);
}

Fixed version (ground truth):
@Override public void onScrolled(RecyclerView recyclerView,int dx,int dy){
  super.onScrolled(recyclerView,dx,dy);
  if (mScrolledY == Integer.MIN_VALUE) {
    mScrolledY=calculateScrollRecyclerView();
  }
 else {
    mScrolledY+=dy;
  }
  mHeaderAnimator.onScroll(-mScrolledY);
}