nus-yam/ex-repair huggingface dataset:
Program: 189728
Project: 189728
Buggy source:
public ParameterAnnotationMapping(final String parameterName,final String functionArgumentName,final Literal defaultValue){
  this.parameterName=parameterName;
  this.functionArgumentName=functionArgumentName;
  this.defaultValue=defaultValue;
}

Fixed version (ground truth):
public ParameterAnnotationMapping(final String parameterName,final String functionArgumentName,final Literal[] defaultValues){
  this.parameterName=parameterName;
  this.functionArgumentName=functionArgumentName;
  this.defaultValues=defaultValues;
}
Program: 189729
Project: 189729
Buggy source:
@Override public Sequence<String> getTypedValue(){
  final Object queryParam=request.getQueryParam(getParameterAnnotationMapping().getParameterName());
  if (queryParam == null) {
    final Literal defaultLiteral=getParameterAnnotationMapping().getDefaultValue();
    if (defaultLiteral != null) {
      return new SequenceImpl<String>(new StringTypedValue(defaultLiteral.getValue()));
    }
 else {
      return Sequence.EMPTY_SEQUENCE;
    }
  }
 else   if (queryParam instanceof String) {
    return new SequenceImpl<String>(new StringTypedValue((String)queryParam));
  }
  return null;
}

Fixed version (ground truth):
@Override public Sequence<String> getTypedValue(){
  final Object queryParam=request.getQueryParam(getParameterAnnotationMapping().getParameterName());
  if (queryParam == null) {
    final Literal defaultLiterals[]=getParameterAnnotationMapping().getDefaultValues();
    if (defaultLiterals.length > 0) {
      return literalsToSequence(defaultLiterals);
    }
 else {
      return Sequence.EMPTY_SEQUENCE;
    }
  }
 else   if (queryParam instanceof String) {
    return new SequenceImpl<String>(new StringTypedValue((String)queryParam));
  }
  return null;
}
Program: 189730
Project: 189730
Buggy source:
/** 
 * @see AbstractParameterAnnotation#extractParameter(org.exquery.http.HttpRequest)
 */
@Override public TypedArgumentValue<String> extractParameter(final HttpRequest request){
  return new TypedArgumentValue<String>(){
    @Override public String getArgumentName(){
      return getParameterAnnotationMapping().getFunctionArgumentName();
    }
    @Override public Sequence<String> getTypedValue(){
      final Object queryParam=request.getQueryParam(getParameterAnnotationMapping().getParameterName());
      if (queryParam == null) {
        final Literal defaultLiteral=getParameterAnnotationMapping().getDefaultValue();
        if (defaultLiteral != null) {
          return new SequenceImpl<String>(new StringTypedValue(defaultLiteral.getValue()));
        }
 else {
          return Sequence.EMPTY_SEQUENCE;
        }
      }
 else       if (queryParam instanceof String) {
        return new SequenceImpl<String>(new StringTypedValue((String)queryParam));
      }
      return null;
    }
  }
;
}

Fixed version (ground truth):
/** 
 * @see AbstractParameterAnnotation#extractParameter(org.exquery.http.HttpRequest)
 */
@Override public TypedArgumentValue<String> extractParameter(final HttpRequest request){
  return new TypedArgumentValue<String>(){
    @Override public String getArgumentName(){
      return getParameterAnnotationMapping().getFunctionArgumentName();
    }
    @Override public Sequence<String> getTypedValue(){
      final Object queryParam=request.getQueryParam(getParameterAnnotationMapping().getParameterName());
      if (queryParam == null) {
        final Literal defaultLiterals[]=getParameterAnnotationMapping().getDefaultValues();
        if (defaultLiterals.length > 0) {
          return literalsToSequence(defaultLiterals);
        }
 else {
          return Sequence.EMPTY_SEQUENCE;
        }
      }
 else       if (queryParam instanceof String) {
        return new SequenceImpl<String>(new StringTypedValue((String)queryParam));
      }
      return null;
    }
  }
;
}
Program: 189733
Project: 189733
Buggy source:
/** 
 * Serialize to the body of the HTTP Response
 * @param result
 * @param response
 * @param serializationProperties
 * @throws RestXqServiceException  
 */
protected void serializeBody(final Sequence result,final HttpResponse response,final Map<SerializationProperty,String> serializationProperties) throws RestXqServiceException {
  SupportedMethod method=null;
  try {
    final String methodProp=serializationProperties.get(SerializationProperty.METHOD);
    method=(methodProp == null ? SupportedMethod.xml : SupportedMethod.valueOf(methodProp));
  }
 catch (  IllegalArgumentException iae) {
    System.out.println(iae.getMessage());
  }
  if (method != null) {
    if (method.equals(SupportedMethod.xml) || method.equals(SupportedMethod.xhtml)) {
      response.setContentType(getDefaultContentType());
    }
 else     if (method.equals(SupportedMethod.html) || method.equals(SupportedMethod.html5)) {
      response.setContentType(InternetMediaType.TEXT_HTML.getMediaType() + "String_Node_Str" + getDefaultEncoding());
    }
 else     if (method.equals(SupportedMethod.json)) {
      response.setContentType(InternetMediaType.APPLICATION_JSON.getMediaType() + "String_Node_Str" + getDefaultEncoding());
    }
  }
  final String mediaType=serializationProperties.get(SerializationProperty.MEDIA_TYPE);
  if (mediaType != null && !mediaType.isEmpty()) {
    response.setContentType(mediaType);
  }
  if (method != null && method.equals(SupportedMethod.binary)) {
    serializeBinaryBody(result,response);
  }
 else {
    serializeNodeBody(result,response,serializationProperties);
  }
}

Fixed version (ground truth):
/** 
 * Serialize to the body of the HTTP Response
 * @param result
 * @param response
 * @param serializationProperties
 * @throws RestXqServiceException  
 */
protected void serializeBody(final Sequence result,final HttpResponse response,final Map<SerializationProperty,String> serializationProperties) throws RestXqServiceException {
  SupportedMethod method=null;
  final String mediaType=serializationProperties.get(SerializationProperty.MEDIA_TYPE);
  if (mediaType != null && !mediaType.isEmpty()) {
    response.setContentType(mediaType);
  }
  if (method != null && method.equals(SupportedMethod.binary)) {
    serializeBinaryBody(result,response);
  }
 else {
    serializeNodeBody(result,response,serializationProperties);
  }
}
Program: 189735
Project: 189735
Buggy source:
@Test public void path_fnArgNodeType_one_template_isNotOk() throws RestAnnotationException {
  final FunctionArgument[] args={new NodeFnArg("String_Node_Str")};
  final PathAnnotationImpl pa=new PathAnnotationImpl();
  pa.setFunctionSignature(new ArgsFunctionSignature(args));
  pa.setLiterals(new Literal[]{new StringLiteral("String_Node_Str")});
  RestXqErrorCode code=null;
  try {
    pa.initialise();
  }
 catch (  final RestAnnotationException rae) {
    code=rae.getErrorCode();
  }
  assertEquals(RestXqErrorCodes.RQST0006,code);
}

Fixed version (ground truth):
@Test public void path_fnArgNodeType_one_template_isNotOk() throws RestAnnotationException {
  final FunctionArgument[] args={new NodeFnArg("String_Node_Str")};
  final PathAnnotationImpl pa=new PathAnnotationImpl();
  pa.setFunctionSignature(new ArgsFunctionSignature(args));
  pa.setLiterals(new Literal[]{new StringLiteral("String_Node_Str")});
  ErrorCode code=null;
  try {
    pa.initialise();
  }
 catch (  final RestAnnotationException rae) {
    code=rae.getErrorCode();
  }
  assertEquals(RestXqErrorCodes.RQST0006,code);
}
Program: 189736
Project: 189736
Buggy source:
@Override public boolean matchesMediaType(final HttpRequest request){
  final String contentType=request.getContentType();
  final Matcher mtcConsumesContentType=getMediaTypesPatternMatcher().matcher(contentType);
  return mtcConsumesContentType.matches();
}

Fixed version (ground truth):
@Override public boolean matchesMediaType(final HttpRequest request){
  final String contentType=request.getContentType();
  if (contentType == null) {
    return false;
  }
  final Matcher mtcConsumesContentType=getMediaTypesPatternMatcher().matcher(contentType);
  return mtcConsumesContentType.matches();
}
Program: 189738
Project: 189738
Buggy source:
/** 
 * Serialize to the body of the HTTP Response
 * @param result
 * @param response
 * @param serializationProperties
 * @throws RestXqServiceException  
 */
protected void serializeBody(final TypedValue result,final HttpResponse response,final Map<SerializationProperty,String> serializationProperties) throws RestXqServiceException {
  SupportedMethod method=null;
  try {
    final String methodProp=serializationProperties.get(SerializationProperty.METHOD);
    method=(methodProp == null ? SupportedMethod.xml : SupportedMethod.valueOf(methodProp));
  }
 catch (  IllegalArgumentException iae) {
    System.out.println(iae.getMessage());
  }
  if (method != null) {
    if (method.equals(SupportedMethod.xml) || method.equals(SupportedMethod.xhtml)) {
      response.setContentType(getDefaultContentType());
    }
 else     if (method.equals(SupportedMethod.html) || method.equals(SupportedMethod.html5)) {
      response.setContentType(InternetMediaType.TEXT_HTML.getMediaType() + "String_Node_Str" + getDefaultEncoding());
    }
 else     if (method.equals(SupportedMethod.json)) {
      response.setContentType(InternetMediaType.APPLICATION_JSON.getMediaType() + "String_Node_Str" + getDefaultEncoding());
    }
  }
  if (method != null && method.equals(SupportedMethod.binary)) {
    serializeBinaryBody(result,response);
  }
 else {
    serializeNodeBody(result,response,serializationProperties);
  }
}

Fixed version (ground truth):
/** 
 * Serialize to the body of the HTTP Response
 * @param result
 * @param response
 * @param serializationProperties
 * @throws RestXqServiceException  
 */
protected void serializeBody(final Sequence result,final HttpResponse response,final Map<SerializationProperty,String> serializationProperties) throws RestXqServiceException {
  SupportedMethod method=null;
  try {
    final String methodProp=serializationProperties.get(SerializationProperty.METHOD);
    method=(methodProp == null ? SupportedMethod.xml : SupportedMethod.valueOf(methodProp));
  }
 catch (  IllegalArgumentException iae) {
    System.out.println(iae.getMessage());
  }
  if (method != null) {
    if (method.equals(SupportedMethod.xml) || method.equals(SupportedMethod.xhtml)) {
      response.setContentType(getDefaultContentType());
    }
 else     if (method.equals(SupportedMethod.html) || method.equals(SupportedMethod.html5)) {
      response.setContentType(InternetMediaType.TEXT_HTML.getMediaType() + "String_Node_Str" + getDefaultEncoding());
    }
 else     if (method.equals(SupportedMethod.json)) {
      response.setContentType(InternetMediaType.APPLICATION_JSON.getMediaType() + "String_Node_Str" + getDefaultEncoding());
    }
  }
  if (method != null && method.equals(SupportedMethod.binary)) {
    serializeBinaryBody(result,response);
  }
 else {
    serializeNodeBody(result,response,serializationProperties);
  }
}
Program: 189740
Project: 189740
Buggy source:
/** 
 * Serialize the Result as Binary content
 * @param result The result to serialize as Binary, typically a sequence of one or more xs:base64Binary or xs:hexBinary
 * @param response The HTTP Response to serialize the result to
 * @throws RestXqServiceException If an error occurred whilst serializing the result
 */
protected abstract void serializeBinaryBody(final TypedValue result,final HttpResponse response) throws RestXqServiceException ;

Fixed version (ground truth):
/** 
 * Serialize the Result as Binary content
 * @param result The result to serialize as Binary, typically a sequence of one or more xs:base64Binary or xs:hexBinary
 * @param response The HTTP Response to serialize the result to
 * @throws RestXqServiceException If an error occurred whilst serializing the result
 */
protected abstract void serializeBinaryBody(final Sequence result,final HttpResponse response) throws RestXqServiceException ;
Program: 189741
Project: 189741
Buggy source:
/** 
 * Serialize the Result The method for serialization can be obtained from the map of Serialization properties using the key SerializationProperty.method, if the method is missing or null, then XML should be assumed.
 * @param result The result to serialize, typically a sequence of one or more documents
 * @param response The HTTP Response to serialize the result to
 * @param serializationProperties Properties for the serialization
 * @throws RestXqServiceException If an error occurred whilst serializing the result
 */
protected abstract void serializeNodeBody(final TypedValue result,final HttpResponse response,final Map<SerializationProperty,String> serializationProperties) throws RestXqServiceException ;

Fixed version (ground truth):
/** 
 * Serialize the Result The method for serialization can be obtained from the map of Serialization properties using the key SerializationProperty.method, if the method is missing or null, then XML should be assumed.
 * @param result The result to serialize, typically a sequence of one or more documents
 * @param response The HTTP Response to serialize the result to
 * @param serializationProperties Properties for the serialization
 * @throws RestXqServiceException If an error occurred whilst serializing the result
 */
protected abstract void serializeNodeBody(final Sequence result,final HttpResponse response,final Map<SerializationProperty,String> serializationProperties) throws RestXqServiceException ;
Program: 189742
Project: 189742
Buggy source:
/** 
 * Gets the value of a HTTP Header
 * @param httpHeaderName The name of the HTTP Header to retrieve
 * @return The value of the header or null if the header was not present
 */
public String getHeader(final HttpHeaderName httpHeaderName);

Fixed version (ground truth):
/** 
 * Gets the value of a HTTP Header
 * @param httpHeaderName The name of the HTTP Header to retrieve
 * @return The value of the header or null if the header was not present
 */
public String getHeader(String httpHeaderName);
Program: 189743
Project: 189743
Buggy source:
public boolean containsHeader(String contentType);

Fixed version (ground truth):
public boolean containsHeader(String httpHeaderName);
Program: 189744
Project: 189744
Buggy source:
public void setHeader(String attribute,String attribute0);

Fixed version (ground truth):
public void setHeader(String httpHeaderName,String value);
Program: 189745
Project: 189745
Buggy source:
@Override public boolean matchesMediaType(final HttpRequest request){
  final String acceptHeader=request.getHeader(HttpHeaderName.Accept);
  if (acceptHeader.indexOf(ANY_MEDIA_TYPE) > -1) {
    return true;
  }
  Matcher mtcProducesContentType=null;
  final String accepts[]=acceptHeader.split("String_Node_Str");
  for (  String accept : accepts) {
    accept=accept.toLowerCase();
    accept=accept.replaceAll("String_Node_Str","String_Node_Str");
    final int idxExt=accept.indexOf("String_Node_Str");
    if (idxExt > -1) {
      accept=accept.substring(0,idxExt);
    }
    accept=accept.replaceFirst(InternetMediaType.subtypeSeparator + "String_Node_Str",InternetMediaType.subtypeSeparator + "String_Node_Str");
    if (mtcProducesContentType == null) {
      mtcProducesContentType=getMediaTypesPatternMatcher().matcher(accept);
    }
 else {
      mtcProducesContentType=mtcProducesContentType.reset(accept);
    }
    if (mtcProducesContentType.matches()) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean matchesMediaType(final HttpRequest request){
  final String acceptHeader=request.getHeader(HttpHeaderName.Accept.toString());
  if (acceptHeader.indexOf(ANY_MEDIA_TYPE) > -1) {
    return true;
  }
  Matcher mtcProducesContentType=null;
  final String accepts[]=acceptHeader.split("String_Node_Str");
  for (  String accept : accepts) {
    accept=accept.toLowerCase();
    accept=accept.replaceAll("String_Node_Str","String_Node_Str");
    final int idxExt=accept.indexOf("String_Node_Str");
    if (idxExt > -1) {
      accept=accept.substring(0,idxExt);
    }
    accept=accept.replaceFirst(InternetMediaType.subtypeSeparator + "String_Node_Str",InternetMediaType.subtypeSeparator + "String_Node_Str");
    if (mtcProducesContentType == null) {
      mtcProducesContentType=getMediaTypesPatternMatcher().matcher(accept);
    }
 else {
      mtcProducesContentType=mtcProducesContentType.reset(accept);
    }
    if (mtcProducesContentType.matches()) {
      return true;
    }
  }
  return false;
}
Program: 189746
Project: 189746
Buggy source:
/** 
 * Iterate over the Services Map
 * @param The visitor which visits the services map
 * @param eagerLockAll true if all methods should be locked before visiting anything, false to lock methods as they are visited
 */
public void iterate(final RestXqServiceMapVisitor visitor,final boolean eagerLockAll){
  try {
    if (eagerLockAll) {
      for (      final HttpMethod method : HttpMethod.values()) {
        final ReentrantReadWriteLock lock=getOrCreateMethodLock(method);
        lock.readLock().lock();
      }
      for (      final HttpMethod method : HttpMethod.values()) {
        visitor.visit(method,orderedServices.get(method));
      }
    }
 else {
      for (      final HttpMethod method : HttpMethod.values()) {
        final ReentrantReadWriteLock lock=getOrCreateMethodLock(method);
        lock.readLock().lock();
        visitor.visit(method,orderedServices.get(method));
      }
    }
  }
  finally {
    for (    final HttpMethod method : HttpMethod.values()) {
      final ReentrantReadWriteLock lock=getOrCreateMethodLock(method);
      lock.readLock().unlock();
    }
  }
}

Fixed version (ground truth):
/** 
 * Iterate over the Services Map
 * @param The visitor which visits the services map
 * @param eagerLockAll true if all methods should be locked before visiting anything, false to lock methods as they are visited
 */
public void iterate(final RestXqServiceMapVisitor visitor,final boolean eagerLockAll){
  try {
    if (eagerLockAll) {
      for (      final HttpMethod method : HttpMethod.values()) {
        final ReentrantReadWriteLock lock=getOrCreateMethodLock(method);
        lock.readLock().lock();
      }
      for (      final HttpMethod method : HttpMethod.values()) {
        final List<RestXqService> services=orderedServices.get(method);
        if (services != null) {
          visitor.visit(method,services);
        }
      }
    }
 else {
      for (      final HttpMethod method : HttpMethod.values()) {
        final ReentrantReadWriteLock lock=getOrCreateMethodLock(method);
        lock.readLock().lock();
        final List<RestXqService> services=orderedServices.get(method);
        if (services != null) {
          visitor.visit(method,services);
        }
      }
    }
  }
  finally {
    for (    final HttpMethod method : HttpMethod.values()) {
      final ReentrantReadWriteLock lock=getOrCreateMethodLock(method);
      lock.readLock().unlock();
    }
  }
}
Program: 189747
Project: 189747
Buggy source:
/** 
 * @see AbstractParameterAnnotation#getInvalidDefaultValueTypeErr()
 */
@Override protected RestXqErrorCode getInvalidDefaultValueTypeErr(){
  return RestXqErrorCodes.RQST0018;
}

Fixed version (ground truth):
/** 
 * @see AbstractParameterAnnotation#getInvalidDefaultValueTypeErr()
 */
@Override protected RestXqErrorCode getInvalidDefaultValueTypeErr(){
  return RestXqErrorCodes.RQST0019;
}
Program: 189748
Project: 189748
Buggy source:
/** 
 * @see AbstractParameterAnnotation#getInvalidKeyErr()
 */
@Override protected RestXqErrorCode getInvalidParameterNameErr(){
  return RestXqErrorCodes.RQST0015;
}

Fixed version (ground truth):
/** 
 * @see AbstractParameterAnnotation#getInvalidKeyErr()
 */
@Override protected RestXqErrorCode getInvalidParameterNameErr(){
  return RestXqErrorCodes.RQST0016;
}
Program: 189749
Project: 189749
Buggy source:
/** 
 * @see AbstractParameterAnnotation#getInvalidAnnotationParamSyntaxErr()
 */
@Override protected RestXqErrorCode getInvalidAnnotationParametersSyntaxErr(){
  return RestXqErrorCodes.RQST0019;
}

Fixed version (ground truth):
/** 
 * @see AbstractParameterAnnotation#getInvalidAnnotationParamSyntaxErr()
 */
@Override protected RestXqErrorCode getInvalidAnnotationParametersSyntaxErr(){
  return RestXqErrorCodes.RQST0020;
}
Program: 189750
Project: 189750
Buggy source:
/** 
 * @see AbstractParameterAnnotation#getInvalidValueErr()
 */
@Override protected RestXqErrorCode getInvalidFunctionArgumentNameErr(){
  return RestXqErrorCodes.RQST0016;
}

Fixed version (ground truth):
/** 
 * @see AbstractParameterAnnotation#getInvalidValueErr()
 */
@Override protected RestXqErrorCode getInvalidFunctionArgumentNameErr(){
  return RestXqErrorCodes.RQST0017;
}
Program: 189751
Project: 189751
Buggy source:
/** 
 * @see AbstractParameterAnnotation#getInvalidDefaultValueErr()
 */
@Override protected RestXqErrorCode getInvalidDefaultValueErr(){
  return RestXqErrorCodes.RQST0017;
}

Fixed version (ground truth):
/** 
 * @see AbstractParameterAnnotation#getInvalidDefaultValueErr()
 */
@Override protected RestXqErrorCode getInvalidDefaultValueErr(){
  return RestXqErrorCodes.RQST0018;
}
Program: 189752
Project: 189752
Buggy source:
/** 
 * @see AbstractParameterAnnotation#getInvalidAnnotationParamsErr()
 */
@Override protected RestXqErrorCode getInvalidAnnotationParamsErr(){
  return RestXqErrorCodes.RQST0014;
}

Fixed version (ground truth):
/** 
 * @see AbstractParameterAnnotation#getInvalidAnnotationParamsErr()
 */
@Override protected RestXqErrorCode getInvalidAnnotationParamsErr(){
  return RestXqErrorCodes.RQST0015;
}
Program: 189753
Project: 189753
Buggy source:
/** 
 * @see AbstractParameterAnnotation#getInvalidDefaultValueTypeErr()
 */
@Override protected RestXqErrorCode getInvalidDefaultValueTypeErr(){
  return RestXqErrorCodes.RQST0024;
}

Fixed version (ground truth):
/** 
 * @see AbstractParameterAnnotation#getInvalidDefaultValueTypeErr()
 */
@Override protected RestXqErrorCode getInvalidDefaultValueTypeErr(){
  return RestXqErrorCodes.RQST0025;
}
Program: 189754
Project: 189754
Buggy source:
/** 
 * @see AbstractParameterAnnotation#getInvalidKeyErr()
 */
@Override protected RestXqErrorCode getInvalidParameterNameErr(){
  return RestXqErrorCodes.RQST0021;
}

Fixed version (ground truth):
/** 
 * @see AbstractParameterAnnotation#getInvalidKeyErr()
 */
@Override protected RestXqErrorCode getInvalidParameterNameErr(){
  return RestXqErrorCodes.RQST0022;
}
Program: 189755
Project: 189755
Buggy source:
/** 
 * @see AbstractParameterAnnotation#getInvalidAnnotationParamSyntaxErr()
 */
@Override protected RestXqErrorCode getInvalidAnnotationParametersSyntaxErr(){
  return RestXqErrorCodes.RQST0025;
}

Fixed version (ground truth):
/** 
 * @see AbstractParameterAnnotation#getInvalidAnnotationParamSyntaxErr()
 */
@Override protected RestXqErrorCode getInvalidAnnotationParametersSyntaxErr(){
  return RestXqErrorCodes.RQST0026;
}
Program: 189756
Project: 189756
Buggy source:
/** 
 * @see AbstractParameterAnnotation#getInvalidValueErr()
 */
@Override protected RestXqErrorCode getInvalidFunctionArgumentNameErr(){
  return RestXqErrorCodes.RQST0022;
}

Fixed version (ground truth):
/** 
 * @see AbstractParameterAnnotation#getInvalidValueErr()
 */
@Override protected RestXqErrorCode getInvalidFunctionArgumentNameErr(){
  return RestXqErrorCodes.RQST0023;
}
Program: 189757
Project: 189757
Buggy source:
/** 
 * @see AbstractParameterAnnotation#getInvalidDefaultValueErr()
 */
@Override protected RestXqErrorCode getInvalidDefaultValueErr(){
  return RestXqErrorCodes.RQST0023;
}

Fixed version (ground truth):
/** 
 * @see AbstractParameterAnnotation#getInvalidDefaultValueErr()
 */
@Override protected RestXqErrorCode getInvalidDefaultValueErr(){
  return RestXqErrorCodes.RQST0024;
}
Program: 189758
Project: 189758
Buggy source:
/** 
 * @see AbstractParameterAnnotation#getInvalidAnnotationParamsErr()
 */
@Override protected RestXqErrorCode getInvalidAnnotationParamsErr(){
  return RestXqErrorCodes.RQST0020;
}

Fixed version (ground truth):
/** 
 * @see AbstractParameterAnnotation#getInvalidAnnotationParamsErr()
 */
@Override protected RestXqErrorCode getInvalidAnnotationParamsErr(){
  return RestXqErrorCodes.RQST0021;
}
Program: 189759
Project: 189759
Buggy source:
@Override public Iterator<RestXqService> iterator(){
  final Set<RestXqService> services=new HashSet<RestXqService>();
  final RestXqServiceMapVisitor visitor=new RestXqServiceMapVisitor(){
    @Override public void visit(    final HttpMethod method,    final List<RestXqService> restXqServices){
      services.putAll(restXqService);
    }
  }
;
  getServices().iterate(visitor,true);
  return services.iterator();
}

Fixed version (ground truth):
@Override public Iterator<RestXqService> iterator(){
  final Set<RestXqService> uniqueServices=new HashSet<RestXqService>();
  final RestXqServiceMapVisitor visitor=new RestXqServiceMapVisitor(){
    @Override public void visit(    final HttpMethod method,    final List<RestXqService> restXqServices){
      uniqueServices.addAll(restXqServices);
    }
  }
;
  getServices().iterate(visitor,true);
  return uniqueServices.iterator();
}
Program: 189760
Project: 189760
Buggy source:
@Override public void visit(final HttpMethod method,final List<RestXqService> restXqServices){
  services.putAll(restXqService);
}

Fixed version (ground truth):
@Override public void visit(final HttpMethod method,final List<RestXqService> restXqServices){
  uniqueServices.addAll(restXqServices);
}
Program: 189762
Project: 189762
Buggy source:
private void renderBigProcessingItem(SubdividedEdgeBigItem item,RenderTarget target,PreviewProperties properties){
  for (  SortedEdgeWrapper edgeWrapper : item.edges) {
    Edge edge=edgeWrapper.edge;
    EdgeLayoutData data=(EdgeLayoutData)edge.getEdgeData().getLayoutData();
    Point2D.Double[] points=data.getSubdivisonPoints();
    PGraphics graphics=((ProcessingTarget)target).getGraphics();
    graphics.noFill();
    graphics.strokeWeight(thickness);
    graphics.strokeCap(PGraphics.ROUND);
    graphics.stroke(data.getEdgeColor().getRed(),data.getEdgeColor().getGreen(),data.getEdgeColor().getBlue(),data.getEdgeColor().getAlpha());
    graphics.beginShape();
    for (int i=0; i < points.length; i++) {
      float x1=(float)points[i].x;
      float y1=(float)points[i].y;
      graphics.vertex(x1,-y1);
    }
    graphics.endShape();
  }
}

Fixed version (ground truth):
private void renderBigProcessingItem(SubdividedEdgeBigItem item,RenderTarget target,PreviewProperties properties){
  for (  SortedEdgeWrapper edgeWrapper : item.edges) {
    Edge edge=edgeWrapper.edge;
    EdgeLayoutData data=(EdgeLayoutData)edge.getEdgeData().getLayoutData();
    Point2D.Double[] points=data.getSubdivisonPoints();
    PGraphics graphics=((ProcessingTarget)target).getGraphics();
    graphics.noFill();
    graphics.strokeWeight(thickness);
    graphics.strokeCap(PGraphics.ROUND);
    graphics.stroke(data.getEdgeColor().getRed(),data.getEdgeColor().getGreen(),data.getEdgeColor().getBlue(),forceAlpha ? intAlpha : data.getEdgeColor().getAlpha());
    graphics.beginShape();
    for (int i=0; i < points.length; i++) {
      float x1=(float)points[i].x;
      float y1=(float)points[i].y;
      graphics.vertex(x1,-y1);
    }
    graphics.endShape();
  }
}
Program: 189763
Project: 189763
Buggy source:
private void renderBigAndComplexProcessingItem(SubdividedEdgeBigItem item,RenderTarget target,PreviewProperties properties){
  for (  SortedEdgeWrapper edgeWrapper : item.edges) {
    Edge edge=edgeWrapper.edge;
    EdgeLayoutData data=(EdgeLayoutData)edge.getEdgeData().getLayoutData();
    Point2D.Double[] points=data.getSubdivisonPoints();
    if (data.getSubdivisonPoints() == null || data.getSubdivisionEdgeColor() == null || edgeWrapper.id == data.getSubdivisonPoints().length - 1) {
      continue;
    }
    PGraphics graphics=((ProcessingTarget)target).getGraphics();
    graphics.noFill();
    graphics.strokeWeight(thickness);
    graphics.strokeCap(PGraphics.ROUND);
    Color color=data.getSubdivisionEdgeColor()[edgeWrapper.id];
    if (color == null) {
      continue;
    }
    graphics.stroke(color.getRed(),color.getGreen(),color.getBlue(),color.getAlpha());
    graphics.line((float)points[edgeWrapper.id].x,-(float)points[edgeWrapper.id].y,(float)points[edgeWrapper.id + 1].x,-(float)points[edgeWrapper.id + 1].y);
  }
}

Fixed version (ground truth):
private void renderBigAndComplexProcessingItem(SubdividedEdgeBigItem item,RenderTarget target,PreviewProperties properties){
  for (  SortedEdgeWrapper edgeWrapper : item.edges) {
    Edge edge=edgeWrapper.edge;
    EdgeLayoutData data=(EdgeLayoutData)edge.getEdgeData().getLayoutData();
    Point2D.Double[] points=data.getSubdivisonPoints();
    if (data.getSubdivisonPoints() == null || data.getSubdivisionEdgeColor() == null || edgeWrapper.id == data.getSubdivisonPoints().length - 1) {
      continue;
    }
    PGraphics graphics=((ProcessingTarget)target).getGraphics();
    graphics.noFill();
    graphics.strokeWeight(thickness);
    graphics.strokeCap(PGraphics.ROUND);
    Color color=data.getSubdivisionEdgeColor()[edgeWrapper.id];
    if (color == null) {
      continue;
    }
    graphics.stroke(color.getRed(),color.getGreen(),color.getBlue(),(forceAlpha ? intAlpha : color.getAlpha()));
    graphics.line((float)points[edgeWrapper.id].x,-(float)points[edgeWrapper.id].y,(float)points[edgeWrapper.id + 1].x,-(float)points[edgeWrapper.id + 1].y);
  }
}
Program: 189764
Project: 189764
Buggy source:
private void renderBigAndComplexPDFItem(SubdividedEdgeBigItem item,RenderTarget target,PreviewProperties properties){
  for (  SortedEdgeWrapper edgeWrapper : item.edges) {
    Edge edge=edgeWrapper.edge;
    EdgeLayoutData data=(EdgeLayoutData)edge.getEdgeData().getLayoutData();
    Point2D.Double[] points=data.getSubdivisonPoints();
    Color color=data.getSubdivisionEdgeColor()[edgeWrapper.id];
    PDFTarget pdfTarget=(PDFTarget)target;
    PdfContentByte cb=pdfTarget.getContentByte();
    int i=edgeWrapper.id;
    if (i == points.length - 1) {
      continue;
    }
    cb.moveTo((float)points[i].x,(float)points[i].y);
    cb.lineTo((float)points[i + 1].x,(float)points[i + 1].y);
    cb.setRGBColorStroke(color.getRed(),color.getGreen(),color.getBlue());
    cb.setLineWidth(thickness);
    if (color.getAlpha() < 255) {
      cb.saveState();
      float alpha=color.getAlpha() / 255f;
      PdfGState gState=new PdfGState();
      gState.setStrokeOpacity(alpha);
      cb.setGState(gState);
    }
    cb.stroke();
    if (color.getAlpha() < 255) {
      cb.restoreState();
    }
  }
}

Fixed version (ground truth):
private void renderBigAndComplexPDFItem(SubdividedEdgeBigItem item,RenderTarget target,PreviewProperties properties){
  for (  SortedEdgeWrapper edgeWrapper : item.edges) {
    Edge edge=edgeWrapper.edge;
    EdgeLayoutData data=(EdgeLayoutData)edge.getEdgeData().getLayoutData();
    Point2D.Double[] points=data.getSubdivisonPoints();
    Color color=data.getSubdivisionEdgeColor()[edgeWrapper.id];
    PDFTarget pdfTarget=(PDFTarget)target;
    PdfContentByte cb=pdfTarget.getContentByte();
    int i=edgeWrapper.id;
    if (i == points.length - 1) {
      continue;
    }
    cb.moveTo((float)points[i].x,(float)points[i].y);
    cb.lineTo((float)points[i + 1].x,(float)points[i + 1].y);
    cb.setRGBColorStroke(color.getRed(),color.getGreen(),color.getBlue());
    cb.setLineWidth(thickness);
    float usedAlpha=(forceAlpha ? intAlpha : color.getAlpha());
    if (usedAlpha < 255) {
      cb.saveState();
      float alpha=usedAlpha / 255f;
      PdfGState gState=new PdfGState();
      gState.setStrokeOpacity(alpha);
      cb.setGState(gState);
    }
    cb.stroke();
    if (usedAlpha < 255) {
      cb.restoreState();
    }
  }
}
Program: 189766
Project: 189766
Buggy source:
private void renderBigAndComplexSVGItem(SubdividedEdgeBigItem item,RenderTarget target,PreviewProperties properties){
  for (  SortedEdgeWrapper edgeWrapper : item.edges) {
    Edge edge=edgeWrapper.edge;
    EdgeLayoutData data=(EdgeLayoutData)edge.getEdgeData().getLayoutData();
    Point2D.Double[] points=data.getSubdivisonPoints();
    if (edgeWrapper.id == points.length - 1) {
      continue;
    }
    Color color=data.getSubdivisionEdgeColor()[edgeWrapper.id];
    SVGTarget svgTarget=(SVGTarget)target;
    Element edgeElem=svgTarget.createElement("String_Node_Str");
    edgeElem.setAttribute("String_Node_Str",edge.getSource().getNodeData().getId() + "String_Node_Str" + edge.getTarget().getNodeData().getId());
    edgeElem.setAttribute("String_Node_Str",String.format(Locale.ENGLISH,"String_Node_Str",points[edgeWrapper.id].x,points[edgeWrapper.id].y,points[edgeWrapper.id + 1].x,points[edgeWrapper.id + 1].y));
    edgeElem.setAttribute("String_Node_Str",svgTarget.toHexString(color));
    edgeElem.setAttribute("String_Node_Str",Float.toString(thickness * svgTarget.getScaleRatio()));
    edgeElem.setAttribute("String_Node_Str",(color.getAlpha() / 255f) + "String_Node_Str");
    edgeElem.setAttribute("String_Node_Str","String_Node_Str");
    svgTarget.getTopElement(SVGTarget.TOP_EDGES).appendChild(edgeElem);
  }
}

Fixed version (ground truth):
private void renderBigAndComplexSVGItem(SubdividedEdgeBigItem item,RenderTarget target,PreviewProperties properties){
  for (  SortedEdgeWrapper edgeWrapper : item.edges) {
    Edge edge=edgeWrapper.edge;
    EdgeLayoutData data=(EdgeLayoutData)edge.getEdgeData().getLayoutData();
    Point2D.Double[] points=data.getSubdivisonPoints();
    if (edgeWrapper.id == points.length - 1) {
      continue;
    }
    Color color=data.getSubdivisionEdgeColor()[edgeWrapper.id];
    SVGTarget svgTarget=(SVGTarget)target;
    Element edgeElem=svgTarget.createElement("String_Node_Str");
    edgeElem.setAttribute("String_Node_Str",edge.getSource().getNodeData().getId() + "String_Node_Str" + edge.getTarget().getNodeData().getId());
    edgeElem.setAttribute("String_Node_Str",String.format(Locale.ENGLISH,"String_Node_Str",points[edgeWrapper.id].x,points[edgeWrapper.id].y,points[edgeWrapper.id + 1].x,points[edgeWrapper.id + 1].y));
    edgeElem.setAttribute("String_Node_Str",svgTarget.toHexString(color));
    edgeElem.setAttribute("String_Node_Str",Float.toString(thickness * svgTarget.getScaleRatio()));
    edgeElem.setAttribute("String_Node_Str",((forceAlpha ? intAlpha : color.getAlpha()) / 255f) + "String_Node_Str");
    edgeElem.setAttribute("String_Node_Str","String_Node_Str");
    svgTarget.getTopElement(SVGTarget.TOP_EDGES).appendChild(edgeElem);
  }
}
Program: 189767
Project: 189767
Buggy source:
private void renderBigSVGItem(SubdividedEdgeBigItem item,RenderTarget target,PreviewProperties properties){
  for (  SortedEdgeWrapper edgeWrapper : item.edges) {
    Edge edge=edgeWrapper.edge;
    EdgeLayoutData data=(EdgeLayoutData)edge.getEdgeData().getLayoutData();
    Point2D.Double[] points=data.getSubdivisonPoints();
    Color color=new Color(data.getEdgeColor().getRed(),data.getEdgeColor().getGreen(),data.getEdgeColor().getBlue(),(int)(255 * alpha));
    SVGTarget svgTarget=(SVGTarget)target;
    Element edgeElem=svgTarget.createElement("String_Node_Str");
    edgeElem.setAttribute("String_Node_Str",svgTarget.toHexString(color));
    edgeElem.setAttribute("String_Node_Str",Float.toString(thickness * svgTarget.getScaleRatio()));
    edgeElem.setAttribute("String_Node_Str",(color.getAlpha() / 255f) + "String_Node_Str");
    edgeElem.setAttribute("String_Node_Str","String_Node_Str");
    edgeElem.setAttribute("String_Node_Str",edge.toString());
    StringBuilder builder=new StringBuilder();
    for (int i=0; i < points.length; i++) {
      if (i != 0) {
        builder.append("String_Node_Str");
      }
      builder.append(points[i].x).append("String_Node_Str").append(-points[i].y);
    }
    edgeElem.setAttribute("String_Node_Str",builder.toString());
    svgTarget.getTopElement(SVGTarget.TOP_EDGES).appendChild(edgeElem);
  }
}

Fixed version (ground truth):
private void renderBigSVGItem(SubdividedEdgeBigItem item,RenderTarget target,PreviewProperties properties){
  for (  SortedEdgeWrapper edgeWrapper : item.edges) {
    Edge edge=edgeWrapper.edge;
    EdgeLayoutData data=(EdgeLayoutData)edge.getEdgeData().getLayoutData();
    Point2D.Double[] points=data.getSubdivisonPoints();
    Color color=new Color(data.getEdgeColor().getRed(),data.getEdgeColor().getGreen(),data.getEdgeColor().getBlue());
    SVGTarget svgTarget=(SVGTarget)target;
    Element edgeElem=svgTarget.createElement("String_Node_Str");
    edgeElem.setAttribute("String_Node_Str",svgTarget.toHexString(color));
    edgeElem.setAttribute("String_Node_Str",Float.toString(thickness * svgTarget.getScaleRatio()));
    edgeElem.setAttribute("String_Node_Str",((forceAlpha ? intAlpha : color.getAlpha()) / 255f) + "String_Node_Str");
    edgeElem.setAttribute("String_Node_Str","String_Node_Str");
    edgeElem.setAttribute("String_Node_Str",edge.toString());
    StringBuilder builder=new StringBuilder();
    for (int i=0; i < points.length; i++) {
      if (i != 0) {
        builder.append("String_Node_Str");
      }
      builder.append(points[i].x).append("String_Node_Str").append(-points[i].y);
    }
    edgeElem.setAttribute("String_Node_Str",builder.toString());
    svgTarget.getTopElement(SVGTarget.TOP_EDGES).appendChild(edgeElem);
  }
}
Program: 189768
Project: 189768
Buggy source:
private void renderBigPDFItem(SubdividedEdgeBigItem item,RenderTarget target,PreviewProperties properties){
  for (  SortedEdgeWrapper edgeWrapper : item.edges) {
    Edge edge=edgeWrapper.edge;
    EdgeLayoutData data=(EdgeLayoutData)edge.getEdgeData().getLayoutData();
    Point2D.Double[] points=data.getSubdivisonPoints();
    Color color=new Color(data.getEdgeColor().getRed(),data.getEdgeColor().getGreen(),data.getEdgeColor().getBlue(),(int)(255 * alpha));
    PDFTarget pdfTarget=(PDFTarget)target;
    PdfContentByte cb=pdfTarget.getContentByte();
    for (int i=0; i < points.length - 1; i++) {
      cb.moveTo((float)points[i].x,(float)points[i].y);
      cb.lineTo((float)points[i + 1].x,(float)points[i + 1].y);
    }
    cb.setRGBColorStroke(color.getRed(),color.getGreen(),color.getBlue());
    cb.setLineWidth(thickness);
    if (color.getAlpha() < 255) {
      cb.saveState();
      float alpha=color.getAlpha() / 255f;
      PdfGState gState=new PdfGState();
      gState.setStrokeOpacity(alpha);
      cb.setGState(gState);
    }
    cb.stroke();
    if (color.getAlpha() < 255) {
      cb.restoreState();
    }
  }
}

Fixed version (ground truth):
private void renderBigPDFItem(SubdividedEdgeBigItem item,RenderTarget target,PreviewProperties properties){
  for (  SortedEdgeWrapper edgeWrapper : item.edges) {
    Edge edge=edgeWrapper.edge;
    EdgeLayoutData data=(EdgeLayoutData)edge.getEdgeData().getLayoutData();
    Point2D.Double[] points=data.getSubdivisonPoints();
    Color color=new Color(data.getEdgeColor().getRed(),data.getEdgeColor().getGreen(),data.getEdgeColor().getBlue(),(int)(255 * alpha));
    PDFTarget pdfTarget=(PDFTarget)target;
    PdfContentByte cb=pdfTarget.getContentByte();
    for (int i=0; i < points.length - 1; i++) {
      cb.moveTo((float)points[i].x,(float)points[i].y);
      cb.lineTo((float)points[i + 1].x,(float)points[i + 1].y);
    }
    cb.setRGBColorStroke(color.getRed(),color.getGreen(),color.getBlue());
    cb.setLineWidth(thickness);
    float usedAlpha=(forceAlpha ? intAlpha : color.getAlpha());
    if (usedAlpha < 255) {
      cb.saveState();
      float alpha=usedAlpha / 255f;
      PdfGState gState=new PdfGState();
      gState.setStrokeOpacity(alpha);
      cb.setGState(gState);
    }
    cb.stroke();
    if (usedAlpha < 255) {
      cb.restoreState();
    }
  }
}
Program: 189769
Project: 189769
Buggy source:
@Override public void preProcess(PreviewModel previewModel){
  alpha=(float)previewModel.getProperties().getDoubleValue(PreviewProperty.EDGE_LAYOUT_EDGE_TRANSPARENCY);
  thickness=(float)previewModel.getProperties().getDoubleValue(PreviewProperty.EDGE_LAYOUT_EDGE_THINKNESS);
  originalColor=previewModel.getProperties().getColorValue(PreviewProperty.EDGE_LAYOUT_SIMPLE_RENDERER_COLOR);
  useSimpleRendererBecauseOtherAreEmpty=false;
  if (previewModel.getItems("String_Node_Str") == null || previewModel.getItems("String_Node_Str").length == 0 || !((SubdividedEdgeBigItem)previewModel.getItems("String_Node_Str")[0]).isReady()) {
    useSimpleRendererBecauseOtherAreEmpty=true;
  }
}

Fixed version (ground truth):
@Override public void preProcess(PreviewModel previewModel){
  alpha=(float)previewModel.getProperties().getDoubleValue(PreviewProperty.EDGE_LAYOUT_EDGE_TRANSPARENCY);
  intAlpha=(int)(255 * alpha);
  forceAlpha=(boolean)previewModel.getProperties().getBooleanValue(PreviewProperty.EDGE_LAYOUT_EDGE_TRANSPARENCY_FORCE);
  thickness=(float)previewModel.getProperties().getDoubleValue(PreviewProperty.EDGE_LAYOUT_EDGE_THICKNESS);
  originalColor=previewModel.getProperties().getColorValue(PreviewProperty.EDGE_LAYOUT_SIMPLE_RENDERER_COLOR);
  useSimpleRendererBecauseOtherAreEmpty=false;
  if (previewModel.getItems("String_Node_Str") == null || previewModel.getItems("String_Node_Str").length == 0 || !((SubdividedEdgeBigItem)previewModel.getItems("String_Node_Str")[0]).isReady()) {
    useSimpleRendererBecauseOtherAreEmpty=true;
  }
}
Program: 189772
Project: 189772
Buggy source:
@Override public void initAlgo(){
  for (  Edge edge : graphModel.getGraph().getEdges()) {
    edge.getEdgeData().setLayoutData(new FDEBLayoutData(edge.getSource().getNodeData().x(),edge.getSource().getNodeData().y(),edge.getTarget().getNodeData().x(),edge.getTarget().getNodeData().y()));
  }
  cycle=1;
  setConverged(false);
  stepSize=parameters.getStepSize();
  sprintConstant=parameters.getSprintConstant();
  iterationsPerCycle=parameters.getIterationsPerCycle();
}

Fixed version (ground truth):
@Override public void initAlgo(){
  for (  Edge edge : graphModel.getGraph().getEdges()) {
    edge.getEdgeData().setLayoutData(new FDEBLayoutData(edge.getSource().getNodeData().x(),edge.getSource().getNodeData().y(),edge.getTarget().getNodeData().x(),edge.getTarget().getNodeData().y()));
  }
  cycle=1;
  setConverged(false);
  stepSize=parameters.getStepSize();
  sprintConstant=parameters.getSprintConstant();
  iterationsPerCycle=parameters.getIterationsPerCycle();
  compatibilityThreshold=parameters.getCompatibilityThreshold();
  System.out.println("String_Node_Str" + sprintConstant);
}
Program: 189774
Project: 189774
Buggy source:
void setParametersToDefault(){
  numCycles=5;
  stepSize=1.0;
  iterationsPerCycle=100;
  sprintConstant=0.5;
  stepDampingFactor=0.5;
}

Fixed version (ground truth):
void setParametersToDefault(){
  numCycles=5;
  stepSize=1;
  iterationsPerCycle=10;
  sprintConstant=0.5;
  stepDampingFactor=0.5;
  compatibilityThreshold=0.6;
}
Program: 189775
Project: 189775
Buggy source:
public void renderStraightEdge(float x1,float y1,float x2,float y2,RenderTarget renderTarget){
  int thickness=2;
  Color color=new Color((float)Math.random(),(float)Math.random(),(float)Math.random());
  Float targetRadius=2f;
  if (targetRadius != null && targetRadius < 0) {
    PVector direction=new PVector(x2,y2);
    direction.sub(new PVector(x1,y1));
    direction.normalize();
    direction=new PVector(direction.x,direction.y);
    direction.mult(targetRadius);
    direction.add(new PVector(x2,y2));
    x2=direction.x;
    y2=direction.y;
  }
  Float sourceRadius=2f;
  if (sourceRadius != null && sourceRadius < 0) {
    PVector direction=new PVector(x1,y1);
    direction.sub(new PVector(x2,y2));
    direction.normalize();
    direction=new PVector(direction.x,direction.y);
    direction.mult(sourceRadius);
    direction.add(new PVector(x1,y1));
    x1=direction.x;
    y1=direction.y;
  }
  PDFTarget pdfTarget=(PDFTarget)renderTarget;
  PdfContentByte cb=pdfTarget.getContentByte();
  cb.moveTo(x1,y1);
  cb.lineTo(x2,y2);
  cb.setRGBColorStroke(color.getRed(),color.getGreen(),color.getBlue());
  cb.setLineWidth(thickness);
  if (color.getAlpha() < 255) {
    cb.saveState();
    float alpha=color.getAlpha() / 255f;
    PdfGState gState=new PdfGState();
    gState.setStrokeOpacity(alpha);
    cb.setGState(gState);
  }
  cb.stroke();
  if (color.getAlpha() < 255) {
    cb.restoreState();
  }
}

Fixed version (ground truth):
public void renderStraightEdge(float x1,float y1,float x2,float y2,RenderTarget renderTarget){
  int thickness=1;
  Color color=new Color((float)Math.random(),(float)Math.random(),(float)Math.random());
  Float targetRadius=1f;
  Float sourceRadius=1f;
  PDFTarget pdfTarget=(PDFTarget)renderTarget;
  PdfContentByte cb=pdfTarget.getContentByte();
  cb.moveTo(x1,y1);
  cb.lineTo(x2,y2);
  cb.setRGBColorStroke(color.getRed(),color.getGreen(),color.getBlue());
  cb.setLineWidth(thickness);
  if (color.getAlpha() < 255) {
    cb.saveState();
    float alpha=color.getAlpha() / 255f;
    PdfGState gState=new PdfGState();
    gState.setStrokeOpacity(alpha);
    cb.setGState(gState);
  }
  cb.stroke();
  if (color.getAlpha() < 255) {
    cb.restoreState();
  }
}
Program: 189776
Project: 189776
Buggy source:
@Override public void render(Item item,RenderTarget target,PreviewProperties properties){
  FDEBLayoutData data=(FDEBLayoutData)item.getSource();
  System.err.println("String_Node_Str" + data.subdivisionPoints.length + "String_Node_Str");
  for (int i=0; i < data.subdivisionPoints.length - 1; i++) {
    float x1=(float)data.subdivisionPoints[i].x;
    float y1=(float)data.subdivisionPoints[i].y;
    float x2=(float)data.subdivisionPoints[i + 1].x;
    float y2=(float)data.subdivisionPoints[i + 1].y;
    renderStraightEdge(x1,y1,x2,y2,target);
  }
  double x1=data.subdivisionPoints[data.subdivisionPoints.length - 1].x;
  double y1=data.subdivisionPoints[data.subdivisionPoints.length - 1].y;
}

Fixed version (ground truth):
@Override public void render(Item item,RenderTarget target,PreviewProperties properties){
  FDEBLayoutData data=(FDEBLayoutData)item.getSource();
  for (int i=0; i < data.subdivisionPoints.length - 1; i++) {
    float x1=(float)data.subdivisionPoints[i].x;
    float y1=(float)data.subdivisionPoints[i].y;
    float x2=(float)data.subdivisionPoints[i + 1].x;
    float y2=(float)data.subdivisionPoints[i + 1].y;
    renderStraightEdge(x1,y1,x2,y2,target);
  }
  double x1=data.subdivisionPoints[data.subdivisionPoints.length - 1].x;
  double y1=data.subdivisionPoints[data.subdivisionPoints.length - 1].y;
}