nus-yam/ex-repair huggingface dataset:
Program: 25592
Project: 25592
Buggy source:
/** 
 * @return a transform mesh built from this spec's list of transforms.
 * @throws IllegalStateException if width or height have not been defined for this tile.
 */
public TransformMesh getTransformMesh() throws IllegalStateException {
  if (!hasWidthAndHeightDefined()) {
    throw new IllegalStateException("String_Node_Str");
  }
  final CoordinateTransformList<CoordinateTransform> ctList=createTransformList();
  return new TransformMesh(ctList,getNumberOfTrianglesCoveringWidth(),width.floatValue(),height.floatValue());
}

Fixed version (ground truth):
/** 
 * @return a transform mesh built from this spec's list of transforms.
 * @throws IllegalStateException if width or height have not been defined for this tile.
 */
public TransformMesh getTransformMesh() throws IllegalStateException {
  if (!hasWidthAndHeightDefined()) {
    throw new IllegalStateException("String_Node_Str");
  }
  final CoordinateTransformList<CoordinateTransform> ctList=getTransformList();
  return new TransformMesh(ctList,getNumberOfTrianglesCoveringWidth(),width.floatValue(),height.floatValue());
}
Program: 25593
Project: 25593
Buggy source:
/** 
 * @param x  local x coordinate to transform into world coordinate.
 * @param y  local y coordinate to transform into world coordinate.
 * @return world coordinates (x, y, z) for the specified local coordinates.
 */
public float[] getWorldCoordinates(float x,float y){
  float[] worldCoordinates;
  float[] w=new float[]{x,y};
  if (hasTransforms()) {
    final CoordinateTransformList<CoordinateTransform> ctl=createTransformList();
    ctl.applyInPlace(w);
  }
  if (z == null) {
    worldCoordinates=w;
  }
 else {
    worldCoordinates=new float[]{w[0],w[1],z.floatValue()};
  }
  return worldCoordinates;
}

Fixed version (ground truth):
/** 
 * @param x  local x coordinate to transform into world coordinate.
 * @param y  local y coordinate to transform into world coordinate.
 * @return world coordinates (x, y, z) for the specified local coordinates.
 */
public float[] getWorldCoordinates(float x,float y){
  float[] worldCoordinates;
  float[] w=new float[]{x,y};
  if (hasTransforms()) {
    final CoordinateTransformList<CoordinateTransform> ctl=getTransformList();
    ctl.applyInPlace(w);
  }
  if (z == null) {
    worldCoordinates=w;
  }
 else {
    worldCoordinates=new float[]{w[0],w[1],z.floatValue()};
  }
  return worldCoordinates;
}
Program: 25594
Project: 25594
Buggy source:
public static TileCoordinates getLocalCoordinates(TileSpec tileSpec,float x,float y){
  final float[] local=tileSpec.getLocalCoordinates(x,y);
  return buildLocalInstance(tileSpec.getTileId(),local);
}

Fixed version (ground truth):
/** 
 * @param tileSpecList  list of tiles that contain the specified point.
 * @param x             x coordinate.
 * @param y             y coordinate.
 * @return a local {@link TileCoordinates} instance with the inverse of the specified world point.
 * @throws IllegalStateException if the specified point cannot be inverted for any of the specified tiles.
 */
public static TileCoordinates getLocalCoordinates(List<TileSpec> tileSpecList,float x,float y) throws IllegalStateException {
  TileCoordinates tileCoordinates=null;
  List<String> nonInvertibleTileIds=null;
  float[] local;
  for (  TileSpec tileSpec : tileSpecList) {
    try {
      local=tileSpec.getLocalCoordinates(x,y);
      tileCoordinates=buildLocalInstance(tileSpec.getTileId(),local);
      break;
    }
 catch (    NoninvertibleModelException e) {
      if (nonInvertibleTileIds == null) {
        nonInvertibleTileIds=new ArrayList<String>();
      }
      nonInvertibleTileIds.add(tileSpec.getTileId());
    }
  }
  if (tileCoordinates == null) {
    throw new IllegalStateException("String_Node_Str" + x + "String_Node_Str"+ y+ "String_Node_Str"+ nonInvertibleTileIds+ "String_Node_Str");
  }
  if (nonInvertibleTileIds != null) {
    LOG.info("String_Node_Str",x,y,nonInvertibleTileIds,tileCoordinates.getTileId());
  }
  return tileCoordinates;
}
Program: 25595
Project: 25595
Buggy source:
/** 
 * @param x  world x coordinate to inversely transform into local coordinate.
 * @param y  world y coordinate to inversely transform into local coordinate.
 * @return local coordinates (x, y, z) for the specified world coordinates.
 * @throws IllegalStateException if width or height have not been defined for this tile.
 */
public float[] getLocalCoordinates(float x,float y) throws IllegalStateException {
  float[] localCoordinates;
  float[] l=new float[]{x,y};
  if (hasTransforms()) {
    final CoordinateTransformMesh mesh=getCoordinateTransformMesh();
    try {
      mesh.applyInverseInPlace(l);
    }
 catch (    NoninvertibleModelException e) {
      LOG.debug("String_Node_Str" + e.getMessage());
    }
  }
  if (z == null) {
    localCoordinates=l;
  }
 else {
    localCoordinates=new float[]{l[0],l[1],z.floatValue()};
  }
  return localCoordinates;
}

Fixed version (ground truth):
/** 
 * @param x  world x coordinate to inversely transform into local coordinate.
 * @param y  world y coordinate to inversely transform into local coordinate.
 * @return local coordinates (x, y, z) for the specified world coordinates.
 * @throws IllegalStateException if width or height have not been defined for this tile.
 * @throws NoninvertibleModelException if this tile's transforms cannot be inverted for the specified point.
 */
public float[] getLocalCoordinates(float x,float y) throws IllegalStateException, NoninvertibleModelException {
  float[] localCoordinates;
  float[] l=new float[]{x,y};
  if (hasTransforms()) {
    final CoordinateTransformMesh mesh=getCoordinateTransformMesh();
    mesh.applyInverseInPlace(l);
  }
  if (z == null) {
    localCoordinates=l;
  }
 else {
    localCoordinates=new float[]{l[0],l[1],z.floatValue()};
  }
  return localCoordinates;
}
Program: 25597
Project: 25597
Buggy source:
/** 
 * @return the tile specification that encompasses the specified coordinates.
 * @throws IllegalArgumentException if any required parameters are missing, the stack cannot be found, or a tile that encompasses the coordinates cannot be found.
 */
public TileSpec getTileSpec(StackId stackId,Double x,Double y,Double z) throws IllegalArgumentException {
  validateRequiredParameter("String_Node_Str",x);
  validateRequiredParameter("String_Node_Str",y);
  validateRequiredParameter("String_Node_Str",z);
  final DB db=getDatabase(stackId);
  final DBCollection tileCollection=db.getCollection(TILE_COLLECTION_NAME);
  final DBObject tileQuery=new BasicDBObject("String_Node_Str",z).append("String_Node_Str",lte(x)).append("String_Node_Str",lte(y)).append("String_Node_Str",gte(x)).append("String_Node_Str",gte(y));
  final RenderParameters renderParameters=new RenderParameters();
  addResolvedTileSpecs(db,tileCollection,tileQuery,renderParameters);
  if (!renderParameters.hasTileSpecs()) {
    throw new IllegalArgumentException("String_Node_Str" + stackId + "String_Node_Str"+ x+ "String_Node_Str"+ y+ "String_Node_Str"+ z);
  }
  return renderParameters.getTileSpecs().get(0);
}

Fixed version (ground truth):
/** 
 * @return the specified tile spec.
 * @throws IllegalArgumentException if any required parameters are missing.
 * @throws ObjectNotFoundException if a spec with the specified z and tileId cannot be found.
 */
public TileSpec getTileSpec(StackId stackId,String tileId,boolean resolveTransformReferences) throws IllegalArgumentException, ObjectNotFoundException {
  validateRequiredParameter("String_Node_Str",tileId);
  final DB db=getDatabase(stackId);
  final DBCollection tileCollection=db.getCollection(TILE_COLLECTION_NAME);
  final BasicDBObject query=new BasicDBObject();
  query.put("String_Node_Str",tileId);
  LOG.debug("String_Node_Str",tileCollection.getDB().getName(),tileCollection.getName(),query);
  final DBObject document=tileCollection.findOne(query);
  if (document == null) {
    throw new ObjectNotFoundException("String_Node_Str" + tileId + "String_Node_Str"+ db.getName()+ "String_Node_Str"+ TILE_COLLECTION_NAME+ "String_Node_Str");
  }
  final TileSpec tileSpec=TileSpec.fromJson(document.toString());
  if (resolveTransformReferences) {
    resolveTransformReferencesForTiles(db,Arrays.asList(tileSpec));
  }
  return tileSpec;
}
Program: 25598
Project: 25598
Buggy source:
public ByteProcessor getProcessor(String urlString,int mipmapLevel){
  if ((lastByteProcessor == null) || (!urlString.equals(lastUrlString)) || (mipmapLevel != lastMipmapLevel)) {
    lastByteProcessor=buildByteProcessor(urlString,mipmapLevel);
    lastUrlString=urlString;
    lastMipmapLevel=mipmapLevel;
  }
  return lastByteProcessor;
}

Fixed version (ground truth):
public ByteProcessor getProcessor(String urlString,int mipmapLevel,boolean isDownSamplingNeeded){
  if ((lastByteProcessor == null) || (!urlString.equals(lastUrlString)) || (mipmapLevel != lastMipmapLevel)) {
    lastByteProcessor=buildByteProcessor(urlString,mipmapLevel,isDownSamplingNeeded);
    lastUrlString=urlString;
    lastMipmapLevel=mipmapLevel;
  }
  return lastByteProcessor;
}
Program: 25599
Project: 25599
Buggy source:
private ByteProcessor buildByteProcessor(String urlString,int mipmapLevel){
  ByteProcessor byteProcessor=null;
  if (urlString != null) {
    final ImagePlus imagePlus=Utils.openImagePlusUrl(urlString);
    if (imagePlus == null) {
      LOG.error("String_Node_Str",urlString);
    }
 else {
      final ImageProcessor imageProcessor=imagePlus.getProcessor();
      byteProcessor=Downsampler.downsampleByteProcessor(imageProcessor.convertToByteProcessor(),mipmapLevel);
    }
  }
  return byteProcessor;
}

Fixed version (ground truth):
private ByteProcessor buildByteProcessor(String urlString,int mipmapLevel,boolean isDownSamplingNeeded){
  ByteProcessor byteProcessor=null;
  if (urlString != null) {
    final ImagePlus imagePlus=Utils.openImagePlusUrl(urlString);
    if (imagePlus == null) {
      LOG.error("String_Node_Str",urlString);
    }
 else {
      final ImageProcessor imageProcessor=imagePlus.getProcessor();
      byteProcessor=imageProcessor.convertToByteProcessor();
      if (isDownSamplingNeeded) {
        byteProcessor=Downsampler.downsampleByteProcessor(byteProcessor,mipmapLevel);
      }
    }
  }
  return byteProcessor;
}
Program: 25600
Project: 25600
Buggy source:
public ByteProcessor getProcessor(String urlString,int mipmapLevel,boolean isDownSamplingNeeded){
  if ((lastByteProcessor == null) || (!urlString.equals(lastUrlString)) || (mipmapLevel != lastMipmapLevel)) {
    lastByteProcessor=buildByteProcessor(urlString,mipmapLevel,isDownSamplingNeeded);
    lastUrlString=urlString;
    lastMipmapLevel=mipmapLevel;
  }
  return lastByteProcessor;
}

Fixed version (ground truth):
/** 
 * @param urlString         url or path for the mask.
 * @param downSampleLevels  the amount of down sampling needed(delta between level of the mask and the desired level for rendering).
 * @return a processor (possibly already cached) for the specified mask and down sampling factor.
 */
public ByteProcessor getProcessor(String urlString,Integer downSampleLevels){
  if ((lastByteProcessor == null) || (!urlString.equals(lastUrlString)) || ((downSampleLevels == null) && (lastDownSampleLevels != null))|| ((downSampleLevels != null) && (!downSampleLevels.equals(lastDownSampleLevels)))) {
    lastByteProcessor=buildByteProcessor(urlString,downSampleLevels);
    lastUrlString=urlString;
    lastDownSampleLevels=downSampleLevels;
  }
  return lastByteProcessor;
}
Program: 25601
Project: 25601
Buggy source:
private ByteProcessor buildByteProcessor(String urlString,int mipmapLevel,boolean isDownSamplingNeeded){
  ByteProcessor byteProcessor=null;
  if (urlString != null) {
    final ImagePlus imagePlus=Utils.openImagePlusUrl(urlString);
    if (imagePlus == null) {
      LOG.error("String_Node_Str",urlString);
    }
 else {
      final ImageProcessor imageProcessor=imagePlus.getProcessor();
      byteProcessor=imageProcessor.convertToByteProcessor();
      if (isDownSamplingNeeded) {
        byteProcessor=Downsampler.downsampleByteProcessor(byteProcessor,mipmapLevel);
      }
    }
  }
  return byteProcessor;
}

Fixed version (ground truth):
private ByteProcessor buildByteProcessor(String urlString,Integer downSampleLevels){
  ByteProcessor byteProcessor=null;
  if (urlString != null) {
    final ImagePlus imagePlus=Utils.openImagePlusUrl(urlString);
    if (imagePlus == null) {
      LOG.error("String_Node_Str",urlString);
    }
 else {
      final ImageProcessor imageProcessor=imagePlus.getProcessor();
      byteProcessor=imageProcessor.convertToByteProcessor();
      if (downSampleLevels != null) {
        byteProcessor=Downsampler.downsampleByteProcessor(byteProcessor,downSampleLevels);
      }
    }
  }
  return byteProcessor;
}
Program: 25602
Project: 25602
Buggy source:
public ByteProcessorCache(){
  this.lastUrlString=null;
  this.lastMipmapLevel=0;
  this.lastByteProcessor=null;
}

Fixed version (ground truth):
public ByteProcessorCache(){
  this.lastUrlString=null;
  this.lastDownSampleLevels=null;
  this.lastByteProcessor=null;
}
Program: 25603
Project: 25603
Buggy source:
/** 
 * If a parametersUrl has been specified, load those values and apply them to any default or unset values in this set of values.  This is a little messy because many of the values are primitives instead of objects which makes it impossible to definitively identify unset values. For now, if a primitive value is set to its default it will be overridden by the parametersUrl value.
 * @throws IllegalArgumentException
 */
private void applyBaseParameters() throws IllegalArgumentException {
  if (parametersUrl != null) {
    final RenderParameters baseParameters=loadParametersUrl();
    tileSpecUrl=mergedValue(tileSpecUrl,baseParameters.tileSpecUrl);
    res=mergedValue(res,baseParameters.res,DEFAULT_RESOLUTION);
    in=mergedValue(in,baseParameters.in);
    out=mergedValue(out,baseParameters.out);
    x=mergedValue(x,baseParameters.x,DEFAULT_X_AND_Y);
    y=mergedValue(y,baseParameters.y,DEFAULT_X_AND_Y);
    width=mergedValue(width,baseParameters.width,DEFAULT_HEIGHT_AND_WIDTH);
    height=mergedValue(height,baseParameters.height,DEFAULT_HEIGHT_AND_WIDTH);
    scale=mergedValue(scale,baseParameters.scale,DEFAULT_SCALE);
    areaOffset=mergedValue(areaOffset,baseParameters.areaOffset,false);
    skipInterpolation=mergedValue(skipInterpolation,baseParameters.skipInterpolation,false);
    if (quality == DEFAULT_QUALITY) {
      quality=baseParameters.quality;
    }
  }
}

Fixed version (ground truth):
/** 
 * If a parametersUrl has been specified, load those values and apply them to any default or unset values in this set of values.  This is a little messy because many of the values are primitives instead of objects which makes it impossible to definitively identify unset values. For now, if a primitive value is set to its default it will be overridden by the parametersUrl value.
 * @throws IllegalArgumentException
 */
private void applyBaseParameters() throws IllegalArgumentException {
  if (parametersUrl != null) {
    final RenderParameters baseParameters=loadParametersUrl();
    tileSpecUrl=mergedValue(tileSpecUrl,baseParameters.tileSpecUrl);
    res=mergedValue(res,baseParameters.res,DEFAULT_RESOLUTION);
    in=mergedValue(in,baseParameters.in);
    out=mergedValue(out,baseParameters.out);
    x=mergedValue(x,baseParameters.x,DEFAULT_X_AND_Y);
    y=mergedValue(y,baseParameters.y,DEFAULT_X_AND_Y);
    width=mergedValue(width,baseParameters.width,DEFAULT_HEIGHT_AND_WIDTH);
    height=mergedValue(height,baseParameters.height,DEFAULT_HEIGHT_AND_WIDTH);
    scale=mergedValue(scale,baseParameters.scale,DEFAULT_SCALE);
    areaOffset=mergedValue(areaOffset,baseParameters.areaOffset,false);
    skipInterpolation=mergedValue(skipInterpolation,baseParameters.skipInterpolation,false);
    if (quality == DEFAULT_QUALITY) {
      quality=baseParameters.quality;
    }
    tileSpecs.addAll(baseParameters.tileSpecs);
  }
}
Program: 25604
Project: 25604
Buggy source:
/** 
 * @param args  arguments to parse.
 * @return parameters instance populated by parsing the specified arguments.
 * @throws IllegalArgumentException if any invalid arguments are specified.
 */
public static RenderParameters parseCommandLineArgs(String[] args) throws IllegalArgumentException {
  RenderParameters parameters=new RenderParameters();
  parameters.setCommander();
  try {
    parameters.jCommander.parse(args);
  }
 catch (  Throwable t) {
    throw new IllegalArgumentException("String_Node_Str",t);
  }
  parameters.applyBaseParameters();
  if (parameters.tileSpecUrl == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  parameters.initializeDerivedValues();
  return parameters;
}

Fixed version (ground truth):
/** 
 * @param args  arguments to parse.
 * @return parameters instance populated by parsing the specified arguments.
 * @throws IllegalArgumentException if any invalid arguments are specified.
 */
public static RenderParameters parseCommandLineArgs(String[] args) throws IllegalArgumentException {
  RenderParameters parameters=new RenderParameters();
  parameters.setCommander();
  try {
    parameters.jCommander.parse(args);
  }
 catch (  Throwable t) {
    throw new IllegalArgumentException("String_Node_Str",t);
  }
  parameters.applyBaseParameters();
  parameters.initializeDerivedValues();
  return parameters;
}
Program: 25605
Project: 25605
Buggy source:
private static void extractPDNGateway(PDNGatewayContents pgwContents,Resource omnEpc){
  String uuid="String_Node_Str" + UUID.randomUUID().toString();
  Resource pgwResource=omnEpc.getModel().createResource(uuid);
  pgwResource.addProperty(RDF.type,info.openmultinet.ontology.vocabulary.Epc.PDNGateway);
  String name=pgwContents.getName();
  if (name != null && name != "String_Node_Str") {
    pgwResource.addProperty(RDFS.label,name);
  }
  BigInteger rate=pgwContents.getRate();
  BigInteger minusOne=BigInteger.valueOf(-1);
  if (rate != null && rate.compareTo(minusOne) != 0) {
    pgwResource.addLiteral(info.openmultinet.ontology.vocabulary.Epc.rateCode,rate);
  }
  BigInteger delay=pgwContents.getDelay();
  if (delay != null && delay.compareTo(minusOne) != 0) {
    pgwResource.addLiteral(info.openmultinet.ontology.vocabulary.Epc.delayCode,delay);
  }
  BigInteger loss=pgwContents.getLoss();
  if (loss != null && loss.compareTo(minusOne) != 0) {
    pgwResource.addLiteral(info.openmultinet.ontology.vocabulary.Epc.packetlossCode,loss);
  }
  omnEpc.addProperty(info.openmultinet.ontology.vocabulary.Epc.pdnGateway,pgwResource);
}

Fixed version (ground truth):
private static void extractPDNGateway(PDNGatewayContents pgwContents,Resource omnEpc){
  String uuid="String_Node_Str" + UUID.randomUUID().toString();
  Resource pgwResource=omnEpc.getModel().createResource(uuid);
  pgwResource.addProperty(RDF.type,info.openmultinet.ontology.vocabulary.Epc.PDNGateway);
  String name=pgwContents.getName();
  if (name != null && name != "String_Node_Str") {
    pgwResource.addProperty(RDFS.label,name);
  }
  BigInteger rateUp=pgwContents.getRateUp();
  BigInteger minusOne=BigInteger.valueOf(-1);
  if (rateUp != null && rateUp.compareTo(minusOne) != 0) {
    pgwResource.addLiteral(info.openmultinet.ontology.vocabulary.Epc.rateCodeUp,rateUp);
  }
  BigInteger rateDown=pgwContents.getRateDown();
  if (rateDown != null && rateDown.compareTo(minusOne) != 0) {
    pgwResource.addLiteral(info.openmultinet.ontology.vocabulary.Epc.rateCodeDown,rateDown);
  }
  BigInteger delay=pgwContents.getDelay();
  if (delay != null && delay.compareTo(minusOne) != 0) {
    pgwResource.addLiteral(info.openmultinet.ontology.vocabulary.Epc.delayCode,delay);
  }
  BigInteger loss=pgwContents.getLoss();
  if (loss != null && loss.compareTo(minusOne) != 0) {
    pgwResource.addLiteral(info.openmultinet.ontology.vocabulary.Epc.packetlossCode,loss);
  }
  omnEpc.addProperty(info.openmultinet.ontology.vocabulary.Epc.pdnGateway,pgwResource);
}
Program: 25606
Project: 25606
Buggy source:
private static void setPGW(Epc epc,Resource pgw){
  PDNGatewayContents pgwContents=new ObjectFactory().createPDNGatewayContents();
  if (pgw.hasProperty(info.openmultinet.ontology.vocabulary.Epc.rateCode)) {
    int rate=pgw.getProperty(info.openmultinet.ontology.vocabulary.Epc.rateCode).getObject().asLiteral().getInt();
    BigInteger bigRate=BigInteger.valueOf(rate);
    pgwContents.setRate(bigRate);
  }
  if (pgw.hasProperty(info.openmultinet.ontology.vocabulary.Epc.delayCode)) {
    int delay=pgw.getProperty(info.openmultinet.ontology.vocabulary.Epc.delayCode).getObject().asLiteral().getInt();
    BigInteger bigDelay=BigInteger.valueOf(delay);
    pgwContents.setDelay(bigDelay);
  }
  if (pgw.hasProperty(info.openmultinet.ontology.vocabulary.Epc.packetlossCode)) {
    int loss=pgw.getProperty(info.openmultinet.ontology.vocabulary.Epc.packetlossCode).getObject().asLiteral().getInt();
    BigInteger bigLoss=BigInteger.valueOf(loss);
    pgwContents.setLoss(bigLoss);
  }
  if (pgw.hasProperty(RDFS.label)) {
    String name=pgw.getProperty(RDFS.label).getObject().asLiteral().getString();
    pgwContents.setName(name);
  }
  epc.getApnOrEnodebOrPdnGateway().add(pgwContents);
}

Fixed version (ground truth):
private static void setPGW(Epc epc,Resource pgw){
  PDNGatewayContents pgwContents=new ObjectFactory().createPDNGatewayContents();
  if (pgw.hasProperty(info.openmultinet.ontology.vocabulary.Epc.rateCodeUp)) {
    int rate=pgw.getProperty(info.openmultinet.ontology.vocabulary.Epc.rateCodeUp).getObject().asLiteral().getInt();
    BigInteger bigRate=BigInteger.valueOf(rate);
    pgwContents.setRateUp(bigRate);
  }
  if (pgw.hasProperty(info.openmultinet.ontology.vocabulary.Epc.rateCodeDown)) {
    int rate=pgw.getProperty(info.openmultinet.ontology.vocabulary.Epc.rateCodeDown).getObject().asLiteral().getInt();
    BigInteger bigRate=BigInteger.valueOf(rate);
    pgwContents.setRateDown(bigRate);
  }
  if (pgw.hasProperty(info.openmultinet.ontology.vocabulary.Epc.delayCode)) {
    int delay=pgw.getProperty(info.openmultinet.ontology.vocabulary.Epc.delayCode).getObject().asLiteral().getInt();
    BigInteger bigDelay=BigInteger.valueOf(delay);
    pgwContents.setDelay(bigDelay);
  }
  if (pgw.hasProperty(info.openmultinet.ontology.vocabulary.Epc.packetlossCode)) {
    int loss=pgw.getProperty(info.openmultinet.ontology.vocabulary.Epc.packetlossCode).getObject().asLiteral().getInt();
    BigInteger bigLoss=BigInteger.valueOf(loss);
    pgwContents.setLoss(bigLoss);
  }
  if (pgw.hasProperty(RDFS.label)) {
    String name=pgw.getProperty(RDFS.label).getObject().asLiteral().getString();
    pgwContents.setName(name);
  }
  epc.getApnOrEnodebOrPdnGateway().add(pgwContents);
}
Program: 25607
Project: 25607
Buggy source:
private static void extractPDNGateway(PDNGatewayContents pgwContents,Resource omnEpc){
  String uuid="String_Node_Str" + UUID.randomUUID().toString();
  Resource pgwResource=omnEpc.getModel().createResource(uuid);
  pgwResource.addProperty(RDF.type,info.openmultinet.ontology.vocabulary.Epc.PDNGateway);
  String name=pgwContents.getName();
  if (name != null && name != "String_Node_Str") {
    pgwResource.addProperty(RDFS.label,name);
  }
  BigInteger rate=pgwContents.getRate();
  BigInteger minusOne=BigInteger.valueOf(-1);
  if (rate != null && rate.compareTo(minusOne) != 0) {
    pgwResource.addLiteral(info.openmultinet.ontology.vocabulary.Epc.rateCode,rate);
  }
  BigInteger delay=pgwContents.getDelay();
  if (delay != null && delay.compareTo(minusOne) != 0) {
    pgwResource.addLiteral(info.openmultinet.ontology.vocabulary.Epc.delayCode,delay);
  }
  BigInteger loss=pgwContents.getLoss();
  if (loss != null && loss.compareTo(minusOne) != 0) {
    pgwResource.addLiteral(info.openmultinet.ontology.vocabulary.Epc.packetlossCode,loss);
  }
  omnEpc.addProperty(info.openmultinet.ontology.vocabulary.Epc.pdnGateway,pgwResource);
}

Fixed version (ground truth):
private static void extractPDNGateway(PDNGatewayContents pgwContents,Resource omnEpc){
  String uuid="String_Node_Str" + UUID.randomUUID().toString();
  Resource pgwResource=omnEpc.getModel().createResource(uuid);
  pgwResource.addProperty(RDF.type,info.openmultinet.ontology.vocabulary.Epc.PDNGateway);
  String name=pgwContents.getName();
  if (name != null && name != "String_Node_Str") {
    pgwResource.addProperty(RDFS.label,name);
  }
  BigInteger rate=pgwContents.getRateUp();
  BigInteger minusOne=BigInteger.valueOf(-1);
  if (rate != null && rate.compareTo(minusOne) != 0) {
    pgwResource.addLiteral(info.openmultinet.ontology.vocabulary.Epc.rateCodeUp,rate);
  }
  BigInteger rateDown=pgwContents.getRateDown();
  if (rateDown != null && rateDown.compareTo(minusOne) != 0) {
    pgwResource.addLiteral(info.openmultinet.ontology.vocabulary.Epc.rateCodeDown,rateDown);
  }
  BigInteger delay=pgwContents.getDelay();
  if (delay != null && delay.compareTo(minusOne) != 0) {
    pgwResource.addLiteral(info.openmultinet.ontology.vocabulary.Epc.delayCode,delay);
  }
  BigInteger loss=pgwContents.getLoss();
  if (loss != null && loss.compareTo(minusOne) != 0) {
    pgwResource.addLiteral(info.openmultinet.ontology.vocabulary.Epc.packetlossCode,loss);
  }
  omnEpc.addProperty(info.openmultinet.ontology.vocabulary.Epc.pdnGateway,pgwResource);
}
Program: 25608
Project: 25608
Buggy source:
private static void setPGW(Epc epc,Resource pgw){
  PDNGatewayContents pgwContents=new ObjectFactory().createPDNGatewayContents();
  if (pgw.hasProperty(info.openmultinet.ontology.vocabulary.Epc.rateCode)) {
    int rate=pgw.getProperty(info.openmultinet.ontology.vocabulary.Epc.rateCode).getObject().asLiteral().getInt();
    BigInteger bigRate=BigInteger.valueOf(rate);
    pgwContents.setRate(bigRate);
  }
  if (pgw.hasProperty(info.openmultinet.ontology.vocabulary.Epc.delayCode)) {
    int delay=pgw.getProperty(info.openmultinet.ontology.vocabulary.Epc.delayCode).getObject().asLiteral().getInt();
    BigInteger bigDelay=BigInteger.valueOf(delay);
    pgwContents.setDelay(bigDelay);
  }
  if (pgw.hasProperty(info.openmultinet.ontology.vocabulary.Epc.packetlossCode)) {
    int loss=pgw.getProperty(info.openmultinet.ontology.vocabulary.Epc.packetlossCode).getObject().asLiteral().getInt();
    BigInteger bigLoss=BigInteger.valueOf(loss);
    pgwContents.setLoss(bigLoss);
  }
  if (pgw.hasProperty(RDFS.label)) {
    String name=pgw.getProperty(RDFS.label).getObject().asLiteral().getString();
    pgwContents.setName(name);
  }
  epc.getApnOrEnodebOrPdnGateway().add(pgwContents);
}

Fixed version (ground truth):
private static void setPGW(Epc epc,Resource pgw){
  PDNGatewayContents pgwContents=new ObjectFactory().createPDNGatewayContents();
  if (pgw.hasProperty(info.openmultinet.ontology.vocabulary.Epc.rateCodeUp)) {
    int rate=pgw.getProperty(info.openmultinet.ontology.vocabulary.Epc.rateCodeUp).getObject().asLiteral().getInt();
    BigInteger bigRate=BigInteger.valueOf(rate);
    pgwContents.setRateUp(bigRate);
  }
  if (pgw.hasProperty(info.openmultinet.ontology.vocabulary.Epc.rateCodeDown)) {
    int rate=pgw.getProperty(info.openmultinet.ontology.vocabulary.Epc.rateCodeDown).getObject().asLiteral().getInt();
    BigInteger bigRate=BigInteger.valueOf(rate);
    pgwContents.setRateDown(bigRate);
  }
  if (pgw.hasProperty(info.openmultinet.ontology.vocabulary.Epc.delayCode)) {
    int delay=pgw.getProperty(info.openmultinet.ontology.vocabulary.Epc.delayCode).getObject().asLiteral().getInt();
    BigInteger bigDelay=BigInteger.valueOf(delay);
    pgwContents.setDelay(bigDelay);
  }
  if (pgw.hasProperty(info.openmultinet.ontology.vocabulary.Epc.packetlossCode)) {
    int loss=pgw.getProperty(info.openmultinet.ontology.vocabulary.Epc.packetlossCode).getObject().asLiteral().getInt();
    BigInteger bigLoss=BigInteger.valueOf(loss);
    pgwContents.setLoss(bigLoss);
  }
  if (pgw.hasProperty(RDFS.label)) {
    String name=pgw.getProperty(RDFS.label).getObject().asLiteral().getString();
    pgwContents.setName(name);
  }
  epc.getApnOrEnodebOrPdnGateway().add(pgwContents);
}
Program: 25609
Project: 25609
Buggy source:
private static void extractPDNGateway(PDNGatewayContents pgwContents,Resource omnEpc){
  String uuid="String_Node_Str" + UUID.randomUUID().toString();
  Resource pgwResource=omnEpc.getModel().createResource(uuid);
  pgwResource.addProperty(RDF.type,info.openmultinet.ontology.vocabulary.Epc.PDNGateway);
  String name=pgwContents.getName();
  if (name != null && name != "String_Node_Str") {
    pgwResource.addProperty(RDFS.label,name);
  }
  BigInteger rate=pgwContents.getRate();
  BigInteger minusOne=BigInteger.valueOf(-1);
  if (rate != null && rate.compareTo(minusOne) != 0) {
    pgwResource.addLiteral(info.openmultinet.ontology.vocabulary.Epc.rateCode,rate);
  }
  BigInteger delay=pgwContents.getDelay();
  if (delay != null && delay.compareTo(minusOne) != 0) {
    pgwResource.addLiteral(info.openmultinet.ontology.vocabulary.Epc.delayCode,delay);
  }
  BigInteger loss=pgwContents.getLoss();
  if (loss != null && loss.compareTo(minusOne) != 0) {
    pgwResource.addLiteral(info.openmultinet.ontology.vocabulary.Epc.packetlossCode,loss);
  }
  omnEpc.addProperty(info.openmultinet.ontology.vocabulary.Epc.pdnGateway,pgwResource);
}

Fixed version (ground truth):
private static void extractPDNGateway(PDNGatewayContents pgwContents,Resource omnEpc){
  String uuid="String_Node_Str" + UUID.randomUUID().toString();
  Resource pgwResource=omnEpc.getModel().createResource(uuid);
  pgwResource.addProperty(RDF.type,info.openmultinet.ontology.vocabulary.Epc.PDNGateway);
  String name=pgwContents.getName();
  if (name != null && name != "String_Node_Str") {
    pgwResource.addProperty(RDFS.label,name);
  }
  BigInteger rateUp=pgwContents.getRateUp();
  BigInteger minusOne=BigInteger.valueOf(-1);
  if (rateUp != null && rateUp.compareTo(minusOne) != 0) {
    pgwResource.addLiteral(info.openmultinet.ontology.vocabulary.Epc.rateCodeUp,rateUp);
  }
  BigInteger rateDown=pgwContents.getRateDown();
  if (rateDown != null && rateDown.compareTo(minusOne) != 0) {
    pgwResource.addLiteral(info.openmultinet.ontology.vocabulary.Epc.rateCodeDown,rateDown);
  }
  BigInteger delay=pgwContents.getDelay();
  if (delay != null && delay.compareTo(minusOne) != 0) {
    pgwResource.addLiteral(info.openmultinet.ontology.vocabulary.Epc.delayCode,delay);
  }
  BigInteger loss=pgwContents.getLoss();
  if (loss != null && loss.compareTo(minusOne) != 0) {
    pgwResource.addLiteral(info.openmultinet.ontology.vocabulary.Epc.packetlossCode,loss);
  }
  omnEpc.addProperty(info.openmultinet.ontology.vocabulary.Epc.pdnGateway,pgwResource);
}
Program: 25610
Project: 25610
Buggy source:
private static void setPGW(Epc epc,Resource pgw){
  PDNGatewayContents pgwContents=new ObjectFactory().createPDNGatewayContents();
  if (pgw.hasProperty(info.openmultinet.ontology.vocabulary.Epc.rateCode)) {
    int rate=pgw.getProperty(info.openmultinet.ontology.vocabulary.Epc.rateCode).getObject().asLiteral().getInt();
    BigInteger bigRate=BigInteger.valueOf(rate);
    pgwContents.setRate(bigRate);
  }
  if (pgw.hasProperty(info.openmultinet.ontology.vocabulary.Epc.delayCode)) {
    int delay=pgw.getProperty(info.openmultinet.ontology.vocabulary.Epc.delayCode).getObject().asLiteral().getInt();
    BigInteger bigDelay=BigInteger.valueOf(delay);
    pgwContents.setDelay(bigDelay);
  }
  if (pgw.hasProperty(info.openmultinet.ontology.vocabulary.Epc.packetlossCode)) {
    int loss=pgw.getProperty(info.openmultinet.ontology.vocabulary.Epc.packetlossCode).getObject().asLiteral().getInt();
    BigInteger bigLoss=BigInteger.valueOf(loss);
    pgwContents.setLoss(bigLoss);
  }
  if (pgw.hasProperty(RDFS.label)) {
    String name=pgw.getProperty(RDFS.label).getObject().asLiteral().getString();
    pgwContents.setName(name);
  }
  epc.getApnOrEnodebOrPdnGateway().add(pgwContents);
}

Fixed version (ground truth):
private static void setPGW(Epc epc,Resource pgw){
  PDNGatewayContents pgwContents=new ObjectFactory().createPDNGatewayContents();
  if (pgw.hasProperty(info.openmultinet.ontology.vocabulary.Epc.rateCodeUp)) {
    int rate=pgw.getProperty(info.openmultinet.ontology.vocabulary.Epc.rateCodeUp).getObject().asLiteral().getInt();
    BigInteger bigRate=BigInteger.valueOf(rate);
    pgwContents.setRateUp(bigRate);
  }
  if (pgw.hasProperty(info.openmultinet.ontology.vocabulary.Epc.rateCodeDown)) {
    int rate=pgw.getProperty(info.openmultinet.ontology.vocabulary.Epc.rateCodeDown).getObject().asLiteral().getInt();
    BigInteger bigRate=BigInteger.valueOf(rate);
    pgwContents.setRateDown(bigRate);
  }
  if (pgw.hasProperty(info.openmultinet.ontology.vocabulary.Epc.delayCode)) {
    int delay=pgw.getProperty(info.openmultinet.ontology.vocabulary.Epc.delayCode).getObject().asLiteral().getInt();
    BigInteger bigDelay=BigInteger.valueOf(delay);
    pgwContents.setDelay(bigDelay);
  }
  if (pgw.hasProperty(info.openmultinet.ontology.vocabulary.Epc.packetlossCode)) {
    int loss=pgw.getProperty(info.openmultinet.ontology.vocabulary.Epc.packetlossCode).getObject().asLiteral().getInt();
    BigInteger bigLoss=BigInteger.valueOf(loss);
    pgwContents.setLoss(bigLoss);
  }
  if (pgw.hasProperty(RDFS.label)) {
    String name=pgw.getProperty(RDFS.label).getObject().asLiteral().getString();
    pgwContents.setName(name);
  }
  epc.getApnOrEnodebOrPdnGateway().add(pgwContents);
}
Program: 25615
Project: 25615
Buggy source:
private static void setValidSource(TRelationshipType relationshipType,Resource relationshipTypeResource) throws RequiredResourceNotFoundException, MultiplePropertyValuesException {
  Resource source=calculateInferredPropertyValue(relationshipTypeResource,(RDFS.domain));
  String namespace=getXMLNamespace(source);
  QName typeRef;
  try {
    typeRef=new QName(namespace,source.getLocalName(),getNSPrefix(source));
  }
 catch (  NoPrefixMappingFoundException e) {
    typeRef=new QName(namespace,source.getLocalName());
  }
  TRelationshipType.ValidSource validSource=objFactory.createTRelationshipTypeValidSource();
  validSource.setTypeRef(typeRef);
  relationshipType.setValidSource(validSource);
}

Fixed version (ground truth):
private static void setValidSource(TRelationshipType relationshipType,Resource relationshipTypeResource) throws RequiredResourceNotFoundException, MultiplePropertyValuesException {
  Resource source=calculateInferredPropertyValue(relationshipTypeResource,RDFS.domain);
  String namespace=getXMLNamespace(source);
  QName typeRef;
  try {
    typeRef=new QName(namespace,source.getLocalName(),getNSPrefix(source));
  }
 catch (  NoPrefixMappingFoundException e) {
    typeRef=new QName(namespace,source.getLocalName());
  }
  TRelationshipType.ValidSource validSource=objFactory.createTRelationshipTypeValidSource();
  validSource.setTypeRef(typeRef);
  relationshipType.setValidSource(validSource);
}
Program: 25616
Project: 25616
Buggy source:
private static TRelationshipType createRelationshipType(TRelationshipTemplate relationshipTemplate,Model model) throws RequiredResourceNotFoundException, MultiplePropertyValuesException {
  TRelationshipType relationshipType=objFactory.createTRelationshipType();
  QName type=relationshipTemplate.getType();
  relationshipType.setName(type.getLocalPart());
  relationshipType.setTargetNamespace(type.getNamespaceURI());
  Resource relationshipTypeResource=model.getResource(type.getNamespaceURI() + type.getLocalPart());
  setValidSource(relationshipType,relationshipTypeResource);
  setValidTarget(relationshipType,relationshipTypeResource);
  return relationshipType;
}

Fixed version (ground truth):
private static TRelationshipType createRelationshipType(TRelationshipTemplate relationshipTemplate,Model model) throws RequiredResourceNotFoundException, MultiplePropertyValuesException {
  TRelationshipType relationshipType=objFactory.createTRelationshipType();
  QName type=relationshipTemplate.getType();
  relationshipType.setName(type.getLocalPart());
  relationshipType.setTargetNamespace(type.getNamespaceURI());
  String namespace=Tosca2OMN.getRDFNamespace(type.getNamespaceURI());
  Resource relationshipTypeResource=model.getResource(namespace + type.getLocalPart());
  setValidSource(relationshipType,relationshipTypeResource);
  setValidTarget(relationshipType,relationshipTypeResource);
  return relationshipType;
}
Program: 25617
Project: 25617
Buggy source:
private static String getRDFNamespace(String namespace){
  if (namespace == null) {
    return "String_Node_Str";
  }
  if (!(namespace.endsWith("String_Node_Str") || namespace.endsWith("String_Node_Str"))) {
    namespace=namespace.concat("String_Node_Str");
  }
  return namespace;
}

Fixed version (ground truth):
protected static String getRDFNamespace(String namespace){
  if (namespace == null || namespace.isEmpty()) {
    return "String_Node_Str";
  }
  if (!(namespace.endsWith("String_Node_Str") || namespace.endsWith("String_Node_Str"))) {
    namespace=namespace.concat("String_Node_Str");
  }
  return namespace;
}
Program: 25618
Project: 25618
Buggy source:
private static void createPrefixMappingFromQName(final QName qname,final Model model){
  String prefix=qname.getPrefix();
  String namespace=qname.getNamespaceURI();
  if (prefix != null && !prefix.isEmpty()) {
    if (model.getNsPrefixURI(prefix) == null) {
      model.setNsPrefix(prefix,namespace);
    }
  }
}

Fixed version (ground truth):
private static void createPrefixMappingFromQName(final QName qname,final Model model){
  String prefix=qname.getPrefix();
  String namespace=qname.getNamespaceURI();
  if (prefix != null && !prefix.isEmpty()) {
    if (model.getNsPrefixURI(prefix) == null) {
      model.setNsPrefix(prefix,getRDFNamespace(namespace));
    }
  }
}
Program: 25619
Project: 25619
Buggy source:
private static void setNodeTypeProperties(Resource nodeTypeResource,TNodeType nodeType){
  PropertiesDefinition nodeTypeProperties=objFactory.createTEntityTypePropertiesDefinition();
  String nodeTypeNameSpace=getXMLNamespace(nodeTypeResource);
  String nodeTypePrefix=getNSPrefix(nodeTypeResource);
  QName propertiesReference=new QName(nodeTypeNameSpace,getNodeTypePropertiesName(nodeTypeResource),nodeTypePrefix);
  nodeTypeProperties.setElement(propertiesReference);
  nodeType.setPropertiesDefinition(nodeTypeProperties);
}

Fixed version (ground truth):
private static void setNodeTypeProperties(Resource nodeTypeResource,TNodeType nodeType){
  PropertiesDefinition nodeTypeProperties=objFactory.createTEntityTypePropertiesDefinition();
  String nodeTypeNameSpace=getXMLNamespace(nodeTypeResource);
  QName propertiesReference;
  try {
    propertiesReference=new QName(nodeTypeNameSpace,getNodeTypePropertiesName(nodeTypeResource),getNSPrefix(nodeTypeResource));
  }
 catch (  NoPrefixMappingFoundException e) {
    propertiesReference=new QName(nodeTypeNameSpace,getNodeTypePropertiesName(nodeTypeResource));
  }
  nodeTypeProperties.setElement(propertiesReference);
  nodeType.setPropertiesDefinition(nodeTypeProperties);
}
Program: 25620
Project: 25620
Buggy source:
private static void createProperties(Resource node,Resource nodeType,Element element,String namespace,String prefix,Element propertiesSeq) throws RequiredResourceNotFoundException, MultiplePropertyValuesException {
  StmtIterator propertiesIterator=node.listProperties();
  while (propertiesIterator.hasNext()) {
    Statement propertyStatement=propertiesIterator.next();
    Property property=propertyStatement.getPredicate();
    if (!irrelevantProperties.contains(property)) {
      if (property.hasProperty(RDF.type,OWL.ObjectProperty)) {
        createObjectProperty(node,propertyStatement,element,namespace,prefix,propertiesSeq);
      }
 else       if (property.hasProperty(RDF.type,OWL.DatatypeProperty)) {
        createDatatypeProperty(propertyStatement,element,namespace,prefix,propertiesSeq);
      }
    }
  }
}

Fixed version (ground truth):
private static void createProperties(Resource node,Resource nodeType,Element element,String namespace,Element propertiesSeq) throws RequiredResourceNotFoundException, MultiplePropertyValuesException {
  StmtIterator propertiesIterator=node.listProperties();
  while (propertiesIterator.hasNext()) {
    Statement propertyStatement=propertiesIterator.next();
    Property property=propertyStatement.getPredicate();
    if (!irrelevantProperties.contains(property)) {
      if (property.hasProperty(RDF.type,OWL.ObjectProperty)) {
        createObjectProperty(node,propertyStatement,element,namespace,nodeType,propertiesSeq);
      }
 else       if (property.hasProperty(RDF.type,OWL.DatatypeProperty)) {
        createDatatypeProperty(propertyStatement,element,namespace,nodeType,propertiesSeq);
      }
    }
  }
}
Program: 25621
Project: 25621
Buggy source:
private static Element createNodePropertiesAndTypes(Resource node,Resource nodeType,TNodeTemplate nodeTemplate,List<Object> types) throws NoPropertiesFoundException, RequiredResourceNotFoundException, MultiplePropertyValuesException, PropertiesTypesAlreadyExistsException {
  Element propertiesSeq=createTypes(nodeType,types);
  Document doc=createDocument();
  String nodeTypeNamespace=getXMLNamespace(nodeType);
  String nodeTypePrefix=getNSPrefix(nodeType);
  Element nodeProperties=doc.createElementNS(nodeTypeNamespace,nodeTypePrefix + "String_Node_Str" + getNodeTypePropertiesName(nodeType));
  doc.appendChild(nodeProperties);
  createProperties(node,nodeType,nodeProperties,nodeTypeNamespace,nodeTypePrefix,propertiesSeq);
  if (0 == nodeProperties.getChildNodes().getLength()) {
    throw new NoPropertiesFoundException();
  }
  return doc.getDocumentElement();
}

Fixed version (ground truth):
private static Element createNodePropertiesAndTypes(Resource node,Resource nodeType,TNodeTemplate nodeTemplate,List<Object> types) throws NoPropertiesFoundException, RequiredResourceNotFoundException, MultiplePropertyValuesException, PropertiesTypesAlreadyExistsException {
  Element propertiesSeq=createTypes(nodeType,types);
  Document doc=createDocument();
  String nodeTypeNamespace=getXMLNamespace(nodeType);
  Element nodeProperties;
  try {
    nodeProperties=doc.createElementNS(nodeTypeNamespace,getNSPrefix(nodeType) + "String_Node_Str" + getNodeTypePropertiesName(nodeType));
  }
 catch (  NoPrefixMappingFoundException e) {
    nodeProperties=doc.createElementNS(nodeTypeNamespace,getNodeTypePropertiesName(nodeType));
  }
  doc.appendChild(nodeProperties);
  createProperties(node,nodeType,nodeProperties,nodeTypeNamespace,propertiesSeq);
  if (0 == nodeProperties.getChildNodes().getLength()) {
    throw new NoPropertiesFoundException();
  }
  return doc.getDocumentElement();
}
Program: 25622
Project: 25622
Buggy source:
private static void setType(TRelationshipTemplate relationshipTemplate,Resource relationType){
  String namespace=getXMLNamespace(relationType);
  String prefix=getNSPrefix(relationType);
  QName type=new QName(namespace,relationType.getLocalName(),prefix);
  relationshipTemplate.setType(type);
}

Fixed version (ground truth):
private static void setType(TRelationshipTemplate relationshipTemplate,Resource relationType){
  String namespace=getXMLNamespace(relationType);
  QName type;
  try {
    type=new QName(namespace,relationType.getLocalName(),getNSPrefix(relationType));
  }
 catch (  NoPrefixMappingFoundException e) {
    type=new QName(namespace,relationType.getLocalName());
  }
  relationshipTemplate.setType(type);
}
Program: 25623
Project: 25623
Buggy source:
private static void setValidSource(TRelationshipType relationshipType,Resource relationshipTypeResource) throws RequiredResourceNotFoundException, MultiplePropertyValuesException {
  Resource source=calculateInferredPropertyValue(relationshipTypeResource,(RDFS.domain));
  String namespace=getXMLNamespace(source);
  String prefix=getNSPrefix(source);
  QName typeRef=new QName(namespace,source.getLocalName(),prefix);
  TRelationshipType.ValidSource validSource=objFactory.createTRelationshipTypeValidSource();
  validSource.setTypeRef(typeRef);
  relationshipType.setValidSource(validSource);
}

Fixed version (ground truth):
private static void setValidSource(TRelationshipType relationshipType,Resource relationshipTypeResource) throws RequiredResourceNotFoundException, MultiplePropertyValuesException {
  Resource source=calculateInferredPropertyValue(relationshipTypeResource,(RDFS.domain));
  String namespace=getXMLNamespace(source);
  QName typeRef;
  try {
    typeRef=new QName(namespace,source.getLocalName(),getNSPrefix(source));
  }
 catch (  NoPrefixMappingFoundException e) {
    typeRef=new QName(namespace,source.getLocalName());
  }
  TRelationshipType.ValidSource validSource=objFactory.createTRelationshipTypeValidSource();
  validSource.setTypeRef(typeRef);
  relationshipType.setValidSource(validSource);
}
Program: 25624
Project: 25624
Buggy source:
private static void setValidTarget(TRelationshipType relationshipType,Resource relationshipTypeResource) throws RequiredResourceNotFoundException, MultiplePropertyValuesException {
  Resource target=calculateInferredPropertyValue(relationshipTypeResource,(RDFS.range));
  String namespace=getXMLNamespace(target);
  String prefix=getNSPrefix(target);
  QName typeRef=new QName(namespace,target.getLocalName(),prefix);
  TRelationshipType.ValidTarget validTarget=objFactory.createTRelationshipTypeValidTarget();
  validTarget.setTypeRef(typeRef);
  relationshipType.setValidTarget(validTarget);
}

Fixed version (ground truth):
private static void setValidTarget(TRelationshipType relationshipType,Resource relationshipTypeResource) throws RequiredResourceNotFoundException, MultiplePropertyValuesException {
  Resource target=calculateInferredPropertyValue(relationshipTypeResource,(RDFS.range));
  String namespace=getXMLNamespace(target);
  QName typeRef;
  try {
    typeRef=new QName(namespace,target.getLocalName(),getNSPrefix(target));
  }
 catch (  NoPrefixMappingFoundException e) {
    typeRef=new QName(namespace,target.getLocalName());
  }
  TRelationshipType.ValidTarget validTarget=objFactory.createTRelationshipTypeValidTarget();
  validTarget.setTypeRef(typeRef);
  relationshipType.setValidTarget(validTarget);
}
Program: 25625
Project: 25625
Buggy source:
private static void createObjectProperty(Resource node,Statement propertyStatement,Element nodeProperties,String namespace,String prefix,Element propertiesSeq) throws RequiredResourceNotFoundException, MultiplePropertyValuesException {
  Element parameter=nodeProperties.getOwnerDocument().createElementNS(namespace,prefix + "String_Node_Str" + propertyStatement.getPredicate().getLocalName());
  if (!propertyStatement.getResource().isAnon()) {
    parameter.setAttribute("String_Node_Str",propertyStatement.getResource().getLocalName());
  }
  Element subSequence=createObjectPropertyType(propertyStatement.getPredicate(),propertiesSeq);
  node=propertyStatement.getResource();
  Resource nodeType=calculateInferredPropertyValue(node,RDF.type);
  createProperties(propertyStatement.getResource(),nodeType,parameter,namespace,prefix,subSequence);
  nodeProperties.appendChild(parameter);
}

Fixed version (ground truth):
private static void createObjectProperty(Resource node,Statement propertyStatement,Element nodeProperties,String namespace,Resource nodeType,Element propertiesSeq) throws RequiredResourceNotFoundException, MultiplePropertyValuesException {
  Element parameter;
  try {
    parameter=nodeProperties.getOwnerDocument().createElementNS(namespace,getNSPrefix(nodeType) + "String_Node_Str" + propertyStatement.getPredicate().getLocalName());
  }
 catch (  NoPrefixMappingFoundException e) {
    parameter=nodeProperties.getOwnerDocument().createElementNS(namespace,propertyStatement.getPredicate().getLocalName());
  }
  if (!propertyStatement.getResource().isAnon()) {
    parameter.setAttribute("String_Node_Str",propertyStatement.getResource().getLocalName());
  }
  Element subSequence=createObjectPropertyType(propertyStatement.getPredicate(),propertiesSeq);
  node=propertyStatement.getResource();
  Resource newNodeType=calculateInferredPropertyValue(node,RDF.type);
  createProperties(node,newNodeType,parameter,namespace,subSequence);
  nodeProperties.appendChild(parameter);
}