nus-yam/ex-repair huggingface dataset:
Program: 161820
Project: 161820
Buggy source:
/** 
 * Get the active MAC address on the current machine as a byte array. This is called when generating a new UUID. Note that a machine can have multiple or no active MAC addresses. This method works by iterating through the list of network interfaces, ignoring the loopback interface and any virtual interfaces (which often have made-up addresses), and returning the first one we find. If no valid addresses are found, then a byte array of the same length with all zeros is returned.
 * @return 6-byte array for first active MAC address, or 6-byte zeroed array if no interfaces are active.
 */
private static byte[] macAddress(){
  try {
    Enumeration<NetworkInterface> interfaces=NetworkInterface.getNetworkInterfaces();
    byte[] mac=null;
    while (interfaces.hasMoreElements() && mac != null && mac.length != 6) {
      NetworkInterface netInterface=interfaces.nextElement();
      if (netInterface.isLoopback() || netInterface.isVirtual())       continue;
      mac=netInterface.getHardwareAddress();
    }
    if (mac == null)     mac=new byte[]{0,0,0,0,0,0};
    return mac;
  }
 catch (  Exception e) {
    throw new RuntimeException("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Get the active MAC address on the current machine as a byte array. This is called when generating a new UUID. Note that a machine can have multiple or no active MAC addresses. This method works by iterating through the list of network interfaces, ignoring the loopback interface and any virtual interfaces (which often have made-up addresses), and returning the first one we find. If no valid addresses are found, then a byte array of the same length with all zeros is returned.
 * @return 6-byte array for first active MAC address, or 6-byte zeroed array if no interfaces are active.
 */
private static byte[] macAddress(){
  try {
    Enumeration<NetworkInterface> interfaces=NetworkInterface.getNetworkInterfaces();
    byte[] mac=null;
    while (interfaces.hasMoreElements() && (mac == null || mac.length != 6)) {
      NetworkInterface netInterface=interfaces.nextElement();
      if (netInterface.isLoopback() || netInterface.isVirtual())       continue;
      mac=netInterface.getHardwareAddress();
    }
    if (mac == null)     mac=new byte[]{0,0,0,0,0,0};
    return mac;
  }
 catch (  Exception e) {
    throw new RuntimeException("String_Node_Str");
  }
}
Program: 161821
Project: 161821
Buggy source:
/** 
 * Exposes the MAC address that us used in the UUID via injection.
 * @return the MAC address.
 */
private static byte[] macAddress() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
  Method macAddress=com.groupon.uuid.UUID.class.getDeclaredMethod("String_Node_Str");
  macAddress.setAccessible(true);
  return (byte[])macAddress.invoke(new UUID());
}

Fixed version (ground truth):
/** 
 * Exposes the MAC address that us used in the UUID via reflection.
 * @return the MAC address.
 */
private static byte[] macAddress() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
  Method macAddress=com.groupon.uuid.UUID.class.getDeclaredMethod("String_Node_Str");
  macAddress.setAccessible(true);
  return (byte[])macAddress.invoke(new UUID());
}
Program: 161822
Project: 161822
Buggy source:
/** 
 * Creates a new   {@link CandidatePacketExtension} with the specified<tt>elementName</tt> so that this class would be usable as a <tt>RemoteCandidatePacketExtension</tt> parent.
 * @param elementName the element name that this instance should be using.
 */
protected CandidatePacketExtension(String elementName){
  super(null,elementName);
}

Fixed version (ground truth):
/** 
 * Creates a new   {@link CandidatePacketExtension} with the specified<tt>elementName</tt> so that this class would be usable as a <tt>RemoteCandidatePacketExtension</tt> parent.
 * @param elementName the element name that this instance should be using.
 */
protected CandidatePacketExtension(String elementName){
  super(NAMESPACE,elementName);
}
Program: 161823
Project: 161823
Buggy source:
/** 
 * Creates a new   {@link PayloadTypePacketExtension} instance.
 */
public PayloadTypePacketExtension(){
  super(null,ELEMENT_NAME);
}

Fixed version (ground truth):
/** 
 * Creates a new   {@link PayloadTypePacketExtension} instance.
 */
public PayloadTypePacketExtension(){
  super(NAMESPACE,ELEMENT_NAME);
}
Program: 161824
Project: 161824
Buggy source:
private MediaFormat getSupportedFormat(String name,PayloadTypePacketExtension payloadType){
  MediaDevice dev=devices.get(name);
  for (  MediaFormat mf : dev.getSupportedFormats()) {
    if ((mf.getRTPPayloadType() == MediaFormat.RTP_PAYLOAD_TYPE_UNKNOWN || mf.getRTPPayloadType() == payloadType.getID()) && mf.getClockRateString().equals(String.valueOf(payloadType.getClockrate())) && mf.getEncoding().equals(payloadType.getName())) {
      return mf;
    }
  }
  return null;
}

Fixed version (ground truth):
private MediaFormat getSupportedFormat(String name,PayloadTypePacketExtension payloadType){
  MediaDevice dev=devices.get(name);
  MediaType mediaType=dev.getMediaType();
  for (  MediaFormat mf : dev.getSupportedFormats()) {
    if (mf.matches(mediaType,payloadType.getName(),payloadType.getClockrate(),payloadType.getChannels(),null)) {
      return mf;
    }
  }
  return null;
}
Program: 161825
Project: 161825
Buggy source:
public IceAgent(final boolean controling,String username,final String streamname,TransportAddress stunAddresses[],TransportAddress turnAddresses[]) throws IOException {
  this.agent=new Agent();
  this.controling=controling;
  this.streamname=streamname;
  agent.setControlling(controling);
  agent.setNominationStrategy(NominationStrategy.NOMINATE_HIGHEST_PRIO);
  if (stunAddresses != null)   for (  TransportAddress ta : stunAddresses)   agent.addCandidateHarvester(new StunCandidateHarvester(ta,username));
  LongTermCredential ltr=new LongTermCredential(username,generateNonce(15));
  if (turnAddresses != null)   for (  TransportAddress ta : turnAddresses)   agent.addCandidateHarvester(new TurnCandidateHarvester(ta,ltr));
  try {
    createStream(9090,streamname);
  }
 catch (  BindException be) {
    throw new IOException(be);
  }
}

Fixed version (ground truth):
public IceAgent(final boolean controling,String username,final String streamname,TransportAddress stunAddresses[],TransportAddress turnAddresses[]) throws IOException {
  this.agent=new Agent();
  this.controling=controling;
  this.streamname=streamname;
  agent.setControlling(controling);
  agent.setNominationStrategy(NominationStrategy.NOMINATE_FIRST_VALID);
  if (stunAddresses != null)   for (  TransportAddress ta : stunAddresses)   agent.addCandidateHarvester(new StunCandidateHarvester(ta));
  LongTermCredential ltr=new LongTermCredential(generateNonce(5),generateNonce(15));
  if (turnAddresses != null)   for (  TransportAddress ta : turnAddresses)   agent.addCandidateHarvester(new TurnCandidateHarvester(ta,ltr));
  try {
    createStream(9090,streamname);
  }
 catch (  BindException be) {
    throw new IOException(be);
  }
}
Program: 161826
Project: 161826
Buggy source:
private void createStream(int rtpPort,String name) throws BindException, IllegalArgumentException, IOException {
  IceMediaStream stream=agent.createMediaStream(name);
  agent.createComponent(stream,Transport.UDP,rtpPort,rtpPort,rtpPort + 100);
  agent.createComponent(stream,Transport.UDP,rtpPort + 1,rtpPort + 1,rtpPort + 101);
}

Fixed version (ground truth):
public void createStream(int rtpPort,String name) throws BindException, IllegalArgumentException, IOException {
  IceMediaStream stream=agent.createMediaStream(name);
  agent.createComponent(stream,Transport.UDP,rtpPort,rtpPort,rtpPort + 100);
  agent.createComponent(stream,Transport.UDP,rtpPort + 1,rtpPort + 1,rtpPort + 101);
}
Program: 161827
Project: 161827
Buggy source:
public void addRemoteCandidates(JingleIQ jiq){
  for (  ContentPacketExtension contentpe : jiq.getContentList()) {
    String name=contentpe.getName();
    IceMediaStream ims=agent.getStream(name);
    if (ims != null) {
      for (      IceUdpTransportPacketExtension tpe : contentpe.getChildExtensionsOfType(IceUdpTransportPacketExtension.class)) {
        ims.setRemotePassword(tpe.getPassword());
        ims.setRemoteUfrag(tpe.getUfrag());
        for (        CandidatePacketExtension cpe : tpe.getCandidateList()) {
          InetAddress ia;
          try {
            ia=InetAddress.getByName(cpe.getIP());
          }
 catch (          UnknownHostException uhe) {
            continue;
          }
          for (          Component component : ims.getComponents()) {
            component.addRemoteCandidate(new RemoteCandidate(new TransportAddress(ia,cpe.getPort(),Transport.parse(cpe.getProtocol().toLowerCase())),component,convertType(cpe.getType()),Integer.toString(cpe.getFoundation()),cpe.getPriority(),null));
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
public void addRemoteCandidates(JingleIQ jiq){
  for (  ContentPacketExtension contentpe : jiq.getContentList()) {
    String name=contentpe.getName();
    IceMediaStream ims=agent.getStream(name);
    if (ims != null) {
      for (      IceUdpTransportPacketExtension tpe : contentpe.getChildExtensionsOfType(IceUdpTransportPacketExtension.class)) {
        ims.setRemotePassword(tpe.getPassword());
        ims.setRemoteUfrag(tpe.getUfrag());
        for (        CandidatePacketExtension cpe : tpe.getCandidateList()) {
          InetAddress ia;
          try {
            ia=InetAddress.getByName(cpe.getIP());
          }
 catch (          UnknownHostException uhe) {
            continue;
          }
          Component component=ims.getComponent(cpe.getComponent());
          if (component != null) {
            component.addRemoteCandidate(new RemoteCandidate(new TransportAddress(ia,cpe.getPort(),Transport.parse(cpe.getProtocol().toLowerCase())),component,convertType(cpe.getType()),Integer.toString(cpe.getFoundation()),cpe.getPriority(),null));
          }
        }
      }
    }
  }
}
Program: 161828
Project: 161828
Buggy source:
public IceUdpTransportPacketExtension getLocalCandidatePacketExtension(){
  IceUdpTransportPacketExtension transport=new IceUdpTransportPacketExtension();
  transport.setPassword(agent.getLocalPassword());
  transport.setUfrag(agent.getLocalUfrag());
  for (  IceMediaStream ims : agent.getStreams()) {
    for (    Component c : ims.getComponents()) {
      for (      Candidate<?> can : c.getLocalCandidates()) {
        CandidatePacketExtension candidate=new CandidatePacketExtension();
        candidate.setComponent(c.getComponentID());
        candidate.setFoundation(Integer.parseInt(can.getFoundation()));
        candidate.setGeneration(agent.getGeneration());
        candidate.setID(generateNonce(10));
        candidate.setNetwork(0);
        TransportAddress ta=can.getTransportAddress();
        candidate.setIP(ta.getHostAddress());
        candidate.setPort(ta.getPort());
        candidate.setPriority(can.getPriority());
        candidate.setProtocol(can.getTransport().name().toLowerCase());
        if (can.getRelatedAddress() != null) {
          candidate.setRelAddr(can.getRelatedAddress().getHostAddress());
          candidate.setRelPort(can.getRelatedAddress().getPort());
        }
        candidate.setType(convertType(can.getType()));
        transport.addCandidate(candidate);
      }
    }
  }
  return transport;
}

Fixed version (ground truth):
public IceUdpTransportPacketExtension getLocalCandidatePacketExtension(){
  IceUdpTransportPacketExtension transport=new IceUdpTransportPacketExtension();
  transport.setPassword(agent.getLocalPassword());
  transport.setUfrag(agent.getLocalUfrag());
  for (  IceMediaStream ims : agent.getStreams()) {
    for (    Component c : ims.getComponents()) {
      for (      Candidate<?> can : c.getLocalCandidates()) {
        CandidatePacketExtension candidate=new CandidatePacketExtension();
        candidate.setComponent(c.getComponentID());
        candidate.setFoundation(Integer.parseInt(can.getFoundation()));
        candidate.setGeneration(agent.getGeneration());
        candidate.setID(String.valueOf(c.getComponentID()));
        candidate.setNetwork(0);
        TransportAddress ta=can.getTransportAddress();
        candidate.setIP(ta.getHostAddress());
        candidate.setPort(ta.getPort());
        candidate.setPriority(can.getPriority());
        candidate.setProtocol(can.getTransport().name().toLowerCase());
        if (can.getRelatedAddress() != null) {
          candidate.setRelAddr(can.getRelatedAddress().getHostAddress());
          candidate.setRelPort(can.getRelatedAddress().getPort());
        }
        candidate.setType(convertType(can.getType()));
        transport.addCandidate(candidate);
      }
    }
  }
  return transport;
}
Program: 161830
Project: 161830
Buggy source:
private Set<AndroidMethod> loadMethodsFromFile(String[] sourceFileName) throws IOException {
  Set<AndroidMethod> methods=new HashSet<AndroidMethod>();
  for (  String fileName : sourceFileName) {
    IPermissionMethodParser pmp=createParser(fileName);
    Set<AndroidMethod> meths=pmp.parse();
    for (    AndroidMethod am : meths) {
      if (methods.contains(am)) {
        for (        AndroidMethod amOrig : methods)         if (am.equals(amOrig)) {
          if (am.isSource())           amOrig.setSource(true);
          if (am.isSource())           amOrig.setSink(true);
          if (am.isNeitherNor())           amOrig.setNeitherNor(true);
          amOrig.getPermissions().addAll(am.getPermissions());
          amOrig.getParameters().addAll(am.getParameters());
          break;
        }
      }
 else {
        methods.add(am);
        if (fileName.endsWith("String_Node_Str"))         methodsWithPermissions.add(am);
      }
    }
  }
  if (ENABLE_PERMISSION) {
    createPermissionFeatures(methods,this.featuresSourceSink);
    createPermissionFeatures(methods,this.featuresCategories);
  }
  System.out.println("String_Node_Str" + featuresSourceSink.size() + "String_Node_Str"+ methods.size()+ "String_Node_Str");
  return methods;
}

Fixed version (ground truth):
private Set<AndroidMethod> loadMethodsFromFile(String[] sourceFileName) throws IOException {
  Set<AndroidMethod> methods=new HashSet<AndroidMethod>();
  for (  String fileName : sourceFileName) {
    IPermissionMethodParser pmp=createParser(fileName);
    Set<AndroidMethod> meths=pmp.parse();
    for (    AndroidMethod am : meths) {
      if (methods.contains(am)) {
        for (        AndroidMethod amOrig : methods)         if (am.equals(amOrig)) {
          if (am.isSource())           amOrig.setSource(true);
          if (am.isSink())           amOrig.setSink(true);
          if (am.isNeitherNor())           amOrig.setNeitherNor(true);
          amOrig.getPermissions().addAll(am.getPermissions());
          amOrig.getParameters().addAll(am.getParameters());
          break;
        }
      }
 else {
        methods.add(am);
        if (fileName.endsWith("String_Node_Str"))         methodsWithPermissions.add(am);
      }
    }
  }
  if (ENABLE_PERMISSION) {
    createPermissionFeatures(methods,this.featuresSourceSink);
    createPermissionFeatures(methods,this.featuresCategories);
  }
  System.out.println("String_Node_Str" + featuresSourceSink.size() + "String_Node_Str"+ methods.size()+ "String_Node_Str");
  return methods;
}
Program: 161831
Project: 161831
Buggy source:
/** 
 * Checks whether there are semantic errors in the given set of Android methods and tries to filter out duplicates by merging.
 * @param methods The set of method definitions to check
 * @return The purged set of Android methods without duplicates
 */
private Set<AndroidMethod> sanityCheck(Set<AndroidMethod> methods){
  Map<String,AndroidMethod> signatureToMethod=new HashMap<>(methods.size());
  for (  AndroidMethod m1 : methods) {
    String sig=m1.getSignature();
    AndroidMethod m2=signatureToMethod.get(sig);
    if (m2 == null)     signatureToMethod.put(sig,m1);
 else {
      if (!m1.equals(m2)) {
        if (!m1.isAnnotated() && m2.isAnnotated()) {
          m1.setSource(m2.isSource());
          m1.setSink(m2.isSink());
          m1.setNeitherNor(m2.isNeitherNor());
          for (          String permission : m2.getPermissions())           m1.addPermission(permission);
        }
        if (!m2.getPermissions().isEmpty()) {
          for (          String permission : m2.getPermissions())           m1.addPermission(permission);
        }
        if (m1.getCategory() == null && m2.getCategory() != null)         m1.setCategory(m2.getCategory());
      }
    }
  }
  System.out.println("String_Node_Str" + (methods.size() - signatureToMethod.size()) + "String_Node_Str");
  return new HashSet<>(signatureToMethod.values());
}

Fixed version (ground truth):
/** 
 * Checks whether there are semantic errors in the given set of Android methods and tries to filter out duplicates by merging.
 * @param methods The set of method definitions to check
 * @return The purged set of Android methods without duplicates
 */
private Set<AndroidMethod> sanityCheck(Set<AndroidMethod> methods){
  Map<String,AndroidMethod> signatureToMethod=new HashMap<>(methods.size());
  for (  AndroidMethod m1 : methods) {
    String sig=m1.getSignature();
    AndroidMethod m2=signatureToMethod.get(sig);
    if (m2 == null)     signatureToMethod.put(sig,m1);
 else {
      if (!m1.equals(m2)) {
        if (!m2.isAnnotated() && m1.isAnnotated()) {
          m2.setSource(m1.isSource());
          m2.setSink(m1.isSink());
          m2.setNeitherNor(m1.isNeitherNor());
          for (          String permission : m1.getPermissions())           m2.addPermission(permission);
        }
        if (!m1.getPermissions().isEmpty()) {
          for (          String permission : m1.getPermissions())           m2.addPermission(permission);
        }
        if (m2.getCategory() == null && m1.getCategory() != null)         m2.setCategory(m1.getCategory());
      }
    }
  }
  System.out.println("String_Node_Str" + (methods.size() - signatureToMethod.size()) + "String_Node_Str");
  return new HashSet<>(signatureToMethod.values());
}
Program: 161833
Project: 161833
Buggy source:
public String NIFGerbil(InputStream input,NEDAlgo_HITS agdistis) throws IOException {
  org.aksw.gerbil.transfer.nif.Document document;
  String nifDocument="String_Node_Str";
  String textWithMentions="String_Node_Str";
  List<MeaningSpan> annotations=new ArrayList<>();
  try {
    document=parser.getDocumentFromNIFStream(input);
    log.info("String_Node_Str");
    textWithMentions=nifParser.createTextWithMentions(document.getText(),document.getMarkings(Span.class));
    Document d=textToDocument(textWithMentions);
    agdistis.run(d,null);
    for (    NamedEntityInText namedEntity : d.getNamedEntitiesInText()) {
      String disambiguatedURL=namedEntity.getNamedEntityUri();
      if (disambiguatedURL == null) {
        annotations.add(new NamedEntity(namedEntity.getStartPos(),namedEntity.getLength(),URLDecoder.decode("String_Node_Str" + namedEntity.getSingleWordLabel(),"String_Node_Str")));
      }
 else {
        annotations.add(new NamedEntity(namedEntity.getStartPos(),namedEntity.getLength(),URLDecoder.decode(namedEntity.getNamedEntityUri(),"String_Node_Str")));
      }
    }
    document.setMarkings(new ArrayList<Marking>(annotations));
    log.debug("String_Node_Str" + document.toString());
    nifDocument=creator.getDocumentAsNIFString(document);
    log.debug(nifDocument);
  }
 catch (  Exception e) {
    log.error("String_Node_Str",e);
    return "String_Node_Str";
  }
  return nifDocument;
}

Fixed version (ground truth):
public String NIFGerbil(InputStream input,NEDAlgo_HITS agdistis) throws IOException {
  org.aksw.gerbil.transfer.nif.Document document;
  String nifDocument="String_Node_Str";
  String textWithMentions="String_Node_Str";
  List<MeaningSpan> annotations=new ArrayList<>();
  try {
    document=parser.getDocumentFromNIFStream(input);
    log.info("String_Node_Str");
    textWithMentions=nifParser.createTextWithMentions(document.getText(),document.getMarkings(Span.class));
    Document d=textToDocument(textWithMentions);
    agdistis.run(d,null);
    for (    NamedEntityInText namedEntity : d.getNamedEntitiesInText()) {
      String disambiguatedURL=namedEntity.getNamedEntityUri();
      if (!namedEntity.getNamedEntityUri().contains("String_Node_Str")) {
        annotations.add(new NamedEntity(namedEntity.getStartPos(),namedEntity.getLength(),URLDecoder.decode("String_Node_Str" + namedEntity.getSingleWordLabel(),"String_Node_Str")));
      }
 else {
        annotations.add(new NamedEntity(namedEntity.getStartPos(),namedEntity.getLength(),URLDecoder.decode(namedEntity.getNamedEntityUri(),"String_Node_Str")));
      }
    }
    document.setMarkings(new ArrayList<Marking>(annotations));
    log.debug("String_Node_Str" + document.toString());
    nifDocument=creator.getDocumentAsNIFString(document);
    log.debug(nifDocument);
  }
 catch (  Exception e) {
    log.error("String_Node_Str",e);
    return "String_Node_Str";
  }
  return nifDocument;
}
Program: 161834
Project: 161834
Buggy source:
private List<Triple> getFromIndex(int maxNumberOfResults,BooleanQuery bq) throws IOException {
  ScoreDoc[] hits=isearcher.search(bq,null,maxNumberOfResults).scoreDocs;
  if (hits.length == 0) {
    return new ArrayList<Triple>();
  }
  List<Triple> triples=new ArrayList<Triple>();
  String s, p, o;
  for (int i=0; i < hits.length; i++) {
    Document hitDoc=isearcher.doc(hits[i].doc);
    s=hitDoc.get(FIELD_NAME_CONTEXT);
    p=hitDoc.get(FIELD_NAME_URI);
    o=hitDoc.get(FIELD_NAME_URI_COUNT);
    Triple triple=new Triple(s,p,o);
    triples.add(triple);
  }
  log.debug("String_Node_Str");
  Collections.sort(triples);
  if (triples.size() < 500) {
    return triples.subList(0,triples.size());
  }
  return triples.subList(0,500);
}

Fixed version (ground truth):
private List<Triple> getFromIndex(int maxNumberOfResults,BooleanQuery bq) throws IOException {
  ScoreDoc[] hits=isearcher.search(bq,null,maxNumberOfResults).scoreDocs;
  if (hits.length == 0) {
    return new ArrayList<Triple>();
  }
  List<Triple> triples=new ArrayList<Triple>();
  String s, p, o;
  for (int i=0; i < hits.length; i++) {
    Document hitDoc=isearcher.doc(hits[i].doc);
    s=hitDoc.get(FIELD_NAME_CONTEXT);
    p=hitDoc.get(FIELD_NAME_URI);
    o=hitDoc.get(FIELD_NAME_URI_COUNT);
    Triple triple=new Triple(s,p,o);
    triples.add(triple);
  }
  log.debug("String_Node_Str");
  Collections.sort(triples);
  if (triples.size() < 500) {
    return triples.subList(0,triples.size());
  }
 else {
    return triples.subList(0,500);
  }
}
Program: 161836
Project: 161836
Buggy source:
public void addNodeToGraph(DirectedSparseGraph<Node,String> graph,HashMap<String,Node> nodes,NamedEntityInText entity,Triple c,String candidateURL) throws IOException {
  Node currentNode=new Node(candidateURL,0,0);
  log.debug("String_Node_Str" + candidateURL);
  if (!graph.addVertex(currentNode)) {
    int st=entity.getStartPos();
    if (nodes.get(candidateURL) != null) {
      nodes.get(candidateURL).addId(st);
    }
 else {
      log.error("String_Node_Str" + candidateURL);
    }
  }
 else {
    currentNode.addId(entity.getStartPos());
    nodes.put(candidateURL,currentNode);
  }
}

Fixed version (ground truth):
public void addNodeToGraph(DirectedSparseGraph<Node,String> graph,HashMap<String,Node> nodes,NamedEntityInText entity,Triple c,String candidateURL) throws IOException {
  Node currentNode=new Node(candidateURL,0,0,algorithm);
  log.debug("String_Node_Str" + candidateURL);
  if (!graph.addVertex(currentNode)) {
    int st=entity.getStartPos();
    if (nodes.get(candidateURL) != null) {
      nodes.get(candidateURL).addId(st);
    }
 else {
      log.error("String_Node_Str" + candidateURL);
    }
  }
 else {
    currentNode.addId(entity.getStartPos());
    nodes.put(candidateURL,currentNode);
  }
}
Program: 161837
Project: 161837
Buggy source:
public CandidateUtil() throws IOException {
  Properties prop=new Properties();
  InputStream input=CandidateUtil.class.getResourceAsStream("String_Node_Str");
  prop.load(input);
  this.nodeType=prop.getProperty("String_Node_Str");
  this.nGramDistance=new NGramDistance(Integer.valueOf(prop.getProperty("String_Node_Str")));
  this.index=new TripleIndex();
  this.context=Boolean.valueOf(prop.getProperty("String_Node_Str"));
  if (context == true) {
    this.index2=new TripleIndexContext();
  }
  this.corporationAffixCleaner=new CorporationAffixCleaner();
  this.domainWhiteLister=new DomainWhiteLister(index);
  this.popularity=Boolean.valueOf(prop.getProperty("String_Node_Str"));
  this.acronym=Boolean.valueOf(prop.getProperty("String_Node_Str"));
  this.commonEntities=Boolean.valueOf(prop.getProperty("String_Node_Str"));
}

Fixed version (ground truth):
public CandidateUtil() throws IOException {
  Properties prop=new Properties();
  InputStream input=CandidateUtil.class.getResourceAsStream("String_Node_Str");
  prop.load(input);
  this.nodeType=prop.getProperty("String_Node_Str");
  this.nGramDistance=new NGramDistance(Integer.valueOf(prop.getProperty("String_Node_Str")));
  this.index=new TripleIndex();
  this.context=Boolean.valueOf(prop.getProperty("String_Node_Str"));
  if (context == true) {
    this.index2=new TripleIndexContext();
  }
  this.corporationAffixCleaner=new CorporationAffixCleaner();
  this.domainWhiteLister=new DomainWhiteLister(index);
  this.popularity=Boolean.valueOf(prop.getProperty("String_Node_Str"));
  this.acronym=Boolean.valueOf(prop.getProperty("String_Node_Str"));
  this.commonEntities=Boolean.valueOf(prop.getProperty("String_Node_Str"));
  this.algorithm=prop.getProperty("String_Node_Str");
}
Program: 161839
Project: 161839
Buggy source:
public BreadthFirstSearch(TripleIndex index){
  this.index=index;
}

Fixed version (ground truth):
public BreadthFirstSearch(TripleIndex index,String algo){
  this.index=index;
  this.algo=algo;
}
Program: 161840
Project: 161840
Buggy source:
public void run(int maxDepth,DirectedSparseGraph<Node,String> graph,String edgeType,String nodeType) throws UnsupportedEncodingException, IOException {
  Queue<Node> q=new LinkedList<Node>();
  for (  Node node : graph.getVertices()) {
    findNode.put(node.getCandidateURI(),node);
    q.add(node);
  }
  while (!q.isEmpty()) {
    Node currentNode=q.poll();
    int level=currentNode.getLevel();
    if (level < maxDepth) {
      List<Triple> outgoingNodes=null;
      outgoingNodes=index.search(currentNode.getCandidateURI(),null,null);
      if (outgoingNodes == null) {
        continue;
      }
      for (      Triple targetNode : outgoingNodes) {
        if (targetNode.getPredicate() == null && targetNode.getObject() == null) {
          continue;
        }
        if (targetNode.getPredicate().startsWith(edgeType) && targetNode.getObject().startsWith(nodeType)) {
          int levelNow=level + 1;
          Node Node=null;
          if (findNode.containsKey(targetNode)) {
            Node=findNode.get(targetNode);
          }
 else {
            Node=new Node(targetNode.getObject(),0,levelNow);
            findNode.put(targetNode.getObject(),Node);
            q.add(Node);
          }
          graph.addEdge(graph.getEdgeCount() + "String_Node_Str" + targetNode.getPredicate(),currentNode,Node);
        }
      }
    }
  }
}

Fixed version (ground truth):
public void run(int maxDepth,DirectedSparseGraph<Node,String> graph,String edgeType,String nodeType) throws UnsupportedEncodingException, IOException {
  Queue<Node> q=new LinkedList<Node>();
  for (  Node node : graph.getVertices()) {
    findNode.put(node.getCandidateURI(),node);
    q.add(node);
  }
  while (!q.isEmpty()) {
    Node currentNode=q.poll();
    int level=currentNode.getLevel();
    if (level < maxDepth) {
      List<Triple> outgoingNodes=null;
      outgoingNodes=index.search(currentNode.getCandidateURI(),null,null);
      if (outgoingNodes == null) {
        continue;
      }
      for (      Triple targetNode : outgoingNodes) {
        if (targetNode.getPredicate() == null && targetNode.getObject() == null) {
          continue;
        }
        if (targetNode.getPredicate().startsWith(edgeType) && targetNode.getObject().startsWith(nodeType)) {
          int levelNow=level + 1;
          Node Node=null;
          if (findNode.containsKey(targetNode)) {
            Node=findNode.get(targetNode);
          }
 else {
            Node=new Node(targetNode.getObject(),0,levelNow,algo);
            findNode.put(targetNode.getObject(),Node);
            q.add(Node);
          }
          graph.addEdge(graph.getEdgeCount() + "String_Node_Str" + targetNode.getPredicate(),currentNode,Node);
        }
      }
    }
  }
}
Program: 161841
Project: 161841
Buggy source:
public Node(String uri,double activation,int level) throws IOException {
  this.candidateURI=uri;
  this.activation=activation;
  this.level=level;
  this.hubWeight=1;
  this.authorityWeight=1;
  ids=new HashSet<Integer>();
  this.successors=new HashSet<Node>();
  this.predecessors=new HashSet<Node>();
  this.pageRank=0;
  Properties prop=new Properties();
  InputStream input=Node.class.getResourceAsStream("String_Node_Str");
  prop.load(input);
  this.algorithm=prop.getProperty("String_Node_Str");
}

Fixed version (ground truth):
public Node(String uri,double activation,int level,String algo) throws IOException {
  this.candidateURI=uri;
  this.activation=activation;
  this.level=level;
  this.hubWeight=1;
  this.authorityWeight=1;
  ids=new HashSet<Integer>();
  this.successors=new HashSet<Node>();
  this.predecessors=new HashSet<Node>();
  this.pageRank=0;
  this.algo=algo;
}
Program: 161842
Project: 161842
Buggy source:
@Override public int compareTo(Node m){
  if (algorithm.equals("String_Node_Str")) {
    if (m.getAuthorityWeight() == this.getAuthorityWeight()) {
      return 0;
    }
 else     if (m.getAuthorityWeight() > this.getAuthorityWeight()) {
      return 1;
    }
 else {
      return -1;
    }
  }
 else   if (algorithm.equals("String_Node_Str")) {
    if (m.getPageRank() == this.getPageRank()) {
      return 0;
    }
 else     if (m.getPageRank() > this.getPageRank()) {
      return 1;
    }
 else {
      return -1;
    }
  }
 else {
    return -1;
  }
}

Fixed version (ground truth):
@Override public int compareTo(Node m){
  if (m.algo.equals("String_Node_Str")) {
    if (m.getAuthorityWeight() == this.getAuthorityWeight()) {
      return 0;
    }
 else     if (m.getAuthorityWeight() > this.getAuthorityWeight()) {
      return 1;
    }
 else {
      return -1;
    }
  }
 else   if (m.algo.equals("String_Node_Str")) {
    if (m.getPageRank() == this.getPageRank()) {
      return 0;
    }
 else     if (m.getPageRank() > this.getPageRank()) {
      return 1;
    }
 else {
      return -1;
    }
  }
 else {
    return -1;
  }
}
Program: 161843
Project: 161843
Buggy source:
public String candidateType(String text,NEDAlgo_HITS agdistis){
  JSONArray arr=new org.json.simple.JSONArray();
  Document d=textToDocument(text);
  Map<NamedEntityInText,List<CandidatesScore>> candidatesPerNE=new HashMap<>();
  agdistis.run(d,candidatesPerNE);
  for (  NamedEntityInText namedEntity : candidatesPerNE.keySet()) {
    List<CandidatesScore> candidates=candidatesPerNE.get(namedEntity);
    JSONObject obj=new JSONObject();
    obj.put("String_Node_Str",namedEntity.getLabel());
    obj.put("String_Node_Str",candidates.toString());
    arr.add(obj);
  }
  log.info("String_Node_Str" + arr.toString());
  log.info("String_Node_Str");
  return arr.toString();
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public String candidateType(String text,NEDAlgo_HITS agdistis){
  JSONArray arr=new org.json.simple.JSONArray();
  Document d=textToDocument(text);
  Map<NamedEntityInText,List<CandidatesScore>> candidatesPerNE=new HashMap<>();
  agdistis.run(d,candidatesPerNE);
  for (  NamedEntityInText namedEntity : candidatesPerNE.keySet()) {
    List<CandidatesScore> candidates=candidatesPerNE.get(namedEntity);
    JSONObject obj=new JSONObject();
    obj.put("String_Node_Str",namedEntity.getLabel());
    obj.put("String_Node_Str",candidates.toString());
    arr.add(obj);
  }
  log.info("String_Node_Str" + arr.toString());
  log.info("String_Node_Str");
  return arr.toString();
}
Program: 161844
Project: 161844
Buggy source:
@Post public String postText(Representation entity) throws IOException, Exception {
  NEDAlgo_HITS agdistis=null;
  log.info("String_Node_Str");
  String result="String_Node_Str";
  String text="String_Node_Str";
  String type="String_Node_Str";
  InputStream input=entity.getStream();
  byte[] byteArray=IOUtils.toByteArray(input);
  InputStream input1=new ByteArrayInputStream(byteArray);
  InputStream input2=new ByteArrayInputStream(byteArray);
  try {
    agdistis=new NEDAlgo_HITS();
  }
 catch (  IOException e) {
    log.error("String_Node_Str",e);
    System.exit(0);
  }
  String string=IOUtils.toString(input1);
  Form form=new Form(string);
  text=form.getFirstValue("String_Node_Str");
  type=form.getFirstValue("String_Node_Str");
  log.info("String_Node_Str" + text);
  log.info("String_Node_Str" + type);
  if (text == null) {
    result=NIFGerbil(input2,agdistis);
    return result;
  }
  if (type == null) {
    type="String_Node_Str";
  }
  if (type.equals("String_Node_Str")) {
    return standardAG(text,agdistis);
  }
 else   if (type.equals("String_Node_Str")) {
    return NIFType(text,agdistis);
  }
 else   if (type.equals("String_Node_Str")) {
    return candidateType(text,agdistis);
  }
 else {
    return "String_Node_Str";
  }
}

Fixed version (ground truth):
@Post public String postText(Representation entity) throws IOException, Exception {
  NEDAlgo_HITS agdistis=null;
  try {
    agdistis=new NEDAlgo_HITS();
  }
 catch (  IOException e) {
    log.error("String_Node_Str",e);
    System.exit(0);
  }
  log.info("String_Node_Str");
  String result="String_Node_Str";
  String text="String_Node_Str";
  String type="String_Node_Str";
  InputStream input=entity.getStream();
  byte[] byteArray=IOUtils.toByteArray(input);
  InputStream input1=new ByteArrayInputStream(byteArray);
  InputStream input2=new ByteArrayInputStream(byteArray);
  String string=IOUtils.toString(input1);
  Form form=new Form(string);
  text=form.getFirstValue("String_Node_Str");
  type=form.getFirstValue("String_Node_Str");
  log.info("String_Node_Str" + text);
  log.info("String_Node_Str" + type);
  if (text == null) {
    result=NIFGerbil(input2,agdistis);
    return result;
  }
  if (type == null) {
    type="String_Node_Str";
  }
  if (type.equals("String_Node_Str")) {
    return standardAG(text,agdistis);
  }
 else   if (type.equals("String_Node_Str")) {
    return NIFType(text,agdistis);
  }
 else   if (type.equals("String_Node_Str")) {
    return candidateType(text,agdistis);
  }
 else {
    return "String_Node_Str";
  }
}
Program: 161845
Project: 161845
Buggy source:
public String standardAG(String text,NEDAlgo_HITS agdistis){
  JSONArray arr=new org.json.simple.JSONArray();
  Document d=textToDocument(text);
  agdistis.run(d,null);
  for (  NamedEntityInText namedEntity : d.getNamedEntitiesInText()) {
    JSONObject obj=new JSONObject();
    obj.put("String_Node_Str",namedEntity.getLabel());
    obj.put("String_Node_Str",namedEntity.getStartPos());
    obj.put("String_Node_Str",namedEntity.getLength());
    obj.put("String_Node_Str",namedEntity.getNamedEntityUri());
    arr.add(obj);
  }
  log.info("String_Node_Str" + arr.toString());
  log.info("String_Node_Str");
  return arr.toString();
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public String standardAG(String text,NEDAlgo_HITS agdistis){
  JSONArray arr=new org.json.simple.JSONArray();
  Document d=textToDocument(text);
  agdistis.run(d,null);
  for (  NamedEntityInText namedEntity : d.getNamedEntitiesInText()) {
    JSONObject obj=new JSONObject();
    obj.put("String_Node_Str",namedEntity.getLabel());
    obj.put("String_Node_Str",namedEntity.getStartPos());
    obj.put("String_Node_Str",namedEntity.getLength());
    obj.put("String_Node_Str",namedEntity.getNamedEntityUri());
    arr.add(obj);
  }
  log.info("String_Node_Str" + arr.toString());
  log.info("String_Node_Str");
  return arr.toString();
}
Program: 161846
Project: 161846
Buggy source:
@Post public String postText(Representation entity) throws IOException, Exception {
  NEDAlgo_HITS agdistis=null;
  log.info("String_Node_Str");
  String result="String_Node_Str";
  InputStream input=entity.getStream();
  byte[] byteArray=IOUtils.toByteArray(input);
  InputStream input1=new ByteArrayInputStream(byteArray);
  InputStream input2=new ByteArrayInputStream(byteArray);
  try {
    agdistis=new NEDAlgo_HITS();
  }
 catch (  IOException e) {
    log.error("String_Node_Str",e);
    System.exit(0);
  }
  result=NIFGerbil(input1,agdistis);
  if (!(result.equals("String_Node_Str"))) {
    return result;
  }
 else {
    String string=IOUtils.toString(input2);
    Form form=new Form(string);
    String text=form.getFirstValue("String_Node_Str");
    String type=form.getFirstValue("String_Node_Str");
    log.info("String_Node_Str" + text);
    log.info("String_Node_Str" + type);
    if (type == null) {
      type="String_Node_Str";
    }
    if (type.equals("String_Node_Str")) {
      return standardAG(text,agdistis);
    }
 else     if (type.equals("String_Node_Str")) {
      return NIFType(text,agdistis);
    }
 else     if (type.equals("String_Node_Str")) {
      return candidateType(text,agdistis);
    }
 else {
      return "String_Node_Str";
    }
  }
}

Fixed version (ground truth):
@Post public String postText(Representation entity) throws IOException, Exception {
  NEDAlgo_HITS agdistis=null;
  log.info("String_Node_Str");
  String result="String_Node_Str";
  String text="String_Node_Str";
  String type="String_Node_Str";
  InputStream input=entity.getStream();
  byte[] byteArray=IOUtils.toByteArray(input);
  InputStream input1=new ByteArrayInputStream(byteArray);
  InputStream input2=new ByteArrayInputStream(byteArray);
  try {
    agdistis=new NEDAlgo_HITS();
  }
 catch (  IOException e) {
    log.error("String_Node_Str",e);
    System.exit(0);
  }
  String string=IOUtils.toString(input1);
  Form form=new Form(string);
  text=form.getFirstValue("String_Node_Str");
  type=form.getFirstValue("String_Node_Str");
  log.info("String_Node_Str" + text);
  log.info("String_Node_Str" + type);
  if (text == null) {
    result=NIFGerbil(input2,agdistis);
    return result;
  }
  if (type == null) {
    type="String_Node_Str";
  }
  if (type.equals("String_Node_Str")) {
    return standardAG(text,agdistis);
  }
 else   if (type.equals("String_Node_Str")) {
    return NIFType(text,agdistis);
  }
 else   if (type.equals("String_Node_Str")) {
    return candidateType(text,agdistis);
  }
 else {
    return "String_Node_Str";
  }
}
Program: 161847
Project: 161847
Buggy source:
static String createTextWithMentions(String text,List<Span> mentions){
  Collections.sort(mentions,new StartPosBasedComparator());
  StringBuilder textBuilder=new StringBuilder();
  int lastPos=0;
  for (int i=0; i < mentions.size(); i++) {
    Span span=mentions.get(i);
    int begin=span.getStartPosition();
    int end=begin + span.getLength();
    if (begin < lastPos) {
      Span prev=mentions.get(i - 1);
      LOGGER.warn("String_Node_Str",text.substring(span.getStartPosition(),span.getStartPosition() + span.getLength()),span.getStartPosition(),text.substring(prev.getStartPosition(),prev.getStartPosition() + prev.getLength()),prev.getStartPosition());
      if (span.getLength() > prev.getLength()) {
        textBuilder.delete(textBuilder.length() - prev.getLength(),textBuilder.length());
        lastPos-=prev.getLength();
      }
 else {
        continue;
      }
    }
    String before=text.substring(lastPos,begin);
    String label=text.substring(begin,end);
    lastPos=end;
    textBuilder.append(before).append("String_Node_Str" + label + "String_Node_Str");
  }
  String lastSnippet=text.substring(lastPos,text.length());
  textBuilder.append(lastSnippet);
  return textBuilder.toString();
}

Fixed version (ground truth):
public String createTextWithMentions(String text,List<Span> mentions){
  Collections.sort(mentions,new StartPosBasedComparator());
  StringBuilder textBuilder=new StringBuilder();
  int lastPos=0;
  for (int i=0; i < mentions.size(); i++) {
    Span span=mentions.get(i);
    int begin=span.getStartPosition();
    int end=begin + span.getLength();
    if (begin < lastPos) {
      Span prev=mentions.get(i - 1);
      LOGGER.warn("String_Node_Str",text.substring(span.getStartPosition(),span.getStartPosition() + span.getLength()),span.getStartPosition(),text.substring(prev.getStartPosition(),prev.getStartPosition() + prev.getLength()),prev.getStartPosition());
      if (span.getLength() > prev.getLength()) {
        textBuilder.delete(textBuilder.length() - prev.getLength(),textBuilder.length());
        lastPos-=prev.getLength();
      }
 else {
        continue;
      }
    }
    String before=text.substring(lastPos,begin);
    String label=text.substring(begin,end);
    lastPos=end;
    textBuilder.append(before).append("String_Node_Str" + label + "String_Node_Str");
  }
  String lastSnippet=text.substring(lastPos,text.length());
  textBuilder.append(lastSnippet);
  return textBuilder.toString();
}
Program: 161850
Project: 161850
Buggy source:
public void setNamedEntity(String namedEntityUri){
  this.namedEntityUri=namedEntityUri;
  this.label=extractLabel(namedEntityUri);
}

Fixed version (ground truth):
public void setNamedEntity(String namedEntityUri){
  this.namedEntityUri=namedEntityUri;
}
Program: 161851
Project: 161851
Buggy source:
public String candidateType(String text,NEDAlgo_HITS agdistis,String type){
  JSONArray arr=new org.json.simple.JSONArray();
  HashMap<NamedEntityInText,ArrayList<CandidatesScore>> resultsScore=new HashMap<NamedEntityInText,ArrayList<CandidatesScore>>();
  Document d=textToDocument(text);
  resultsScore=resultsCandidates(d,agdistis,type);
  for (  NamedEntityInText namedEntity : resultsScore.keySet()) {
    ArrayList<CandidatesScore> candidates=resultsScore.get(namedEntity);
    JSONObject obj=new JSONObject();
    obj.put("String_Node_Str",namedEntity.getLabel());
    obj.put("String_Node_Str",candidates.toString());
    arr.add(obj);
  }
  log.info("String_Node_Str" + arr.toString());
  log.info("String_Node_Str");
  return arr.toString();
}

Fixed version (ground truth):
public String candidateType(String text,NEDAlgo_HITS agdistis){
  JSONArray arr=new org.json.simple.JSONArray();
  Document d=textToDocument(text);
  Map<NamedEntityInText,List<CandidatesScore>> candidatesPerNE=new HashMap<>();
  agdistis.run(d,candidatesPerNE);
  for (  NamedEntityInText namedEntity : candidatesPerNE.keySet()) {
    List<CandidatesScore> candidates=candidatesPerNE.get(namedEntity);
    JSONObject obj=new JSONObject();
    obj.put("String_Node_Str",namedEntity.getLabel());
    obj.put("String_Node_Str",candidates.toString());
    arr.add(obj);
  }
  log.info("String_Node_Str" + arr.toString());
  log.info("String_Node_Str");
  return arr.toString();
}
Program: 161852
Project: 161852
Buggy source:
@SuppressWarnings("String_Node_Str") @Post public String postText(Representation entity) throws IOException, Exception {
  NEDAlgo_HITS agdistis=null;
  log.info("String_Node_Str");
  String result="String_Node_Str";
  InputStream input=entity.getStream();
  byte[] byteArray=IOUtils.toByteArray(input);
  InputStream input1=new ByteArrayInputStream(byteArray);
  InputStream input2=new ByteArrayInputStream(byteArray);
  try {
    agdistis=new NEDAlgo_HITS();
  }
 catch (  IOException e) {
    log.error("String_Node_Str",e);
    System.exit(0);
  }
  result=NIFGerbil(input1,agdistis);
  if (!(result.equals("String_Node_Str"))) {
    return result;
  }
 else {
    String string=IOUtils.toString(input2);
    Form form=new Form(string);
    String text=form.getFirstValue("String_Node_Str");
    String type=form.getFirstValue("String_Node_Str");
    log.info("String_Node_Str" + text);
    log.info("String_Node_Str" + type);
    evaluationOptionalParameters(form,agdistis);
    if (type == null) {
      type="String_Node_Str";
    }
    if (type.equals("String_Node_Str")) {
      return standardAG(text,agdistis,type);
    }
 else     if (type.equals("String_Node_Str")) {
      return NIFType(text,agdistis);
    }
 else     if (type.equals("String_Node_Str")) {
      return candidateType(text,agdistis,type);
    }
 else {
      return "String_Node_Str";
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Post public String postText(Representation entity) throws IOException, Exception {
  NEDAlgo_HITS agdistis=null;
  log.info("String_Node_Str");
  String result="String_Node_Str";
  InputStream input=entity.getStream();
  byte[] byteArray=IOUtils.toByteArray(input);
  InputStream input1=new ByteArrayInputStream(byteArray);
  InputStream input2=new ByteArrayInputStream(byteArray);
  try {
    agdistis=new NEDAlgo_HITS();
  }
 catch (  IOException e) {
    log.error("String_Node_Str",e);
    System.exit(0);
  }
  result=NIFGerbil(input1,agdistis);
  if (!(result.equals("String_Node_Str"))) {
    return result;
  }
 else {
    String string=IOUtils.toString(input2);
    Form form=new Form(string);
    String text=form.getFirstValue("String_Node_Str");
    String type=form.getFirstValue("String_Node_Str");
    log.info("String_Node_Str" + text);
    log.info("String_Node_Str" + type);
    evaluationOptionalParameters(form,agdistis);
    if (type == null) {
      type="String_Node_Str";
    }
    if (type.equals("String_Node_Str")) {
      return standardAG(text,agdistis);
    }
 else     if (type.equals("String_Node_Str")) {
      return NIFType(text,agdistis);
    }
 else     if (type.equals("String_Node_Str")) {
      return candidateType(text,agdistis);
    }
 else {
      return "String_Node_Str";
    }
  }
}
Program: 161853
Project: 161853
Buggy source:
public String standardAG(String text,NEDAlgo_HITS agdistis,String type){
  HashMap<NamedEntityInText,String> results=new HashMap<NamedEntityInText,String>();
  JSONArray arr=new org.json.simple.JSONArray();
  Document d=textToDocument(text);
  results=results(d,agdistis,type);
  for (  NamedEntityInText namedEntity : results.keySet()) {
    String disambiguatedURL=results.get(namedEntity);
    JSONObject obj=new JSONObject();
    obj.put("String_Node_Str",namedEntity.getLabel());
    obj.put("String_Node_Str",namedEntity.getStartPos());
    obj.put("String_Node_Str",namedEntity.getLength());
    obj.put("String_Node_Str",disambiguatedURL);
    arr.add(obj);
  }
  log.info("String_Node_Str" + arr.toString());
  log.info("String_Node_Str");
  return arr.toString();
}

Fixed version (ground truth):
public String standardAG(String text,NEDAlgo_HITS agdistis){
  JSONArray arr=new org.json.simple.JSONArray();
  Document d=textToDocument(text);
  agdistis.run(d,null);
  for (  NamedEntityInText namedEntity : d.getNamedEntitiesInText()) {
    JSONObject obj=new JSONObject();
    obj.put("String_Node_Str",namedEntity.getLabel());
    obj.put("String_Node_Str",namedEntity.getStartPos());
    obj.put("String_Node_Str",namedEntity.getLength());
    obj.put("String_Node_Str",namedEntity.getNamedEntityUri());
    arr.add(obj);
  }
  log.info("String_Node_Str" + arr.toString());
  log.info("String_Node_Str");
  return arr.toString();
}