nus-yam/ex-repair huggingface dataset:
Program: 25626
Project: 25626
Buggy source:
private static void createDatatypeProperty(Statement propertyStatement,Element nodeProperties,String namespace,String prefix,Element propertiesSeq) throws RequiredResourceNotFoundException, MultiplePropertyValuesException {
  Element parameter=nodeProperties.getOwnerDocument().createElementNS(namespace,prefix + "String_Node_Str" + propertyStatement.getPredicate().getLocalName());
  parameter.setTextContent(propertyStatement.getLiteral().getString());
  nodeProperties.appendChild(parameter);
  createDatatypePropertyType(propertyStatement.getPredicate(),propertiesSeq);
}

Fixed version (ground truth):
private static void createDatatypeProperty(Statement propertyStatement,Element nodeProperties,String namespace,Resource nodeType,Element propertiesSeq) throws RequiredResourceNotFoundException, MultiplePropertyValuesException {
  Element parameter;
  try {
    parameter=nodeProperties.getOwnerDocument().createElementNS(namespace,getNSPrefix(nodeType) + "String_Node_Str" + propertyStatement.getPredicate().getLocalName());
  }
 catch (  NoPrefixMappingFoundException e) {
    parameter=nodeProperties.getOwnerDocument().createElementNS(namespace,propertyStatement.getPredicate().getLocalName());
  }
  parameter.setTextContent(propertyStatement.getLiteral().getString());
  nodeProperties.appendChild(parameter);
  createDatatypePropertyType(propertyStatement.getPredicate(),propertiesSeq);
}
Program: 25627
Project: 25627
Buggy source:
private static String getNSPrefix(Resource resource){
  Map<String,String> prefixMap=resource.getModel().getNsPrefixMap();
  for (  Map.Entry<String,String> mapping : prefixMap.entrySet()) {
    if (mapping.getValue().equals(resource.getNameSpace())) {
      return mapping.getKey();
    }
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
private static String getNSPrefix(Resource resource) throws NoPrefixMappingFoundException {
  Map<String,String> prefixMap=resource.getModel().getNsPrefixMap();
  for (  Map.Entry<String,String> mapping : prefixMap.entrySet()) {
    if (mapping.getValue().equals(resource.getNameSpace())) {
      return mapping.getKey();
    }
  }
  throw new NoPrefixMappingFoundException();
}
Program: 25628
Project: 25628
Buggy source:
private static void setNameAndTypeAndID(Resource node,Resource nodeTypeResource,TNodeTemplate nodeTemplate){
  String name=getName(node);
  nodeTemplate.setName(name);
  nodeTemplate.setId(name);
  String nodeTypeNameSpace=getXMLNamespace(nodeTypeResource);
  String nodeTypePrefix=getNSPrefix(nodeTypeResource);
  QName type=new QName(nodeTypeNameSpace,nodeTypeResource.getLocalName(),nodeTypePrefix);
  nodeTemplate.setType(type);
}

Fixed version (ground truth):
private static void setNameAndTypeAndID(Resource node,Resource nodeTypeResource,TNodeTemplate nodeTemplate){
  String name=getName(node);
  nodeTemplate.setName(name);
  nodeTemplate.setId(name);
  String nodeTypeNameSpace=getXMLNamespace(nodeTypeResource);
  QName type;
  try {
    type=new QName(nodeTypeNameSpace,nodeTypeResource.getLocalName(),getNSPrefix(nodeTypeResource));
  }
 catch (  NoPrefixMappingFoundException e) {
    type=new QName(nodeTypeNameSpace,nodeTypeResource.getLocalName());
  }
  nodeTemplate.setType(type);
}
Program: 25629
Project: 25629
Buggy source:
private static void createType(Model model,String namespace,Resource superProperty,Node typesNode){
  for (int k=0; k < (typesNode.getChildNodes().getLength() - 1); k++) {
    final Node sequenceNode=typesNode.getChildNodes().item(k);
    if (sequenceNode.getLocalName().equals("String_Node_Str")) {
      for (int l=0; l < (sequenceNode.getChildNodes().getLength() - 1); l++) {
        final Node typeNode=sequenceNode.getChildNodes().item(l);
        if (typeNode.getLocalName().equals("String_Node_Str")) {
          final String name=typeNode.getAttributes().getNamedItem("String_Node_Str").getNodeValue();
          final String type=typeNode.getAttributes().getNamedItem("String_Node_Str").getNodeValue();
          Property property=model.createProperty(namespace + name);
          Resource propertyRangeClass;
          if (type.startsWith("String_Node_Str")) {
            propertyRangeClass=getXSDType(type,model);
            property.addProperty(RDF.type,OWL.DatatypeProperty);
          }
 else {
            propertyRangeClass=model.createResource(namespace + type);
            propertyRangeClass.addProperty(RDF.type,OWL2.Class);
            property.addProperty(RDF.type,OWL.ObjectProperty);
            createTypeProperty(model,namespace,typeNode,null);
          }
          if (superProperty != null) {
            property.addProperty(RDFS.subPropertyOf,superProperty);
          }
          property.addProperty(RDFS.range,propertyRangeClass);
        }
      }
    }
  }
}

Fixed version (ground truth):
private static void createType(Model model,String namespace,Resource superProperty,Node typesNode){
  for (int k=0; k < (typesNode.getChildNodes().getLength()); k++) {
    final Node sequenceNode=typesNode.getChildNodes().item(k);
    if ("String_Node_Str".equals(sequenceNode.getLocalName())) {
      for (int l=0; l < (sequenceNode.getChildNodes().getLength()); l++) {
        final Node typeNode=sequenceNode.getChildNodes().item(l);
        if ("String_Node_Str".equals(typeNode.getLocalName())) {
          final String name=typeNode.getAttributes().getNamedItem("String_Node_Str").getNodeValue();
          final String type=typeNode.getAttributes().getNamedItem("String_Node_Str").getNodeValue();
          Property property=model.createProperty(namespace + name);
          Resource propertyRangeClass;
          if (type.startsWith("String_Node_Str")) {
            propertyRangeClass=getXSDType(type,model);
            property.addProperty(RDF.type,OWL.DatatypeProperty);
          }
 else {
            propertyRangeClass=model.createResource(namespace + type);
            propertyRangeClass.addProperty(RDF.type,OWL2.Class);
            property.addProperty(RDF.type,OWL.ObjectProperty);
            createTypeProperty(model,namespace,typeNode,null);
          }
          if (superProperty != null) {
            property.addProperty(RDFS.subPropertyOf,superProperty);
          }
          property.addProperty(RDFS.range,propertyRangeClass);
        }
      }
    }
  }
}
Program: 25630
Project: 25630
Buggy source:
private static void createTypeProperty(Model model,String namespace,Node elementNode,Resource superProperty){
  for (int j=0; j < (elementNode.getChildNodes().getLength() - 1); j++) {
    final Node typesNode=elementNode.getChildNodes().item(j);
    if (typesNode.getLocalName().equals("String_Node_Str")) {
      createType(model,namespace,superProperty,typesNode);
    }
  }
}

Fixed version (ground truth):
private static void createTypeProperty(Model model,String namespace,Node elementNode,Resource superProperty){
  for (int j=0; j < (elementNode.getChildNodes().getLength()); j++) {
    final Node typesNode=elementNode.getChildNodes().item(j);
    if ("String_Node_Str".equals(typesNode.getLocalName())) {
      createType(model,namespace,superProperty,typesNode);
    }
  }
}
Program: 25631
Project: 25631
Buggy source:
public static Model getModel(final InputStream input) throws JAXBException, InvalidModelException, UnsupportedException {
  final JAXBContext context=JAXBContext.newInstance(Definitions.class);
  final Unmarshaller unmarshaller=context.createUnmarshaller();
  final Definitions definitions=unmarshaller.unmarshal(new StreamSource(input),Definitions.class).getValue();
  final Model model=tosca2Model(definitions);
  Parser.setCommonPrefixes(model);
  model.setNsPrefix("String_Node_Str",getRDFNamespace(definitions.getTargetNamespace()));
  return model;
}

Fixed version (ground truth):
public static Model getModel(final Definitions definitions) throws UnsupportedException {
  final Model model=ModelFactory.createDefaultModel();
  processTypes(definitions,model);
  processNodeTypes(definitions,model);
  processRelationshipTypes(definitions,model);
  processTemplates(definitions,model);
  Parser.setCommonPrefixes(model);
  model.setNsPrefix("String_Node_Str",getRDFNamespace(definitions.getTargetNamespace()));
  return model;
}
Program: 25632
Project: 25632
Buggy source:
private static void processTypes(final Definitions definitions,final Model model){
  if (definitions.getTypes() != null) {
    final List<Object> types=definitions.getTypes().getAny();
    for (    final Object schema : types) {
      if (schema instanceof Element) {
        final Element schemaElement=(Element)schema;
        if (isXMLSchemaElement(schemaElement)) {
          String namespace=getRDFNamespace(schemaElement.getAttribute("String_Node_Str"));
          if (namespace.isEmpty() || namespace.equals("String_Node_Str")) {
            namespace=getRDFNamespace(definitions.getTargetNamespace());
          }
          for (int i=0; i < (schemaElement.getChildNodes().getLength() - 1); i++) {
            final Node elementNode=schemaElement.getChildNodes().item(i);
            final String superPropertyName=elementNode.getAttributes().getNamedItem("String_Node_Str").getNodeValue();
            final Resource superProperty=model.createResource(namespace + superPropertyName);
            try {
              createTypeProperty(model,namespace,elementNode,superProperty);
            }
 catch (            PropertyNotFoundException e) {
              LOG.log(Level.WARNING,"String_Node_Str" + superProperty + "String_Node_Str");
            }
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
private static void processTypes(final Definitions definitions,final Model model){
  if (definitions.getTypes() != null) {
    final List<Object> types=definitions.getTypes().getAny();
    for (    final Object schema : types) {
      if (schema instanceof Element) {
        final Element schemaElement=(Element)schema;
        if (isXMLSchemaElement(schemaElement)) {
          String namespace=getRDFNamespace(schemaElement.getAttribute("String_Node_Str"));
          if (namespace.isEmpty() || namespace.equals("String_Node_Str")) {
            namespace=getRDFNamespace(definitions.getTargetNamespace());
          }
          for (int i=0; i < (schemaElement.getChildNodes().getLength()); i++) {
            final Node elementNode=schemaElement.getChildNodes().item(i);
            if (elementNode.getAttributes() != null && elementNode.getAttributes().getNamedItem("String_Node_Str") != null) {
              final String superPropertyName=elementNode.getAttributes().getNamedItem("String_Node_Str").getNodeValue();
              final Resource superProperty=model.createResource(namespace + superPropertyName);
              try {
                createTypeProperty(model,namespace,elementNode,superProperty);
              }
 catch (              PropertyNotFoundException e) {
                LOG.log(Level.WARNING,"String_Node_Str" + superProperty + "String_Node_Str");
              }
            }
          }
        }
      }
    }
  }
}
Program: 25633
Project: 25633
Buggy source:
public void init(final Model model) throws InvalidModelException {
  Parser.reasoner=Parser.createReasoner();
  this.model=Parser.createInfModel(model);
  if (!Parser.isValid(this.model)) {
    throw new InvalidModelException(Parser.getValidationReport(this.model));
  }
}

Fixed version (ground truth):
public void init(final Model model) throws InvalidModelException {
  this.model=model;
  Parser.reasoner=Parser.createReasoner();
  this.infModel=Parser.createInfModel(model);
  if (!Parser.isValid(this.infModel)) {
    throw new InvalidModelException(Parser.getValidationReport(this.infModel));
  }
}
Program: 25634
Project: 25634
Buggy source:
public InfModel getModel(){
  return this.model;
}

Fixed version (ground truth):
public Model getModel(){
  return this.model;
}
Program: 25635
Project: 25635
Buggy source:
public void printStatements(final Resource s,final Property p,final Resource o){
  for (final StmtIterator i=this.model.listStatements(s,p,o); i.hasNext(); ) {
    final Statement stmt=i.nextStatement();
    System.out.println("String_Node_Str" + PrintUtil.print(stmt));
  }
}

Fixed version (ground truth):
public void printStatements(final Resource s,final Property p,final Resource o){
  for (final StmtIterator i=this.infModel.listStatements(s,p,o); i.hasNext(); ) {
    final Statement stmt=i.nextStatement();
    System.out.println("String_Node_Str" + PrintUtil.print(stmt));
  }
}
Program: 25636
Project: 25636
Buggy source:
public ResultSetRewindable query(String queryString){
  queryString=Parser.getDefaultPrefixes() + queryString;
  final Query query=QueryFactory.create(queryString);
  final QueryExecution qexec=QueryExecutionFactory.create(query,this.model);
  final ResultSetRewindable rewindable=ResultSetFactory.makeRewindable(qexec.execSelect());
  return rewindable;
}

Fixed version (ground truth):
public ResultSetRewindable query(String queryString){
  queryString=Parser.getDefaultPrefixes() + queryString;
  final Query query=QueryFactory.create(queryString);
  final QueryExecution qexec=QueryExecutionFactory.create(query,this.infModel);
  final ResultSetRewindable rewindable=ResultSetFactory.makeRewindable(qexec.execSelect());
  return rewindable;
}
Program: 25637
Project: 25637
Buggy source:
public boolean isValid(){
  return Parser.isValid(this.model);
}

Fixed version (ground truth):
public boolean isValid(){
  return Parser.isValid(this.infModel);
}
Program: 25638
Project: 25638
Buggy source:
public String getValidationReport(){
  return Parser.getValidationReport(this.model);
}

Fixed version (ground truth):
public String getValidationReport(){
  return Parser.getValidationReport(this.infModel);
}
Program: 25639
Project: 25639
Buggy source:
public ResIterator getGroups(){
  return this.model.listSubjectsWithProperty(RDF.type,Omn.Group);
}

Fixed version (ground truth):
public ResIterator getGroups(){
  return this.infModel.listSubjectsWithProperty(RDF.type,Omn.Group);
}
Program: 25641
Project: 25641
Buggy source:
private static void processPropertiesElement(Resource node,Model model,Node propertiesElement) throws UnsupportedException {
  for (int i=0; i < (propertiesElement.getChildNodes().getLength() - 1); i++) {
    Node propertyNode=propertiesElement.getChildNodes().item(i);
    String namespace=propertyNode.getNamespaceURI();
    Property property=model.getProperty(namespace + propertyNode.getLocalName());
    Resource propertyRange=getPropertyRange(property);
    Node childElement=propertyNode.getChildNodes().item(0);
    if (childElement.getNodeType() == Node.ELEMENT_NODE) {
      Resource propertyValue=model.createResource(namespace + childElement.getLocalName());
      propertyValue.addProperty(RDF.type,propertyRange);
      processPropertiesElement(propertyValue,model,childElement);
      node.addProperty(property,propertyValue);
    }
 else     if (childElement.getNodeType() == Node.TEXT_NODE) {
      final Literal literal=model.createTypedLiteral(propertyNode.getTextContent(),propertyRange.getURI());
      node.addLiteral(property,literal);
    }
 else {
      throw new UnsupportedException("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
private static void processPropertiesElement(Resource node,Model model,Node propertiesElement) throws UnsupportedException {
  for (int i=0; i < (propertiesElement.getChildNodes().getLength() - 1); i++) {
    Node propertyNode=propertiesElement.getChildNodes().item(i);
    String namespace=propertyNode.getNamespaceURI();
    Property property=model.getProperty(namespace + propertyNode.getLocalName());
    Resource propertyRange=getPropertyRange(property);
    Node childElement=propertyNode.getChildNodes().item(0);
    if (childElement.getNodeType() == Node.ELEMENT_NODE) {
      Resource propertyValue=model.createResource(node.getNameSpace() + childElement.getLocalName());
      propertyValue.addProperty(RDF.type,propertyRange);
      propertyValue.addProperty(RDF.type,OWL2.NamedIndividual);
      processPropertiesElement(propertyValue,model,childElement);
      node.addProperty(property,propertyValue);
    }
 else     if (childElement.getNodeType() == Node.TEXT_NODE) {
      final Literal literal=model.createTypedLiteral(propertyNode.getTextContent(),propertyRange.getURI());
      node.addLiteral(property,literal);
    }
 else {
      throw new UnsupportedException("String_Node_Str");
    }
  }
}
Program: 25642
Project: 25642
Buggy source:
private static Resource createTopology(Model model,TServiceTemplate serviceTemplate){
  Resource topologyResource=model.createResource(serviceTemplate.getId());
  topologyResource.addProperty(RDF.type,Omn.Topology);
  return topologyResource;
}

Fixed version (ground truth):
private static Resource createTopology(Model model,TServiceTemplate serviceTemplate){
  Resource topologyResource=model.createResource(serviceTemplate.getId());
  topologyResource.addProperty(RDF.type,Omn.Topology);
  topologyResource.addProperty(RDF.type,OWL2.NamedIndividual);
  return topologyResource;
}
Program: 25643
Project: 25643
Buggy source:
private static void setNodeType(final TNodeTemplate nodeTemplate,final Resource node,final Model model){
  final QName type=nodeTemplate.getType();
  final Resource nodeType=createResourceFromQName(type,model);
  node.addProperty(RDF.type,nodeType);
}

Fixed version (ground truth):
private static void setNodeType(final TNodeTemplate nodeTemplate,final Resource node,final Model model){
  final QName type=nodeTemplate.getType();
  final Resource nodeType=createResourceFromQName(type,model);
  node.addProperty(RDF.type,nodeType);
  node.addProperty(RDF.type,OWL2.NamedIndividual);
}
Program: 25644
Project: 25644
Buggy source:
private static void setRelationshipType(TRelationshipTemplate relationshipTemplate,Property relationship,Model model){
  final QName type=relationshipTemplate.getType();
  final Resource relationshipType=createResourceFromQName(type,model);
  relationship.addProperty(RDF.type,relationshipType);
}

Fixed version (ground truth):
private static void setRelationshipType(TRelationshipTemplate relationshipTemplate,Property relationship,Model model){
  final QName type=relationshipTemplate.getType();
  final Resource relationshipType=createResourceFromQName(type,model);
  relationship.addProperty(RDF.type,relationshipType);
  relationship.addProperty(RDF.type,OWL2.NamedIndividual);
}
Program: 25645
Project: 25645
Buggy source:
@Test public void testModelQuery() throws IOException {
  final Model model=this.parser.getModel();
  ResIterator requests;
  requests=model.listSubjectsWithProperty(RDF.type,Omn_lifecycle.Request);
  Assert.assertTrue("String_Node_Str",requests.hasNext());
  requests=model.listSubjectsWithProperty(RDF.type,Omn.Group);
  Assert.assertTrue("String_Node_Str",requests.hasNext());
  while (requests.hasNext()) {
    final Resource request=requests.next();
    final StmtIterator statements=request.listProperties();
    System.out.println("String_Node_Str" + request);
    while (statements.hasNext()) {
      final Statement statement=statements.next();
      if (statement.getPredicate().equals(Omn.hasResource)) {
        System.out.println("String_Node_Str" + statement.getObject());
      }
 else       if (statement.getPredicate().equals(RDFS.comment)) {
        System.out.println("String_Node_Str" + statement.getObject());
      }
 else {
        System.out.println("String_Node_Str" + statement.getPredicate() + "String_Node_Str"+ statement.getObject());
      }
    }
  }
}

Fixed version (ground truth):
@Test public void testModelQuery() throws IOException {
  final Model model=this.parser.getInfModel();
  ResIterator requests;
  requests=model.listSubjectsWithProperty(RDF.type,Omn_lifecycle.Request);
  Assert.assertTrue("String_Node_Str",requests.hasNext());
  requests=model.listSubjectsWithProperty(RDF.type,Omn.Group);
  Assert.assertTrue("String_Node_Str",requests.hasNext());
  while (requests.hasNext()) {
    final Resource request=requests.next();
    final StmtIterator statements=request.listProperties();
    System.out.println("String_Node_Str" + request);
    while (statements.hasNext()) {
      final Statement statement=statements.next();
      if (statement.getPredicate().equals(Omn.hasResource)) {
        System.out.println("String_Node_Str" + statement.getObject());
      }
 else       if (statement.getPredicate().equals(RDFS.comment)) {
        System.out.println("String_Node_Str" + statement.getObject());
      }
 else {
        System.out.println("String_Node_Str" + statement.getPredicate() + "String_Node_Str"+ statement.getObject());
      }
    }
  }
}
Program: 25646
Project: 25646
Buggy source:
@Test public void testSPARQLQuery() throws IOException {
  final String queryString="String_Node_Str";
  final ResultSet result=this.parser.query(queryString);
  Assert.assertTrue("String_Node_Str",result.hasNext());
  while (result.hasNext()) {
    final QuerySolution solution=result.nextSolution();
    final RDFNode node=solution.get("String_Node_Str");
    final String groupURI=node.asNode().getURI();
    System.out.println("String_Node_Str" + groupURI);
    final Resource requestedGroupDetails=this.parser.getModel().getResource(groupURI);
    this.parser.printStatements(requestedGroupDetails,null,null);
    final Property requestedResourceDetails=this.parser.getModel().getProperty(Omn.hasResource.getURI());
    this.parser.printStatements(null,requestedResourceDetails,null);
  }
}

Fixed version (ground truth):
@Test public void testSPARQLQuery() throws IOException {
  final String queryString="String_Node_Str";
  final ResultSet result=this.parser.query(queryString);
  Assert.assertTrue("String_Node_Str",result.hasNext());
  while (result.hasNext()) {
    final QuerySolution solution=result.nextSolution();
    final RDFNode node=solution.get("String_Node_Str");
    final String groupURI=node.asNode().getURI();
    System.out.println("String_Node_Str" + groupURI);
    final Resource requestedGroupDetails=this.parser.getInfModel().getResource(groupURI);
    this.parser.printStatements(requestedGroupDetails,null,null);
    final Property requestedResourceDetails=this.parser.getInfModel().getProperty(Omn.hasResource.getURI());
    this.parser.printStatements(null,requestedResourceDetails,null);
  }
}
Program: 25647
Project: 25647
Buggy source:
@Test public void testNTUAAdvertisement() throws JAXBException, InvalidModelException {
  final Model model=new Parser("String_Node_Str").getModel();
  final String rspec=AdvertisementConverter.getRSpec(model);
  System.out.println(rspec);
  Assert.assertTrue("String_Node_Str",rspec.contains("String_Node_Str"));
  Assert.assertTrue("String_Node_Str",rspec.contains("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testNTUAAdvertisement() throws JAXBException, InvalidModelException {
  final Model model=new Parser("String_Node_Str").getInfModel();
  final String rspec=AdvertisementConverter.getRSpec(model);
  System.out.println(rspec);
  Assert.assertTrue("String_Node_Str",rspec.contains("String_Node_Str"));
  Assert.assertTrue("String_Node_Str",rspec.contains("String_Node_Str"));
}
Program: 25648
Project: 25648
Buggy source:
@Test public void testModel2Advertisement() throws JAXBException, InvalidModelException {
  final Model model=Omn4GeniTest.parser.getModel();
  final String rspec=AdvertisementConverter.getRSpec(model);
  System.out.println(rspec);
  Assert.assertTrue("String_Node_Str",rspec.contains("String_Node_Str"));
  Assert.assertTrue("String_Node_Str",rspec.contains("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testModel2Advertisement() throws JAXBException, InvalidModelException {
  final Model model=Omn4GeniTest.parser.getInfModel();
  final String rspec=AdvertisementConverter.getRSpec(model);
  System.out.println(rspec);
  Assert.assertTrue("String_Node_Str",rspec.contains("String_Node_Str"));
  Assert.assertTrue("String_Node_Str",rspec.contains("String_Node_Str"));
}
Program: 25649
Project: 25649
Buggy source:
@Test public void testModel2Manifest() throws JAXBException, InvalidModelException {
  final Model model=Omn4GeniTest.parser.getModel();
  final String rspec=ManifestConverter.getRSpec(model);
  System.out.println(rspec);
  Assert.assertTrue("String_Node_Str",rspec.contains("String_Node_Str"));
  Assert.assertTrue("String_Node_Str",rspec.contains("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testModel2Manifest() throws JAXBException, InvalidModelException {
  final Model model=Omn4GeniTest.parser.getInfModel();
  final String rspec=ManifestConverter.getRSpec(model);
  System.out.println(rspec);
  Assert.assertTrue("String_Node_Str",rspec.contains("String_Node_Str"));
  Assert.assertTrue("String_Node_Str",rspec.contains("String_Node_Str"));
}
Program: 25650
Project: 25650
Buggy source:
@Test public void testUnboundRequest() throws JAXBException, InvalidModelException, IOException {
  final String filename="String_Node_Str";
  final InputStream inputRspec=RequestConverterTest.class.getResourceAsStream(filename);
  System.out.println("String_Node_Str" + filename + "String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println(AbstractConverter.toString(filename));
  System.out.println("String_Node_Str");
  final Model model=RequestConverter.getModel(inputRspec);
  final ResIterator topology=model.listResourcesWithProperty(RDF.type,Omn_lifecycle.Request);
  Assert.assertTrue("String_Node_Str",topology.hasNext());
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println(Parser.toString(model));
  System.out.println("String_Node_Str");
  final InfModel infModel=new Parser(model).getModel();
  final String outputRspec=RequestConverter.getRSpec(infModel);
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println(outputRspec);
  System.out.println("String_Node_Str");
}

Fixed version (ground truth):
@Test public void testUnboundRequest() throws JAXBException, InvalidModelException, IOException {
  final String filename="String_Node_Str";
  final InputStream inputRspec=RequestConverterTest.class.getResourceAsStream(filename);
  System.out.println("String_Node_Str" + filename + "String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println(AbstractConverter.toString(filename));
  System.out.println("String_Node_Str");
  final Model model=RequestConverter.getModel(inputRspec);
  final ResIterator topology=model.listResourcesWithProperty(RDF.type,Omn_lifecycle.Request);
  Assert.assertTrue("String_Node_Str",topology.hasNext());
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println(Parser.toString(model));
  System.out.println("String_Node_Str");
  final InfModel infModel=new Parser(model).getInfModel();
  final String outputRspec=RequestConverter.getRSpec(infModel);
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println(outputRspec);
  System.out.println("String_Node_Str");
}
Program: 25651
Project: 25651
Buggy source:
@Test public void testAdvertismentRoundtrip() throws JAXBException, InvalidModelException {
  System.out.println("String_Node_Str");
  System.out.println(System.currentTimeMillis());
  final InputStream rspec=RoundtripTest.class.getResourceAsStream("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println(System.currentTimeMillis());
  final Model model=AdvertisementConverter.getModel(rspec);
  System.out.println("String_Node_Str");
  System.out.println(System.currentTimeMillis());
  final InfModel infModel=new Parser(model).getModel();
  final String advertisement=AdvertisementConverter.getRSpec(infModel);
  System.out.println("String_Node_Str");
  System.out.println(System.currentTimeMillis());
  System.out.println(advertisement);
}

Fixed version (ground truth):
@Test public void testAdvertismentRoundtrip() throws JAXBException, InvalidModelException {
  System.out.println("String_Node_Str");
  System.out.println(System.currentTimeMillis());
  final InputStream rspec=RoundtripTest.class.getResourceAsStream("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println(System.currentTimeMillis());
  final Model model=AdvertisementConverter.getModel(rspec);
  System.out.println("String_Node_Str");
  System.out.println(System.currentTimeMillis());
  final InfModel infModel=new Parser(model).getInfModel();
  final String advertisement=AdvertisementConverter.getRSpec(infModel);
  System.out.println("String_Node_Str");
  System.out.println(System.currentTimeMillis());
  System.out.println(advertisement);
}
Program: 25652
Project: 25652
Buggy source:
@Test public void testGetTopology() throws JAXBException, InvalidModelException, MultipleNamespacesException, RequiredResourceNotFoundException, MultiplePropertyValuesException {
  final InfModel model=this.parser.getModel();
  final String topology=OMN2Tosca.getTopology(model);
  System.out.println(topology);
  OMN2ToscaTest.testGeneralToscaDefinitions(topology);
  OMN2ToscaTest.testTypes(topology);
  OMN2ToscaTest.testNodeTypes(topology);
  OMN2ToscaTest.testNodeTemplates(topology);
  OMN2ToscaTest.testRelationshipTemplates(topology);
  this.testRelationshipTypes(topology);
}

Fixed version (ground truth):
@Test public void testGetTopology() throws JAXBException, InvalidModelException, MultipleNamespacesException, RequiredResourceNotFoundException, MultiplePropertyValuesException {
  InputStream input=this.getClass().getResourceAsStream("String_Node_Str");
  Parser parser=new Parser(input);
  final InfModel model=parser.getInfModel();
  final String topology=OMN2Tosca.getTopology(model);
  System.out.println(topology);
  OMN2ToscaTest.testGeneralToscaDefinitions(topology);
  OMN2ToscaTest.testTypes(topology);
  OMN2ToscaTest.testNodeTypes(topology);
  OMN2ToscaTest.testNodeTemplates(topology);
  OMN2ToscaTest.testRelationshipTemplates(topology);
  this.testRelationshipTypes(topology);
}
Program: 25653
Project: 25653
Buggy source:
@Test public void testGetTopology() throws JAXBException, InvalidModelException, UnsupportedException {
  final Model model=Tosca2OMN.getModel(this.input);
  final String serializedModel=Tosca2OMNTest.serializeModel(model,"String_Node_Str");
  System.out.println(serializedModel);
  Assert.assertTrue("String_Node_Str",model.containsResource(Omn.Topology));
  Assert.assertTrue("String_Node_Str",model.contains(Osco.dummy,RDFS.subClassOf,Tosca.Node));
  Assert.assertTrue("String_Node_Str",model.containsResource(Tosca.State));
  Assert.assertTrue("String_Node_Str",model.containsResource(Osco.Active));
  Assert.assertTrue("String_Node_Str",model.containsResource(Osco.parameter1));
  Assert.assertTrue("String_Node_Str",model.contains(Osco.port,RDFS.range,XSD.xint));
  Assert.assertTrue("String_Node_Str",model.contains(Osco.parameter1,RDFS.range,XSD.xstring));
  Assert.assertTrue("String_Node_Str",model.containsResource(Osco.dummy));
  Assert.assertTrue("String_Node_Str",model.containsResource(Osco.test_param));
}

Fixed version (ground truth):
@Test public void testGetTopology() throws JAXBException, InvalidModelException, UnsupportedException {
  InputStream input=this.getClass().getResourceAsStream("String_Node_Str");
  final Model model=Tosca2OMN.getModel(input);
  final String serializedModel=Tosca2OMNTest.serializeModel(model,"String_Node_Str");
  System.out.println(serializedModel);
  Assert.assertTrue("String_Node_Str",model.containsResource(Omn.Topology));
  Assert.assertTrue("String_Node_Str",model.contains(Osco.dummy,RDFS.subClassOf,Tosca.Node));
  Assert.assertTrue("String_Node_Str",model.containsResource(Tosca.State));
  Assert.assertTrue("String_Node_Str",model.containsResource(Osco.Active));
  Assert.assertTrue("String_Node_Str",model.containsResource(Osco.parameter1));
  Assert.assertTrue("String_Node_Str",model.contains(Osco.port,RDFS.range,XSD.xint));
  Assert.assertTrue("String_Node_Str",model.contains(Osco.parameter1,RDFS.range,XSD.xstring));
  Assert.assertTrue("String_Node_Str",model.containsResource(Osco.dummy));
  Assert.assertTrue("String_Node_Str",model.containsResource(Osco.test_param));
}
Program: 25654
Project: 25654
Buggy source:
public void init(Model model) throws InvalidModelException {
  Parser.reasoner=createReasoner();
  this.model=createInfModel(model);
  if (!isValid(this.model))   throw new InvalidModelException(getValidationReport(this.model));
}

Fixed version (ground truth):
public void init(final Model model) throws InvalidModelException {
  Parser.reasoner=Parser.createReasoner();
  this.model=Parser.createInfModel(model);
  if (!Parser.isValid(this.model)) {
    throw new InvalidModelException(Parser.getValidationReport(this.model));
  }
}
Program: 25655
Project: 25655
Buggy source:
public static InfModel createInfModel(Model data) throws InvalidModelException {
  InfModel infModel=ModelFactory.createInfModel(reasoner,data);
  setCommonPrefixes(infModel);
  return infModel;
}

Fixed version (ground truth):
public static InfModel createInfModel(final Model data) throws InvalidModelException {
  final InfModel infModel=ModelFactory.createInfModel(Parser.reasoner,data);
  Parser.setCommonPrefixes(infModel);
  return infModel;
}
Program: 25656
Project: 25656
Buggy source:
public void printStatements(Resource s,Property p,Resource o){
  for (StmtIterator i=model.listStatements(s,p,o); i.hasNext(); ) {
    Statement stmt=i.nextStatement();
    System.out.println("String_Node_Str" + PrintUtil.print(stmt));
  }
}

Fixed version (ground truth):
public void printStatements(final Resource s,final Property p,final Resource o){
  for (final StmtIterator i=this.model.listStatements(s,p,o); i.hasNext(); ) {
    final Statement stmt=i.nextStatement();
    System.out.println("String_Node_Str" + PrintUtil.print(stmt));
  }
}
Program: 25657
Project: 25657
Buggy source:
public ResultSetRewindable query(String queryString){
  queryString=getDefaultPrefixes() + queryString;
  Query query=QueryFactory.create(queryString);
  QueryExecution qexec=QueryExecutionFactory.create(query,this.model);
  ResultSetRewindable rewindable=ResultSetFactory.makeRewindable(qexec.execSelect());
  return rewindable;
}

Fixed version (ground truth):
public ResultSetRewindable query(String queryString){
  queryString=Parser.getDefaultPrefixes() + queryString;
  final Query query=QueryFactory.create(queryString);
  final QueryExecution qexec=QueryExecutionFactory.create(query,this.model);
  final ResultSetRewindable rewindable=ResultSetFactory.makeRewindable(qexec.execSelect());
  return rewindable;
}
Program: 25658
Project: 25658
Buggy source:
public static String getDefaultPrefixes(){
  return createPrefix("String_Node_Str",Omn.getURI()) + createPrefix("String_Node_Str",Omn_lifecycle.getURI()) + createPrefix("String_Node_Str",RDF.getURI())+ createPrefix("String_Node_Str",RDFS.getURI())+ createPrefix("String_Node_Str",OWL.getURI())+ createPrefix("String_Node_Str",Osco.getURI())+ createPrefix("String_Node_Str",Tosca.getURI());
}

Fixed version (ground truth):
public static String getDefaultPrefixes(){
  return Parser.createPrefix("String_Node_Str",Omn.getURI()) + Parser.createPrefix("String_Node_Str",Omn_lifecycle.getURI()) + Parser.createPrefix("String_Node_Str",RDF.getURI())+ Parser.createPrefix("String_Node_Str",RDFS.getURI())+ Parser.createPrefix("String_Node_Str",OWL.getURI())+ Parser.createPrefix("String_Node_Str",Osco.getURI())+ Parser.createPrefix("String_Node_Str",Tosca.getURI());
}
Program: 25659
Project: 25659
Buggy source:
public static String createPrefix(String name,String URI){
  return "String_Node_Str" + name + "String_Node_Str"+ URI+ "String_Node_Str"+ NL;
}

Fixed version (ground truth):
public static String createPrefix(final String name,final String URI){
  return "String_Node_Str" + name + "String_Node_Str"+ URI+ "String_Node_Str"+ Parser.NL;
}
Program: 25660
Project: 25660
Buggy source:
public static Reasoner createReasoner(){
  Model schema=ModelFactory.createDefaultModel();
  schema.add(parse("String_Node_Str"));
  schema.add(parse("String_Node_Str"));
  schema.add(parse("String_Node_Str"));
  schema.add(parse("String_Node_Str"));
  schema.add(parse("String_Node_Str"));
  schema.add(parse("String_Node_Str"));
  schema.add(parse("String_Node_Str"));
  schema.add(parse("String_Node_Str"));
  Reasoner reasoner=ReasonerRegistry.getOWLMiniReasoner();
  reasoner=reasoner.bindSchema(schema);
  return reasoner;
}

Fixed version (ground truth):
public static Reasoner createReasoner(){
  final Model schema=ModelFactory.createDefaultModel();
  schema.add(Parser.parse("String_Node_Str"));
  schema.add(Parser.parse("String_Node_Str"));
  schema.add(Parser.parse("String_Node_Str"));
  schema.add(Parser.parse("String_Node_Str"));
  schema.add(Parser.parse("String_Node_Str"));
  schema.add(Parser.parse("String_Node_Str"));
  schema.add(Parser.parse("String_Node_Str"));
  schema.add(Parser.parse("String_Node_Str"));
  Reasoner reasoner=ReasonerRegistry.getOWLMiniReasoner();
  reasoner=reasoner.bindSchema(schema);
  return reasoner;
}
Program: 25661
Project: 25661
Buggy source:
public static Model parse(String filename){
  InputStream stream=Parser.class.getResourceAsStream(filename);
  Model model=ModelFactory.createDefaultModel().read(stream,StandardCharsets.UTF_8.toString(),"String_Node_Str");
  return model;
}

Fixed version (ground truth):
public static Model parse(final String filename){
  final InputStream stream=Parser.class.getResourceAsStream(filename);
  final Model model=ModelFactory.createDefaultModel().read(stream,StandardCharsets.UTF_8.toString(),"String_Node_Str");
  return model;
}
Program: 25662
Project: 25662
Buggy source:
public Parser(Model model) throws InvalidModelException {
  init(model);
}

Fixed version (ground truth):
public Parser(final Model model) throws InvalidModelException {
  this.init(model);
}
Program: 25663
Project: 25663
Buggy source:
public static String toString(Model model){
  String result="String_Node_Str";
  for (StmtIterator i=model.listStatements(); i.hasNext(); ) {
    Statement stmt=i.nextStatement();
    result+=PrintUtil.print(stmt) + NL;
  }
  return result;
}

Fixed version (ground truth):
public static String toString(final Model model){
  String result="String_Node_Str";
  for (final StmtIterator i=model.listStatements(); i.hasNext(); ) {
    final Statement stmt=i.nextStatement();
    result+=PrintUtil.print(stmt) + Parser.NL;
  }
  return result;
}
Program: 25664
Project: 25664
Buggy source:
public static void setCommonPrefixes(Model model){
  model.setNsPrefix("String_Node_Str",Omn.getURI());
  model.setNsPrefix("String_Node_Str",Omn_lifecycle.getURI());
  model.setNsPrefix("String_Node_Str",RDF.getURI());
  model.setNsPrefix("String_Node_Str",RDFS.getURI());
  model.setNsPrefix("String_Node_Str",OWL.getURI());
  model.setNsPrefix("String_Node_Str",Tosca.getURI());
  model.setNsPrefix("String_Node_Str",Osco.getURI());
  model.setNsPrefix("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
public static void setCommonPrefixes(final Model model){
  model.setNsPrefix("String_Node_Str",Omn.getURI());
  model.setNsPrefix("String_Node_Str",Omn_lifecycle.getURI());
  model.setNsPrefix("String_Node_Str",RDF.getURI());
  model.setNsPrefix("String_Node_Str",RDFS.getURI());
  model.setNsPrefix("String_Node_Str",OWL.getURI());
  model.setNsPrefix("String_Node_Str",Tosca.getURI());
  model.setNsPrefix("String_Node_Str",Osco.getURI());
  model.setNsPrefix("String_Node_Str","String_Node_Str");
}
Program: 25665
Project: 25665
Buggy source:
public InvalidModelException(Throwable cause){
  super(cause);
}

Fixed version (ground truth):
public InvalidModelException(final Throwable cause){
  super(cause);
}
Program: 25666
Project: 25666
Buggy source:
protected static void validateModel(List<Resource> groups) throws InvalidModelException {
  if (groups.isEmpty())   throw new InvalidModelException("String_Node_Str");
  if (groups.size() > 1)   throw new InvalidModelException("String_Node_Str");
}

Fixed version (ground truth):
protected static void validateModel(final List<Resource> groups) throws InvalidModelException {
  if (groups.isEmpty()) {
    throw new InvalidModelException("String_Node_Str");
  }
  if (groups.size() > 1) {
    throw new InvalidModelException("String_Node_Str");
  }
}
Program: 25667
Project: 25667
Buggy source:
public static String toString(String filename) throws IOException {
  String result="String_Node_Str";
  InputStream inputStream=AbstractConverter.class.getResourceAsStream(filename);
  BufferedReader br=new BufferedReader(new InputStreamReader(inputStream));
  String line=null;
  while ((line=br.readLine()) != null) {
    result+=line + "String_Node_Str";
  }
  return result;
}

Fixed version (ground truth):
public static String toString(final String filename) throws IOException {
  String result="String_Node_Str";
  final InputStream inputStream=AbstractConverter.class.getResourceAsStream(filename);
  final BufferedReader br=new BufferedReader(new InputStreamReader(inputStream));
  String line=null;
  while ((line=br.readLine()) != null) {
    result+=line + "String_Node_Str";
  }
  return result;
}
Program: 25668
Project: 25668
Buggy source:
public static String toString(Model model){
  String result="String_Node_Str";
  for (StmtIterator i=model.listStatements(); i.hasNext(); ) {
    Statement stmt=i.nextStatement();
    result+=PrintUtil.print(stmt);
  }
  return result;
}

Fixed version (ground truth):
public static String toString(Model model){
  String result="String_Node_Str";
  for (StmtIterator i=model.listStatements(); i.hasNext(); ) {
    Statement stmt=i.nextStatement();
    result+=PrintUtil.print(stmt) + NL;
  }
  return result;
}
Program: 25669
Project: 25669
Buggy source:
@Override public void validate(Object target,Errors errors){
  ConsentSignature sig=(ConsentSignature)target;
  if (Strings.isNullOrEmpty(sig.getName())) {
    errors.rejectValue("String_Node_Str",CANNOT_BE_BLANK);
  }
  if (Strings.isNullOrEmpty(sig.getBirthdate())) {
    if (minAgeOfConsent > 0) {
      errors.rejectValue("String_Node_Str",CANNOT_BE_BLANK);
    }
  }
 else {
    LocalDate birthdate=parseBirthday(sig.getBirthdate());
    if (birthdate == null) {
      errors.rejectValue("String_Node_Str","String_Node_Str");
    }
 else     if (minAgeOfConsent > 0) {
      LocalDate now=LocalDate.now();
      Period period=new Period(birthdate,now);
      if (period.getYears() < minAgeOfConsent) {
        String message=String.format(TOO_YOUNG,minAgeOfConsent);
        errors.rejectValue("String_Node_Str",message);
      }
    }
  }
  if (sig.getSignedOn() <= 0L) {
    errors.rejectValue("String_Node_Str","String_Node_Str");
  }
  String imageData=sig.getImageData();
  String imageMimeType=sig.getImageMimeType();
  if (imageData != null && imageData.isEmpty()) {
    errors.rejectValue("String_Node_Str",CANNOT_BE_EMPTY_STRING);
  }
  if (imageMimeType != null && imageMimeType.isEmpty()) {
    errors.rejectValue("String_Node_Str",CANNOT_BE_EMPTY_STRING);
  }
  if (imageData != null ^ imageMimeType != null) {
    errors.reject("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void validate(Object target,Errors errors){
  ConsentSignature sig=(ConsentSignature)target;
  if (Strings.isNullOrEmpty(sig.getName())) {
    errors.rejectValue("String_Node_Str",CANNOT_BE_BLANK);
  }
  if (Strings.isNullOrEmpty(sig.getBirthdate())) {
    if (minAgeOfConsent > 0) {
      errors.rejectValue("String_Node_Str",CANNOT_BE_BLANK);
    }
  }
 else {
    LocalDate birthdate=parseBirthday(sig.getBirthdate());
    if (birthdate == null) {
      errors.rejectValue("String_Node_Str","String_Node_Str");
    }
 else     if (minAgeOfConsent > 0) {
      LocalDate now=LocalDate.now(DateTimeZone.UTC);
      Period period=new Period(birthdate,now);
      if (period.getYears() < minAgeOfConsent) {
        String message=String.format(TOO_YOUNG,minAgeOfConsent);
        errors.rejectValue("String_Node_Str",message);
      }
    }
  }
  if (sig.getSignedOn() <= 0L) {
    errors.rejectValue("String_Node_Str","String_Node_Str");
  }
  String imageData=sig.getImageData();
  String imageMimeType=sig.getImageMimeType();
  if (imageData != null && imageData.isEmpty()) {
    errors.rejectValue("String_Node_Str",CANNOT_BE_EMPTY_STRING);
  }
  if (imageMimeType != null && imageMimeType.isEmpty()) {
    errors.rejectValue("String_Node_Str",CANNOT_BE_EMPTY_STRING);
  }
  if (imageData != null ^ imageMimeType != null) {
    errors.reject("String_Node_Str");
  }
}
Program: 25670
Project: 25670
Buggy source:
@Test public void minAgeLimitBirthdateOK(){
  String birthdate=DateTime.now(DateTimeZone.UTC).minusYears(18).toString();
  validator=new ConsentSignatureValidator(18);
  ConsentSignature sig=new ConsentSignature.Builder().withName("String_Node_Str").withBirthdate(birthdate).build();
  Validate.entityThrowingException(validator,sig);
}

Fixed version (ground truth):
@Test public void minAgeLimitBirthdateOK(){
  String birthdate=NOW.minusYears(18).toLocalDate().toString();
  validator=new ConsentSignatureValidator(18);
  ConsentSignature sig=new ConsentSignature.Builder().withName("String_Node_Str").withBirthdate(birthdate).build();
  Validate.entityThrowingException(validator,sig);
}
Program: 25671
Project: 25671
Buggy source:
@Before public void before(){
  DateTimeUtils.setCurrentMillisFixed(DateTime.parse("String_Node_Str").getMillis());
  validator=new ConsentSignatureValidator(0);
}

Fixed version (ground truth):
@Before public void before(){
  DateTimeUtils.setCurrentMillisFixed(NOW.getMillis());
  validator=new ConsentSignatureValidator(0);
}
Program: 25672
Project: 25672
Buggy source:
@Test public void minAgeLimitButBirthdateTooRecent(){
  String birthdate=LocalDate.now(DateTimeZone.UTC).minusYears(18).plusDays(1).toString();
  validator=new ConsentSignatureValidator(18);
  ConsentSignature sig=new ConsentSignature.Builder().withName("String_Node_Str").withBirthdate(birthdate).build();
  assertValidatorMessage(validator,sig,"String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Test public void minAgeLimitButBirthdateTooRecent(){
  String birthdate=NOW.minusYears(18).plusDays(1).toLocalDate().toString();
  validator=new ConsentSignatureValidator(18);
  ConsentSignature sig=new ConsentSignature.Builder().withName("String_Node_Str").withBirthdate(birthdate).build();
  assertValidatorMessage(validator,sig,"String_Node_Str","String_Node_Str");
}
Program: 25674
Project: 25674
Buggy source:
@Test public void updateStudyCorrectlyDetectsEmailChangesInvolvingNulls(){
  String originalEmail=TestUtils.getValidStudy(StudyServiceMockTest.class).getConsentNotificationEmail();
  String newEmail="String_Node_Str";
  setupConsentEmailChangeTest(null,null,false,false);
  setupConsentEmailChangeTest(originalEmail,originalEmail,false,false);
  setupConsentEmailChangeTest(null,newEmail,true,true);
  setupConsentEmailChangeTest(originalEmail,null,true,false);
  setupConsentEmailChangeTest(originalEmail,newEmail,true,true);
}

Fixed version (ground truth):
@Test public void updateStudyCorrectlyDetectsEmailChangesInvolvingNulls(){
  String originalEmail=TestUtils.getValidStudy(StudyServiceMockTest.class).getConsentNotificationEmail();
  String newEmail="String_Node_Str";
  setupConsentEmailChangeTest(null,null,false,false);
  setupConsentEmailChangeTest(originalEmail,originalEmail,false,false);
  setupConsentEmailChangeTest(null,newEmail,true,true);
  setupConsentEmailChangeTest(originalEmail,null,true,false);
  setupConsentEmailChangeTest(originalEmail,newEmail,true,true);
  setupConsentEmailChangeTest(originalEmail,"String_Node_Str",true,false);
}
Program: 25675
Project: 25675
Buggy source:
public static final CacheKey viewKey(Class<?> clazz,String... elements){
  List<String> list=Lists.newArrayList(elements);
  list.add(clazz.getSimpleName());
  list.add("String_Node_Str");
  return new CacheKey(COLON_JOINER.join(elements));
}

Fixed version (ground truth):
public static final CacheKey viewKey(Class<?> clazz,String... elements){
  List<String> list=Lists.newArrayList(elements);
  list.add(clazz.getSimpleName());
  list.add("String_Node_Str");
  return new CacheKey(COLON_JOINER.join(list));
}