nus-yam/ex-repair huggingface dataset:
Program: 97075
Project: 97075
Buggy source:
public void cacheByTag(String tag,IAtsConfigObject configObject){
  tagToConfigObject.put(tag,configObject);
}

Fixed version (ground truth):
public void cacheByTag(String tag,IAtsConfigObject configObject){
  Conditions.checkNotNull(tag,"String_Node_Str");
  Conditions.checkNotNull(configObject,"String_Node_Str");
  tagToConfigObject.put(tag,configObject);
}
Program: 97076
Project: 97076
Buggy source:
public void invalidateByTag(String tag){
  tagToConfigObject.removeValues(tag);
}

Fixed version (ground truth):
public void invalidateByTag(String tag){
  Conditions.checkNotNull(tag,"String_Node_Str");
  tagToConfigObject.removeValues(tag);
}
Program: 97077
Project: 97077
Buggy source:
/** 
 * Clear out all values cached by tag and add sole tag to this configObject
 */
public void cacheSoleByTag(String tag,IAtsConfigObject configObject){
  Collection<IAtsConfigObject> values=tagToConfigObject.getValues(tag);
  if (values != null) {
    values.clear();
  }
  cacheByTag(tag,configObject);
}

Fixed version (ground truth):
/** 
 * Clear out all values cached by tag and add sole tag to this configObject
 */
public void cacheSoleByTag(String tag,IAtsConfigObject configObject){
  Conditions.checkNotNull(tag,"String_Node_Str");
  Conditions.checkNotNull(configObject,"String_Node_Str");
  Collection<IAtsConfigObject> values=tagToConfigObject.getValues(tag);
  if (values != null) {
    values.clear();
  }
  cacheByTag(tag,configObject);
}
Program: 97078
Project: 97078
Buggy source:
@Override public void invalidate(IAtsConfigObject atsObject){
  configObjects.remove(atsObject);
  List<String> keysToRemove=new ArrayList<String>();
  for (  Entry<String,Collection<IAtsConfigObject>> entry : tagToConfigObject.entrySet()) {
    if (entry.getValue().contains(atsObject)) {
      keysToRemove.add(entry.getKey());
    }
  }
  for (  String key : keysToRemove) {
    tagToConfigObject.removeValue(key,atsObject);
  }
}

Fixed version (ground truth):
@Override public void invalidate(IAtsConfigObject atsObject){
  Conditions.checkNotNull(atsObject,"String_Node_Str");
  configObjects.remove(atsObject);
  List<String> keysToRemove=new ArrayList<String>();
  for (  Entry<String,Collection<IAtsConfigObject>> entry : tagToConfigObject.entrySet()) {
    if (entry.getValue().contains(atsObject)) {
      keysToRemove.add(entry.getKey());
    }
  }
  invalidateByUuid(atsObject.getUuid());
  for (  String key : keysToRemove) {
    tagToConfigObject.removeValue(key,atsObject);
  }
}
Program: 97079
Project: 97079
Buggy source:
public void cacheById(long id,IAtsConfigObject configObject){
  idToConfigObject.put(id,configObject);
}

Fixed version (ground truth):
public void cacheById(long id,IAtsConfigObject configObject){
  Conditions.checkNotNull(configObject,"String_Node_Str");
  idToConfigObject.put(id,configObject);
}
Program: 97080
Project: 97080
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public final <A extends IAtsConfigObject>List<A> getByTag(String tag,Class<A> clazz){
  List<A> objs=new ArrayList<A>();
  Collection<IAtsConfigObject> values=tagToConfigObject.getValues(tag);
  if (values != null) {
    for (    IAtsConfigObject obj : values) {
      if (clazz.isInstance(obj)) {
        objs.add((A)obj);
      }
    }
  }
  return objs;
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public final <A extends IAtsConfigObject>List<A> getByTag(String tag,Class<A> clazz){
  Conditions.checkNotNull(tag,"String_Node_Str");
  List<A> objs=new ArrayList<A>();
  Collection<IAtsConfigObject> values=tagToConfigObject.getValues(tag);
  if (values != null) {
    for (    IAtsConfigObject obj : values) {
      if (clazz.isInstance(obj)) {
        objs.add((A)obj);
      }
    }
  }
  return objs;
}
Program: 97081
Project: 97081
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public final <A extends IAtsConfigObject>A getSoleByTag(String tag,Class<A> clazz){
  Collection<IAtsConfigObject> values=tagToConfigObject.getValues(tag);
  if (values != null) {
    for (    IAtsConfigObject obj : values) {
      if (clazz.isInstance(obj)) {
        return (A)obj;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public final <A extends IAtsConfigObject>A getSoleByTag(String tag,Class<A> clazz){
  Conditions.checkNotNull(tag,"String_Node_Str");
  Collection<IAtsConfigObject> values=tagToConfigObject.getValues(tag);
  if (values != null) {
    for (    IAtsConfigObject obj : values) {
      if (clazz.isInstance(obj)) {
        return (A)obj;
      }
    }
  }
  return null;
}
Program: 97082
Project: 97082
Buggy source:
/** 
 * @return html5 action entry page
 * @throws Exception
 */
@Path("String_Node_Str") @GET @Produces(MediaType.TEXT_HTML) public ViewModel getNewSource() throws Exception ;

Fixed version (ground truth):
/** 
 * @return html5 action entry page
 * @throws Exception
 */
@GET @Path("String_Node_Str") @Produces(MediaType.TEXT_HTML) public ViewModel getNewSource() throws Exception ;
Program: 97083
Project: 97083
Buggy source:
/** 
 * Create new ATS configuration branch and ATS config object on Common branch
 * @param form containing information to configure new ATS branch
 * @param form.fromBranchUuid of branch to get config artifacts from
 * @param form.newBranchName of new branch
 * @param form.userId - userId of user performing transition
 * @param uriInfo
 * @return json object with new branchUuid
 */
@POST @Consumes("String_Node_Str") @Produces(MediaType.APPLICATION_JSON) public AtsConfiguration createConfig(MultivaluedMap<String,String> form,@Context UriInfo uriInfo);

Fixed version (ground truth):
/** 
 * Create new ATS configuration branch and ATS config object on Common branch
 * @param form containing information to configure new ATS branch
 * @param form.fromBranchUuid of branch to get config artifacts from
 * @param form.newBranchName of new branch
 * @param form.userId - userId of user performing transition
 * @param uriInfo
 * @return json object with new branchUuid
 */
@POST @Path("String_Node_Str") @Consumes("String_Node_Str") @Produces(MediaType.APPLICATION_JSON) public AtsConfiguration createConfig(MultivaluedMap<String,String> form,@Context UriInfo uriInfo);
Program: 97084
Project: 97084
Buggy source:
private static JaxRsWebTarget getTarget(){
  if (target == null) {
    String appServer=OseeClientProperties.getOseeApplicationServer();
    String atsUri=String.format("String_Node_Str",appServer);
    JaxRsClient jaxRsClient=JaxRsClient.newBuilder().build();
    target=jaxRsClient.target(atsUri);
  }
  return target;
}

Fixed version (ground truth):
private static JaxRsWebTarget getTarget(){
  if (target == null) {
    String appServer=OseeClientProperties.getOseeApplicationServer();
    String atsUri=String.format("String_Node_Str",appServer);
    JaxRsClient jaxRsClient=JaxRsClient.newBuilder().createThreadSafeProxyClients(true).build();
    target=jaxRsClient.target(atsUri);
  }
  return target;
}
Program: 97085
Project: 97085
Buggy source:
private static JaxRsWebTarget getTarget(){
  if (target == null) {
    String appServer=OseeClientProperties.getOseeApplicationServer();
    String atsUri=String.format("String_Node_Str",appServer);
    JaxRsClient jaxRsClient=JaxRsClient.newBuilder().build();
    target=jaxRsClient.target(atsUri);
  }
  return target;
}

Fixed version (ground truth):
private static JaxRsWebTarget getTarget(){
  if (target == null) {
    String appServer=OseeClientProperties.getOseeApplicationServer();
    String atsUri=String.format("String_Node_Str",appServer);
    JaxRsClient jaxRsClient=JaxRsClient.newBuilder().createThreadSafeProxyClients(true).build();
    target=jaxRsClient.target(atsUri);
  }
  return target;
}
Program: 97086
Project: 97086
Buggy source:
@Override protected IStatus run(IProgressMonitor monitor){
  AtsJaxRsService.get().getNotify().sendNotifications(notifications);
  return Status.OK_STATUS;
}

Fixed version (ground truth):
@Override protected IStatus run(IProgressMonitor monitor){
  AtsClientService.getNotifyEndpoint().sendNotifications(notifications);
  return Status.OK_STATUS;
}
Program: 97087
Project: 97087
Buggy source:
@Override public void sendNotifications(final AtsNotificationCollector notifications){
  if (AtsUtilClient.isEmailEnabled()) {
    Jobs.startJob(new Job("String_Node_Str"){
      @Override protected IStatus run(      IProgressMonitor monitor){
        AtsJaxRsService.get().getNotify().sendNotifications(notifications);
        return Status.OK_STATUS;
      }
    }
,false);
  }
}

Fixed version (ground truth):
@Override public void sendNotifications(final AtsNotificationCollector notifications){
  if (AtsUtilClient.isEmailEnabled()) {
    Jobs.startJob(new Job("String_Node_Str"){
      @Override protected IStatus run(      IProgressMonitor monitor){
        AtsClientService.getNotifyEndpoint().sendNotifications(notifications);
        return Status.OK_STATUS;
      }
    }
,false);
  }
}
Program: 97088
Project: 97088
Buggy source:
private static JaxRsWebTarget getTarget(){
  if (target == null) {
    String appServer=OseeClientProperties.getOseeApplicationServer();
    String atsUri=String.format("String_Node_Str",appServer);
    JaxRsClient jaxRsClient=JaxRsClient.newBuilder().build();
    target=jaxRsClient.target(atsUri);
  }
  return target;
}

Fixed version (ground truth):
private static JaxRsWebTarget getTarget(){
  if (target == null) {
    String appServer=OseeClientProperties.getOseeApplicationServer();
    String atsUri=String.format("String_Node_Str",appServer);
    JaxRsClient jaxRsClient=JaxRsClient.newBuilder().createThreadSafeProxyClients(true).build();
    target=jaxRsClient.target(atsUri);
  }
  return target;
}
Program: 97089
Project: 97089
Buggy source:
@Test public void testGetDispoPrograms(){
  ResultSet<IOseeBranch> programsSet=ResultSets.singleton(mockBranch);
  when(storage.getDispoBranches()).thenAnswer(newAnswer(programsSet));
  ResultSet<IOseeBranch> actual=dispoApi.getDispoPrograms();
  assertEquals(programsSet.iterator().next(),actual.iterator().next());
}

Fixed version (ground truth):
@Test public void testGetDispoPrograms(){
  List<IOseeBranch> programsSet=Collections.singletonList(mockBranch);
  when(storage.getDispoBranches()).thenAnswer(newAnswer(programsSet));
  List<IOseeBranch> actual=dispoApi.getDispoPrograms();
  assertEquals(programsSet.iterator().next(),actual.iterator().next());
}
Program: 97090
Project: 97090
Buggy source:
@Test public void testGetAll() throws JSONException {
  ResultSet<IOseeBranch> emptyResultSet=ResultSets.emptyResultSet();
  when(dispoApi.getDispoPrograms()).thenReturn(emptyResultSet);
  Response noProgramsResponse=resource.getAllPrograms();
  String messageActual=(String)noProgramsResponse.getEntity();
  assertEquals(Response.Status.NOT_FOUND.getStatusCode(),noProgramsResponse.getStatus());
  assertEquals("String_Node_Str",messageActual);
  IOseeBranch branch=TokenFactory.createBranch(id1.getUuid(),"String_Node_Str");
  ResultSet<IOseeBranch> branchList=ResultSets.singleton(branch);
  when(dispoApi.getDispoPrograms()).thenReturn(branchList);
  Response oneSetResponse=resource.getAllPrograms();
  JSONArray entity=new JSONArray((String)oneSetResponse.getEntity());
  JSONObject programFromEntity=entity.getJSONObject(0);
  assertEquals(Response.Status.OK.getStatusCode(),oneSetResponse.getStatus());
  assertEquals(String.valueOf(id1.getUuid()),programFromEntity.getString("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testGetAll() throws JSONException {
  List<IOseeBranch> emptyResultSet=Collections.emptyList();
  when(dispoApi.getDispoPrograms()).thenReturn(emptyResultSet);
  Response noProgramsResponse=resource.getAllPrograms();
  String messageActual=(String)noProgramsResponse.getEntity();
  assertEquals(Response.Status.NOT_FOUND.getStatusCode(),noProgramsResponse.getStatus());
  assertEquals("String_Node_Str",messageActual);
  IOseeBranch branch=TokenFactory.createBranch(id1.getUuid(),"String_Node_Str");
  List<IOseeBranch> branchList=Collections.singletonList(branch);
  when(dispoApi.getDispoPrograms()).thenReturn(branchList);
  Response oneSetResponse=resource.getAllPrograms();
  JSONArray entity=new JSONArray((String)oneSetResponse.getEntity());
  JSONObject programFromEntity=entity.getJSONObject(0);
  assertEquals(Response.Status.OK.getStatusCode(),oneSetResponse.getStatus());
  assertEquals(String.valueOf(id1.getUuid()),programFromEntity.getString("String_Node_Str"));
}
Program: 97091
Project: 97091
Buggy source:
ResultSet<IOseeBranch> getDispoPrograms();

Fixed version (ground truth):
List<IOseeBranch> getDispoPrograms();
Program: 97092
Project: 97092
Buggy source:
@Override public ResultSet<IOseeBranch> getDispoPrograms(){
  return getQuery().getDispoBranches();
}

Fixed version (ground truth):
@Override public List<IOseeBranch> getDispoPrograms(){
  return getQuery().getDispoBranches();
}
Program: 97093
Project: 97093
Buggy source:
ResultSet<IOseeBranch> getDispoBranches();

Fixed version (ground truth):
List<IOseeBranch> getDispoBranches();
Program: 97094
Project: 97094
Buggy source:
@Override public ResultSet<IOseeBranch> getDispoBranches(){
  ResultSet<BranchReadable> baselineBranches=getQuery().branchQuery().andIsOfType(BranchType.BASELINE).getResults();
  String configContents=getDispoConfigContents();
  List<IOseeBranch> results=new ArrayList<IOseeBranch>();
  for (  BranchReadable baselineBranch : baselineBranches) {
    IOseeBranch dispoBranch=convertToDispoBranch(configContents,baselineBranch);
    if (dispoBranch != null) {
      results.add(dispoBranch);
    }
  }
  return ResultSets.newResultSet(results);
}

Fixed version (ground truth):
@Override public List<IOseeBranch> getDispoBranches(){
  List<IOseeBranch> dispoBranchesNormalized=new ArrayList<IOseeBranch>();
  BranchReadable dispoBranch=getQuery().branchQuery().andNameEquals("String_Node_Str").getResults().getExactlyOne();
  ResultSet<BranchReadable> dispoBranches=getQuery().branchQuery().andIsOfType(BranchType.WORKING).andIsChildOf(dispoBranch).getResults();
  for (  BranchReadable branch : dispoBranches) {
    IOseeBranch newName=TokenFactory.createBranch(branch.getUuid(),branch.getName().replaceFirst("String_Node_Str","String_Node_Str"));
    dispoBranchesNormalized.add(newName);
  }
  return dispoBranchesNormalized;
}
Program: 97095
Project: 97095
Buggy source:
private static String getName(TransactionDelta txDelta) throws OseeCoreException {
  Artifact associatedArtifact=BranchManager.getAssociatedArtifact(txDelta);
  String name=associatedArtifact == null ? "String_Node_Str" : associatedArtifact.getName();
  return name.substring(0,Math.min(name.length(),15));
}

Fixed version (ground truth):
private static String getName(TransactionDelta txDelta) throws OseeCoreException {
  Artifact associatedArtifact=BranchManager.getAssociatedArtifact(txDelta);
  String name=associatedArtifact == null ? "String_Node_Str" : associatedArtifact.getName();
  name=name.replaceAll("String_Node_Str","String_Node_Str");
  return name.substring(0,Math.min(name.length(),15));
}
Program: 97096
Project: 97096
Buggy source:
@POST @Path("String_Node_Str") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public Response createInsertionActivity(@PathParam("String_Node_Str") long programUuid,@PathParam("String_Node_Str") long insertionUuid,JaxNewInsertionActivity newActivity) throws Exception {
  ArtifactReadable insertion=atsServer.getArtifactByUuid(insertionUuid);
  if (insertion == null) {
    throw new OseeCoreException("String_Node_Str");
  }
  if (!insertion.getArtifactType().equals(AtsArtifactTypes.Insertion)) {
    throw new OseeCoreException("String_Node_Str");
  }
  ResultSet<?> results=atsServer.getQuery().andUuid(newActivity.getUuid()).getResults();
  if (results.size() != 0) {
    throw new OseeStateException("String_Node_Str",newActivity.getUuid());
  }
  IAtsInsertionActivity created=atsServer.getConfigItemFactory().createInsertionActivity(insertion,newActivity);
  return getResponse(created);
}

Fixed version (ground truth):
@POST @Path("String_Node_Str") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public Response createInsertionActivity(@PathParam("String_Node_Str") long programUuid,@PathParam("String_Node_Str") long insertionUuid,JaxNewInsertionActivity newActivity) throws Exception {
  ArtifactReadable insertion=atsServer.getArtifactByUuid(insertionUuid);
  if (insertion == null) {
    throw new OseeCoreException("String_Node_Str");
  }
  if (!insertion.isOfType(AtsArtifactTypes.Insertion)) {
    throw new OseeCoreException("String_Node_Str");
  }
  ResultSet<?> results=atsServer.getQuery().andUuid(newActivity.getUuid()).getResults();
  if (results.size() != 0) {
    throw new OseeStateException("String_Node_Str",newActivity.getUuid());
  }
  IAtsInsertionActivity created=atsServer.getConfigItemFactory().createInsertionActivity(insertion,newActivity);
  return getResponse(created);
}
Program: 97097
Project: 97097
Buggy source:
@GET @Path("String_Node_Str") @Produces(MediaType.APPLICATION_JSON) public Response getProgramInsertions(@PathParam("String_Node_Str") long uuid) throws Exception {
  ArtifactReadable programArt=atsServer.getArtifactByUuid(uuid);
  if (programArt == null) {
    throw new OseeCoreException("String_Node_Str");
  }
  if (!programArt.getArtifactType().equals(AtsArtifactTypes.Program)) {
    throw new OseeCoreException("String_Node_Str");
  }
  ResultSet<ArtifactReadable> results=programArt.getRelated(AtsRelationTypes.ProgramToInsertion_Insertion);
  List<IAtsConfigObject> insertions=new LinkedList<IAtsConfigObject>();
  for (  ArtifactReadable insertion : results) {
    insertions.add(atsServer.getConfigItemFactory().getInsertion(insertion));
  }
  GenericEntity<List<IAtsConfigObject>> entity=new GenericEntity<List<IAtsConfigObject>>(insertions){
  }
;
  return Response.ok(entity).build();
}

Fixed version (ground truth):
@GET @Path("String_Node_Str") @Produces(MediaType.APPLICATION_JSON) public Response getProgramInsertions(@PathParam("String_Node_Str") long uuid) throws Exception {
  ArtifactReadable programArt=atsServer.getArtifactByUuid(uuid);
  if (programArt == null) {
    throw new OseeCoreException("String_Node_Str");
  }
  if (!programArt.isOfType(AtsArtifactTypes.Program)) {
    throw new OseeCoreException("String_Node_Str");
  }
  ResultSet<ArtifactReadable> results=programArt.getRelated(AtsRelationTypes.ProgramToInsertion_Insertion);
  List<IAtsConfigObject> insertions=new LinkedList<IAtsConfigObject>();
  for (  ArtifactReadable insertion : results) {
    insertions.add(atsServer.getConfigItemFactory().getInsertion(insertion));
  }
  GenericEntity<List<IAtsConfigObject>> entity=new GenericEntity<List<IAtsConfigObject>>(insertions){
  }
;
  return Response.ok(entity).build();
}
Program: 97098
Project: 97098
Buggy source:
@GET @Path("String_Node_Str") @Produces(MediaType.APPLICATION_JSON) public Response getInsertionActivitys(@PathParam("String_Node_Str") long programUuid,@PathParam("String_Node_Str") long insertionUuid) throws Exception {
  ArtifactReadable insertion=atsServer.getArtifactByUuid(insertionUuid);
  if (insertion == null) {
    throw new OseeCoreException("String_Node_Str");
  }
  if (!insertion.getArtifactType().equals(AtsArtifactTypes.Insertion)) {
    throw new OseeCoreException("String_Node_Str");
  }
  ResultSet<ArtifactReadable> results=insertion.getRelated(AtsRelationTypes.InsertionToInsertionActivity_InsertionActivity);
  List<IAtsConfigObject> insertionActivitys=new LinkedList<IAtsConfigObject>();
  for (  ArtifactReadable insertionActivity : results) {
    insertionActivitys.add(atsServer.getConfigItemFactory().getInsertionActivity(insertionActivity));
  }
  GenericEntity<List<IAtsConfigObject>> entity=new GenericEntity<List<IAtsConfigObject>>(insertionActivitys){
  }
;
  return Response.ok(entity).build();
}

Fixed version (ground truth):
@GET @Path("String_Node_Str") @Produces(MediaType.APPLICATION_JSON) public Response getInsertionActivitys(@PathParam("String_Node_Str") long programUuid,@PathParam("String_Node_Str") long insertionUuid) throws Exception {
  ArtifactReadable insertion=atsServer.getArtifactByUuid(insertionUuid);
  if (insertion == null) {
    throw new OseeCoreException("String_Node_Str");
  }
  if (!insertion.isOfType(AtsArtifactTypes.Insertion)) {
    throw new OseeCoreException("String_Node_Str");
  }
  ResultSet<ArtifactReadable> results=insertion.getRelated(AtsRelationTypes.InsertionToInsertionActivity_InsertionActivity);
  List<IAtsConfigObject> insertionActivitys=new LinkedList<IAtsConfigObject>();
  for (  ArtifactReadable insertionActivity : results) {
    insertionActivitys.add(atsServer.getConfigItemFactory().getInsertionActivity(insertionActivity));
  }
  GenericEntity<List<IAtsConfigObject>> entity=new GenericEntity<List<IAtsConfigObject>>(insertionActivitys){
  }
;
  return Response.ok(entity).build();
}
Program: 97099
Project: 97099
Buggy source:
@PUT @Path("String_Node_Str") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public Response updateInsertionActivity(@PathParam("String_Node_Str") long programUuid,@PathParam("String_Node_Str") long insertionUuid,JaxNewInsertionActivity newActivity) throws Exception {
  ArtifactReadable insertionActivityArt=atsServer.getArtifactByUuid(newActivity.getUuid());
  if (insertionActivityArt == null) {
    throw new OseeCoreException("String_Node_Str");
  }
  if (!insertionActivityArt.getArtifactType().equals(AtsArtifactTypes.InsertionActivity)) {
    throw new OseeCoreException("String_Node_Str");
  }
  Response response=null;
  if (!insertionActivityArt.getName().equals(newActivity.getName())) {
    IAtsConfigObject updated=atsServer.getConfigItemFactory().updateInsertionActivity(newActivity);
    response=Response.ok().entity(updated).build();
  }
 else {
    response=Response.notModified().build();
  }
  return response;
}

Fixed version (ground truth):
@PUT @Path("String_Node_Str") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public Response updateInsertionActivity(@PathParam("String_Node_Str") long programUuid,@PathParam("String_Node_Str") long insertionUuid,JaxNewInsertionActivity newActivity) throws Exception {
  ArtifactReadable insertionActivityArt=atsServer.getArtifactByUuid(newActivity.getUuid());
  if (insertionActivityArt == null) {
    throw new OseeCoreException("String_Node_Str");
  }
  if (!insertionActivityArt.isOfType(AtsArtifactTypes.InsertionActivity)) {
    throw new OseeCoreException("String_Node_Str");
  }
  Response response=null;
  if (!insertionActivityArt.getName().equals(newActivity.getName())) {
    IAtsConfigObject updated=atsServer.getConfigItemFactory().updateInsertionActivity(newActivity);
    response=Response.ok().entity(updated).build();
  }
 else {
    response=Response.notModified().build();
  }
  return response;
}
Program: 97100
Project: 97100
Buggy source:
@POST @Path("String_Node_Str") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public Response createInsertion(@PathParam("String_Node_Str") long programUuid,JaxNewInsertion newInsertion) throws Exception {
  ArtifactReadable programArt=atsServer.getArtifactByUuid(programUuid);
  if (programArt == null) {
    throw new OseeCoreException("String_Node_Str");
  }
  if (!programArt.getArtifactType().equals(AtsArtifactTypes.Program)) {
    throw new OseeCoreException("String_Node_Str");
  }
  ResultSet<?> results=atsServer.getQuery().andUuid(newInsertion.getUuid()).getResults();
  if (results.size() != 0) {
    throw new OseeStateException("String_Node_Str",newInsertion.getUuid());
  }
  IAtsInsertion created=atsServer.getConfigItemFactory().createInsertion(programArt,newInsertion);
  return getResponse(created);
}

Fixed version (ground truth):
@POST @Path("String_Node_Str") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public Response createInsertion(@PathParam("String_Node_Str") long programUuid,JaxNewInsertion newInsertion) throws Exception {
  ArtifactReadable programArt=atsServer.getArtifactByUuid(programUuid);
  if (programArt == null) {
    throw new OseeCoreException("String_Node_Str");
  }
  if (!programArt.isOfType(AtsArtifactTypes.Program)) {
    throw new OseeCoreException("String_Node_Str");
  }
  ResultSet<?> results=atsServer.getQuery().andUuid(newInsertion.getUuid()).getResults();
  if (results.size() != 0) {
    throw new OseeStateException("String_Node_Str",newInsertion.getUuid());
  }
  IAtsInsertion created=atsServer.getConfigItemFactory().createInsertion(programArt,newInsertion);
  return getResponse(created);
}
Program: 97101
Project: 97101
Buggy source:
@PUT @Path("String_Node_Str") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public Response updateInsertion(@PathParam("String_Node_Str") long programUuid,JaxNewInsertion insertion){
  ArtifactReadable insertionArt=atsServer.getArtifactByUuid(insertion.getUuid());
  if (insertionArt == null) {
    throw new OseeCoreException("String_Node_Str");
  }
  if (!insertionArt.getArtifactType().equals(AtsArtifactTypes.Insertion)) {
    throw new OseeCoreException("String_Node_Str");
  }
  Response response=null;
  if (!insertionArt.getName().equals(insertion.getName())) {
    IAtsConfigObject updated=atsServer.getConfigItemFactory().updateInsertion(insertion);
    response=Response.ok().entity(updated).build();
  }
 else {
    response=Response.notModified().build();
  }
  return response;
}

Fixed version (ground truth):
@PUT @Path("String_Node_Str") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public Response updateInsertion(@PathParam("String_Node_Str") long programUuid,JaxNewInsertion insertion){
  ArtifactReadable insertionArt=atsServer.getArtifactByUuid(insertion.getUuid());
  if (insertionArt == null) {
    throw new OseeCoreException("String_Node_Str");
  }
  if (!insertionArt.isOfType(AtsArtifactTypes.Insertion)) {
    throw new OseeCoreException("String_Node_Str");
  }
  Response response=null;
  if (!insertionArt.getName().equals(insertion.getName())) {
    IAtsConfigObject updated=atsServer.getConfigItemFactory().updateInsertion(insertion);
    response=Response.ok().entity(updated).build();
  }
 else {
    response=Response.notModified().build();
  }
  return response;
}
Program: 97102
Project: 97102
Buggy source:
private void setGuid(Element pictElement){
  Node imageData=getElement(pictElement,IMAGE);
  if (imageData != null) {
    Node srcAttribute=imageData.getAttributes().getNamedItem(TITLE);
    guid=srcAttribute.getNodeValue();
  }
}

Fixed version (ground truth):
private void setGuid(Element pictElement){
  Node imageData=getElement(pictElement,IMAGE);
  if (imageData != null) {
    Node srcAttribute=imageData.getAttributes().getNamedItem(TITLE);
    if (srcAttribute != null) {
      guid=srcAttribute.getNodeValue();
    }
  }
}
Program: 97103
Project: 97103
Buggy source:
private String getImageId(Element pictElement){
  String imgId=null;
  Node imageData=getElement(pictElement,IMAGE);
  if (imageData != null) {
    Node srcAttribute=imageData.getAttributes().getNamedItem(SRC);
    imgId=srcAttribute.getNodeValue();
  }
  return imgId;
}

Fixed version (ground truth):
private String getImageId(Element pictElement){
  String imgId=null;
  Node imageData=getElement(pictElement,IMAGE);
  if (imageData != null) {
    Node srcAttribute=imageData.getAttributes().getNamedItem(SRC);
    if (srcAttribute != null) {
      imgId=srcAttribute.getNodeValue();
    }
  }
  return imgId;
}
Program: 97105
Project: 97105
Buggy source:
@Path("String_Node_Str") @GET @RolesAllowed(DispoRoles.ROLES_ADMINISTRATOR) @Produces(MediaType.APPLICATION_OCTET_STREAM) public Response postDispoSetExport(@QueryParam("String_Node_Str") String primarySet,@QueryParam("String_Node_Str") String option){
  final DispoSet dispoSet=dispoApi.getDispoSetById(program,primarySet);
  final ExportSet writer=new ExportSet(dispoApi);
  final String options=option;
  final String fileName=String.format("String_Node_Str",System.currentTimeMillis());
  StreamingOutput streamingOutput=new StreamingOutput(){
    @Override public void write(    OutputStream outputStream) throws WebApplicationException, IOException {
      writer.runReport(program,dispoSet,options,outputStream);
      outputStream.flush();
    }
  }
;
  String contentDisposition=String.format("String_Node_Str",fileName,new Date());
  return Response.ok(streamingOutput).header("String_Node_Str",contentDisposition).type("String_Node_Str").build();
}

Fixed version (ground truth):
@Path("String_Node_Str") @GET @RolesAllowed(DispoRoles.ROLES_ADMINISTRATOR) @Produces(MediaType.APPLICATION_OCTET_STREAM) public Response postDispoSetExport(@Encoded @QueryParam("String_Node_Str") String primarySet,@QueryParam("String_Node_Str") String option){
  final DispoSet dispoSet=dispoApi.getDispoSetById(program,primarySet);
  final ExportSet writer=new ExportSet(dispoApi);
  final String options=option;
  final String fileName=String.format("String_Node_Str",System.currentTimeMillis());
  StreamingOutput streamingOutput=new StreamingOutput(){
    @Override public void write(    OutputStream outputStream) throws WebApplicationException, IOException {
      writer.runReport(program,dispoSet,options,outputStream);
      outputStream.flush();
    }
  }
;
  String contentDisposition=String.format("String_Node_Str",fileName,new Date());
  return Response.ok(streamingOutput).header("String_Node_Str",contentDisposition).type("String_Node_Str").build();
}
Program: 97106
Project: 97106
Buggy source:
@Path("String_Node_Str") @POST @RolesAllowed(DispoRoles.ROLES_ADMINISTRATOR) @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public Response getDispoSetCopy(@QueryParam("String_Node_Str") String destinationSet,@QueryParam("String_Node_Str") String sourceSet,CopySetParams params){
  Response.Status status;
  final DispoSet destination=dispoApi.getDispoSetById(program,destinationSet);
  final DispoSet source=dispoApi.getDispoSetById(program,sourceSet);
  String reportUrl=dispoApi.copyDispoSet(program,destination,source,params);
  DispoSetData responseSet=new DispoSetData();
  responseSet.setOperationStatus(reportUrl);
  if (Strings.isValid(reportUrl)) {
    status=Status.OK;
  }
 else {
    status=Status.NOT_FOUND;
  }
  return Response.status(status).entity(responseSet).build();
}

Fixed version (ground truth):
@Path("String_Node_Str") @POST @RolesAllowed(DispoRoles.ROLES_ADMINISTRATOR) @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public Response getDispoSetCopy(@Encoded @QueryParam("String_Node_Str") String destinationSet,@Encoded @QueryParam("String_Node_Str") String sourceSet,CopySetParams params){
  Response.Status status;
  final DispoSet destination=dispoApi.getDispoSetById(program,destinationSet);
  final DispoSet source=dispoApi.getDispoSetById(program,sourceSet);
  String reportUrl=dispoApi.copyDispoSet(program,destination,source,params);
  DispoSetData responseSet=new DispoSetData();
  responseSet.setOperationStatus(reportUrl);
  if (Strings.isValid(reportUrl)) {
    status=Status.OK;
  }
 else {
    status=Status.NOT_FOUND;
  }
  return Response.status(status).entity(responseSet).build();
}
Program: 97107
Project: 97107
Buggy source:
@Path("String_Node_Str") @GET @RolesAllowed(DispoRoles.ROLES_ADMINISTRATOR) @Produces(MediaType.APPLICATION_OCTET_STREAM) public Response getDispoSetReport(@QueryParam("String_Node_Str") String primarySet,@QueryParam("String_Node_Str") String secondarySet){
  final DispoSet dispoSet=dispoApi.getDispoSetById(program,primarySet);
  final DispoSet dispoSet2=dispoApi.getDispoSetById(program,secondarySet);
  final STRSReport writer=new STRSReport(dispoApi);
  final String fileName=String.format("String_Node_Str",System.currentTimeMillis());
  StreamingOutput streamingOutput=new StreamingOutput(){
    @Override public void write(    OutputStream outputStream) throws WebApplicationException, IOException {
      writer.runReport(program,dispoSet,dispoSet2,outputStream);
      outputStream.flush();
    }
  }
;
  String contentDisposition=String.format("String_Node_Str",fileName,new Date());
  return Response.ok(streamingOutput).header("String_Node_Str",contentDisposition).type("String_Node_Str").build();
}

Fixed version (ground truth):
@Path("String_Node_Str") @GET @RolesAllowed(DispoRoles.ROLES_ADMINISTRATOR) @Produces(MediaType.APPLICATION_OCTET_STREAM) public Response getDispoSetReport(@Encoded @QueryParam("String_Node_Str") String primarySet,@Encoded @QueryParam("String_Node_Str") String secondarySet){
  final DispoSet dispoSet=dispoApi.getDispoSetById(program,primarySet);
  final DispoSet dispoSet2=dispoApi.getDispoSetById(program,secondarySet);
  final STRSReport writer=new STRSReport(dispoApi);
  final String fileName=String.format("String_Node_Str",System.currentTimeMillis());
  StreamingOutput streamingOutput=new StreamingOutput(){
    @Override public void write(    OutputStream outputStream) throws WebApplicationException, IOException {
      writer.runReport(program,dispoSet,dispoSet2,outputStream);
      outputStream.flush();
    }
  }
;
  String contentDisposition=String.format("String_Node_Str",fileName,new Date());
  return Response.ok(streamingOutput).header("String_Node_Str",contentDisposition).type("String_Node_Str").build();
}
Program: 97108
Project: 97108
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj) {
    return true;
  }
  if (obj == null) {
    return false;
  }
  if (!(obj instanceof IAgileFeatureGroup)) {
    return false;
  }
  IAgileFeatureGroup other=(IAgileFeatureGroup)obj;
  if (uuid != other.getUuid()) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (this == obj) {
    return true;
  }
  if (obj == null) {
    return false;
  }
  if (!(obj instanceof AbstractAgileObject)) {
    return false;
  }
  AbstractAgileObject other=(AbstractAgileObject)obj;
  if (uuid != other.getUuid()) {
    return false;
  }
  return true;
}
Program: 97110
Project: 97110
Buggy source:
@Path("String_Node_Str") @GET @RolesAllowed(DispoRoles.ROLES_ADMINISTRATOR) @Produces(MediaType.APPLICATION_OCTET_STREAM) public Response postDispoSetExport(@Encoded @QueryParam("String_Node_Str") String primarySet,@QueryParam("String_Node_Str") String option){
  final DispoSet dispoSet=dispoApi.getDispoSetById(program,primarySet);
  final ExportSet writer=new ExportSet(dispoApi);
  final String options=option;
  final String fileName=String.format("String_Node_Str",System.currentTimeMillis());
  StreamingOutput streamingOutput=new StreamingOutput(){
    @Override public void write(    OutputStream outputStream) throws WebApplicationException, IOException {
      writer.runReport(program,dispoSet,options,outputStream);
      outputStream.flush();
    }
  }
;
  String contentDisposition=String.format("String_Node_Str",fileName,new Date());
  return Response.ok(streamingOutput).header("String_Node_Str",contentDisposition).type("String_Node_Str").build();
}

Fixed version (ground truth):
@Path("String_Node_Str") @GET @RolesAllowed(DispoRoles.ROLES_ADMINISTRATOR) @Produces(MediaType.APPLICATION_OCTET_STREAM) public Response postDispoSetExport(@QueryParam("String_Node_Str") String primarySet,@QueryParam("String_Node_Str") String option){
  final DispoSet dispoSet=dispoApi.getDispoSetById(program,primarySet);
  final ExportSet writer=new ExportSet(dispoApi);
  final String options=option;
  final String fileName=String.format("String_Node_Str",System.currentTimeMillis());
  StreamingOutput streamingOutput=new StreamingOutput(){
    @Override public void write(    OutputStream outputStream) throws WebApplicationException, IOException {
      writer.runReport(program,dispoSet,options,outputStream);
      outputStream.flush();
    }
  }
;
  String contentDisposition=String.format("String_Node_Str",fileName,new Date());
  return Response.ok(streamingOutput).header("String_Node_Str",contentDisposition).type("String_Node_Str").build();
}
Program: 97111
Project: 97111
Buggy source:
@Path("String_Node_Str") @POST @RolesAllowed(DispoRoles.ROLES_ADMINISTRATOR) @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public Response getDispoSetCopy(@Encoded @QueryParam("String_Node_Str") String destinationSet,@Encoded @QueryParam("String_Node_Str") String sourceSet,CopySetParams params){
  Response.Status status;
  final DispoSet destination=dispoApi.getDispoSetById(program,destinationSet);
  final DispoSet source=dispoApi.getDispoSetById(program,sourceSet);
  String reportUrl=dispoApi.copyDispoSet(program,destination,source,params);
  DispoSetData responseSet=new DispoSetData();
  responseSet.setOperationStatus(reportUrl);
  if (Strings.isValid(reportUrl)) {
    status=Status.OK;
  }
 else {
    status=Status.NOT_FOUND;
  }
  return Response.status(status).entity(responseSet).build();
}

Fixed version (ground truth):
@Path("String_Node_Str") @POST @RolesAllowed(DispoRoles.ROLES_ADMINISTRATOR) @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public Response getDispoSetCopy(@QueryParam("String_Node_Str") String destinationSet,@QueryParam("String_Node_Str") String sourceSet,CopySetParams params){
  Response.Status status;
  final DispoSet destination=dispoApi.getDispoSetById(program,destinationSet);
  final DispoSet source=dispoApi.getDispoSetById(program,sourceSet);
  String reportUrl=dispoApi.copyDispoSet(program,destination,source,params);
  DispoSetData responseSet=new DispoSetData();
  responseSet.setOperationStatus(reportUrl);
  if (Strings.isValid(reportUrl)) {
    status=Status.OK;
  }
 else {
    status=Status.NOT_FOUND;
  }
  return Response.status(status).entity(responseSet).build();
}
Program: 97112
Project: 97112
Buggy source:
@Path("String_Node_Str") @GET @RolesAllowed(DispoRoles.ROLES_ADMINISTRATOR) @Produces(MediaType.APPLICATION_OCTET_STREAM) public Response getDispoSetReport(@Encoded @QueryParam("String_Node_Str") String primarySet,@Encoded @QueryParam("String_Node_Str") String secondarySet){
  final DispoSet dispoSet=dispoApi.getDispoSetById(program,primarySet);
  final DispoSet dispoSet2=dispoApi.getDispoSetById(program,secondarySet);
  final STRSReport writer=new STRSReport(dispoApi);
  final String fileName=String.format("String_Node_Str",System.currentTimeMillis());
  StreamingOutput streamingOutput=new StreamingOutput(){
    @Override public void write(    OutputStream outputStream) throws WebApplicationException, IOException {
      writer.runReport(program,dispoSet,dispoSet2,outputStream);
      outputStream.flush();
    }
  }
;
  String contentDisposition=String.format("String_Node_Str",fileName,new Date());
  return Response.ok(streamingOutput).header("String_Node_Str",contentDisposition).type("String_Node_Str").build();
}

Fixed version (ground truth):
@Path("String_Node_Str") @GET @RolesAllowed(DispoRoles.ROLES_ADMINISTRATOR) @Produces(MediaType.APPLICATION_OCTET_STREAM) public Response getDispoSetReport(@QueryParam("String_Node_Str") String primarySet,@QueryParam("String_Node_Str") String secondarySet){
  final DispoSet dispoSet=dispoApi.getDispoSetById(program,primarySet);
  final DispoSet dispoSet2=dispoApi.getDispoSetById(program,secondarySet);
  final STRSReport writer=new STRSReport(dispoApi);
  final String fileName=String.format("String_Node_Str",System.currentTimeMillis());
  StreamingOutput streamingOutput=new StreamingOutput(){
    @Override public void write(    OutputStream outputStream) throws WebApplicationException, IOException {
      writer.runReport(program,dispoSet,dispoSet2,outputStream);
      outputStream.flush();
    }
  }
;
  String contentDisposition=String.format("String_Node_Str",fileName,new Date());
  return Response.ok(streamingOutput).header("String_Node_Str",contentDisposition).type("String_Node_Str").build();
}
Program: 97113
Project: 97113
Buggy source:
@Override public Object getRelatedOrNull(Object object,IRelationTypeSide relationType){
  Object related=null;
  ArtifactReadable artifact=atsServer.getArtifact(object);
  if (artifact != null) {
    try {
      related=artifact.getRelated(relationType);
    }
 catch (    ArtifactDoesNotExist ex) {
    }
  }
  return related;
}

Fixed version (ground truth):
@Override public Object getRelatedOrNull(Object object,IRelationTypeSide relationType){
  Object related=null;
  ArtifactReadable artifact=atsServer.getArtifact(object);
  if (artifact != null) {
    try {
      related=artifact.getRelated(relationType).getAtMostOneOrNull();
    }
 catch (    ArtifactDoesNotExist ex) {
    }
  }
  return related;
}
Program: 97114
Project: 97114
Buggy source:
private void processAttributes(Artifact artifact,WordMLProducer wordMl,PresentationType presentationType,boolean publishInLine,String footer) throws OseeCoreException {
  for (  AttributeElement attributeElement : attributeElements) {
    String attributeName=attributeElement.getAttributeName();
    if (renderer.getBooleanOption(ALL_ATTRIBUTES) || (attributeName.equals("String_Node_Str"))) {
      for (      IAttributeType attributeType : RendererManager.getAttributeTypeOrderList(artifact)) {
        if (!outlining || !attributeType.equals(headingAttributeType)) {
          processAttribute(artifact,wordMl,attributeElement,attributeType,true,presentationType,publishInLine,footer);
        }
      }
    }
 else {
      AttributeType attributeType=AttributeTypeManager.getType(attributeName);
      if (artifact.isAttributeTypeValid(attributeType)) {
        processAttribute(artifact,wordMl,attributeElement,attributeType,false,presentationType,publishInLine,footer);
      }
    }
  }
  wordMl.setPageLayout(artifact,footer);
}

Fixed version (ground truth):
private void processAttributes(Artifact artifact,WordMLProducer wordMl,PresentationType presentationType,boolean publishInLine,String footer) throws OseeCoreException {
  for (  AttributeElement attributeElement : attributeElements) {
    String attributeName=attributeElement.getAttributeName();
    if (renderer.getBooleanOption(ALL_ATTRIBUTES) || (attributeName.equals("String_Node_Str"))) {
      for (      IAttributeType attributeType : RendererManager.getAttributeTypeOrderList(artifact)) {
        if (!outlining || !attributeType.equals(headingAttributeType)) {
          processAttribute(artifact,wordMl,attributeElement,attributeType,true,presentationType,publishInLine,footer);
        }
      }
    }
 else {
      AttributeType attributeType=AttributeTypeManager.getType(attributeName);
      if (artifact.isAttributeTypeValid(attributeType)) {
        processAttribute(artifact,wordMl,attributeElement,attributeType,false,presentationType,publishInLine,footer);
      }
    }
  }
}
Program: 97115
Project: 97115
Buggy source:
/** 
 * Process old format: http://127.0.0.1:<port>/get/guid/<guid>/<ats,Define> old format should be removed once all legacy references are change to new format
 */
private boolean parseOldSchoolStyleLinks(String link){
  boolean wasHandled=false;
  Matcher oldMatcher=LEGACY_MATCHER;
  oldMatcher.reset(link);
  if (oldMatcher.find()) {
    wasHandled=true;
    String guid=oldMatcher.group(2);
    if (oldMatcher.groupCount() > 2) {
      String processType=oldMatcher.group(3);
      if (processType.equals("String_Node_Str")) {
        parameterMap.put("String_Node_Str",guid);
      }
 else       if (processType.equals("String_Node_Str") || processType.equals("String_Node_Str")) {
        parameterMap.put("String_Node_Str",guid);
      }
    }
  }
  return wasHandled;
}

Fixed version (ground truth):
/** 
 * Process old format: http://127.0.0.1:<port>/get/guid/<guid>/<ats,Define> old format should be removed once all legacy references are change to new format
 */
private boolean parseOldSchoolStyleLinks(String link){
  boolean wasHandled=false;
  Matcher oldMatcher=LEGACY_MATCHER;
  oldMatcher.reset(link);
  if (oldMatcher.find()) {
    wasHandled=true;
    String guid=oldMatcher.group(2);
    if (oldMatcher.groupCount() > 2) {
      String processType=oldMatcher.group(3);
      if (processType.equals("String_Node_Str")) {
        parameterMap.put("String_Node_Str",guid);
      }
 else       if (processType.equals("String_Node_Str") || processType.equals("String_Node_Str")) {
        parameterMap.put("String_Node_Str",guid);
      }
 else       if (GUID.isValid(guid)) {
        parameterMap.put("String_Node_Str",guid);
      }
    }
  }
  return wasHandled;
}
Program: 97116
Project: 97116
Buggy source:
/** 
 * Find WordML links locations in content grouped by GUID
 * @return locations where WordMlLinks were found grouped by GUID
 */
public static HashCollection<String,MatchRange> parseOseeWordMLLinks(String content) throws OseeCoreException {
  HashCollection<String,MatchRange> matchMap=new HashCollection<String,MatchRange>();
  OseeLinkParser linkParser=new OseeLinkParser();
  WORDML_LINK.reset(content);
  while (WORDML_LINK.find()) {
    String link=WORDML_LINK.group(1);
    if (Strings.isValid(link)) {
      linkParser.parse(link);
      String guid=linkParser.getGuid();
      if (Strings.isValid(guid)) {
        matchMap.put(guid,new MatchRange(WORDML_LINK.start(),WORDML_LINK.end()));
      }
    }
  }
  WORDML_LINK.reset();
  return matchMap;
}

Fixed version (ground truth):
/** 
 * Find WordML links locations in content grouped by GUID
 * @return locations where WordMlLinks were found grouped by GUID
 */
public static HashCollection<String,MatchRange> parseOseeWordMLLinks(String content) throws OseeCoreException {
  HashCollection<String,MatchRange> matchMap=new HashCollection<String,MatchRange>();
  OseeLinkParser linkParser=new OseeLinkParser();
  WORDML_LINK.reset(content);
  while (WORDML_LINK.find()) {
    String link=WORDML_LINK.group(1);
    if (Strings.isValid(link)) {
      linkParser.parse(link);
      String guid=linkParser.getGuid();
      if (Strings.isValid(guid)) {
        matchMap.put(guid,new MatchRange(WORDML_LINK.start(),WORDML_LINK.end()));
      }
    }
  }
  WORDML_LINK.reset();
  HYPERLINK_PATTERN.reset(content);
  while (HYPERLINK_PATTERN.find()) {
    String link=HYPERLINK_PATTERN.group(2);
    if (Strings.isValid(link)) {
      linkParser.parse(link);
      String guid=linkParser.getGuid();
      if (Strings.isValid(guid)) {
        matchMap.put(guid,new MatchRange(HYPERLINK_PATTERN.start(),HYPERLINK_PATTERN.end()));
      }
    }
  }
  HYPERLINK_PATTERN.reset();
  return matchMap;
}