nus-yam/ex-repair huggingface dataset:
Program: 85789
Project: 85789
Buggy source:
/** 
 * Behavior of this method is undefined if it is not mixin.
 * @return 
 */
public ReusableStructure convertToReusableStructure(){
  if (!usableAsReusableStructure())   throw new BugHappened("String_Node_Str",this);
  SimpleSelector head=(SimpleSelector)selectors.get(0).getHead();
  ElementSubsequent className=(ElementSubsequent)head.getSubsequent().get(0);
  ReusableStructure reusable=new ReusableStructure(getUnderlyingStructure(),className.clone());
  reusable.setBody(getBody().clone());
  reusable.configureParentToAllChilds();
  return reusable;
}

Fixed version (ground truth):
/** 
 * Behavior of this method is undefined if it is not mixin.
 * @return 
 */
public ReusableStructure convertToReusableStructure(){
  if (!usableAsReusableStructure())   throw new BugHappened("String_Node_Str",this);
  List<ElementSubsequent> reusableSelectors=new ArrayList<ElementSubsequent>();
  for (  Selector selector : selectors)   if (isReusableSelector(selector)) {
    SimpleSelector head=(SimpleSelector)selector.getHead();
    ElementSubsequent className=(ElementSubsequent)head.getSubsequent().get(0);
    reusableSelectors.add(className.clone());
  }
  ReusableStructure reusable=new ReusableStructure(getUnderlyingStructure(),reusableSelectors);
  reusable.setBody(getBody().clone());
  reusable.configureParentToAllChilds();
  return reusable;
}
Program: 85790
Project: 85790
Buggy source:
private Expression subtract(Expression first,double red1,double green1,double blue1,double red2,double green2,double blue2,HiddenTokenAwareTree parentToken){
  if (first.getType() == ASTCssNodeType.NUMBER) {
    problemsHandler.substractOrDiveColorFromNumber(first);
    return new FaultyExpression(first);
  }
  return createResultColor(parentToken,round(red1 - red2),round(green1 - green2),round(blue1 - blue2));
}

Fixed version (ground truth):
private Expression subtract(Expression first,double red1,double green1,double blue1,double red2,double green2,double blue2,HiddenTokenAwareTree parentToken){
  if (first.getType() == ASTCssNodeType.NUMBER) {
    problemsHandler.subtractOrDiveColorFromNumber(first);
    return new FaultyExpression(first);
  }
  return createResultColor(parentToken,round(red1 - red2),round(green1 - green2),round(blue1 - blue2));
}
Program: 85791
Project: 85791
Buggy source:
private Expression divide(Expression first,double red1,double green1,double blue1,double red2,double green2,double blue2,HiddenTokenAwareTree parentToken){
  if (first.getType() == ASTCssNodeType.NUMBER) {
    problemsHandler.substractOrDiveColorFromNumber(first);
    return new FaultyExpression(first);
  }
  return createResultColor(parentToken,round(red1 / red2),round(green1 / green2),round(blue1 / blue2));
}

Fixed version (ground truth):
private Expression divide(Expression first,double red1,double green1,double blue1,double red2,double green2,double blue2,HiddenTokenAwareTree parentToken){
  if (first.getType() == ASTCssNodeType.NUMBER) {
    problemsHandler.subtractOrDiveColorFromNumber(first);
    return new FaultyExpression(first);
  }
  return createResultColor(parentToken,round(red1 / red2),round(green1 / green2),round(blue1 / blue2));
}
Program: 85792
Project: 85792
Buggy source:
private void evaluateExpressions(ASTCssNode node){
  ASTManipulator manipulator=new ASTManipulator();
  ExpressionEvaluator expressionEvaluator=new ExpressionEvaluator(null);
  if (node instanceof Expression) {
    Expression value=expressionEvaluator.evaluate((Expression)node);
    manipulator.replace(node,value);
  }
 else {
    List<? extends ASTCssNode> childs=node.getChilds();
    for (    ASTCssNode kid : childs) {
switch (kid.getType()) {
case MEDIA_EXPRESSION:
        evaluateInMediaExpressions((MediaExpression)kid);
      break;
case DECLARATION:
    evaluateInDeclaration((Declaration)kid);
  break;
default :
evaluateExpressions(kid);
break;
}
}
}
}

Fixed version (ground truth):
private void evaluateExpressions(ASTCssNode node){
  ASTManipulator manipulator=new ASTManipulator();
  ExpressionEvaluator expressionEvaluator=new ExpressionEvaluator();
  if (node instanceof Expression) {
    Expression value=expressionEvaluator.evaluate((Expression)node);
    manipulator.replace(node,value);
  }
 else {
    List<? extends ASTCssNode> childs=node.getChilds();
    for (    ASTCssNode kid : childs) {
switch (kid.getType()) {
case MEDIA_EXPRESSION:
        evaluateInMediaExpressions((MediaExpression)kid);
      break;
case DECLARATION:
    evaluateInDeclaration((Declaration)kid);
  break;
default :
evaluateExpressions(kid);
break;
}
}
}
}
Program: 85793
Project: 85793
Buggy source:
public ExpressionEvaluator(Scope scope){
  super();
  this.scope=scope;
}

Fixed version (ground truth):
public ExpressionEvaluator(Scope scope){
  super();
  this.scope=scope == null ? new NullScope() : scope;
}
Program: 85794
Project: 85794
Buggy source:
private Scope buildScope(ASTCssNode node){
  boolean hasOwnScope=AstLogic.hasOwnScope(node);
  if (hasOwnScope)   increaseScope(node);
  String representedNamespace=representedNamedScope(node);
  if (representedNamespace != null) {
    nextChildScopeName=representedNamespace;
  }
  List<? extends ASTCssNode> childs=new ArrayList<ASTCssNode>(node.getChilds());
  for (  ASTCssNode kid : childs) {
    buildScope(kid);
    if (kid.getType() == ASTCssNodeType.VARIABLE_DECLARATION) {
      currentScope.registerVariable((VariableDeclaration)kid);
    }
 else     if (kid.getType() == ASTCssNodeType.PURE_MIXIN) {
      PureMixin mixin=(PureMixin)kid;
      Scope bodyScope=currentScope.getChildOwnerOf(mixin.getBody());
      currentScope.registerMixin(mixin,bodyScope);
    }
 else     if (kid.getType() == ASTCssNodeType.RULE_SET) {
      RuleSet ruleSet=(RuleSet)kid;
      if (ruleSet.isMixin()) {
        Scope bodyScope=currentScope.getChildOwnerOf(ruleSet.getBody());
        currentScope.registerMixin(ruleSet.convertToMixin(),bodyScope);
      }
    }
  }
  Scope result=currentScope;
  if (hasOwnScope)   decreaseScope();
  return result;
}

Fixed version (ground truth):
private Scope buildScope(ASTCssNode node){
  boolean hasOwnScope=AstLogic.hasOwnScope(node);
  if (hasOwnScope)   increaseScope(node);
  String representedNamespace=representedNamedScope(node);
  if (representedNamespace != null) {
    nextChildScopeName=representedNamespace;
  }
  List<? extends ASTCssNode> childs=new ArrayList<ASTCssNode>(node.getChilds());
  for (  ASTCssNode kid : childs) {
    buildScope(kid);
    if (kid.getType() == ASTCssNodeType.VARIABLE_DECLARATION) {
      currentScope.registerVariable((VariableDeclaration)kid);
      manipulator.removeFromBody(kid);
    }
 else     if (kid.getType() == ASTCssNodeType.PURE_MIXIN) {
      PureMixin mixin=(PureMixin)kid;
      Scope bodyScope=currentScope.getChildOwnerOf(mixin.getBody());
      currentScope.registerMixin(mixin,bodyScope);
      bodyScope.removedFromTree();
      manipulator.removeFromBody(kid);
    }
 else     if (kid.getType() == ASTCssNodeType.RULE_SET) {
      RuleSet ruleSet=(RuleSet)kid;
      if (ruleSet.isMixin()) {
        Scope bodyScope=currentScope.getChildOwnerOf(ruleSet.getBody());
        currentScope.registerMixin(ruleSet.convertToMixin(),bodyScope);
      }
    }
 else     if (kid.getType() == ASTCssNodeType.PURE_NAMESPACE) {
      PureNamespace namespace=(PureNamespace)kid;
      Scope bodyScope=currentScope.getChildOwnerOf(namespace.getBody());
      bodyScope.removedFromTree();
      manipulator.removeFromBody(kid);
    }
  }
  Scope result=currentScope;
  if (hasOwnScope)   decreaseScope();
  return result;
}
Program: 85795
Project: 85795
Buggy source:
public Scope extractScope(ASTCssNode node){
  Scope result=buildScope(node);
  removeUsedNodes(node,result);
  return result;
}

Fixed version (ground truth):
public Scope extractScope(ASTCssNode node){
  Scope result=buildScope(node);
  return result;
}
Program: 85796
Project: 85796
Buggy source:
/** 
 * Behavior of this method is undefined if it is not mixin.
 * @return 
 */
public PureMixin convertToMixin(){
  CssClass className=(CssClass)selectors.get(0).getHead().getSubsequent().get(0);
  PureMixin pureMixin=new PureMixin(getUnderlyingStructure(),className.clone());
  pureMixin.setBody(getBody().clone());
  pureMixin.getBody().setParent(pureMixin);
  pureMixin.getSelector().setParent(pureMixin);
  return pureMixin;
}

Fixed version (ground truth):
/** 
 * Behavior of this method is undefined if it is not mixin.
 * @return 
 */
public PureMixin convertToMixin(){
  CssClass className=(CssClass)selectors.get(0).getHead().getSubsequent().get(0);
  PureMixin pureMixin=new PureMixin(getUnderlyingStructure(),className.clone());
  pureMixin.setBody(getBody().clone());
  pureMixin.configureParentToAllChilds();
  return pureMixin;
}
Program: 85797
Project: 85797
Buggy source:
public boolean isMixin(){
  if (selectors == null || selectors.size() != 1)   return false;
  SimpleSelector selector=selectors.get(0).getHead();
  return selector.isSingleClassSelector();
}

Fixed version (ground truth):
public boolean isMixin(){
  if (selectors == null || selectors.size() != 1)   return false;
  Selector first=selectors.get(0);
  if (first.isCombined())   return false;
  SimpleSelector selector=first.getHead();
  return selector.isSingleClassSelector();
}
Program: 85798
Project: 85798
Buggy source:
public void addDeclaration(AbstractVariableDeclaration node,Expression replacementValue){
  variablesScope.peek().put(node.getVariable().getName(),replacementValue);
}

Fixed version (ground truth):
public void addDeclaration(Map<String,Expression> variablesState,ArgumentDeclaration node,Expression replacementValue){
  variablesState.put(node.getVariable().getName(),replacementValue);
}
Program: 85799
Project: 85799
Buggy source:
public boolean isInPureMixin(){
  return mixinsStack.isEmpty();
}

Fixed version (ground truth):
public boolean isInPureMixin(){
  return !mixinsStack.isEmpty();
}
Program: 85800
Project: 85800
Buggy source:
public boolean isTurnedOn(){
  return activeEngine == calculatingEngine;
}

Fixed version (ground truth):
private boolean isTurnedOn(){
  return activeEngine == calculatingEngine;
}
Program: 85801
Project: 85801
Buggy source:
public void turnOnEvaluation(){
  activeEngine=calculatingEngine;
}

Fixed version (ground truth):
public boolean turnOnEvaluation(){
  boolean previousState=isTurnedOn();
  activeEngine=calculatingEngine;
  return previousState;
}
Program: 85802
Project: 85802
Buggy source:
private void initializeMixinVariableScope(MixinReference reference,MixinWithScope mixin){
  activeScope.enterMixinVariableScope(mixin.getVariablesUponDefinition());
  int length=mixin.getMixin().getParameters().size();
  for (int i=0; i < length; i++) {
    ASTCssNode parameter=mixin.getMixin().getParameters().get(i);
    if (parameter.getType() == ASTCssNodeType.ARGUMENT_DECLARATION) {
      ArgumentDeclaration declaration=(ArgumentDeclaration)parameter;
      if (reference.hasParameter(i)) {
        activeScope.addDeclaration(declaration,reference.getParameter(i));
      }
 else {
        if (declaration.getValue() == null)         CompileException.throwUndefinedMixinParameterValue(mixin.getMixin(),declaration,reference);
        activeScope.addDeclaration(declaration);
      }
    }
  }
}

Fixed version (ground truth):
private void initializeMixinVariableScope(MixinReference reference,MixinWithScope mixin){
  Map<String,Expression> variableState=mixin.getVariablesUponDefinition();
  int length=mixin.getMixin().getParameters().size();
  for (int i=0; i < length; i++) {
    ASTCssNode parameter=mixin.getMixin().getParameters().get(i);
    if (parameter.getType() == ASTCssNodeType.ARGUMENT_DECLARATION) {
      ArgumentDeclaration declaration=(ArgumentDeclaration)parameter;
      if (reference.hasParameter(i)) {
        Expression value=expressionEvaluator.evaluate(reference.getParameter(i));
        activeScope.addDeclaration(variableState,declaration,value);
      }
 else {
        if (declaration.getValue() == null)         CompileException.throwUndefinedMixinParameterValue(mixin.getMixin(),declaration,reference);
        activeScope.addDeclaration(variableState,declaration);
      }
    }
  }
  activeScope.enterMixinVariableScope(variableState);
}
Program: 85803
Project: 85803
Buggy source:
private RuleSetsBody solveVariablesAndMixinsInMixin(PureMixin mixin){
  boolean evaluatorOn=expressionEvaluator.isTurnedOn();
  expressionEvaluator.turnOnEvaluation();
  if (!expressionEvaluator.evaluate(mixin.getGuards())) {
    List<ASTCssNode> emptyList=Collections.emptyList();
    return new RuleSetsBody(mixin.getUnderlyingStructure(),emptyList);
  }
  RuleSetsBody body=mixin.getBody().clone();
  solveVariablesAndMixins(body);
  if (!evaluatorOn)   expressionEvaluator.turnOffEvaluation();
  return body;
}

Fixed version (ground truth):
private RuleSetsBody solveVariablesAndMixinsInMixin(PureMixin mixin){
  if (!expressionEvaluator.evaluate(mixin.getGuards())) {
    List<ASTCssNode> emptyList=Collections.emptyList();
    return new RuleSetsBody(mixin.getUnderlyingStructure(),emptyList);
  }
  RuleSetsBody body=mixin.getBody().clone();
  solveVariablesAndMixins(body);
  return body;
}
Program: 85804
Project: 85804
Buggy source:
private RuleSetsBody resolveMixinReference(MixinReference reference){
  List<MixinWithScope> matchingMixins=activeScope.getAllMatchingMixins(reference);
  RuleSetsBody result=new RuleSetsBody(reference.getUnderlyingStructure());
  for (  MixinWithScope mixin : matchingMixins) {
    initializeMixinVariableScope(reference,mixin);
    RuleSetsBody body=solveVariablesAndMixinsInMixin(mixin.getMixin());
    result.addMembers(body.getChilds());
    activeScope.leaveMixinVariableScope();
  }
  if (reference.isImportant()) {
    declarationsAreImportant(result);
  }
  return result;
}

Fixed version (ground truth):
private RuleSetsBody resolveMixinReference(MixinReference reference){
  List<MixinWithScope> matchingMixins=activeScope.getAllMatchingMixins(reference);
  RuleSetsBody result=new RuleSetsBody(reference.getUnderlyingStructure());
  for (  MixinWithScope mixin : matchingMixins) {
    boolean evaluatorOn=expressionEvaluator.turnOnEvaluation();
    initializeMixinVariableScope(reference,mixin);
    RuleSetsBody body=solveVariablesAndMixinsInMixin(mixin.getMixin());
    result.addMembers(body.getChilds());
    activeScope.leaveMixinVariableScope();
    if (!evaluatorOn)     expressionEvaluator.turnOffEvaluation();
  }
  if (reference.isImportant()) {
    declarationsAreImportant(result);
  }
  return result;
}
Program: 85805
Project: 85805
Buggy source:
private ParseResult parse(String input,InputType inputType){
  try {
    List<AntlrException> errors=new ArrayList<AntlrException>();
    LessLexer lexer=createLexer(input,errors);
    CollectorTokenSource tokenSource=new CollectorTokenSource(lexer,KEEP_HIDDEN_TOKENS);
    LessParser parser=createParser(tokenSource,errors);
    ParserRuleReturnScope returnScope=inputType.parseTree(parser);
    HiddenTokenAwareTree ast=(HiddenTokenAwareTree)returnScope.getTree();
    merge(ast,tokenSource.getCollectedTokens());
    DebugPrint.print(ast);
    return new ParseResultImpl(ast,new ArrayList<AntlrException>(errors));
  }
 catch (  RecognitionException e) {
    throw new IllegalStateException("String_Node_Str");
  }
}

Fixed version (ground truth):
private ParseResult parse(String input,InputType inputType){
  try {
    List<AntlrException> errors=new ArrayList<AntlrException>();
    LessLexer lexer=createLexer(input,errors);
    CollectorTokenSource tokenSource=new CollectorTokenSource(lexer,KEEP_HIDDEN_TOKENS);
    LessParser parser=createParser(tokenSource,errors);
    ParserRuleReturnScope returnScope=inputType.parseTree(parser);
    HiddenTokenAwareTree ast=(HiddenTokenAwareTree)returnScope.getTree();
    merge(ast,tokenSource.getCollectedTokens());
    return new ParseResultImpl(ast,new ArrayList<AntlrException>(errors));
  }
 catch (  RecognitionException e) {
    throw new IllegalStateException("String_Node_Str");
  }
}
Program: 85806
Project: 85806
Buggy source:
@Parameters() public static Collection<Object[]> allTestsParameters(){
  return (new TestFileUtils()).loadTestFiles(standardCases,lessjsIncompatible);
}

Fixed version (ground truth):
@Parameters() public static Collection<Object[]> allTestsParameters(){
  return (new TestFileUtils()).loadTestFiles(standardCases,lessjsIncompatible,lessjsTests);
}
Program: 85807
Project: 85807
Buggy source:
/** 
 * Returns the flag that, if <code>true</code>, causes the whiskers to be drawn using the series outline paint.
 * @return A boolean.
 * @since 1.0.14
 */
public boolean getUseOutlinePaintForWhiskers(){
  return this.useOutlinePaintForWhiskers;
}

Fixed version (ground truth):
/** 
 * Returns the flag that, if   {@code true}, causes the whiskers to be drawn using the series outline paint.
 * @return A boolean.
 * @since 1.0.14
 */
public boolean getUseOutlinePaintForWhiskers(){
  return this.useOutlinePaintForWhiskers;
}
Program: 85808
Project: 85808
Buggy source:
/** 
 * Sets the flag that, if <code>true</code>, causes the whiskers to be drawn using the series outline paint, and sends a  {@link RendererChangeEvent} to all registered listeners.
 * @param flag  the new flag value.
 * @since 1.0.14
 */
public void setUseOutlinePaintForWhiskers(boolean flag){
  if (this.useOutlinePaintForWhiskers == flag) {
    return;
  }
  this.useOutlinePaintForWhiskers=flag;
  fireChangeEvent();
}

Fixed version (ground truth):
/** 
 * Sets the flag that, if   {@code true}, causes the whiskers to be drawn using the series outline paint, and sends a  {@link RendererChangeEvent} to all registered listeners.
 * @param flag  the new flag value.
 * @since 1.0.14
 */
public void setUseOutlinePaintForWhiskers(boolean flag){
  if (this.useOutlinePaintForWhiskers == flag) {
    return;
  }
  this.useOutlinePaintForWhiskers=flag;
  fireChangeEvent();
}
Program: 85810
Project: 85810
Buggy source:
/** 
 * Returns the paint used to color the median and average markers.
 * @return The paint used to draw the median and average markers (never<code>null</code>).
 * @see #setArtifactPaint(Paint)
 */
public Paint getArtifactPaint(){
  return this.artifactPaint;
}

Fixed version (ground truth):
/** 
 * Returns the paint used to color the median and average markers.
 * @return The paint used to draw the median and average markers (never{@code null}).
 * @see #setArtifactPaint(Paint)
 */
public Paint getArtifactPaint(){
  return this.artifactPaint;
}
Program: 85811
Project: 85811
Buggy source:
/** 
 * Returns a legend item for a series.
 * @param datasetIndex  the dataset index (zero-based).
 * @param series  the series index (zero-based).
 * @return The legend item (possibly <code>null</code>).
 */
@Override public LegendItem getLegendItem(int datasetIndex,int series){
  CategoryPlot cp=getPlot();
  if (cp == null) {
    return null;
  }
  if (!isSeriesVisible(series) || !isSeriesVisibleInLegend(series)) {
    return null;
  }
  CategoryDataset dataset=cp.getDataset(datasetIndex);
  String label=getLegendItemLabelGenerator().generateLabel(dataset,series);
  String description=label;
  String toolTipText=null;
  if (getLegendItemToolTipGenerator() != null) {
    toolTipText=getLegendItemToolTipGenerator().generateLabel(dataset,series);
  }
  String urlText=null;
  if (getLegendItemURLGenerator() != null) {
    urlText=getLegendItemURLGenerator().generateLabel(dataset,series);
  }
  Shape shape=lookupLegendShape(series);
  Paint paint=lookupSeriesPaint(series);
  Paint outlinePaint=lookupSeriesOutlinePaint(series);
  Stroke outlineStroke=lookupSeriesOutlineStroke(series);
  LegendItem result=new LegendItem(label,description,toolTipText,urlText,shape,paint,outlineStroke,outlinePaint);
  result.setLabelFont(lookupLegendTextFont(series));
  Paint labelPaint=lookupLegendTextPaint(series);
  if (labelPaint != null) {
    result.setLabelPaint(labelPaint);
  }
  result.setDataset(dataset);
  result.setDatasetIndex(datasetIndex);
  result.setSeriesKey(dataset.getRowKey(series));
  result.setSeriesIndex(series);
  return result;
}

Fixed version (ground truth):
/** 
 * Returns a legend item for a series.
 * @param datasetIndex  the dataset index (zero-based).
 * @param series  the series index (zero-based).
 * @return The legend item (possibly {@code null}).
 */
@Override public LegendItem getLegendItem(int datasetIndex,int series){
  CategoryPlot cp=getPlot();
  if (cp == null) {
    return null;
  }
  if (!isSeriesVisible(series) || !isSeriesVisibleInLegend(series)) {
    return null;
  }
  CategoryDataset dataset=cp.getDataset(datasetIndex);
  String label=getLegendItemLabelGenerator().generateLabel(dataset,series);
  String description=label;
  String toolTipText=null;
  if (getLegendItemToolTipGenerator() != null) {
    toolTipText=getLegendItemToolTipGenerator().generateLabel(dataset,series);
  }
  String urlText=null;
  if (getLegendItemURLGenerator() != null) {
    urlText=getLegendItemURLGenerator().generateLabel(dataset,series);
  }
  Shape shape=lookupLegendShape(series);
  Paint paint=lookupSeriesPaint(series);
  Paint outlinePaint=lookupSeriesOutlinePaint(series);
  Stroke outlineStroke=lookupSeriesOutlineStroke(series);
  LegendItem result=new LegendItem(label,description,toolTipText,urlText,shape,paint,outlineStroke,outlinePaint);
  result.setLabelFont(lookupLegendTextFont(series));
  Paint labelPaint=lookupLegendTextPaint(series);
  if (labelPaint != null) {
    result.setLabelPaint(labelPaint);
  }
  result.setDataset(dataset);
  result.setDatasetIndex(datasetIndex);
  result.setSeriesKey(dataset.getRowKey(series));
  result.setSeriesIndex(series);
  return result;
}
Program: 85812
Project: 85812
Buggy source:
/** 
 * Sets the paint used to color the median and average markers and sends a   {@link RendererChangeEvent} to all registered listeners.
 * @param paint  the paint (<code>null</code> not permitted).
 * @see #getArtifactPaint()
 */
public void setArtifactPaint(Paint paint){
  if (paint == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.artifactPaint=paint;
  fireChangeEvent();
}

Fixed version (ground truth):
/** 
 * Sets the paint used to color the median and average markers and sends a   {@link RendererChangeEvent} to all registered listeners.
 * @param paint  the paint ({@code null} not permitted).
 * @see #getArtifactPaint()
 */
public void setArtifactPaint(Paint paint){
  ParamChecks.nullNotPermitted(paint,"String_Node_Str");
  this.artifactPaint=paint;
  fireChangeEvent();
}
Program: 85813
Project: 85813
Buggy source:
/** 
 * Tests this renderer for equality with an arbitrary object.
 * @param obj  the object (<code>null</code> permitted).
 * @return <code>true</code> or <code>false</code>.
 */
@Override public boolean equals(Object obj){
  if (obj == this) {
    return true;
  }
  if (!(obj instanceof BoxAndWhiskerRenderer)) {
    return false;
  }
  BoxAndWhiskerRenderer that=(BoxAndWhiskerRenderer)obj;
  if (this.fillBox != that.fillBox) {
    return false;
  }
  if (this.itemMargin != that.itemMargin) {
    return false;
  }
  if (this.maximumBarWidth != that.maximumBarWidth) {
    return false;
  }
  if (this.meanVisible != that.meanVisible) {
    return false;
  }
  if (this.medianVisible != that.medianVisible) {
    return false;
  }
  if (this.useOutlinePaintForWhiskers != that.useOutlinePaintForWhiskers) {
    return false;
  }
  if (this.whiskerWidth != that.whiskerWidth) {
    return false;
  }
  if (!PaintUtils.equal(this.artifactPaint,that.artifactPaint)) {
    return false;
  }
  return super.equals(obj);
}

Fixed version (ground truth):
/** 
 * Tests this renderer for equality with an arbitrary object.
 * @param obj  the object ({@code null} permitted).
 * @return {@code true} or {@code false}.
 */
@Override public boolean equals(Object obj){
  if (obj == this) {
    return true;
  }
  if (!(obj instanceof BoxAndWhiskerRenderer)) {
    return false;
  }
  BoxAndWhiskerRenderer that=(BoxAndWhiskerRenderer)obj;
  if (this.fillBox != that.fillBox) {
    return false;
  }
  if (this.itemMargin != that.itemMargin) {
    return false;
  }
  if (this.maximumBarWidth != that.maximumBarWidth) {
    return false;
  }
  if (this.meanVisible != that.meanVisible) {
    return false;
  }
  if (this.medianVisible != that.medianVisible) {
    return false;
  }
  if (this.useOutlinePaintForWhiskers != that.useOutlinePaintForWhiskers) {
    return false;
  }
  if (this.whiskerWidth != that.whiskerWidth) {
    return false;
  }
  if (!PaintUtils.equal(this.artifactPaint,that.artifactPaint)) {
    return false;
  }
  return super.equals(obj);
}
Program: 85816
Project: 85816
Buggy source:
/** 
 * Finds the range of y-values that fall within the specified range of x-values (where the x-values are interpreted as milliseconds since the epoch and converted to time periods using the specified timezone).
 * @param xRange  the subset of x-values to use ({@code null} notpermitted).
 * @param xAnchor  the anchor point for the x-values ({@code null}not permitted).
 * @param zone  the time zone ({@code null} not permitted).
 * @return The range of y-values.
 * @since 1.0.18
 */
public Range findValueRange(Range xRange,TimePeriodAnchor xAnchor,TimeZone zone){
  ParamChecks.nullNotPermitted(xRange,"String_Node_Str");
  ParamChecks.nullNotPermitted(xAnchor,"String_Node_Str");
  ParamChecks.nullNotPermitted(zone,"String_Node_Str");
  if (this.data.isEmpty()) {
    return null;
  }
  Calendar calendar=Calendar.getInstance(zone);
  double lowY=Double.POSITIVE_INFINITY;
  double highY=Double.NEGATIVE_INFINITY;
  for (  TimeSeriesDataItem item : this.data) {
    long millis=item.getPeriod().getMillisecond(xAnchor,calendar);
    if (xRange.contains(millis)) {
      Number n=item.getValue();
      if (n != null) {
        double v=n.doubleValue();
        lowY=Math.min(lowY,v);
        highY=Math.max(highY,v);
      }
    }
  }
  if (Double.isInfinite(lowY) && Double.isInfinite(highY)) {
    if (lowY < highY) {
      return new Range(lowY,highY);
    }
 else {
      return new Range(Double.NaN,Double.NaN);
    }
  }
  return new Range(lowY,highY);
}

Fixed version (ground truth):
/** 
 * Finds the range of y-values that fall within the specified range of x-values (where the x-values are interpreted as milliseconds since the epoch and converted to time periods using the specified timezone).
 * @param xRange  the subset of x-values to use ({@code null} notpermitted).
 * @param xAnchor  the anchor point for the x-values ({@code null}not permitted).
 * @param zone  the time zone ({@code null} not permitted).
 * @return The range of y-values.
 * @since 1.0.18
 */
public Range findValueRange(Range xRange,TimePeriodAnchor xAnchor,TimeZone zone){
  ParamChecks.nullNotPermitted(xRange,"String_Node_Str");
  ParamChecks.nullNotPermitted(xAnchor,"String_Node_Str");
  ParamChecks.nullNotPermitted(zone,"String_Node_Str");
  if (this.data.isEmpty()) {
    return null;
  }
  Calendar calendar=Calendar.getInstance(zone);
  double lowY=Double.POSITIVE_INFINITY;
  double highY=Double.NEGATIVE_INFINITY;
  for (  TimeSeriesDataItem item : this.data) {
    long millis=item.getPeriod().getMillisecond(xAnchor,calendar);
    if (xRange.contains(millis)) {
      Number n=item.getValue();
      if (n != null) {
        double v=n.doubleValue();
        lowY=minIgnoreNaN(lowY,v);
        highY=maxIgnoreNaN(highY,v);
      }
    }
  }
  if (Double.isInfinite(lowY) && Double.isInfinite(highY)) {
    if (lowY < highY) {
      return new Range(lowY,highY);
    }
 else {
      return new Range(Double.NaN,Double.NaN);
    }
  }
  return new Range(lowY,highY);
}
Program: 85817
Project: 85817
Buggy source:
/** 
 * Sets the size (width or height, depending on the orientation of the plot) for the domain axis of each subplot.
 * @param space  the space (<code>null</code> permitted).
 */
protected void setFixedRangeAxisSpaceForSubplots(AxisSpace space){
  for (  XYPlot subplot : this.subplots) {
    subplot.setFixedRangeAxisSpace(space,false);
  }
}

Fixed version (ground truth):
/** 
 * Sets the size (width or height, depending on the orientation of the plot) for the domain axis of each subplot.
 * @param space  the space ({@code null} permitted).
 */
protected void setFixedRangeAxisSpaceForSubplots(AxisSpace space){
  for (  XYPlot subplot : this.subplots) {
    subplot.setFixedRangeAxisSpace(space,false);
  }
}
Program: 85818
Project: 85818
Buggy source:
/** 
 * Handles a 'click' on the plot by updating the anchor values.
 * @param x  x-coordinate, where the click occured.
 * @param y  y-coordinate, where the click occured.
 * @param info  object containing information about the plot dimensions.
 */
@Override public void handleClick(int x,int y,PlotRenderingInfo info){
  Rectangle2D dataArea=info.getDataArea();
  if (dataArea.contains(x,y)) {
    for (int i=0; i < this.subplots.size(); i++) {
      XYPlot subplot=this.subplots.get(i);
      PlotRenderingInfo subplotInfo=info.getSubplotInfo(i);
      subplot.handleClick(x,y,subplotInfo);
    }
  }
}

Fixed version (ground truth):
/** 
 * Handles a 'click' on the plot by updating the anchor values.
 * @param x  x-coordinate, where the click occurred.
 * @param y  y-coordinate, where the click occurred.
 * @param info  object containing information about the plot dimensions.
 */
@Override public void handleClick(int x,int y,PlotRenderingInfo info){
  Rectangle2D dataArea=info.getDataArea();
  if (dataArea.contains(x,y)) {
    for (int i=0; i < this.subplots.size(); i++) {
      XYPlot subplot=this.subplots.get(i);
      PlotRenderingInfo subplotInfo=info.getSubplotInfo(i);
      subplot.handleClick(x,y,subplotInfo);
    }
  }
}
Program: 85819
Project: 85819
Buggy source:
/** 
 * Returns a range representing the extent of the data values in this plot (obtained from the subplots) that will be rendered against the specified axis.  NOTE: This method is intended for internal JFreeChart use, and is public only so that code in the axis classes can call it.  Since only the domain axis is shared between subplots, the JFreeChart code will only call this method for the domain values (although this is not checked/enforced).
 * @param axis  the axis.
 * @return The range (possibly <code>null</code>).
 */
@Override public Range getDataRange(ValueAxis axis){
  Range result=null;
  if (this.subplots != null) {
    for (    XYPlot subplot : this.subplots) {
      result=Range.combine(result,subplot.getDataRange(axis));
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Returns a range representing the extent of the data values in this plot (obtained from the subplots) that will be rendered against the specified axis.  NOTE: This method is intended for internal JFreeChart use, and is public only so that code in the axis classes can call it.  Since only the domain axis is shared between subplots, the JFreeChart code will only call this method for the domain values (although this is not checked/enforced).
 * @param axis  the axis.
 * @return The range (possibly <code>null</code>).
 */
@Override public Range getDataRange(ValueAxis axis){
  if (this.subplots == null) {
    return null;
  }
  Range result=null;
  for (  XYPlot subplot : this.subplots) {
    result=Range.combine(result,subplot.getDataRange(axis));
  }
  return result;
}
Program: 85820
Project: 85820
Buggy source:
/** 
 * Returns the list of subplots.  The returned list may be empty, but is never <code>null</code>.
 * @return An unmodifiable list of subplots.
 */
public List<XYPlot> getSubplots(){
  if (this.subplots != null) {
    return Collections.unmodifiableList(this.subplots);
  }
 else {
    return Collections.EMPTY_LIST;
  }
}

Fixed version (ground truth):
/** 
 * Returns the list of subplots.  The returned list may be empty, but is never   {@code null}.
 * @return An unmodifiable list of subplots.
 */
public List<XYPlot> getSubplots(){
  return Collections.unmodifiableList(this.subplots);
}
Program: 85822
Project: 85822
Buggy source:
/** 
 * Draws the axis on a Java 2D graphics device (such as the screen or a printer).
 * @param g2  the graphics device (<code>null</code> not permitted).
 * @param cursor  the cursor location.
 * @param plotArea  the area within which the plot and axes should be drawn(<code>null</code> not permitted).
 * @param dataArea  the area within which the data should be drawn(<code>null</code> not permitted).
 * @param edge  the axis location (<code>null</code> not permitted).
 * @param plotState  collects information about the plot(<code>null</code> permitted).
 * @return The axis state (never <code>null</code>).
 */
@Override public AxisState draw(Graphics2D g2,double cursor,Rectangle2D plotArea,Rectangle2D dataArea,RectangleEdge edge,PlotRenderingInfo plotState){
  AxisState info=new AxisState(cursor);
  if (isVisible()) {
    info=super.draw(g2,cursor,plotArea,dataArea,edge,plotState);
  }
  if (this.gridBandsVisible) {
    drawGridBands(g2,plotArea,dataArea,edge,info.getTicks());
  }
  return info;
}

Fixed version (ground truth):
/** 
 * Draws the axis on a Java 2D graphics device (such as the screen or a printer).
 * @param g2  the graphics device (<code>null</code> not permitted).
 * @param cursor  the cursor location.
 * @param plotArea  the area within which the plot and axes should be drawn(<code>null</code> not permitted).
 * @param dataArea  the area within which the data should be drawn(<code>null</code> not permitted).
 * @param edge  the axis location (<code>null</code> not permitted).
 * @param plotState  collects information about the plot(<code>null</code> permitted).
 * @return The axis state (never <code>null</code>).
 */
@Override public AxisState draw(Graphics2D g2,double cursor,Rectangle2D plotArea,Rectangle2D dataArea,RectangleEdge edge,PlotRenderingInfo plotState){
  AxisState info=new AxisState(cursor);
  if (isVisible()) {
    info=super.draw(g2,cursor,plotArea,dataArea,edge,plotState);
  }
  if (this.gridBandsVisible) {
    drawGridBands(g2,dataArea,edge,info.getTicks());
  }
  return info;
}
Program: 85823
Project: 85823
Buggy source:
/** 
 * Sets the visibility of the grid bands and notifies registered listeners that the axis has been modified.
 * @param flag  the new setting.
 * @see #isGridBandsVisible()
 */
public void setGridBandsVisible(boolean flag){
  if (this.gridBandsVisible != flag) {
    this.gridBandsVisible=flag;
    fireChangeEvent();
  }
}

Fixed version (ground truth):
/** 
 * Sets the visibility of the grid bands and notifies registered listeners that the axis has been modified.
 * @param flag  the new setting.
 * @see #isGridBandsVisible()
 */
public void setGridBandsVisible(boolean flag){
  this.gridBandsVisible=flag;
  fireChangeEvent();
}
Program: 85824
Project: 85824
Buggy source:
/** 
 * Draws the grid bands.  Alternate bands are colored using <CODE>gridBandPaint</CODE> (<CODE>DEFAULT_GRID_BAND_PAINT</CODE> by default).
 * @param g2  the graphics device.
 * @param plotArea  the area within which the chart should be drawn.
 * @param dataArea  the area within which the plot should be drawn (asubset of the drawArea).
 * @param edge  the axis location.
 * @param ticks  the ticks.
 */
protected void drawGridBands(Graphics2D g2,Rectangle2D plotArea,Rectangle2D dataArea,RectangleEdge edge,List<ValueTick> ticks){
  Shape savedClip=g2.getClip();
  g2.clip(dataArea);
  if (RectangleEdge.isTopOrBottom(edge)) {
    drawGridBandsHorizontal(g2,plotArea,dataArea,true,ticks);
  }
 else   if (RectangleEdge.isLeftOrRight(edge)) {
    drawGridBandsVertical(g2,plotArea,dataArea,true,ticks);
  }
  g2.setClip(savedClip);
}

Fixed version (ground truth):
/** 
 * Draws the grid bands.  Alternate bands are colored using <CODE>gridBandPaint</CODE> (<CODE>DEFAULT_GRID_BAND_PAINT</CODE> by default).
 * @param g2  the graphics target (<code>null</code> not permitted).
 * @param dataArea  the data area to which the axes are aligned (<code>null</code> not permitted).
 * @param edge  the edge to which the axis is aligned (<code>null</code> notpermitted).
 * @param ticks  the ticks (<code>null</code> not permitted).
 */
protected void drawGridBands(Graphics2D g2,Rectangle2D dataArea,RectangleEdge edge,List<ValueTick> ticks){
  Shape savedClip=g2.getClip();
  g2.clip(dataArea);
  if (RectangleEdge.isTopOrBottom(edge)) {
    drawGridBandsHorizontal(g2,dataArea,true,ticks);
  }
 else   if (RectangleEdge.isLeftOrRight(edge)) {
    drawGridBandsVertical(g2,dataArea,true,ticks);
  }
  g2.setClip(savedClip);
}
Program: 85825
Project: 85825
Buggy source:
/** 
 * Draws the grid bands for the axis when it is at the top or bottom of the plot.
 * @param g2  the graphics device.
 * @param drawArea  the area within which the chart should be drawn.
 * @param plotArea  the area within which the plot should be drawn (asubset of the drawArea).
 * @param firstGridBandIsDark  True: the first grid band takes thecolor of <CODE>gridBandPaint</CODE>. False: the second grid band takes the color of <CODE>gridBandPaint</CODE>.
 * @param ticks  a list of ticks.
 */
protected void drawGridBandsVertical(Graphics2D g2,Rectangle2D drawArea,Rectangle2D plotArea,boolean firstGridBandIsDark,List<ValueTick> ticks){
  boolean currentGridBandIsDark=firstGridBandIsDark;
  double xx=plotArea.getX();
  double yy1, yy2;
  double outlineStrokeWidth;
  Stroke outlineStroke=getPlot().getOutlineStroke();
  if (outlineStroke != null && outlineStroke instanceof BasicStroke) {
    outlineStrokeWidth=((BasicStroke)outlineStroke).getLineWidth();
  }
 else {
    outlineStrokeWidth=1d;
  }
  for (  ValueTick tick : ticks) {
    yy1=valueToJava2D(tick.getValue() + 0.5d,plotArea,RectangleEdge.LEFT);
    yy2=valueToJava2D(tick.getValue() - 0.5d,plotArea,RectangleEdge.LEFT);
    if (currentGridBandIsDark) {
      g2.setPaint(this.gridBandPaint);
    }
 else {
      g2.setPaint(this.gridBandAlternatePaint);
    }
    Rectangle2D band=new Rectangle2D.Double(xx + outlineStrokeWidth,yy1,plotArea.getMaxX() - xx - outlineStrokeWidth,yy2 - yy1);
    g2.fill(band);
    currentGridBandIsDark=!currentGridBandIsDark;
  }
  g2.setPaintMode();
}

Fixed version (ground truth):
/** 
 * Draws the grid bands for an axis that is aligned to the left or right of the data area (that is, a vertical axis).
 * @param g2  the graphics target (<code>null</code> not permitted).
 * @param dataArea  the area for the data (to which the axes are aligned,<code>null</code> not permitted).
 * @param firstGridBandIsDark  True: the first grid band takes thecolor of <CODE>gridBandPaint</CODE>. False: the second grid band takes the color of <CODE>gridBandPaint</CODE>.
 * @param ticks  a list of ticks (<code>null</code> not permitted).
 */
protected void drawGridBandsVertical(Graphics2D g2,Rectangle2D dataArea,boolean firstGridBandIsDark,List<ValueTick> ticks){
  boolean currentGridBandIsDark=firstGridBandIsDark;
  double xx=dataArea.getX();
  double yy1, yy2;
  double outlineStrokeWidth=1.0;
  Stroke outlineStroke=getPlot().getOutlineStroke();
  if (outlineStroke != null && outlineStroke instanceof BasicStroke) {
    outlineStrokeWidth=((BasicStroke)outlineStroke).getLineWidth();
  }
  for (  ValueTick tick : ticks) {
    yy1=valueToJava2D(tick.getValue() + 0.5d,dataArea,RectangleEdge.LEFT);
    yy2=valueToJava2D(tick.getValue() - 0.5d,dataArea,RectangleEdge.LEFT);
    if (currentGridBandIsDark) {
      g2.setPaint(this.gridBandPaint);
    }
 else {
      g2.setPaint(this.gridBandAlternatePaint);
    }
    Rectangle2D band=new Rectangle2D.Double(xx + outlineStrokeWidth,Math.min(yy1,yy2),dataArea.getMaxX() - xx - outlineStrokeWidth,Math.abs(yy2 - yy1));
    g2.fill(band);
    currentGridBandIsDark=!currentGridBandIsDark;
  }
}
Program: 85826
Project: 85826
Buggy source:
/** 
 * Draws the grid bands for the axis when it is at the top or bottom of the plot.
 * @param g2  the graphics device.
 * @param plotArea  the area within which the chart should be drawn.
 * @param dataArea  the area within which the plot should be drawn(a subset of the drawArea).
 * @param firstGridBandIsDark  True: the first grid band takes thecolor of <CODE>gridBandPaint</CODE>. False: the second grid band takes the color of <CODE>gridBandPaint</CODE>.
 * @param ticks  the ticks.
 */
protected void drawGridBandsHorizontal(Graphics2D g2,Rectangle2D plotArea,Rectangle2D dataArea,boolean firstGridBandIsDark,List<ValueTick> ticks){
  boolean currentGridBandIsDark=firstGridBandIsDark;
  double yy=dataArea.getY();
  double xx1, xx2;
  double outlineStrokeWidth;
  if (getPlot().getOutlineStroke() != null) {
    outlineStrokeWidth=((BasicStroke)getPlot().getOutlineStroke()).getLineWidth();
  }
 else {
    outlineStrokeWidth=1d;
  }
  for (  ValueTick tick : ticks) {
    xx1=valueToJava2D(tick.getValue() - 0.5d,dataArea,RectangleEdge.BOTTOM);
    xx2=valueToJava2D(tick.getValue() + 0.5d,dataArea,RectangleEdge.BOTTOM);
    if (currentGridBandIsDark) {
      g2.setPaint(this.gridBandPaint);
    }
 else {
      g2.setPaint(this.gridBandAlternatePaint);
    }
    Rectangle2D band=new Rectangle2D.Double(xx1,yy + outlineStrokeWidth,xx2 - xx1,dataArea.getMaxY() - yy - outlineStrokeWidth);
    g2.fill(band);
    currentGridBandIsDark=!currentGridBandIsDark;
  }
  g2.setPaintMode();
}

Fixed version (ground truth):
/** 
 * Draws the grid bands for the axis when it is at the top or bottom of the plot.
 * @param g2  the graphics target (<code>null</code> not permitted).
 * @param dataArea  the area for the data (to which the axes are aligned,<code>null</code> not permitted).
 * @param firstGridBandIsDark  True: the first grid band takes thecolor of <CODE>gridBandPaint</CODE>. False: the second grid band takes the color of <CODE>gridBandPaint</CODE>.
 * @param ticks  a list of ticks (<code>null</code> not permitted).
 */
protected void drawGridBandsHorizontal(Graphics2D g2,Rectangle2D dataArea,boolean firstGridBandIsDark,List<ValueTick> ticks){
  boolean currentGridBandIsDark=firstGridBandIsDark;
  double yy=dataArea.getY();
  double xx1, xx2;
  double outlineStrokeWidth=1.0;
  Stroke outlineStroke=getPlot().getOutlineStroke();
  if (outlineStroke != null && outlineStroke instanceof BasicStroke) {
    outlineStrokeWidth=((BasicStroke)outlineStroke).getLineWidth();
  }
  for (  ValueTick tick : ticks) {
    xx1=valueToJava2D(tick.getValue() - 0.5d,dataArea,RectangleEdge.BOTTOM);
    xx2=valueToJava2D(tick.getValue() + 0.5d,dataArea,RectangleEdge.BOTTOM);
    if (currentGridBandIsDark) {
      g2.setPaint(this.gridBandPaint);
    }
 else {
      g2.setPaint(this.gridBandAlternatePaint);
    }
    Rectangle2D band=new Rectangle2D.Double(Math.min(xx1,xx2),yy + outlineStrokeWidth,Math.abs(xx2 - xx1),dataArea.getMaxY() - yy - outlineStrokeWidth);
    g2.fill(band);
    currentGridBandIsDark=!currentGridBandIsDark;
  }
}
Program: 85827
Project: 85827
Buggy source:
/** 
 * Fills a band between two values on the axis.  This can be used to color bands between the grid lines.
 * @param g2  the graphics device.
 * @param plot  the plot.
 * @param axis  the domain axis.
 * @param dataArea  the data area.
 * @param start  the start value.
 * @param end  the end value.
 */
@Override public void fillDomainGridBand(Graphics2D g2,XYPlot plot,ValueAxis axis,Rectangle2D dataArea,double start,double end){
  double x1=axis.valueToJava2D(start,dataArea,plot.getDomainAxisEdge());
  double x2=axis.valueToJava2D(end,dataArea,plot.getDomainAxisEdge());
  Rectangle2D band;
  if (plot.getOrientation() == PlotOrientation.VERTICAL) {
    band=new Rectangle2D.Double(Math.min(x1,x2),dataArea.getMinY(),Math.abs(x2 - x1),dataArea.getWidth());
  }
 else {
    band=new Rectangle2D.Double(dataArea.getMinX(),Math.min(x1,x2),dataArea.getWidth(),Math.abs(x2 - x1));
  }
  Paint paint=plot.getDomainTickBandPaint();
  if (paint != null) {
    g2.setPaint(paint);
    g2.fill(band);
  }
}

Fixed version (ground truth):
/** 
 * Fills a band between two values on the axis.  This can be used to color bands between the grid lines.
 * @param g2  the graphics device.
 * @param plot  the plot.
 * @param axis  the domain axis.
 * @param dataArea  the data area.
 * @param start  the start value.
 * @param end  the end value.
 */
@Override public void fillDomainGridBand(Graphics2D g2,XYPlot plot,ValueAxis axis,Rectangle2D dataArea,double start,double end){
  double x1=axis.valueToJava2D(start,dataArea,plot.getDomainAxisEdge());
  double x2=axis.valueToJava2D(end,dataArea,plot.getDomainAxisEdge());
  Rectangle2D band;
  if (plot.getOrientation() == PlotOrientation.VERTICAL) {
    band=new Rectangle2D.Double(Math.min(x1,x2),dataArea.getMinY(),Math.abs(x2 - x1),dataArea.getHeight());
  }
 else {
    band=new Rectangle2D.Double(dataArea.getMinX(),Math.min(x1,x2),dataArea.getWidth(),Math.abs(x2 - x1));
  }
  Paint paint=plot.getDomainTickBandPaint();
  if (paint != null) {
    g2.setPaint(paint);
    g2.fill(band);
  }
}
Program: 85828
Project: 85828
Buggy source:
/** 
 * Initialises the renderer and returns a state object that should be passed to all subsequent calls to the drawItem() method. <P> This method will be called before the first item is rendered, giving the renderer an opportunity to initialise any state information it wants to maintain.  The renderer can do nothing if it chooses.
 * @param g2  the graphics device.
 * @param dataArea  the area inside the axes.
 * @param plot  the plot.
 * @param data  the data.
 * @param info  an optional info collection object to return data back tothe caller.
 * @return The renderer state (never <code>null</code>).
 */
@Override public XYItemRendererState initialise(Graphics2D g2,Rectangle2D dataArea,XYPlot plot,XYDataset data,PlotRenderingInfo info){
  XYItemRendererState state=new XYItemRendererState(info);
  return state;
}

Fixed version (ground truth):
/** 
 * Initialises the renderer and returns a state object that should be passed to all subsequent calls to the drawItem() method. <P> This method will be called before the first item is rendered, giving the renderer an opportunity to initialise any state information it wants to maintain.  The renderer can do nothing if it chooses.
 * @param g2  the graphics device.
 * @param dataArea  the area inside the axes.
 * @param plot  the plot.
 * @param data  the data.
 * @param info  an optional info collection object to return data back tothe caller.
 * @return The renderer state (never <code>null</code>).
 */
@Override public XYItemRendererState initialise(Graphics2D g2,Rectangle2D dataArea,XYPlot plot,XYDataset data,PlotRenderingInfo info){
  return new XYItemRendererState(info);
}
Program: 85830
Project: 85830
Buggy source:
/** 
 * Adds a block to the arrangement manager at the specified edge.
 * @param block  the block (<code>null</code> permitted).
 * @param key  the edge (an instance of {@link RectangleEdge}) or <code>null</code> for the center block.
 */
@Override public void add(Block block,Object key){
  if (key == null) {
    this.centerBlock=block;
  }
 else {
    RectangleEdge edge=(RectangleEdge)key;
    if (edge == RectangleEdge.TOP) {
      this.topBlock=block;
    }
 else     if (edge == RectangleEdge.BOTTOM) {
      this.bottomBlock=block;
    }
 else     if (edge == RectangleEdge.LEFT) {
      this.leftBlock=block;
    }
 else     if (edge == RectangleEdge.RIGHT) {
      this.rightBlock=block;
    }
  }
}

Fixed version (ground truth):
/** 
 * Adds a block to the arrangement manager at the specified edge. If the key is not an instance of   {@link RectangleEdge} the block willbe added in the center.
 * @param block  the block (<code>null</code> permitted).
 * @param key  the edge (an instance of {@link RectangleEdge}) or <code>null</code> for the center block.
 */
@Override public void add(Block block,Object key){
  if (!(key instanceof RectangleEdge)) {
    this.centerBlock=block;
  }
 else {
    RectangleEdge edge=(RectangleEdge)key;
    if (edge == RectangleEdge.TOP) {
      this.topBlock=block;
    }
 else     if (edge == RectangleEdge.BOTTOM) {
      this.bottomBlock=block;
    }
 else     if (edge == RectangleEdge.LEFT) {
      this.leftBlock=block;
    }
 else     if (edge == RectangleEdge.RIGHT) {
      this.rightBlock=block;
    }
  }
}