nus-yam/ex-repair huggingface dataset:
Program: 85877
Project: 85877
Buggy source:
/** 
 * Sets the alpha transparency that should be used when drawing the marker, and sends a   {@link MarkerChangeEvent} to all registeredlisteners.  The alpha transparency is a value in the range 0.0f (completely transparent) to 1.0f (completely opaque).
 * @param alpha  the alpha transparency (must be in the range 0.0f to1.0f).
 * @throws IllegalArgumentException if <code>alpha</code> is not in thespecified range.
 * @see #getAlpha()
 */
public void setAlpha(float alpha){
  if (alpha < 0.0f || alpha > 1.0f)   throw new IllegalArgumentException("String_Node_Str");
  this.alpha=alpha;
  notifyListeners(new MarkerChangeEvent(this));
}

Fixed version (ground truth):
/** 
 * Sets the alpha transparency that should be used when drawing the marker, and sends a   {@link MarkerChangeEvent} to all registeredlisteners.  The alpha transparency is a value in the range 0.0f (completely transparent) to 1.0f (completely opaque).
 * @param alpha  the alpha transparency (must be in the range 0.0f to1.0f).
 * @throws IllegalArgumentException if <code>alpha</code> is not in thespecified range.
 * @see #getAlpha()
 */
public void setAlpha(float alpha){
  if (alpha < 0.0f || alpha > 1.0f) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.alpha=alpha;
  notifyListeners(new MarkerChangeEvent(this));
}
Program: 85878
Project: 85878
Buggy source:
/** 
 * Constructs a new marker.
 * @param paint  the paint (<code>null</code> not permitted).
 * @param stroke  the stroke (<code>null</code> not permitted).
 * @param outlinePaint  the outline paint (<code>null</code> permitted).
 * @param outlineStroke  the outline stroke (<code>null</code> permitted).
 * @param alpha  the alpha transparency (must be in the range 0.0f to1.0f).
 * @throws IllegalArgumentException if <code>paint</code> or<code>stroke</code> is <code>null</code>, or <code>alpha</code> is not in the specified range.
 */
protected Marker(Paint paint,Stroke stroke,Paint outlinePaint,Stroke outlineStroke,float alpha){
  if (paint == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (stroke == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (alpha < 0.0f || alpha > 1.0f)   throw new IllegalArgumentException("String_Node_Str");
  this.paint=paint;
  this.stroke=stroke;
  this.outlinePaint=outlinePaint;
  this.outlineStroke=outlineStroke;
  this.alpha=alpha;
  this.labelFont=new Font("String_Node_Str",Font.PLAIN,9);
  this.labelPaint=Color.BLACK;
  this.labelAnchor=RectangleAnchor.TOP_LEFT;
  this.labelOffset=new RectangleInsets(3.0,3.0,3.0,3.0);
  this.labelOffsetType=LengthAdjustmentType.CONTRACT;
  this.labelTextAnchor=TextAnchor.CENTER;
  this.listenerList=new EventListenerList();
}

Fixed version (ground truth):
/** 
 * Constructs a new marker.
 * @param paint  the paint (<code>null</code> not permitted).
 * @param stroke  the stroke (<code>null</code> not permitted).
 * @param outlinePaint  the outline paint (<code>null</code> permitted).
 * @param outlineStroke  the outline stroke (<code>null</code> permitted).
 * @param alpha  the alpha transparency (must be in the range 0.0f to1.0f).
 * @throws IllegalArgumentException if <code>paint</code> or<code>stroke</code> is <code>null</code>, or <code>alpha</code> is not in the specified range.
 */
protected Marker(Paint paint,Stroke stroke,Paint outlinePaint,Stroke outlineStroke,float alpha){
  if (paint == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (stroke == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (alpha < 0.0f || alpha > 1.0f) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.paint=paint;
  this.stroke=stroke;
  this.outlinePaint=outlinePaint;
  this.outlineStroke=outlineStroke;
  this.alpha=alpha;
  this.labelFont=new Font("String_Node_Str",Font.PLAIN,9);
  this.labelPaint=Color.BLACK;
  this.labelAnchor=RectangleAnchor.TOP_LEFT;
  this.labelOffset=new RectangleInsets(3.0,3.0,3.0,3.0);
  this.labelOffsetType=LengthAdjustmentType.CONTRACT;
  this.labelTextAnchor=TextAnchor.CENTER;
  this.listenerList=new EventListenerList();
}
Program: 85879
Project: 85879
Buggy source:
/** 
 * Sets the alpha transparency used when drawing the background image.
 * @param alpha  the alpha transparency (in the range 0.0f to 1.0f, where0.0f is fully transparent, and 1.0f is fully opaque).
 * @throws IllegalArgumentException if <code>alpha</code> is not withinthe specified range.
 * @see #getBackgroundImageAlpha()
 */
public void setBackgroundImageAlpha(float alpha){
  if (alpha < 0.0f || alpha > 1.0f)   throw new IllegalArgumentException("String_Node_Str");
  if (this.backgroundImageAlpha != alpha) {
    this.backgroundImageAlpha=alpha;
    fireChangeEvent();
  }
}

Fixed version (ground truth):
/** 
 * Sets the alpha transparency used when drawing the background image.
 * @param alpha  the alpha transparency (in the range 0.0f to 1.0f, where0.0f is fully transparent, and 1.0f is fully opaque).
 * @throws IllegalArgumentException if <code>alpha</code> is not withinthe specified range.
 * @see #getBackgroundImageAlpha()
 */
public void setBackgroundImageAlpha(float alpha){
  if (alpha < 0.0f || alpha > 1.0f) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (this.backgroundImageAlpha != alpha) {
    this.backgroundImageAlpha=alpha;
    fireChangeEvent();
  }
}
Program: 85880
Project: 85880
Buggy source:
/** 
 * Translates a (theta, radius) pair into Java2D coordinates.  If <code>radius</code> is less than the lower bound of the axis, then this method returns the centre point.
 * @param angleDegrees  the angle in degrees.
 * @param radius  the radius.
 * @param dataArea  the data area.
 * @return A point in Java2D space.
 * @since 1.0.14
 */
public Point translateToJava2D(double angleDegrees,double radius,ValueAxis axis,Rectangle2D dataArea){
  if (counterClockwise)   angleDegrees=-angleDegrees;
  double radians=Math.toRadians(angleDegrees + this.angleOffset);
  double minx=dataArea.getMinX() + this.margin;
  double maxx=dataArea.getMaxX() - this.margin;
  double miny=dataArea.getMinY() + this.margin;
  double maxy=dataArea.getMaxY() - this.margin;
  double halfWidth=(maxx - minx) / 2.0;
  double halfHeight=(maxy - miny) / 2.0;
  double midX=minx + halfWidth;
  double midY=miny + halfHeight;
  double l=Math.min(halfWidth,halfHeight);
  Rectangle2D quadrant=new Rectangle2D.Double(midX,midY,l,l);
  double axisMin=axis.getLowerBound();
  double adjustedRadius=Math.max(radius,axisMin);
  double length=axis.valueToJava2D(adjustedRadius,quadrant,RectangleEdge.BOTTOM) - midX;
  float x=(float)(midX + Math.cos(radians) * length);
  float y=(float)(midY + Math.sin(radians) * length);
  int ix=Math.round(x);
  int iy=Math.round(y);
  Point p=new Point(ix,iy);
  return p;
}

Fixed version (ground truth):
/** 
 * Translates a (theta, radius) pair into Java2D coordinates.  If <code>radius</code> is less than the lower bound of the axis, then this method returns the centre point.
 * @param angleDegrees  the angle in degrees.
 * @param radius  the radius.
 * @param dataArea  the data area.
 * @return A point in Java2D space.
 * @since 1.0.14
 */
public Point translateToJava2D(double angleDegrees,double radius,ValueAxis axis,Rectangle2D dataArea){
  if (counterClockwise) {
    angleDegrees=-angleDegrees;
  }
  double radians=Math.toRadians(angleDegrees + this.angleOffset);
  double minx=dataArea.getMinX() + this.margin;
  double maxx=dataArea.getMaxX() - this.margin;
  double miny=dataArea.getMinY() + this.margin;
  double maxy=dataArea.getMaxY() - this.margin;
  double halfWidth=(maxx - minx) / 2.0;
  double halfHeight=(maxy - miny) / 2.0;
  double midX=minx + halfWidth;
  double midY=miny + halfHeight;
  double l=Math.min(halfWidth,halfHeight);
  Rectangle2D quadrant=new Rectangle2D.Double(midX,midY,l,l);
  double axisMin=axis.getLowerBound();
  double adjustedRadius=Math.max(radius,axisMin);
  double length=axis.valueToJava2D(adjustedRadius,quadrant,RectangleEdge.BOTTOM) - midX;
  float x=(float)(midX + Math.cos(radians) * length);
  float y=(float)(midY + Math.sin(radians) * length);
  int ix=Math.round(x);
  int iy=Math.round(y);
  Point p=new Point(ix,iy);
  return p;
}
Program: 85882
Project: 85882
Buggy source:
/** 
 * Binding this object to the session has no additional effects.
 * @param event  the session bind event.
 */
@Override public void valueBound(HttpSessionBindingEvent event){
  return;
}

Fixed version (ground truth):
/** 
 * Binding this object to the session has no additional effects.
 * @param event  the session bind event.
 */
@Override public void valueBound(HttpSessionBindingEvent event){
}
Program: 85883
Project: 85883
Buggy source:
/** 
 * When this object is unbound from the session (including upon session expiry) the files that have been added to the ArrayList are iterated and deleted.
 * @param event  the session unbind event.
 */
@Override public void valueUnbound(HttpSessionBindingEvent event){
  Iterator iter=this.chartNames.listIterator();
  while (iter.hasNext()) {
    String filename=(String)iter.next();
    File file=new File(System.getProperty("String_Node_Str"),filename);
    if (file.exists()) {
      file.delete();
    }
  }
  return;
}

Fixed version (ground truth):
/** 
 * When this object is unbound from the session (including upon session expiry) the files that have been added to the ArrayList are iterated and deleted.
 * @param event  the session unbind event.
 */
@Override public void valueUnbound(HttpSessionBindingEvent event){
  File tempDir=new File(System.getProperty("String_Node_Str"));
  for (  String filename : this.chartNames) {
    File file=new File(tempDir,filename);
    if (file.exists()) {
      file.delete();
    }
  }
}
Program: 85884
Project: 85884
Buggy source:
/** 
 * Returns a string that is equivalent to the input string, but with special characters converted to HTML escape sequences.
 * @param input  the string to escape (<code>null</code> not permitted).
 * @return A string with characters escaped.
 * @since 1.0.9
 */
public static String htmlEscape(String input){
  if (input == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  StringBuffer result=new StringBuffer();
  int length=input.length();
  for (int i=0; i < length; i++) {
    char c=input.charAt(i);
    if (c == '&') {
      result.append("String_Node_Str");
    }
 else     if (c == '\"') {
      result.append("String_Node_Str");
    }
 else     if (c == '<') {
      result.append("String_Node_Str");
    }
 else     if (c == '>') {
      result.append("String_Node_Str");
    }
 else     if (c == '\'') {
      result.append("String_Node_Str");
    }
 else     if (c == '\\') {
      result.append("String_Node_Str");
    }
 else {
      result.append(c);
    }
  }
  return result.toString();
}

Fixed version (ground truth):
/** 
 * Returns a string that is equivalent to the input string, but with special characters converted to HTML escape sequences.
 * @param input  the string to escape (<code>null</code> not permitted).
 * @return A string with characters escaped.
 * @since 1.0.9
 */
public static String htmlEscape(String input){
  if (input == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  StringBuilder result=new StringBuilder();
  int length=input.length();
  for (int i=0; i < length; i++) {
    char c=input.charAt(i);
    if (c == '&') {
      result.append("String_Node_Str");
    }
 else     if (c == '\"') {
      result.append("String_Node_Str");
    }
 else     if (c == '<') {
      result.append("String_Node_Str");
    }
 else     if (c == '>') {
      result.append("String_Node_Str");
    }
 else     if (c == '\'') {
      result.append("String_Node_Str");
    }
 else     if (c == '\\') {
      result.append("String_Node_Str");
    }
 else {
      result.append(c);
    }
  }
  return result.toString();
}
Program: 85886
Project: 85886
Buggy source:
/** 
 * Returns a string that is equivalent to the input string, but with special characters converted to JavaScript escape sequences.
 * @param input  the string to escape (<code>null</code> not permitted).
 * @return A string with characters escaped.
 * @since 1.0.13
 */
public static String javascriptEscape(String input){
  if (input == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  StringBuffer result=new StringBuffer();
  int length=input.length();
  for (int i=0; i < length; i++) {
    char c=input.charAt(i);
    if (c == '\"') {
      result.append("String_Node_Str");
    }
 else     if (c == '\'') {
      result.append("String_Node_Str");
    }
 else     if (c == '\\') {
      result.append("String_Node_Str");
    }
 else {
      result.append(c);
    }
  }
  return result.toString();
}

Fixed version (ground truth):
/** 
 * Returns a string that is equivalent to the input string, but with special characters converted to JavaScript escape sequences.
 * @param input  the string to escape (<code>null</code> not permitted).
 * @return A string with characters escaped.
 * @since 1.0.13
 */
public static String javascriptEscape(String input){
  if (input == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  StringBuilder result=new StringBuilder();
  int length=input.length();
  for (int i=0; i < length; i++) {
    char c=input.charAt(i);
    if (c == '\"') {
      result.append("String_Node_Str");
    }
 else     if (c == '\'') {
      result.append("String_Node_Str");
    }
 else     if (c == '\\') {
      result.append("String_Node_Str");
    }
 else {
      result.append(c);
    }
  }
  return result.toString();
}
Program: 85887
Project: 85887
Buggy source:
/** 
 * Generates a label for the specified series.  This label will be used for the chart legend.
 * @param dataset  the dataset (<code>null</code> not permitted).
 * @param series  the series.
 * @return A series label.
 */
@Override public String generateLabel(XYDataset dataset,int series){
  if (dataset == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  StringBuffer label=new StringBuffer();
  label.append(MessageFormat.format(this.formatPattern,createItemArray(dataset,series)));
  Integer key=new Integer(series);
  List extraLabels=(List)this.seriesLabelLists.get(key);
  if (extraLabels != null) {
    Object[] temp=new Object[1];
    for (int i=0; i < extraLabels.size(); i++) {
      temp[0]=extraLabels.get(i);
      String labelAddition=MessageFormat.format(this.additionalFormatPattern,temp);
      label.append(labelAddition);
    }
  }
  return label.toString();
}

Fixed version (ground truth):
/** 
 * Generates a label for the specified series.  This label will be used for the chart legend.
 * @param dataset  the dataset (<code>null</code> not permitted).
 * @param series  the series.
 * @return A series label.
 */
@Override public String generateLabel(XYDataset dataset,int series){
  if (dataset == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  StringBuilder label=new StringBuilder();
  label.append(MessageFormat.format(this.formatPattern,createItemArray(dataset,series)));
  Integer key=new Integer(series);
  List extraLabels=(List)this.seriesLabelLists.get(key);
  if (extraLabels != null) {
    Object[] temp=new Object[1];
    for (int i=0; i < extraLabels.size(); i++) {
      temp[0]=extraLabels.get(i);
      String labelAddition=MessageFormat.format(this.additionalFormatPattern,temp);
      label.append(labelAddition);
    }
  }
  return label.toString();
}
Program: 85888
Project: 85888
Buggy source:
/** 
 * Returns a string representation of the chart entity, useful for debugging.
 * @return A string.
 */
@Override public String toString(){
  StringBuffer buf=new StringBuffer("String_Node_Str");
  buf.append("String_Node_Str");
  buf.append(getToolTipText());
  return buf.toString();
}

Fixed version (ground truth):
/** 
 * Returns a string representation of the chart entity, useful for debugging.
 * @return A string.
 */
@Override public String toString(){
  StringBuilder buf=new StringBuilder("String_Node_Str");
  buf.append("String_Node_Str");
  buf.append(getToolTipText());
  return buf.toString();
}
Program: 85889
Project: 85889
Buggy source:
/** 
 * Returns a string representation of this entity.  This is primarily useful for debugging.
 * @return A string representation of this entity.
 */
@Override public String toString(){
  StringBuffer buf=new StringBuffer("String_Node_Str");
  buf.append("String_Node_Str");
  buf.append(this.key);
  buf.append("String_Node_Str" + getToolTipText());
  buf.append("String_Node_Str" + getURLText());
  return buf.toString();
}

Fixed version (ground truth):
/** 
 * Returns a string representation of this entity.  This is primarily useful for debugging.
 * @return A string representation of this entity.
 */
@Override public String toString(){
  StringBuilder buf=new StringBuilder("String_Node_Str");
  buf.append("String_Node_Str");
  buf.append(this.key);
  buf.append("String_Node_Str").append(getToolTipText());
  buf.append("String_Node_Str").append(getURLText());
  return buf.toString();
}
Program: 85890
Project: 85890
Buggy source:
/** 
 * Returns a string containing the coordinates for a given shape.  This string is intended for use in an image map.
 * @param shape  the shape (<code>null</code> not permitted).
 * @return The coordinates for a given shape as string.
 */
private String getPolyCoords(Shape shape){
  if (shape == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  StringBuffer result=new StringBuffer();
  boolean first=true;
  float[] coords=new float[6];
  PathIterator pi=shape.getPathIterator(null,1.0);
  while (!pi.isDone()) {
    pi.currentSegment(coords);
    if (first) {
      first=false;
      result.append((int)coords[0]);
      result.append("String_Node_Str").append((int)coords[1]);
    }
 else {
      result.append("String_Node_Str");
      result.append((int)coords[0]);
      result.append("String_Node_Str");
      result.append((int)coords[1]);
    }
    pi.next();
  }
  return result.toString();
}

Fixed version (ground truth):
/** 
 * Returns a string containing the coordinates for a given shape.  This string is intended for use in an image map.
 * @param shape  the shape (<code>null</code> not permitted).
 * @return The coordinates for a given shape as string.
 */
private String getPolyCoords(Shape shape){
  if (shape == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  StringBuilder result=new StringBuilder();
  boolean first=true;
  float[] coords=new float[6];
  PathIterator pi=shape.getPathIterator(null,1.0);
  while (!pi.isDone()) {
    pi.currentSegment(coords);
    if (first) {
      first=false;
      result.append((int)coords[0]);
      result.append("String_Node_Str").append((int)coords[1]);
    }
 else {
      result.append("String_Node_Str");
      result.append((int)coords[0]);
      result.append("String_Node_Str");
      result.append((int)coords[1]);
    }
    pi.next();
  }
  return result.toString();
}
Program: 85891
Project: 85891
Buggy source:
/** 
 * Returns a string representation of the chart entity, useful for debugging.
 * @return A string.
 */
@Override public String toString(){
  StringBuffer buf=new StringBuffer("String_Node_Str");
  buf.append("String_Node_Str");
  buf.append(this.toolTipText);
  return buf.toString();
}

Fixed version (ground truth):
/** 
 * Returns a string representation of the chart entity, useful for debugging.
 * @return A string.
 */
@Override public String toString(){
  StringBuilder buf=new StringBuilder("String_Node_Str");
  buf.append("String_Node_Str");
  buf.append(this.toolTipText);
  return buf.toString();
}
Program: 85892
Project: 85892
Buggy source:
/** 
 * Returns an HTML image map tag for this entity.  The returned fragment should be <code>XHTML 1.0</code> compliant.
 * @param toolTipTagFragmentGenerator  a generator for the HTML fragmentthat will contain the tooltip text (<code>null</code> not permitted if this entity contains tooltip information).
 * @param urlTagFragmentGenerator  a generator for the HTML fragment thatwill contain the URL reference (<code>null</code> not permitted if this entity has a URL).
 * @return The HTML tag.
 */
public String getImageMapAreaTag(ToolTipTagFragmentGenerator toolTipTagFragmentGenerator,URLTagFragmentGenerator urlTagFragmentGenerator){
  StringBuffer tag=new StringBuffer();
  boolean hasURL=(this.urlText == null ? false : !this.urlText.equals("String_Node_Str"));
  boolean hasToolTip=(this.toolTipText == null ? false : !this.toolTipText.equals("String_Node_Str"));
  if (hasURL || hasToolTip) {
    tag.append("String_Node_Str" + getShapeType() + "String_Node_Str"+ "String_Node_Str"+ getShapeCoords()+ "String_Node_Str");
    if (hasToolTip) {
      tag.append(toolTipTagFragmentGenerator.generateToolTipFragment(this.toolTipText));
    }
    if (hasURL) {
      tag.append(urlTagFragmentGenerator.generateURLFragment(this.urlText));
    }
 else {
      tag.append("String_Node_Str");
    }
    if (!hasToolTip) {
      tag.append("String_Node_Str");
    }
    tag.append("String_Node_Str");
  }
  return tag.toString();
}

Fixed version (ground truth):
/** 
 * Returns an HTML image map tag for this entity.  The returned fragment should be <code>XHTML 1.0</code> compliant.
 * @param toolTipTagFragmentGenerator  a generator for the HTML fragmentthat will contain the tooltip text (<code>null</code> not permitted if this entity contains tooltip information).
 * @param urlTagFragmentGenerator  a generator for the HTML fragment thatwill contain the URL reference (<code>null</code> not permitted if this entity has a URL).
 * @return The HTML tag.
 */
public String getImageMapAreaTag(ToolTipTagFragmentGenerator toolTipTagFragmentGenerator,URLTagFragmentGenerator urlTagFragmentGenerator){
  StringBuilder tag=new StringBuilder();
  boolean hasURL=(this.urlText == null ? false : !this.urlText.equals("String_Node_Str"));
  boolean hasToolTip=(this.toolTipText == null ? false : !this.toolTipText.equals("String_Node_Str"));
  if (hasURL || hasToolTip) {
    tag.append("String_Node_Str" + getShapeType() + "String_Node_Str"+ "String_Node_Str"+ getShapeCoords()+ "String_Node_Str");
    if (hasToolTip) {
      tag.append(toolTipTagFragmentGenerator.generateToolTipFragment(this.toolTipText));
    }
    if (hasURL) {
      tag.append(urlTagFragmentGenerator.generateURLFragment(this.urlText));
    }
 else {
      tag.append("String_Node_Str");
    }
    if (!hasToolTip) {
      tag.append("String_Node_Str");
    }
    tag.append("String_Node_Str");
  }
  return tag.toString();
}
Program: 85893
Project: 85893
Buggy source:
/** 
 * Returns a string representation of the chart entity, useful for debugging.
 * @return A string.
 */
@Override public String toString(){
  StringBuffer buf=new StringBuffer("String_Node_Str");
  buf.append("String_Node_Str");
  buf.append(getToolTipText());
  return buf.toString();
}

Fixed version (ground truth):
/** 
 * Returns a string representation of the chart entity, useful for debugging.
 * @return A string.
 */
@Override public String toString(){
  StringBuilder buf=new StringBuilder("String_Node_Str");
  buf.append("String_Node_Str");
  buf.append(getToolTipText());
  return buf.toString();
}
Program: 85894
Project: 85894
Buggy source:
/** 
 * Returns a string representation of the plot entity, useful for debugging.
 * @return A string.
 */
@Override public String toString(){
  StringBuffer buf=new StringBuffer("String_Node_Str");
  buf.append("String_Node_Str");
  buf.append(getToolTipText());
  return buf.toString();
}

Fixed version (ground truth):
/** 
 * Returns a string representation of the plot entity, useful for debugging.
 * @return A string.
 */
@Override public String toString(){
  StringBuilder buf=new StringBuilder("String_Node_Str");
  buf.append("String_Node_Str");
  buf.append(getToolTipText());
  return buf.toString();
}
Program: 85895
Project: 85895
Buggy source:
/** 
 * Returns a string representation of the chart entity, useful for debugging.
 * @return A string.
 */
@Override public String toString(){
  StringBuffer buf=new StringBuffer("String_Node_Str");
  buf.append("String_Node_Str");
  buf.append(getToolTipText());
  return buf.toString();
}

Fixed version (ground truth):
/** 
 * Returns a string representation of the chart entity, useful for debugging.
 * @return A string.
 */
@Override public String toString(){
  StringBuilder buf=new StringBuilder("String_Node_Str");
  buf.append("String_Node_Str");
  buf.append(getToolTipText());
  return buf.toString();
}
Program: 85896
Project: 85896
Buggy source:
/** 
 * Creates a new comparator.
 * @param type  the type (<code>BY_KEY</code> or <code>BY_VALUE</code>,<code>null</code> not permitted).
 * @param order  the order (<code>null</code> not permitted).
 */
public KeyedValueComparator(KeyedValueComparatorType type,SortOrder order){
  if (order == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.type=type;
  this.order=order;
}

Fixed version (ground truth):
/** 
 * Creates a new comparator.
 * @param type  the type (<code>BY_KEY</code> or <code>BY_VALUE</code>,<code>null</code> not permitted).
 * @param order  the order (<code>null</code> not permitted).
 */
public KeyedValueComparator(KeyedValueComparatorType type,SortOrder order){
  ParamChecks.nullNotPermitted(type,"String_Node_Str");
  ParamChecks.nullNotPermitted(order,"String_Node_Str");
  this.type=type;
  this.order=order;
}
Program: 85897
Project: 85897
Buggy source:
/** 
 * Sets up default encoders (uses Sun PNG Encoder if JDK 1.4+ and the SunPNGEncoderAdapter class is available).
 */
private static void init(){
  encoders=new Hashtable();
  encoders.put("String_Node_Str","String_Node_Str");
  try {
    Class.forName("String_Node_Str");
    Class.forName("String_Node_Str");
    encoders.put("String_Node_Str","String_Node_Str");
    encoders.put("String_Node_Str","String_Node_Str");
  }
 catch (  ClassNotFoundException e) {
    encoders.put("String_Node_Str","String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Sets up default encoders (uses Sun PNG Encoder if JDK 1.4+ and the SunPNGEncoderAdapter class is available).
 */
private static void init(){
  encoders=new HashMap<String,String>();
  encoders.put("String_Node_Str","String_Node_Str");
  encoders.put("String_Node_Str","String_Node_Str");
}
Program: 85898
Project: 85898
Buggy source:
/** 
 * Returns a string containing a description of the object for debugging purposes.
 * @return A string.
 */
@Override public String toString(){
  StringBuffer result=new StringBuffer();
  for (int i=0; i < this.labels.size(); i++) {
    result.append(getPieLabelRecord(i).toString()).append("String_Node_Str");
  }
  return result.toString();
}

Fixed version (ground truth):
/** 
 * Returns a string containing a description of the object for debugging purposes.
 * @return A string.
 */
@Override public String toString(){
  StringBuilder result=new StringBuilder();
  for (int i=0; i < this.labels.size(); i++) {
    result.append(getPieLabelRecord(i).toString()).append("String_Node_Str");
  }
  return result.toString();
}
Program: 85900
Project: 85900
Buggy source:
/** 
 * Creates a new series with the specified key and description.
 * @param key  the series key (<code>null</code> NOT permitted).
 * @param description  the series description (<code>null</code> permitted).
 */
protected Series(Comparable key,String description){
  if (key == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.key=key;
  this.description=description;
  this.listeners=new EventListenerList();
  this.propertyChangeSupport=new PropertyChangeSupport(this);
  this.vetoableChangeSupport=new VetoableChangeSupport(this);
  this.notify=true;
}

Fixed version (ground truth):
/** 
 * Creates a new series with the specified key and description.
 * @param key  the series key (<code>null</code> NOT permitted).
 * @param description  the series description (<code>null</code> permitted).
 */
protected Series(Comparable key,String description){
  ParamChecks.nullNotPermitted(key,"String_Node_Str");
  this.key=key;
  this.description=description;
  this.listeners=new EventListenerList();
  this.propertyChangeSupport=new PropertyChangeSupport(this);
  this.vetoableChangeSupport=new VetoableChangeSupport(this);
  this.notify=true;
}
Program: 85901
Project: 85901
Buggy source:
/** 
 * Sets the key for the series and sends a <code>VetoableChangeEvent</code> (with the property name "Key") to all registered listeners.  For  backwards compatibility, this method also fires a regular  <code>PropertyChangeEvent</code>.
 * @param key  the key (<code>null</code> not permitted).
 * @see #getKey()
 */
public void setKey(Comparable key){
  ParamChecks.nullNotPermitted(key,"String_Node_Str");
  Comparable old=this.key;
  try {
    this.vetoableChangeSupport.fireVetoableChange("String_Node_Str",old,key);
    this.key=key;
    this.propertyChangeSupport.firePropertyChange("String_Node_Str",old,key);
  }
 catch (  PropertyVetoException e) {
    throw new IllegalArgumentException(e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * Sets the key for the series and sends a <code>VetoableChangeEvent</code> (with the property name "Key") to all registered listeners.  If the change is vetoed by a listener, this method will throw an  IllegalArgumentException.
 * @param key  the key (<code>null</code> not permitted).
 * @see #getKey()
 */
public void setKey(Comparable key){
  ParamChecks.nullNotPermitted(key,"String_Node_Str");
  Comparable old=this.key;
  try {
    this.vetoableChangeSupport.fireVetoableChange("String_Node_Str",old,key);
    this.key=key;
  }
 catch (  PropertyVetoException e) {
    throw new IllegalArgumentException(e);
  }
}
Program: 85902
Project: 85902
Buggy source:
/** 
 * Removes all the series from the collection and sends a  {@link DatasetChangeEvent} to all registered listeners.
 */
public void removeAllSeries(){
  for (int i=0; i < this.data.size(); i++) {
    XYSeries series=(XYSeries)this.data.get(i);
    series.removeChangeListener(this);
    series.removeVetoableChangeListener(this);
  }
  this.data.clear();
  fireDatasetChanged();
}

Fixed version (ground truth):
/** 
 * Removes all the series from the collection and sends a  {@link DatasetChangeEvent} to all registered listeners.
 */
public void removeAllSeries(){
  for (  XYSeries series : this.data) {
    series.removeChangeListener(this);
    series.removeVetoableChangeListener(this);
  }
  this.data.clear();
  fireDatasetChanged();
}
Program: 85903
Project: 85903
Buggy source:
/** 
 * Removes a series from the collection and sends a  {@link DatasetChangeEvent} to all registered listeners.
 * @param series  the series (<code>null</code> not permitted).
 */
public void removeSeries(XYSeries series){
  if (series == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (this.data.contains(series)) {
    series.removeChangeListener(this);
    series.removeVetoableChangeListener(this);
    this.data.remove(series);
    fireDatasetChanged();
  }
}

Fixed version (ground truth):
/** 
 * Removes a series from the collection and sends a  {@link DatasetChangeEvent} to all registered listeners.
 * @param series  the series (<code>null</code> not permitted).
 */
public void removeSeries(XYSeries series){
  ParamChecks.nullNotPermitted(series,"String_Node_Str");
  if (this.data.contains(series)) {
    series.removeChangeListener(this);
    series.removeVetoableChangeListener(this);
    this.data.remove(series);
    fireDatasetChanged();
  }
}
Program: 85904
Project: 85904
Buggy source:
/** 
 * Returns the index of the specified series, or -1 if that series is not present in the dataset.
 * @param series  the series (<code>null</code> not permitted).
 * @return The series index.
 * @since 1.0.6
 */
public int indexOf(XYSeries series){
  if (series == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  return this.data.indexOf(series);
}

Fixed version (ground truth):
/** 
 * Returns the index of the specified series, or -1 if that series is not present in the dataset.
 * @param series  the series (<code>null</code> not permitted).
 * @return The series index.
 * @since 1.0.6
 */
public int indexOf(XYSeries series){
  ParamChecks.nullNotPermitted(series,"String_Node_Str");
  return this.data.indexOf(series);
}
Program: 85905
Project: 85905
Buggy source:
/** 
 * Returns the x-value for the specified series and item.
 * @param series  the series (zero-based index).
 * @param item  the item (zero-based index).
 * @return The value.
 */
@Override public Number getX(int series,int item){
  XYSeries s=(XYSeries)this.data.get(series);
  return s.getX(item);
}

Fixed version (ground truth):
/** 
 * Returns the x-value for the specified series and item.
 * @param series  the series (zero-based index).
 * @param item  the item (zero-based index).
 * @return The value.
 */
@Override public Number getX(int series,int item){
  XYSeries s=this.data.get(series);
  return s.getX(item);
}
Program: 85906
Project: 85906
Buggy source:
/** 
 * Returns the y-value for the specified series and item.
 * @param series  the series (zero-based index).
 * @param index  the index of the item of interest (zero-based).
 * @return The value (possibly <code>null</code>).
 */
@Override public Number getY(int series,int index){
  XYSeries s=(XYSeries)this.data.get(series);
  return s.getY(index);
}

Fixed version (ground truth):
/** 
 * Returns the y-value for the specified series and item.
 * @param series  the series (zero-based index).
 * @param index  the index of the item of interest (zero-based).
 * @return The value (possibly <code>null</code>).
 */
@Override public Number getY(int series,int index){
  XYSeries s=this.data.get(series);
  return s.getY(index);
}
Program: 85907
Project: 85907
Buggy source:
/** 
 * Returns a series from the collection.
 * @param key  the key (<code>null</code> not permitted).
 * @return The series with the specified key.
 * @throws UnknownKeyException if <code>key</code> is not found in thecollection.
 * @since 1.0.9
 */
public XYSeries getSeries(Comparable key){
  if (key == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  Iterator iterator=this.data.iterator();
  while (iterator.hasNext()) {
    XYSeries series=(XYSeries)iterator.next();
    if (key.equals(series.getKey())) {
      return series;
    }
  }
  throw new UnknownKeyException("String_Node_Str" + key);
}

Fixed version (ground truth):
/** 
 * Returns a series from the collection.
 * @param key  the key (<code>null</code> not permitted).
 * @return The series with the specified key.
 * @throws UnknownKeyException if <code>key</code> is not found in thecollection.
 * @since 1.0.9
 */
public XYSeries getSeries(Comparable key){
  ParamChecks.nullNotPermitted(key,"String_Node_Str");
  for (  XYSeries series : this.data) {
    if (key.equals(series.getKey())) {
      return series;
    }
  }
  throw new UnknownKeyException("String_Node_Str" + key);
}
Program: 85908
Project: 85908
Buggy source:
/** 
 * Constructs a dataset and populates it with a single series.
 * @param series  the series (<code>null</code> ignored).
 */
public XYSeriesCollection(XYSeries series){
  this.data=new java.util.ArrayList();
  this.intervalDelegate=new IntervalXYDelegate(this,false);
  addChangeListener(this.intervalDelegate);
  if (series != null) {
    this.data.add(series);
    series.addChangeListener(this);
    series.addVetoableChangeListener(this);
  }
}

Fixed version (ground truth):
/** 
 * Constructs a dataset and populates it with a single series.
 * @param series  the series (<code>null</code> ignored).
 */
public XYSeriesCollection(XYSeries series){
  this.data=new java.util.ArrayList<XYSeries>();
  this.intervalDelegate=new IntervalXYDelegate(this,false);
  addChangeListener(this.intervalDelegate);
  if (series != null) {
    this.data.add(series);
    series.addChangeListener(this);
    series.addVetoableChangeListener(this);
  }
}
Program: 85909
Project: 85909
Buggy source:
/** 
 * Receives notification that the key for one of the series in the  collection has changed, and vetos it if the key is already present in  the collection.
 * @param e  the event.
 * @since 1.0.14
 */
@Override public void vetoableChange(PropertyChangeEvent e) throws PropertyVetoException {
  if (!"String_Node_Str".equals(e.getPropertyName())) {
    return;
  }
  Series s=(Series)e.getSource();
  if (getSeries(s.getKey()) == null) {
    throw new IllegalStateException("String_Node_Str" + "String_Node_Str");
  }
  Comparable key=(Comparable)e.getNewValue();
  if (this.getSeries(key) != null) {
    throw new PropertyVetoException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Receives notification that the key for one of the series in the  collection has changed, and vetos it if the key is already present in  the collection.
 * @param e  the event.
 * @since 1.0.14
 */
@Override public void vetoableChange(PropertyChangeEvent e) throws PropertyVetoException {
  if (!"String_Node_Str".equals(e.getPropertyName())) {
    return;
  }
  Series s=(Series)e.getSource();
  if (getSeriesIndex(s.getKey()) == -1) {
    throw new IllegalStateException("String_Node_Str" + "String_Node_Str");
  }
  Comparable key=(Comparable)e.getNewValue();
  if (getSeriesIndex(key) >= 0) {
    throw new PropertyVetoException("String_Node_Str",e);
  }
}
Program: 85910
Project: 85910
Buggy source:
@Override @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) public TaskWrapper[] getAssignedTasksForGivenUser(String workspaceId,String userLogin) throws UserNotFoundException, UserNotActiveException, WorkspaceNotFoundException, WorkspaceNotEnabledException {
  User user=userManager.checkWorkspaceReadAccess(workspaceId);
  TaskDAO taskDAO=new TaskDAO(new Locale(user.getLanguage()),em);
  Task[] assignedTasks=taskDAO.findAssignedTasks(workspaceId,userLogin);
  List<TaskWrapper> taskWrappers=new ArrayList<>();
  for (  Task task : assignedTasks) {
    TaskWrapper taskWrapper=wrapTask(task,workspaceId);
    if (taskWrapper != null) {
      taskWrappers.add(taskWrapper);
    }
  }
  return taskWrappers.toArray(new TaskWrapper[taskWrappers.size()]);
}

Fixed version (ground truth):
@Override @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) public TaskWrapper[] getAssignedTasksForGivenUser(String workspaceId,String userLogin) throws UserNotFoundException, UserNotActiveException, WorkspaceNotFoundException, WorkspaceNotEnabledException {
  User user=userManager.checkWorkspaceReadAccess(workspaceId);
  TaskDAO taskDAO=new TaskDAO(new Locale(user.getLanguage()),em);
  Task[] assignedTasks=taskDAO.findAssignedTasks(workspaceId,userLogin);
  List<TaskWrapper> taskWrappers=Stream.of(assignedTasks).map(task -> wrapTask(task,workspaceId)).filter(taskWrapper -> taskWrapper != null).collect(Collectors.toList());
  return taskWrappers.toArray(new TaskWrapper[taskWrappers.size()]);
}
Program: 85911
Project: 85911
Buggy source:
@Override @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) public TaskWrapper[] getInProgressTasksForGivenUser(String workspaceId,String userLogin) throws UserNotFoundException, UserNotActiveException, WorkspaceNotFoundException, WorkspaceNotEnabledException {
  User user=userManager.checkWorkspaceReadAccess(workspaceId);
  TaskDAO taskDAO=new TaskDAO(new Locale(user.getLanguage()),em);
  Task[] inProgressTasks=taskDAO.findInProgressTasks(workspaceId,userLogin);
  List<TaskWrapper> taskWrappers=new ArrayList<>();
  for (  Task task : inProgressTasks) {
    TaskWrapper taskWrapper=wrapTask(task,workspaceId);
    if (taskWrapper != null) {
      taskWrappers.add(taskWrapper);
    }
  }
  return taskWrappers.toArray(new TaskWrapper[taskWrappers.size()]);
}

Fixed version (ground truth):
@Override @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) public TaskWrapper[] getInProgressTasksForGivenUser(String workspaceId,String userLogin) throws UserNotFoundException, UserNotActiveException, WorkspaceNotFoundException, WorkspaceNotEnabledException {
  User user=userManager.checkWorkspaceReadAccess(workspaceId);
  TaskDAO taskDAO=new TaskDAO(new Locale(user.getLanguage()),em);
  Task[] inProgressTasks=taskDAO.findInProgressTasks(workspaceId,userLogin);
  List<TaskWrapper> taskWrappers=Stream.of(inProgressTasks).map(task -> wrapTask(task,workspaceId)).filter(taskWrapper -> taskWrapper != null).collect(Collectors.toList());
  return taskWrappers.toArray(new TaskWrapper[taskWrappers.size()]);
}
Program: 85912
Project: 85912
Buggy source:
public List<String> runQuery(ProductInstanceIteration productInstanceIteration,Query query){
  cq.select(pdm);
  List<PathDataMaster> pathDataMasterList=productInstanceIteration.getPathDataMasterList();
  Set<Integer> pathIds=pathDataMasterList.stream().map(PathDataMaster::getId).collect(Collectors.toSet());
  Predicate pathFilter=cb.and(pdm.get("String_Node_Str").in(pathIds),cb.equal(pdi.get("String_Node_Str"),pdm));
  Predicate rulesPredicate=getPredicate(query.getPathDataQueryRule());
  cq.where(cb.and(pathFilter,rulesPredicate));
  TypedQuery<PathDataMaster> tp=em.createQuery(cq);
  Set<String> pathList=tp.getResultList().stream().map(PathDataMaster::getPath).collect(Collectors.toSet());
  return new ArrayList<>(pathList);
}

Fixed version (ground truth):
public List<String> runQuery(ProductInstanceIteration productInstanceIteration,Query query){
  cq.select(pdm);
  List<PathDataMaster> pathDataMasterList=productInstanceIteration.getPathDataMasterList();
  if (pathDataMasterList.isEmpty()) {
    return new ArrayList<>();
  }
  Set<Integer> pathIds=pathDataMasterList.stream().map(PathDataMaster::getId).collect(Collectors.toSet());
  Predicate pathFilter=cb.and(pdm.get("String_Node_Str").in(pathIds),cb.equal(pdi.get("String_Node_Str"),pdm));
  Predicate rulesPredicate=getPredicate(query.getPathDataQueryRule());
  cq.where(cb.and(pathFilter,rulesPredicate));
  TypedQuery<PathDataMaster> tp=em.createQuery(cq);
  Set<String> pathList=tp.getResultList().stream().map(PathDataMaster::getPath).collect(Collectors.toSet());
  return new ArrayList<>(pathList);
}
Program: 85913
Project: 85913
Buggy source:
private void sendMessage(String login,String name,String subject,String content) throws MessagingException {
  try {
    InternetAddress emailAddress=new InternetAddress(login,name);
    Message message=new MimeMessage(mailSession);
    message.addRecipient(Message.RecipientType.TO,emailAddress);
    message.setSubject(subject);
    message.setSentDate(new Date());
    message.setContent(content,"String_Node_Str");
    message.setFrom();
    Transport.send(message);
  }
 catch (  UnsupportedEncodingException e) {
    logUnsupportedEncodingException(e);
  }
}

Fixed version (ground truth):
private void sendMessage(String email,String name,String subject,String content) throws MessagingException {
  try {
    InternetAddress emailAddress=new InternetAddress(email,name);
    Message message=new MimeMessage(mailSession);
    message.addRecipient(Message.RecipientType.TO,emailAddress);
    message.setSubject(subject);
    message.setSentDate(new Date());
    message.setContent(content,"String_Node_Str");
    message.setFrom();
    Transport.send(message);
  }
 catch (  UnsupportedEncodingException e) {
    logUnsupportedEncodingException(e);
  }
}
Program: 85914
Project: 85914
Buggy source:
public Organization getOrganizationOfCurrentUser() throws AccountNotFoundException {
  Account account=accountManager.getMyAccount();
  return organizationManager.getOrganizationOfAccount(account.getLogin());
}

Fixed version (ground truth):
private Organization getOrganizationOfCurrentUser() throws AccountNotFoundException {
  Account account=accountManager.getMyAccount();
  return organizationManager.getOrganizationOfAccount(account.getLogin());
}
Program: 85915
Project: 85915
Buggy source:
@GET @Path("String_Node_Str") @ApiOperation(value="String_Node_Str",response=Response.class) @Produces(MediaType.APPLICATION_JSON) public List<Account> getMembers() throws AccountNotFoundException, OrganizationNotFoundException, AccessRightException {
  Organization organization=this.getOrganizationOfCurrentUser();
  return organization.getMembers();
}

Fixed version (ground truth):
@GET @Path("String_Node_Str") @ApiOperation(value="String_Node_Str",response=AccountDTO.class,responseContainer="String_Node_Str") @Produces(MediaType.APPLICATION_JSON) public AccountDTO[] getMembers() throws AccountNotFoundException, OrganizationNotFoundException, AccessRightException {
  Organization organization=this.getOrganizationOfCurrentUser();
  List<Account> accounts=organization.getMembers();
  AccountDTO[] dtos=new AccountDTO[accounts.size()];
  for (int i=0; i < accounts.size(); i++) {
    dtos[i]=mapper.map(accounts.get(i),AccountDTO.class);
  }
  return dtos;
}
Program: 85920
Project: 85920
Buggy source:
/** 
 * test the add of new tags to a part that doesn't have any tag
 * @throws UserNotFoundException
 * @throws WorkspaceNotFoundException
 * @throws UserNotActiveException
 * @throws PartRevisionNotFoundException
 * @throws AccessRightException
 */
@Test public void addTagToPartWithNoTags() throws UserNotFoundException, WorkspaceNotFoundException, UserNotActiveException, PartRevisionNotFoundException, AccessRightException {
  PartRevisionKey partRevisionKey=partRevision.getKey();
  String[] tags=new String[3];
  tags[0]="String_Node_Str";
  tags[1]="String_Node_Str";
  tags[2]="String_Node_Str";
  Mockito.when(userManager.checkWorkspaceReadAccess(ProductUtil.WORKSPACE_ID)).thenReturn(user);
  Mockito.when(userManager.checkWorkspaceWriteAccess(ProductUtil.WORKSPACE_ID)).thenReturn(user);
  Mockito.when(em.find(PartRevision.class,partRevisionKey)).thenReturn(partRevision);
  Mockito.when(em.createQuery("String_Node_Str",Tag.class)).thenReturn(tagsQuery);
  Mockito.when(tagsQuery.setParameter("String_Node_Str",ProductUtil.WORKSPACE_ID)).thenReturn(tagsQuery);
  Mockito.when(tagsQuery.getResultList()).thenReturn(new ArrayList<Tag>());
  PartRevision partRevisionResult=productManagerBean.saveTags(partRevisionKey,(String[])tags);
  Assert.assertEquals(partRevisionResult.getTags().size(),3);
  int i=0;
  for (Iterator<Tag> it=partRevisionResult.getTags().iterator(); it.hasNext(); ) {
    Tag tag=it.next();
    Assert.assertEquals(tag.getLabel(),tags[i++]);
  }
  Mockito.verify(esIndexer,Mockito.times(1)).index(Mockito.any(PartIteration.class));
}

Fixed version (ground truth):
/** 
 * test the add of new tags to a part that doesn't have any tag
 * @throws UserNotFoundException
 * @throws WorkspaceNotFoundException
 * @throws UserNotActiveException
 * @throws PartRevisionNotFoundException
 * @throws AccessRightException
 */
@Test public void addTagToPartWithNoTags() throws UserNotFoundException, WorkspaceNotFoundException, UserNotActiveException, PartRevisionNotFoundException, AccessRightException {
  PartRevisionKey partRevisionKey=partRevision.getKey();
  String[] tags=new String[3];
  tags[0]="String_Node_Str";
  tags[1]="String_Node_Str";
  tags[2]="String_Node_Str";
  Mockito.when(userManager.checkWorkspaceReadAccess(ProductUtil.WORKSPACE_ID)).thenReturn(user);
  Mockito.when(userManager.checkWorkspaceWriteAccess(ProductUtil.WORKSPACE_ID)).thenReturn(user);
  Mockito.when(em.find(PartRevision.class,partRevisionKey)).thenReturn(partRevision);
  Mockito.when(em.createQuery("String_Node_Str",Tag.class)).thenReturn(tagsQuery);
  Mockito.when(tagsQuery.setParameter("String_Node_Str",ProductUtil.WORKSPACE_ID)).thenReturn(tagsQuery);
  Mockito.when(tagsQuery.getResultList()).thenReturn(new ArrayList<>());
  PartRevision partRevisionResult=productManagerBean.saveTags(partRevisionKey,tags);
  Assert.assertEquals(partRevisionResult.getTags().size(),3);
  int i=0;
  for (Iterator<Tag> it=partRevisionResult.getTags().iterator(); it.hasNext(); ) {
    Tag tag=it.next();
    Assert.assertEquals(tag.getLabel(),tags[i++]);
  }
  Mockito.verify(esIndexer,Mockito.times(1)).index(Mockito.any(PartIteration.class));
}