Program: 15603
Project: 15603
Buggy source:
private String processRequestImpl(String api,Object object){
  String result="String_Node_Str";
  try {
    SensorManager sensorManager=new SensorManager();
    Sensor sensor=null;
switch (api) {
case "String_Node_Str":
      if (object instanceof Sensor)       sensor=(Sensor)object;
 else       break;
    logger.info("String_Node_Str" + sensor.getId());
  String sensorTypeId=sensorManager.getSensorTypeId(sensor.getSensorType().toLowerCase());
String triples=TriplesDataRetriever.getSensorTripleMetadata(sensor,sensorTypeId);
if ((sensor.getMetaGraph() == null) || (sensor.getMetaGraph() == "String_Node_Str")) sensor.setMetaGraph(prop.getProperty("String_Node_Str"));
sensorManager.setDataGraph(sensor.getDataGraph());
sensorManager.setMetaGraph(sensor.getMetaGraph());
sensorManager.insertTriplesToGraph(sensor.getMetaGraph(),triples);
sensorManager.runSpatialIndex();
logger.info("String_Node_Str");
logger.debug("String_Node_Str");
break;
case "String_Node_Str":
Observation observation=null;
if (object instanceof Observation) observation=(Observation)object;
 else break;
logger.info("String_Node_Str" + observation.getId());
triples="String_Node_Str";
if ((observation.getMetaGraph() == null) || (observation.getMetaGraph() == "String_Node_Str")) observation.setMetaGraph(prop.getProperty("String_Node_Str"));
sensorManager.setDataGraph(observation.getDataGraph());
sensorManager.setMetaGraph(observation.getMetaGraph());
sensor=sensorManager.getSpecifiedSensorWithSensorId(observation.getSensor());
String foi=VirtuosoConstantUtil.sensorObjectDataPrefix + Double.toString(sensor.getPlace().getLat()).replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str") + Double.toString(sensor.getPlace().getLng()).replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str");
triples+=TriplesDataRetriever.getObservationTripleData(observation.getId(),observation.getSensor(),foi,observation.getTimes());
OntModel model=ModelFactory.createOntologyModel();
for (ObservedProperty obv : observation.getReadings()) {
OntClass cl=model.createClass(obv.getPropertyType());
if (obv.getUnit().equals("String_Node_Str")) triples+=TriplesDataRetriever.getTripleDataHasNoUnit("String_Node_Str",cl.getLocalName(),obv.getValue(),observation.getId(),sensor.getProperties().get(obv.getPropertyType()),observation.getTimes());
 else triples+=TriplesDataRetriever.getTripleDataHasUnit("String_Node_Str",cl.getLocalName(),obv.getValue(),obv.getUnit(),observation.getId(),sensor.getProperties().get(obv.getPropertyType()),observation.getTimes());
}
sensorManager.insertTriplesToGraph(observation.getDataGraph(),triples);
logger.info("String_Node_Str");
break;
case "String_Node_Str":
RDFTuple tuple=null;
if (object instanceof RDFTuple) tuple=(RDFTuple)object;
 else break;
sensorManager.insertTriplesToGraph(tuple.getGraphURL(),tuple.getNtriple());
logger.info("String_Node_Str" + tuple.getGraphURL());
break;
case "String_Node_Str":
tuple=null;
if (object instanceof RDFTuple) tuple=(RDFTuple)object;
 else break;
if (tuple.getNtriple().equals("String_Node_Str")) {
sensorManager.clearGraph(tuple.getGraphURL());
logger.info("String_Node_Str" + tuple.getGraphURL());
}
 else {
sensorManager.deleteTriples(tuple.getGraphURL(),tuple.getNtriple());
logger.info("String_Node_Str" + tuple.getGraphURL());
}
break;
case "String_Node_Str":
HashMap<String,String> patterns=null;
if (object instanceof HashMap<?,?>) patterns=(HashMap<String,String>)object;
sensorManager.updateGraph(patterns.get("String_Node_Str"),patterns.get("String_Node_Str"),patterns.get("String_Node_Str"));
default :
break;
}
}
 catch (Exception e) {
logger.error("String_Node_Str",e);
result=e.toString();
}
return result;
}

Fixed version (ground truth):
private String processRequestImpl(String api,Object object){
  String result="String_Node_Str";
  try {
    SensorManager sensorManager=new SensorManager();
    Sensor sensor=null;
switch (api) {
case "String_Node_Str":
      if (object instanceof Sensor)       sensor=(Sensor)object;
 else       break;
    logger.info("String_Node_Str" + sensor.getId());
  String sensorTypeId=sensorManager.getSensorTypeId(sensor.getSensorType().toLowerCase());
String triples=TriplesDataRetriever.getSensorTripleMetadata(sensor,sensorTypeId);
if ((sensor.getMetaGraph() == null) || (sensor.getMetaGraph() == "String_Node_Str")) sensor.setMetaGraph(propertyManagement.getSchedulerLsmMetaGraph());
sensorManager.setDataGraph(sensor.getDataGraph());
sensorManager.setMetaGraph(sensor.getMetaGraph());
sensorManager.insertTriplesToGraph(sensor.getMetaGraph(),triples);
sensorManager.runSpatialIndex();
logger.info("String_Node_Str");
logger.debug("String_Node_Str");
break;
case "String_Node_Str":
Observation observation=null;
if (object instanceof Observation) observation=(Observation)object;
 else break;
logger.info("String_Node_Str" + observation.getId());
triples="String_Node_Str";
if ((observation.getMetaGraph() == null) || (observation.getMetaGraph() == "String_Node_Str")) observation.setMetaGraph(propertyManagement.getLSMLocalMetaGraph());
sensorManager.setDataGraph(observation.getDataGraph());
sensorManager.setMetaGraph(observation.getMetaGraph());
sensor=sensorManager.getSpecifiedSensorWithSensorId(observation.getSensor());
String foi=VirtuosoConstantUtil.sensorObjectDataPrefix + Double.toString(sensor.getPlace().getLat()).replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str") + Double.toString(sensor.getPlace().getLng()).replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str");
triples+=TriplesDataRetriever.getObservationTripleData(observation.getId(),observation.getSensor(),foi,observation.getTimes());
OntModel model=ModelFactory.createOntologyModel();
for (ObservedProperty obv : observation.getReadings()) {
OntClass cl=model.createClass(obv.getPropertyType());
if (obv.getUnit().equals("String_Node_Str")) triples+=TriplesDataRetriever.getTripleDataHasNoUnit("String_Node_Str",cl.getLocalName(),obv.getValue(),observation.getId(),sensor.getProperties().get(obv.getPropertyType()),observation.getTimes());
 else triples+=TriplesDataRetriever.getTripleDataHasUnit("String_Node_Str",cl.getLocalName(),obv.getValue(),obv.getUnit(),observation.getId(),sensor.getProperties().get(obv.getPropertyType()),observation.getTimes());
}
sensorManager.insertTriplesToGraph(observation.getDataGraph(),triples);
logger.info("String_Node_Str");
break;
case "String_Node_Str":
RDFTuple tuple=null;
if (object instanceof RDFTuple) tuple=(RDFTuple)object;
 else break;
sensorManager.insertTriplesToGraph(tuple.getGraphURL(),tuple.getNtriple());
logger.info("String_Node_Str" + tuple.getGraphURL());
break;
case "String_Node_Str":
tuple=null;
if (object instanceof RDFTuple) tuple=(RDFTuple)object;
 else break;
if (tuple.getNtriple().equals("String_Node_Str")) {
sensorManager.clearGraph(tuple.getGraphURL());
logger.info("String_Node_Str" + tuple.getGraphURL());
}
 else {
sensorManager.deleteTriples(tuple.getGraphURL(),tuple.getNtriple());
logger.info("String_Node_Str" + tuple.getGraphURL());
}
break;
case "String_Node_Str":
HashMap<String,String> patterns=null;
if (object instanceof HashMap<?,?>) patterns=(HashMap<String,String>)object;
sensorManager.updateGraph(patterns.get("String_Node_Str"),patterns.get("String_Node_Str"),patterns.get("String_Node_Str"));
default :
break;
}
}
 catch (Exception e) {
logger.error("String_Node_Str",e);
result=e.toString();
}
return result;
}