nus-yam/ex-repair huggingface dataset:
Program: 171190
Project: 171190
Buggy source:
private void adjustAxisAnchors(){
  axis.forEach(axis -> {
    if (Orientation.HORIZONTAL == axis.getOrientation()) {
      AnchorPane.setLeftAnchor(axis,hasLeftYAxis ? leftAxisWidth : 0d);
      AnchorPane.setRightAnchor(axis,hasRightYAxis ? rightAxisWidth : 0d);
      AnchorPane.setLeftAnchor(xyPane,hasLeftYAxis ? leftAxisWidth : 0d);
      AnchorPane.setRightAnchor(xyPane,hasRightYAxis ? rightAxisWidth : 0d);
    }
 else {
      AnchorPane.setTopAnchor(axis,hasTopXAxis ? topAxisHeight : 0d);
      AnchorPane.setBottomAnchor(axis,hasBottomXAxis ? bottomAxisHeight : 0d);
      AnchorPane.setTopAnchor(xyPane,hasTopXAxis ? topAxisHeight : 0d);
      AnchorPane.setBottomAnchor(xyPane,hasBottomXAxis ? bottomAxisHeight : 0d);
    }
  }
);
  if (hasCenterYAxis) {
    AnchorPane.setLeftAnchor(yAxisC,yAxisC.getZeroPosition());
  }
  if (hasCenterXAxis) {
    AnchorPane.setTopAnchor(xAxisC,xAxisC.getZeroPosition());
  }
}

Fixed version (ground truth):
private void adjustAxisAnchors(){
  axis.forEach(axis -> {
    if (Orientation.HORIZONTAL == axis.getOrientation()) {
      AnchorPane.setLeftAnchor(axis,hasLeftYAxis ? leftAxisWidth : 0d);
      AnchorPane.setRightAnchor(axis,hasRightYAxis ? rightAxisWidth : 0d);
      AnchorPane.setLeftAnchor(xyPane,hasLeftYAxis ? leftAxisWidth : 0d);
      AnchorPane.setRightAnchor(xyPane,hasRightYAxis ? rightAxisWidth : 0d);
    }
 else {
      AnchorPane.setTopAnchor(axis,hasTopXAxis ? topAxisHeight : 0d);
      AnchorPane.setBottomAnchor(axis,hasBottomXAxis ? bottomAxisHeight : 0d);
      AnchorPane.setTopAnchor(xyPane,hasTopXAxis ? topAxisHeight : 0d);
      AnchorPane.setBottomAnchor(xyPane,hasBottomXAxis ? bottomAxisHeight : 0d);
    }
  }
);
}
Program: 171191
Project: 171191
Buggy source:
private void adjustChartRange(){
  if (hasBottomXAxis) {
    xyPane.setLowerBoundX(xAxisB.getMinValue());
    xyPane.setUpperBoundX(xAxisB.getMaxValue());
  }
 else   if (hasTopXAxis) {
    xyPane.setLowerBoundX(xAxisT.getMinValue());
    xyPane.setUpperBoundX(xAxisT.getMaxValue());
  }
  if (hasLeftYAxis) {
    xyPane.setLowerBoundY(yAxisL.getMinValue());
    xyPane.setUpperBoundY(yAxisL.getMaxValue());
  }
 else   if (hasRightYAxis) {
    xyPane.setLowerBoundY(yAxisR.getMinValue());
    xyPane.setUpperBoundY(yAxisR.getMaxValue());
  }
}

Fixed version (ground truth):
private void adjustChartRange(){
  if (hasBottomXAxis) {
    xyPane.setLowerBoundX(xAxisB.getMinValue());
    xyPane.setUpperBoundX(xAxisB.getMaxValue());
  }
 else   if (hasTopXAxis) {
    xyPane.setLowerBoundX(xAxisT.getMinValue());
    xyPane.setUpperBoundX(xAxisT.getMaxValue());
  }
 else   if (hasCenterXAxis) {
    xyPane.setLowerBoundX(xAxisC.getMinValue());
    xyPane.setUpperBoundX(xAxisC.getMaxValue());
  }
  if (hasLeftYAxis) {
    xyPane.setLowerBoundY(yAxisL.getMinValue());
    xyPane.setUpperBoundY(yAxisL.getMaxValue());
  }
 else   if (hasRightYAxis) {
    xyPane.setLowerBoundY(yAxisR.getMinValue());
    xyPane.setUpperBoundY(yAxisR.getMaxValue());
  }
 else   if (hasCenterYAxis) {
    xyPane.setLowerBoundY(yAxisC.getMinValue());
    xyPane.setUpperBoundY(yAxisC.getMaxValue());
  }
}
Program: 171192
Project: 171192
Buggy source:
private void registerListeners(){
  widthProperty().addListener(o -> resize());
  heightProperty().addListener(o -> resize());
}

Fixed version (ground truth):
private void registerListeners(){
  widthProperty().addListener(o -> resize());
  heightProperty().addListener(o -> resize());
  if (null != getScene()) {
    setupBinding();
  }
 else {
    sceneProperty().addListener((o1,ov1,nv1) -> {
      if (null == nv1) {
        return;
      }
      if (null != getScene().getWindow()) {
        setupBinding();
      }
 else {
        sceneProperty().get().windowProperty().addListener((o2,ov2,nv2) -> {
          if (null == nv2) {
            return;
          }
          setupBinding();
        }
);
      }
    }
);
  }
}
Program: 171193
Project: 171193
Buggy source:
private void resize(){
  width=getWidth() - getInsets().getLeft() - getInsets().getRight();
  height=getHeight() - getInsets().getTop() - getInsets().getBottom();
  if (width > 0 && height > 0) {
    pane.setMaxSize(width,height);
    pane.setPrefSize(width,height);
    pane.relocate((getWidth() - width) * 0.5,(getHeight() - height) * 0.5);
  }
}

Fixed version (ground truth):
private void resize(){
  width=getWidth() - getInsets().getLeft() - getInsets().getRight();
  height=getHeight() - getInsets().getTop() - getInsets().getBottom();
  if (width > 0 && height > 0) {
    pane.setMaxSize(width,height);
    pane.setPrefSize(width,height);
    pane.relocate((getWidth() - width) * 0.5,(getHeight() - height) * 0.5);
    adjustCenterAxisAnchors();
  }
}
Program: 171194
Project: 171194
Buggy source:
@Override public void init(){
  xAxisBottom=new Axis(-20,20,Orientation.HORIZONTAL,Position.BOTTOM);
  xAxisBottom.setPrefHeight(20);
  AnchorPane.setLeftAnchor(xAxisBottom,20d);
  AnchorPane.setRightAnchor(xAxisBottom,20d);
  AnchorPane.setBottomAnchor(xAxisBottom,0d);
  xAxisTop=new Axis(0,100,Orientation.HORIZONTAL,Position.TOP);
  xAxisTop.setPrefHeight(20);
  AnchorPane.setLeftAnchor(xAxisTop,20d);
  AnchorPane.setRightAnchor(xAxisTop,20d);
  AnchorPane.setTopAnchor(xAxisTop,0d);
  yAxisLeft=new Axis(-20,20,Orientation.VERTICAL,Position.LEFT);
  yAxisLeft.setPrefWidth(20);
  AnchorPane.setLeftAnchor(yAxisLeft,0d);
  AnchorPane.setTopAnchor(yAxisLeft,20d);
  AnchorPane.setBottomAnchor(yAxisLeft,20d);
  Converter tempConverter=new Converter(TEMPERATURE,CELSIUS);
  double tempFahrenheitMin=tempConverter.convert(-20,FAHRENHEIT);
  double tempFahrenheitMax=tempConverter.convert(20,FAHRENHEIT);
  yAxisRight=new Axis(tempFahrenheitMin,tempFahrenheitMax,Orientation.VERTICAL,Position.RIGHT);
  yAxisRight.setPrefWidth(20);
  yAxisRight.setAutoScale(false);
  AnchorPane.setRightAnchor(yAxisRight,0d);
  AnchorPane.setTopAnchor(yAxisRight,20d);
  AnchorPane.setBottomAnchor(yAxisRight,20d);
}

Fixed version (ground truth):
@Override public void init(){
  xAxisBottom=Helper.createBottomAxis(-20,20,AXIS_WIDTH);
  xAxisTop=Helper.createTopAxis(0,100,AXIS_WIDTH);
  yAxisLeft=Helper.createLeftAxis(-20,20,AXIS_WIDTH);
  Converter tempConverter=new Converter(TEMPERATURE,CELSIUS);
  double tempFahrenheitMin=tempConverter.convert(-20,FAHRENHEIT);
  double tempFahrenheitMax=tempConverter.convert(20,FAHRENHEIT);
  yAxisRight=Helper.createRightAxis(tempFahrenheitMin,tempFahrenheitMax,false,AXIS_WIDTH);
}
Program: 171198
Project: 171198
Buggy source:
private void adjustAxisAnchors(){
  axis.forEach(axis -> {
    if (Orientation.HORIZONTAL == axis.getOrientation()) {
      AnchorPane.setLeftAnchor(axis,hasLeftYAxis ? AXIS_WIDTH : 0d);
      AnchorPane.setRightAnchor(axis,hasRightYAxis ? AXIS_WIDTH : 0d);
      AnchorPane.setLeftAnchor(xyPane,hasLeftYAxis ? AXIS_WIDTH : 0d);
      AnchorPane.setRightAnchor(xyPane,hasRightYAxis ? AXIS_WIDTH : 0d);
    }
 else {
      AnchorPane.setTopAnchor(axis,hasTopXAxis ? AXIS_WIDTH : 0d);
      AnchorPane.setBottomAnchor(axis,hasBottomXAxis ? AXIS_WIDTH : 0d);
      AnchorPane.setTopAnchor(xyPane,hasTopXAxis ? AXIS_WIDTH : 0d);
      AnchorPane.setBottomAnchor(xyPane,hasBottomXAxis ? AXIS_WIDTH : 0d);
    }
  }
);
  if (hasCenterYAxis) {
    AnchorPane.setLeftAnchor(yAxisC,yAxisC.getZeroPosition());
  }
  if (hasCenterXAxis) {
    AnchorPane.setTopAnchor(xAxisC,xAxisC.getZeroPosition());
  }
}

Fixed version (ground truth):
private void adjustAxisAnchors(){
  axis.forEach(axis -> {
    if (Orientation.HORIZONTAL == axis.getOrientation()) {
      AnchorPane.setLeftAnchor(axis,hasLeftYAxis ? leftAxisWidth : 0d);
      AnchorPane.setRightAnchor(axis,hasRightYAxis ? rightAxisWidth : 0d);
      AnchorPane.setLeftAnchor(xyPane,hasLeftYAxis ? leftAxisWidth : 0d);
      AnchorPane.setRightAnchor(xyPane,hasRightYAxis ? rightAxisWidth : 0d);
    }
 else {
      AnchorPane.setTopAnchor(axis,hasTopXAxis ? topAxisHeight : 0d);
      AnchorPane.setBottomAnchor(axis,hasBottomXAxis ? bottomAxisHeight : 0d);
      AnchorPane.setTopAnchor(xyPane,hasTopXAxis ? topAxisHeight : 0d);
      AnchorPane.setBottomAnchor(xyPane,hasBottomXAxis ? bottomAxisHeight : 0d);
    }
  }
);
  if (hasCenterYAxis) {
    AnchorPane.setLeftAnchor(yAxisC,yAxisC.getZeroPosition());
  }
  if (hasCenterXAxis) {
    AnchorPane.setTopAnchor(xAxisC,xAxisC.getZeroPosition());
  }
}
Program: 171199
Project: 171199
Buggy source:
private void adjustGridAnchors(){
  if (null == grid)   return;
  AnchorPane.setLeftAnchor(grid,hasLeftYAxis ? AXIS_WIDTH : 0d);
  AnchorPane.setRightAnchor(grid,hasRightYAxis ? AXIS_WIDTH : 0d);
  AnchorPane.setTopAnchor(grid,hasTopXAxis ? AXIS_WIDTH : 0d);
  AnchorPane.setBottomAnchor(grid,hasBottomXAxis ? AXIS_WIDTH : 0d);
}

Fixed version (ground truth):
private void adjustGridAnchors(){
  if (null == grid)   return;
  AnchorPane.setLeftAnchor(grid,hasLeftYAxis ? leftAxisWidth : 0d);
  AnchorPane.setRightAnchor(grid,hasRightYAxis ? rightAxisWidth : 0d);
  AnchorPane.setTopAnchor(grid,hasTopXAxis ? topAxisHeight : 0d);
  AnchorPane.setBottomAnchor(grid,hasBottomXAxis ? bottomAxisHeight : 0d);
}
Program: 171200
Project: 171200
Buggy source:
private void checkForAxis(){
  axis.forEach(axis -> {
    Position position=axis.getPosition();
switch (axis.getOrientation()) {
case HORIZONTAL:
switch (position) {
case TOP:
        hasTopXAxis=true;
      xAxisT=axis;
    break;
case CENTER:
  hasCenterXAxis=true;
xAxisC=axis;
break;
case BOTTOM:
hasBottomXAxis=true;
xAxisB=axis;
break;
default :
hasTopXAxis=false;
hasCenterXAxis=false;
hasBottomXAxis=false;
break;
}
break;
case VERTICAL:
switch (position) {
case LEFT:
hasLeftYAxis=true;
yAxisL=axis;
break;
case CENTER:
hasCenterYAxis=true;
yAxisC=axis;
break;
case RIGHT:
hasRightYAxis=true;
yAxisR=axis;
break;
default :
hasLeftYAxis=false;
hasCenterYAxis=false;
hasRightYAxis=false;
break;
}
break;
}
}
);
}

Fixed version (ground truth):
private void checkForAxis(){
  axis.forEach(axis -> {
    Position position=axis.getPosition();
switch (axis.getOrientation()) {
case HORIZONTAL:
switch (position) {
case TOP:
        hasTopXAxis=true;
      topAxisHeight=axis.getPrefHeight();
    xAxisT=axis;
  break;
case CENTER:
hasCenterXAxis=true;
xAxisC=axis;
break;
case BOTTOM:
hasBottomXAxis=true;
bottomAxisHeight=axis.getPrefHeight();
xAxisB=axis;
break;
default :
hasTopXAxis=false;
hasCenterXAxis=false;
hasBottomXAxis=false;
break;
}
break;
case VERTICAL:
switch (position) {
case LEFT:
hasLeftYAxis=true;
leftAxisWidth=axis.getPrefWidth();
yAxisL=axis;
break;
case CENTER:
hasCenterYAxis=true;
yAxisC=axis;
break;
case RIGHT:
hasRightYAxis=true;
rightAxisWidth=axis.getPrefWidth();
yAxisR=axis;
break;
default :
hasLeftYAxis=false;
hasCenterYAxis=false;
hasRightYAxis=false;
break;
}
break;
}
}
);
}
Program: 171202
Project: 171202
Buggy source:
public DoubleProperty valueProperty(){
  if (null == value) {
    value=new DoublePropertyBase(_value){
      @Override public void set(      final double VALUE){
        oldValue=get();
        super.set(VALUE);
      }
      @Override protected void invalidated(){
        if (isAnimated()) {
          timeline.stop();
          KeyValue kv1=new KeyValue(currentValue,getOldValue(),Interpolator.EASE_BOTH);
          KeyValue kv2=new KeyValue(currentValue,get(),Interpolator.EASE_BOTH);
          KeyFrame kf1=new KeyFrame(Duration.ZERO,kv1);
          KeyFrame kf2=new KeyFrame(Duration.millis(animationDuration),kv2);
          timeline.getKeyFrames().setAll(kf1,kf2);
          timeline.play();
        }
 else {
          fireItemEvent(FINISHED_EVENT);
        }
      }
      @Override public Object getBean(){
        return ChartItem.this;
      }
      @Override public String getName(){
        return "String_Node_Str";
      }
    }
;
  }
  return value;
}

Fixed version (ground truth):
public DoubleProperty valueProperty(){
  if (null == value) {
    value=new DoublePropertyBase(_value){
      @Override public void set(      final double VALUE){
        oldValue=get();
        super.set(VALUE);
      }
      @Override protected void invalidated(){
        if (isAnimated()) {
          if (timeline.getCurrentRate() > 0) {
            oldValue=get();
          }
 else {
            oldValue=get();
            timeline.stop();
            KeyValue kv1=new KeyValue(currentValue,oldValue,Interpolator.EASE_BOTH);
            KeyValue kv2=new KeyValue(currentValue,get(),Interpolator.EASE_BOTH);
            KeyFrame kf1=new KeyFrame(Duration.ZERO,kv1);
            KeyFrame kf2=new KeyFrame(Duration.millis(animationDuration),kv2);
            timeline.getKeyFrames().setAll(kf1,kf2);
            timeline.play();
          }
        }
 else {
          fireItemEvent(FINISHED_EVENT);
        }
      }
      @Override public Object getBean(){
        return ChartItem.this;
      }
      @Override public String getName(){
        return "String_Node_Str";
      }
    }
;
  }
  return value;
}
Program: 171203
Project: 171203
Buggy source:
public ChartItem(final String NAME,final double VALUE,final Color FILL,final Color STROKE,final Color TEXT_COLOR,final Instant TIMESTAMP,final boolean ANIMATED,final long ANIMATION_DURATION){
  _name=NAME;
  _value=VALUE;
  oldValue=0;
  _fill=FILL;
  _stroke=STROKE;
  _textColor=TEXT_COLOR;
  _timestamp=TIMESTAMP;
  _symbol=Symbol.NONE;
  _animated=ANIMATED;
  currentValue=new DoublePropertyBase(_value){
    @Override protected void invalidated(){
      oldValue=getValue();
      setValue(get());
      fireItemEvent(UPDATE_EVENT);
    }
    @Override public Object getBean(){
      return ChartItem.this;
    }
    @Override public String getName(){
      return "String_Node_Str";
    }
  }
;
  timeline=new Timeline();
  animationDuration=ANIMATION_DURATION;
  timeline.setOnFinished(e -> fireItemEvent(FINISHED_EVENT));
}

Fixed version (ground truth):
public ChartItem(final String NAME,final double VALUE,final Color FILL,final Color STROKE,final Color TEXT_COLOR,final Instant TIMESTAMP,final boolean ANIMATED,final long ANIMATION_DURATION){
  _name=NAME;
  _value=VALUE;
  oldValue=0;
  _fill=FILL;
  _stroke=STROKE;
  _textColor=TEXT_COLOR;
  _timestamp=TIMESTAMP;
  _symbol=Symbol.NONE;
  _animated=ANIMATED;
  currentValue=new DoublePropertyBase(_value){
    @Override protected void invalidated(){
      oldValue=ChartItem.this.getValue();
      ChartItem.this.setValue(get());
      fireItemEvent(UPDATE_EVENT);
    }
    @Override public Object getBean(){
      return ChartItem.this;
    }
    @Override public String getName(){
      return "String_Node_Str";
    }
  }
;
  timeline=new Timeline();
  animationDuration=ANIMATION_DURATION;
  timeline.setOnFinished(e -> fireItemEvent(FINISHED_EVENT));
}
Program: 171204
Project: 171204
Buggy source:
public void setValue(final double VALUE){
  if (null == value) {
    if (isAnimated()) {
      oldValue=_value;
      _value=VALUE;
      timeline.stop();
      KeyValue kv1=new KeyValue(currentValue,oldValue,Interpolator.EASE_BOTH);
      KeyValue kv2=new KeyValue(currentValue,VALUE,Interpolator.EASE_BOTH);
      KeyFrame kf1=new KeyFrame(Duration.ZERO,kv1);
      KeyFrame kf2=new KeyFrame(Duration.millis(animationDuration),kv2);
      timeline.getKeyFrames().setAll(kf1,kf2);
      timeline.play();
    }
 else {
      oldValue=_value;
      _value=VALUE;
      fireItemEvent(FINISHED_EVENT);
    }
  }
 else {
    value.set(VALUE);
  }
}

Fixed version (ground truth):
public void setValue(final double VALUE){
  if (null == value) {
    if (isAnimated()) {
      if (timeline.getCurrentRate() > 0) {
        oldValue=_value;
        _value=VALUE;
      }
 else {
        oldValue=_value;
        _value=VALUE;
        timeline.stop();
        KeyValue kv1=new KeyValue(currentValue,oldValue,Interpolator.EASE_BOTH);
        KeyValue kv2=new KeyValue(currentValue,VALUE,Interpolator.EASE_BOTH);
        KeyFrame kf1=new KeyFrame(Duration.ZERO,kv1);
        KeyFrame kf2=new KeyFrame(Duration.millis(animationDuration),kv2);
        timeline.getKeyFrames().setAll(kf1,kf2);
        timeline.play();
      }
    }
 else {
      oldValue=_value;
      _value=VALUE;
      fireItemEvent(FINISHED_EVENT);
    }
  }
 else {
    value.set(VALUE);
  }
}
Program: 171205
Project: 171205
Buggy source:
public void setDecimals(final int DECIMALS){
  if (null == decimals) {
    _decimals=DECIMALS;
    redraw();
  }
 else {
    decimals.set(DECIMALS);
  }
}

Fixed version (ground truth):
public void setDecimals(final int DECIMALS){
  if (null == decimals) {
    _decimals=Helper.clamp(0,12,DECIMALS);
    tickLabelFormatString=new StringBuilder("String_Node_Str").append(Integer.toString(_decimals)).append("String_Node_Str").toString();
    redraw();
  }
 else {
    decimals.set(DECIMALS);
  }
}
Program: 171206
Project: 171206
Buggy source:
public IntegerProperty decimals(){
  if (null == decimals) {
    decimals=new IntegerPropertyBase(_decimals){
      @Override protected void invalidated(){
        redraw();
      }
      @Override public Object getBean(){
        return Axis.this;
      }
      @Override public String getName(){
        return "String_Node_Str";
      }
    }
;
  }
  return decimals;
}

Fixed version (ground truth):
public IntegerProperty decimals(){
  if (null == decimals) {
    decimals=new IntegerPropertyBase(_decimals){
      @Override protected void invalidated(){
        set(Helper.clamp(0,12,get()));
        tickLabelFormatString=new StringBuilder("String_Node_Str").append(Integer.toString(get())).append("String_Node_Str").toString();
        redraw();
      }
      @Override public Object getBean(){
        return Axis.this;
      }
      @Override public String getName(){
        return "String_Node_Str";
      }
    }
;
  }
  return decimals;
}
Program: 171208
Project: 171208
Buggy source:
private void drawSmoothLine(final double TENSION,final boolean IS_CLOSED,final int NUMBER_OF_SEGMENTS,final boolean SHOW_POINTS){
  List<Double> pointList=new ArrayList<>(model.getItems().size() * 2);
  model.getItems().forEach(item -> {
    pointList.add(item.getX());
    pointList.add(item.getY());
  }
);
  Double[] points=new Double[pointList.size()];
  points=pointList.toArray(points);
  List<Double> curvePoints=getCurvePoints(points,TENSION,IS_CLOSED,NUMBER_OF_SEGMENTS);
  ctx.beginPath();
  for (int i=2; i < curvePoints.size() - 1; i+=2) {
    ctx.lineTo(curvePoints.get(i) * scaleX,curvePoints.get(i + 1) * scaleY);
  }
  ctx.stroke();
  if (SHOW_POINTS) {
    model.getItems().forEach(item -> drawSymbol(item.getX() * scaleX,item.getY() * scaleY,item.getColor(),item.getSymbol()));
  }
}

Fixed version (ground truth):
private void drawSmoothLine(final double TENSION,final boolean IS_CLOSED,final int NUMBER_OF_SEGMENTS,final boolean SHOW_POINTS){
  List<Double> pointList=new ArrayList<>(model.getItems().size() * 2);
  model.getItems().forEach(item -> {
    pointList.add(item.getX());
    pointList.add(item.getY());
  }
);
  Double[] points=new Double[pointList.size()];
  points=pointList.toArray(points);
  List<Double> curvePoints=getCurvePoints(points,TENSION,IS_CLOSED,NUMBER_OF_SEGMENTS);
  ctx.beginPath();
  for (int i=2; i < curvePoints.size() - 1; i+=2) {
    ctx.lineTo(curvePoints.get(i) * scaleX,height - curvePoints.get(i + 1) * scaleY);
  }
  ctx.stroke();
  if (SHOW_POINTS) {
    drawSymbols();
  }
}
Program: 171211
Project: 171211
Buggy source:
@Override protected Long handleInternally(JSONObject content){
  final Long guildId=content.has("String_Node_Str") ? content.getLong("String_Node_Str") : null;
  if (guildId != null && api.getGuildLock().isLocked(guildId))   return guildId;
  if (guildId == null)   return super.handleInternally(content);
  final long userId=content.getLong("String_Node_Str");
  final Long channelId=!content.isNull("String_Node_Str") ? content.getLong("String_Node_Str") : null;
  Guild guild=api.getGuildById(guildId);
  if (guild == null)   return super.handleInternally(content);
  Member member=guild.getMemberById(userId);
  if (member == null)   return super.handleInternally(content);
  if (!member.equals(guild.getSelfMember()))   return super.handleInternally(content);
  VoiceChannel channel=channelId != null ? guild.getVoiceChannelById(channelId) : null;
  JdaLink link=lavalink.getLink(guildId.toString());
  if (channelId == null) {
    if (link.getState() != Link.State.DESTROYED) {
      link.onDisconnected();
    }
  }
 else   if (channel != null) {
    link.setChannel(channel);
  }
  if (link.getState() == Link.State.CONNECTED) {
    api.getClient().updateAudioConnection(guildId,channel);
  }
  return super.handleInternally(content);
}

Fixed version (ground truth):
@Override protected Long handleInternally(JSONObject content){
  final Long guildId=content.has("String_Node_Str") ? content.getLong("String_Node_Str") : null;
  if (guildId != null && api.getGuildLock().isLocked(guildId))   return guildId;
  if (guildId == null)   return super.handleInternally(content);
  final long userId=content.getLong("String_Node_Str");
  final Long channelId=!content.isNull("String_Node_Str") ? content.getLong("String_Node_Str") : null;
  Guild guild=api.getGuildById(guildId);
  if (guild == null)   return super.handleInternally(content);
  Member member=guild.getMemberById(userId);
  if (member == null)   return super.handleInternally(content);
  if (!member.equals(guild.getSelfMember()))   return super.handleInternally(content);
  VoiceChannel channel=channelId != null ? guild.getVoiceChannelById(channelId) : null;
  JdaLink link=lavalink.getLink(guildId.toString());
  if (channelId == null) {
    if (link.getState() != Link.State.DESTROYED) {
      link.onDisconnected();
    }
  }
 else   if (channel != null) {
    link.setChannel(channel.getId());
  }
  if (link.getState() == Link.State.CONNECTED) {
    api.getClient().updateAudioConnection(guildId,channel);
  }
  return super.handleInternally(content);
}
Program: 171213
Project: 171213
Buggy source:
@Override public void onTrackEnd(IPlayer player,AudioTrack track,AudioTrackEndReason endReason){
  ((LavalinkPlayer)player).clearTrack();
}

Fixed version (ground truth):
@Override public void onTrackEnd(IPlayer player,AudioTrack track,AudioTrackEndReason endReason){
  if (endReason != AudioTrackEndReason.REPLACED && endReason != AudioTrackEndReason.STOPPED) {
    ((LavalinkPlayer)player).clearTrack();
  }
}
Program: 171214
Project: 171214
Buggy source:
private Penalties(LavalinkSocket socket,long guild,List<PenaltyProvider> penaltyProviders){
  this.socket=socket;
  this.guild=guild;
  if (socket.stats == null)   return;
  playerPenalty=socket.stats.getPlayingPlayers();
  cpuPenalty=(int)Math.pow(1.05d,100 * socket.stats.getSystemLoad()) * 10 - 10;
  if (socket.stats.getAvgFramesDeficitPerMinute() == -1)   return;
  deficitFramePenalty=(int)(Math.pow(1.03d,500f * ((float)socket.stats.getAvgFramesDeficitPerMinute() / 3000f)) * 300 - 300);
  nullFramePenalty=(int)(Math.pow(1.03d,500f * ((float)socket.stats.getAvgFramesNulledPerMinute() / 3000f)) * 300 - 300);
  nullFramePenalty*=2;
  penaltyProviders.forEach(pp -> customPenalties+=pp.getPenalty(this));
}

Fixed version (ground truth):
private Penalties(LavalinkSocket socket,long guild,List<PenaltyProvider> penaltyProviders){
  this.socket=socket;
  this.guild=guild;
  if (socket.stats == null)   return;
  playerPenalty=socket.stats.getPlayingPlayers();
  cpuPenalty=(int)Math.pow(1.05d,100 * socket.stats.getSystemLoad()) * 10 - 10;
  if (socket.stats.getAvgFramesDeficitPerMinute() != -1) {
    deficitFramePenalty=(int)(Math.pow(1.03d,500f * ((float)socket.stats.getAvgFramesDeficitPerMinute() / 3000f)) * 300 - 300);
    nullFramePenalty=(int)(Math.pow(1.03d,500f * ((float)socket.stats.getAvgFramesNulledPerMinute() / 3000f)) * 300 - 300);
    nullFramePenalty*=2;
  }
  penaltyProviders.forEach(pp -> customPenalties+=pp.getPenalty(this));
}
Program: 171215
Project: 171215
Buggy source:
public int getTotal(){
  return playerPenalty + cpuPenalty + deficitFramePenalty+ nullFramePenalty+ customPenalties;
}

Fixed version (ground truth):
public int getTotal(){
  if (socket.stats == null)   return (Integer.MAX_VALUE - 1);
  return playerPenalty + cpuPenalty + deficitFramePenalty+ nullFramePenalty+ customPenalties;
}
Program: 171216
Project: 171216
Buggy source:
private Penalties(LavalinkSocket socket){
  this.socket=socket;
  if (socket.stats == null)   return;
  playerPenalty=socket.stats.getPlayingPlayers();
  cpuPenalty=(int)Math.pow(1.05d,100 * socket.stats.getSystemLoad()) * 10 - 10;
  if (socket.stats.getAvgFramesDeficitPerMinute() == -1)   return;
  deficitFramePenalty=(int)Math.pow(1.02d,200 * (socket.stats.getAvgFramesDeficitPerMinute() / 3000)) * 300 - 300;
  nullFramePenalty=(int)Math.pow(1.02d,200 * (socket.stats.getAvgFramesNulledPerMinute() / 3000)) * 300 - 300;
  nullFramePenalty*=2;
}

Fixed version (ground truth):
private Penalties(LavalinkSocket socket){
  this.socket=socket;
  if (socket.stats == null)   return;
  playerPenalty=socket.stats.getPlayingPlayers();
  cpuPenalty=(int)Math.pow(1.05d,100 * socket.stats.getSystemLoad()) * 10 - 10;
  if (socket.stats.getAvgFramesDeficitPerMinute() == -1)   return;
  deficitFramePenalty=(int)(Math.pow(1.03d,500f * ((float)socket.stats.getAvgFramesNulledPerMinute() / 3000f)) * 300 - 300);
  nullFramePenalty=(int)(Math.pow(1.03d,500f * ((float)socket.stats.getAvgFramesNulledPerMinute() / 3000f)) * 300 - 300);
  nullFramePenalty*=2;
}
Program: 171218
Project: 171218
Buggy source:
@BeforeAll static void setUp(){
  SimpleLog.addListener(new SimpleLogToSLF4JAdapter());
  SimpleLog.LEVEL=SimpleLog.Level.OFF;
  try {
    jda=new JDABuilder(AccountType.BOT).setToken(System.getenv("String_Node_Str")).buildBlocking();
    lavalink=new Lavalink(1,integer -> jda);
    lavalink.addNode(new URI("String_Node_Str"),"String_Node_Str");
    lavalink.interceptJdaAudio(jda);
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
@BeforeAll static void setUp(){
  SimpleLog.addListener(new SimpleLogToSLF4JAdapter());
  SimpleLog.LEVEL=SimpleLog.Level.OFF;
  try {
    jda=new JDABuilder(AccountType.BOT).setToken(System.getenv("String_Node_Str")).addEventListener(lavalink).buildBlocking();
    lavalink=new Lavalink(1,integer -> jda);
    lavalink.addNode(new URI("String_Node_Str"),"String_Node_Str");
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}
Program: 171219
Project: 171219
Buggy source:
public int getTotal(){
  if (!socket.isOpen())   return Integer.MAX_VALUE;
  return playerPenalty + cpuPenalty + deficitFramePenalty+ nullFramePenalty;
}

Fixed version (ground truth):
public int getTotal(){
  if (!socket.isOpen())   return Integer.MAX_VALUE - 1;
  return playerPenalty + cpuPenalty + deficitFramePenalty+ nullFramePenalty;
}
Program: 171220
Project: 171220
Buggy source:
@Override public String toString(){
  if (!socket.isOpen())   return "String_Node_Str" + "String_Node_Str" + Integer.MAX_VALUE + '}';
  return "String_Node_Str" + "String_Node_Str" + playerPenalty + "String_Node_Str"+ cpuPenalty+ "String_Node_Str"+ deficitFramePenalty+ "String_Node_Str"+ nullFramePenalty+ '}';
}

Fixed version (ground truth):
@Override public String toString(){
  if (!socket.isOpen())   return "String_Node_Str" + "String_Node_Str" + (Integer.MAX_VALUE - 1) + '}';
  return "String_Node_Str" + "String_Node_Str" + playerPenalty + "String_Node_Str"+ cpuPenalty+ "String_Node_Str"+ deficitFramePenalty+ "String_Node_Str"+ nullFramePenalty+ '}';
}
Program: 171221
Project: 171221
Buggy source:
public void shutdown(){
  nodes.forEach(WebSocketClient::close);
}

Fixed version (ground truth):
public void shutdown(){
  nodes.forEach(ReusableWebSocket::close);
}
Program: 171226
Project: 171226
Buggy source:
private void hookAdapterInit(XC_MethodHook.MethodHookParam param){
  chatRoomViewPresenter=new ChatRoomViewPresenter(context,Type.CHAT_ROOMS);
  chatRoomViewPresenter.setAdapter(param.thisObject);
  chatRoomViewPresenter.start();
  officialViewPresenter=new ChatRoomViewPresenter(context,Type.OFFICIAL);
  officialViewPresenter.setAdapter(param.thisObject);
  officialViewPresenter.start();
}

Fixed version (ground truth):
private void hookAdapterInit(XC_MethodHook.MethodHookParam param){
  if (chatRoomViewPresenter == null)   chatRoomViewPresenter=new ChatRoomViewPresenter(context,Type.CHAT_ROOMS);
  if (officialViewPresenter == null)   officialViewPresenter=new ChatRoomViewPresenter(context,Type.OFFICIAL);
  chatRoomViewPresenter.setAdapter(param.thisObject);
  chatRoomViewPresenter.start();
  officialViewPresenter.setAdapter(param.thisObject);
  officialViewPresenter.start();
}
Program: 171227
Project: 171227
Buggy source:
private void hookGetCount(XC_MethodHook.MethodHookParam param){
  String clazzName=param.thisObject.getClass().getSimpleName();
  if (!clazzName.equals(Class_Conversation_List_View_Adapter_SimpleName))   return;
  Object tMb=XposedHelpers.getObjectField(param.thisObject,Method_Adapter_Get_Object_Step_1);
  Integer result=(Integer)XposedHelpers.callMethod(tMb,"String_Node_Str");
  if (result == 0)   return;
  if (notifyList) {
    int chatRoomSize=chatRoomListInAdapterPositions.size();
    int officialSize=officialListInAdapterPositions.size();
    int count=result - chatRoomSize + (chatRoomSize > 0 ? 1 : 0);
    count=count - officialSize + (officialSize > 0 ? 1 : 0);
    param.setResult(count);
    LogUtils.INSTANCE.log("String_Node_Str" + result + "String_Node_Str"+ chatRoomSize+ "String_Node_Str"+ officialSize+ "String_Node_Str"+ count);
  }
 else {
    LogUtils.INSTANCE.log("String_Node_Str" + result);
    param.setResult(result);
  }
}

Fixed version (ground truth):
private void hookGetCount(XC_MethodHook.MethodHookParam param){
  String clazzName=param.thisObject.getClass().getSimpleName();
  if (!clazzName.equals(Class_Conversation_List_View_Adapter_SimpleName))   return;
  Object tMb=XposedHelpers.getObjectField(param.thisObject,Method_Adapter_Get_Object_Step_1);
  Integer result=(Integer)XposedHelpers.callMethod(tMb,"String_Node_Str");
  if (result == 0)   return;
  if (notifyList) {
    int chatRoomSize=chatRoomListInAdapterPositions.size();
    int officialSize=officialListInAdapterPositions.size();
    int count=result - chatRoomSize + (chatRoomSize > 0 ? 1 : 0);
    count=count - officialSize + (officialSize > 0 ? 1 : 0);
    param.setResult(count);
  }
 else {
    param.setResult(result);
  }
}
Program: 171228
Project: 171228
Buggy source:
public ChatRoomView(Context context,final ViewGroup container,Type type){
  this.mContainer=(AbsoluteLayout)container;
  this.mContext=context;
  this.type=type;
  int width=ScreenUtils.getScreenWidth(mContext);
  AbsoluteLayout.LayoutParams params=new AbsoluteLayout.LayoutParams(width,ViewGroup.LayoutParams.MATCH_PARENT,0,0);
  mainView=new LinearLayout(mContext);
  mainView.setLayoutParams(new ViewGroup.LayoutParams(ScreenUtils.getScreenWidth(mContext),ViewGroup.LayoutParams.MATCH_PARENT));
  mainView.setOrientation(LinearLayout.VERTICAL);
  mRecyclerView=new RecyclerView(mContext);
  mRecyclerView.setId(android.R.id.list);
  mRecyclerView.setLayoutManager(new LinearLayoutManager(mContext){
    @Override public boolean canScrollVertically(){
      return !isDragging;
    }
  }
);
  mainView.addView(initToolbar());
  mainView.addView(mRecyclerView);
  mainView.setClickable(true);
  mainView.setBackgroundColor(Color.parseColor("String_Node_Str" + AppSaveInfoUtils.INSTANCE.helperColorInfo()));
  initSwipeBack();
  mContainer.addView(swipeBackLayout,params);
  uuid=DeviceUtils.getIMELCode(context);
  ApiManager.INSTANCE.sendRequestForUserStatistics("String_Node_Str",uuid,Build.MODEL);
}

Fixed version (ground truth):
public ChatRoomView(Context context,final ViewGroup container,Type type){
  this.mContainer=container;
  this.mContext=context;
  this.type=type;
  ViewGroup.MarginLayoutParams params=new ViewGroup.MarginLayoutParams(ViewGroup.MarginLayoutParams.MATCH_PARENT,ViewGroup.MarginLayoutParams.MATCH_PARENT);
  mainView=new LinearLayout(mContext);
  mainView.setLayoutParams(new ViewGroup.LayoutParams(ScreenUtils.getScreenWidth(mContext),ViewGroup.LayoutParams.MATCH_PARENT));
  mainView.setOrientation(LinearLayout.VERTICAL);
  mRecyclerView=new RecyclerView(mContext);
  mRecyclerView.setId(android.R.id.list);
  mRecyclerView.setLayoutManager(new LinearLayoutManager(mContext){
    @Override public boolean canScrollVertically(){
      return !isDragging;
    }
  }
);
  mainView.addView(initToolbar());
  mainView.addView(mRecyclerView);
  mainView.setClickable(true);
  mainView.setBackgroundColor(Color.parseColor("String_Node_Str" + AppSaveInfoUtils.INSTANCE.helperColorInfo()));
  initSwipeBack();
  mContainer.addView(swipeBackLayout,params);
  uuid=DeviceUtils.getIMELCode(context);
  ApiManager.INSTANCE.sendRequestForUserStatistics("String_Node_Str",uuid,Build.MODEL);
}
Program: 171229
Project: 171229
Buggy source:
public ChatRoomViewPresenter(Context context,Type type){
  mContext=context;
  chatRoomView=new AbsoluteLayout(context);
  chatRoomView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT));
  chatRoomView.setPadding(0,ScreenUtils.getStatusHeight(context),0,ScreenUtils.getNavigationBarHeight(context));
  mView=new ChatRoomView(context,chatRoomView,type);
  mView.setPresenter(this);
}

Fixed version (ground truth):
public ChatRoomViewPresenter(Context context,Type type){
  mContext=context;
  try {
    Class<?> aClass=XposedHelpers.findClass("String_Node_Str",HookLogic.mClassLoader);
    Constructor<?> constructor=aClass.getConstructor(Context.class);
    chatRoomView=(ViewGroup)constructor.newInstance(context);
  }
 catch (  NoSuchMethodException|InstantiationException|IllegalAccessException|InvocationTargetException e) {
    e.printStackTrace();
  }
  chatRoomView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT));
  chatRoomView.setPadding(0,0,0,0);
  mView=new ChatRoomView(context,chatRoomView,type);
  mView.setPresenter(this);
}
Program: 171234
Project: 171234
Buggy source:
public static TattooWriting loadFromXML(Element parentElement,Document doc){
  try {
    List<TattooWritingStyle> importedStyles=new ArrayList<>();
    try {
      NodeList stylesList=((Element)parentElement.getElementsByTagName("String_Node_Str").item(0)).getElementsByTagName("String_Node_Str");
      for (int i=0; i < stylesList.getLength(); i++) {
        Element e=((Element)stylesList.item(i));
        TattooWritingStyle style=TattooWritingStyle.valueOf(e.getAttribute("String_Node_Str"));
        importedStyles.add(style);
      }
    }
 catch (    Exception ex) {
    }
    TattooWriting tw=new TattooWriting(parentElement.getTextContent(),Colour.valueOf(parentElement.getAttribute("String_Node_Str")),Boolean.valueOf(parentElement.getAttribute("String_Node_Str")));
    tw.styles=importedStyles;
    return tw;
  }
 catch (  Exception ex) {
    System.err.println("String_Node_Str");
    return null;
  }
}

Fixed version (ground truth):
public static TattooWriting loadFromXML(Element parentElement,Document doc){
  try {
    List<TattooWritingStyle> importedStyles=new ArrayList<>();
    try {
      NodeList stylesList=((Element)parentElement.getElementsByTagName("String_Node_Str").item(0)).getElementsByTagName("String_Node_Str");
      for (int i=0; i < stylesList.getLength(); i++) {
        Element e=((Element)stylesList.item(i));
        TattooWritingStyle style=TattooWritingStyle.valueOf(e.getAttribute("String_Node_Str"));
        importedStyles.add(style);
      }
    }
 catch (    Exception ex) {
    }
    String text=parentElement.getTextContent();
    TattooWriting tw=new TattooWriting(text.trim(),Colour.valueOf(parentElement.getAttribute("String_Node_Str")),Boolean.valueOf(parentElement.getAttribute("String_Node_Str")));
    tw.styles=importedStyles;
    return tw;
  }
 catch (  Exception ex) {
    System.err.println("String_Node_Str");
    return null;
  }
}
Program: 171236
Project: 171236
Buggy source:
public boolean isOrificeTypeAvailable(){
  if (sexAreaAccessRequiredForTargeted == null || sexAreaAccessRequiredForTargeted.isEmpty()) {
    return true;
  }
  if (getSexActionType() != null) {
switch (getSexActionType()) {
case REQUIRES_NO_PENETRATION:
      for (      SexAreaInterface sArea : sexAreaAccessRequiredForTargeted) {
        if (!sArea.isFree(characterTargetedForSexAction)) {
          return false;
        }
      }
    return true;
case START_ONGOING:
  for (  SexAreaInterface sArea : sexAreaAccessRequiredForTargeted) {
    if (!sArea.isFree(characterTargetedForSexAction)) {
      return false;
    }
  }
break;
default :
break;
}
}
for (SexAreaInterface sArea : sexAreaAccessRequiredForTargeted) {
if (!characterTargetedForSexAction.isSexAreaExposed(sArea)) {
return false;
}
}
if (getSexActionType() != null) {
switch (getSexActionType()) {
case REQUIRES_NO_PENETRATION_AND_EXPOSED:
for (SexAreaInterface sArea : sexAreaAccessRequiredForTargeted) {
if (!sArea.isFree(characterTargetedForSexAction)) {
return false;
}
}
break;
default :
break;
}
}
return true;
}

Fixed version (ground truth):
public boolean isOrificeTypeAvailable(){
  if (sexAreaAccessRequiredForTargeted == null || sexAreaAccessRequiredForTargeted.isEmpty()) {
    return true;
  }
  if (getSexActionType() != null) {
switch (getSexActionType()) {
case REQUIRES_NO_PENETRATION:
      for (      SexAreaInterface sArea : sexAreaAccessRequiredForTargeted) {
        if (sArea != null && !sArea.isFree(characterTargetedForSexAction)) {
          return false;
        }
      }
    return true;
case START_ONGOING:
  for (  SexAreaInterface sArea : sexAreaAccessRequiredForTargeted) {
    if (sArea != null && !sArea.isFree(characterTargetedForSexAction)) {
      return false;
    }
  }
break;
default :
break;
}
}
for (SexAreaInterface sArea : sexAreaAccessRequiredForTargeted) {
if (!characterTargetedForSexAction.isSexAreaExposed(sArea)) {
return false;
}
}
if (getSexActionType() != null) {
switch (getSexActionType()) {
case REQUIRES_NO_PENETRATION_AND_EXPOSED:
for (SexAreaInterface sArea : sexAreaAccessRequiredForTargeted) {
if (sArea != null && !sArea.isFree(characterTargetedForSexAction)) {
return false;
}
}
break;
default :
break;
}
}
return true;
}
Program: 171239
Project: 171239
Buggy source:
public default List<SexAreaOrifice> getPerformingCharacterOrifices(){
  List<SexAreaOrifice> list=new ArrayList<>();
  if (this.getParticipantType().isUsingSelfOrificeType()) {
    for (    SexAreaInterface sArea : getSexAreaInteractions().values()) {
      if (sArea.isOrifice()) {
        list.add((SexAreaOrifice)sArea);
      }
    }
  }
  return list;
}

Fixed version (ground truth):
public default List<SexAreaOrifice> getPerformingCharacterOrifices(){
  List<SexAreaOrifice> list=new ArrayList<>();
  if (this.getParticipantType().isUsingSelfOrificeType()) {
    for (    SexAreaInterface sArea : getSexAreaInteractions().values()) {
      if (sArea != null && sArea.isOrifice()) {
        list.add((SexAreaOrifice)sArea);
      }
    }
  }
  return list;
}
Program: 171241
Project: 171241
Buggy source:
public default List<SexAreaPenetration> getTargetedCharacterPenetrations(){
  List<SexAreaPenetration> list=new ArrayList<>();
  if (!this.getParticipantType().isUsingSelfPenetrationType()) {
    for (    SexAreaInterface sArea : getSexAreaInteractions().keySet()) {
      if (sArea.isPenetration()) {
        list.add((SexAreaPenetration)sArea);
      }
    }
  }
  return list;
}

Fixed version (ground truth):
public default List<SexAreaPenetration> getTargetedCharacterPenetrations(){
  List<SexAreaPenetration> list=new ArrayList<>();
  if (!this.getParticipantType().isUsingSelfPenetrationType()) {
    for (    SexAreaInterface sArea : getSexAreaInteractions().keySet()) {
      if (sArea != null && sArea.isPenetration()) {
        list.add((SexAreaPenetration)sArea);
      }
    }
  }
  return list;
}
Program: 171242
Project: 171242
Buggy source:
public default List<SexAreaOrifice> getTargetedCharacterOrifices(){
  List<SexAreaOrifice> list=new ArrayList<>();
  if (!this.getParticipantType().isUsingSelfOrificeType()) {
    for (    SexAreaInterface sArea : getSexAreaInteractions().values()) {
      if (sArea.isOrifice()) {
        list.add((SexAreaOrifice)sArea);
      }
    }
  }
  return list;
}

Fixed version (ground truth):
public default List<SexAreaOrifice> getTargetedCharacterOrifices(){
  List<SexAreaOrifice> list=new ArrayList<>();
  if (!this.getParticipantType().isUsingSelfOrificeType()) {
    for (    SexAreaInterface sArea : getSexAreaInteractions().values()) {
      if (sArea != null && sArea.isOrifice()) {
        list.add((SexAreaOrifice)sArea);
      }
    }
  }
  return list;
}
Program: 171243
Project: 171243
Buggy source:
public default List<SexAreaPenetration> getPerformingCharacterPenetrations(){
  List<SexAreaPenetration> list=new ArrayList<>();
  if (this.getParticipantType().isUsingSelfPenetrationType()) {
    for (    SexAreaInterface sArea : getSexAreaInteractions().keySet()) {
      if (sArea.isPenetration()) {
        list.add((SexAreaPenetration)sArea);
      }
    }
  }
  return list;
}

Fixed version (ground truth):
public default List<SexAreaPenetration> getPerformingCharacterPenetrations(){
  List<SexAreaPenetration> list=new ArrayList<>();
  if (this.getParticipantType().isUsingSelfPenetrationType()) {
    for (    SexAreaInterface sArea : getSexAreaInteractions().keySet()) {
      if (sArea != null && sArea.isPenetration()) {
        list.add((SexAreaPenetration)sArea);
      }
    }
  }
  return list;
}
Program: 171245
Project: 171245
Buggy source:
public CumProduction getPenisOrgasmCumQuantity(){
  return CumProduction.getCumProductionFromInt((int)(body.getPenis().getTesticle().getRawStoredCumValue() * getPenisRawCumExpulsionValue()));
}

Fixed version (ground truth):
public CumProduction getPenisOrgasmCumQuantity(){
  return CumProduction.getCumProductionFromInt(getPenisRawOrgasmCumQuantity());
}
Program: 171246
Project: 171246
Buggy source:
public int getPenisRawOrgasmCumQuantity(){
  if (body.getPenis().getTesticle().getRawStoredCumValue() < 5) {
    return body.getPenis().getTesticle().getRawStoredCumValue();
  }
  return (int)(body.getPenis().getTesticle().getRawStoredCumValue() * getPenisRawCumExpulsionValue());
}

Fixed version (ground truth):
public int getPenisRawOrgasmCumQuantity(){
  if (body.getPenis().getTesticle().getRawStoredCumValue() <= Testicle.MINIMUM_VALUE_FOR_ALL_CUM_TO_BE_EXPELLED) {
    return body.getPenis().getTesticle().getRawStoredCumValue();
  }
  return (int)(body.getPenis().getTesticle().getRawStoredCumValue() * (getPenisRawCumExpulsionValue() / 100f));
}
Program: 171247
Project: 171247
Buggy source:
public String setPenisCumExpulsion(float percentage){
  return body.getPenis().getTesticle().setCumExpulsion(this,percentage);
}

Fixed version (ground truth):
public String setPenisCumExpulsion(int percentage){
  return body.getPenis().getTesticle().setCumExpulsion(this,percentage);
}
Program: 171248
Project: 171248
Buggy source:
/** 
 * As a percentage from 0 -> 1. 
 */
public float getPenisRawCumExpulsionValue(){
  return body.getPenis().getTesticle().getRawCumExpulsionValue();
}

Fixed version (ground truth):
/** 
 * As a percentage from 0 -> 100. 
 */
public int getPenisRawCumExpulsionValue(){
  return body.getPenis().getTesticle().getRawCumExpulsionValue();
}
Program: 171249
Project: 171249
Buggy source:
public String incrementPenisCumExpulsion(int increment){
  return setPenisCumExpulsion(getPenisRawCumExpulsionValue() + increment);
}

Fixed version (ground truth):
public String incrementPenisCumExpulsion(int percentage){
  return setPenisCumExpulsion(getPenisRawCumExpulsionValue() + percentage);
}
Program: 171251
Project: 171251
Buggy source:
public float getRawCumExpulsionValue(){
  return cumExpulsion;
}

Fixed version (ground truth):
public int getRawCumExpulsionValue(){
  return cumExpulsion;
}
Program: 171252
Project: 171252
Buggy source:
public String setCumExpulsion(GameCharacter owner,float cumExpulsion){
  float oldExpulsion=this.cumExpulsion;
  this.cumExpulsion=Math.max(0,Math.min(cumExpulsion,FluidExpulsion.FOUR_HUGE.getMaximumValue()));
  float expulsionChange=this.cumExpulsion - oldExpulsion;
  if (owner == null) {
    return "String_Node_Str";
  }
  if (expulsionChange == 0) {
    if (owner.isPlayer()) {
      return "String_Node_Str";
    }
 else {
      return UtilText.parse(owner,"String_Node_Str");
    }
  }
  String expulsionDescriptor=getCumExpulsion().getDescriptor();
  if (expulsionChange > 0) {
    return UtilText.parse(owner,"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str" + UtilText.generateSingularDeterminer(expulsionDescriptor) + "String_Node_Str"+ expulsionDescriptor+ "String_Node_Str"+ "String_Node_Str");
  }
 else {
    return UtilText.parse(owner,"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str" + UtilText.generateSingularDeterminer(expulsionDescriptor) + "String_Node_Str"+ expulsionDescriptor+ "String_Node_Str"+ "String_Node_Str");
  }
}

Fixed version (ground truth):
public String setCumExpulsion(GameCharacter owner,int cumExpulsion){
  int oldExpulsion=this.cumExpulsion;
  this.cumExpulsion=Math.max(0,Math.min(cumExpulsion,FluidExpulsion.FOUR_HUGE.getMaximumValue()));
  int expulsionChange=this.cumExpulsion - oldExpulsion;
  if (owner == null) {
    return "String_Node_Str";
  }
  if (expulsionChange == 0) {
    if (owner.isPlayer()) {
      return "String_Node_Str";
    }
 else {
      return UtilText.parse(owner,"String_Node_Str");
    }
  }
  String expulsionDescriptor=getCumExpulsion().getDescriptor();
  if (expulsionChange > 0) {
    return UtilText.parse(owner,"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str" + UtilText.generateSingularDeterminer(expulsionDescriptor) + "String_Node_Str"+ expulsionDescriptor+ "String_Node_Str"+ "String_Node_Str");
  }
 else {
    return UtilText.parse(owner,"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str" + UtilText.generateSingularDeterminer(expulsionDescriptor) + "String_Node_Str"+ expulsionDescriptor+ "String_Node_Str"+ "String_Node_Str");
  }
}
Program: 171253
Project: 171253
Buggy source:
@Override public void dailyReset(){
  clearNonEquippedInventory();
  int iterations=3 + Util.random.nextInt(3);
  for (int i=0; i < iterations; i++) {
    this.addClothing(AbstractClothingType.generateClothingWithEnchantment(ClothingType.getCommonJewellery().get(Util.random.nextInt(ClothingType.getCommonJewellery().size()))),false);
  }
  for (int i=0; i < getClothingCount(); i++) {
    getClothing(i).setEnchantmentKnown(true);
  }
  for (  AbstractClothingType ct : ClothingType.getCommonJewellery()) {
    iterations=1 + Util.random.nextInt(2);
    for (int i=0; i < iterations; i++) {
      this.addClothing(AbstractClothingType.generateClothing(ct,false),false);
    }
  }
}

Fixed version (ground truth):
@Override public void dailyReset(){
  clearNonEquippedInventory();
  List<AbstractClothing> clothingToSell=new ArrayList<>();
  for (  AbstractClothingType clothing : ClothingType.getAllClothing()) {
    if (clothing.getItemTags().contains(ItemTag.SOLD_BY_KATE)) {
      clothingToSell.add(AbstractClothingType.generateClothing(clothing,false));
    }
  }
  addEnchantedClothing(clothingToSell);
  for (  AbstractClothing c : clothingToSell) {
    this.addClothing(c,false);
  }
}