Program: 10131
Project: 10131
Buggy source:
@WebMethod public String[] getNegativeExamples(int sessionID,int componentID,String[] positives,int results,String namespace,String[] filterClasses) throws ClientNotKnownException {
  int sparqlResultSetLimit=500;
  SortedSet<String> positiveSet=new TreeSet<String>(Arrays.asList(positives));
  SortedSet<String> filterSet=new TreeSet<String>(Arrays.asList(filterClasses));
  ClientState state=getState(sessionID);
  Component component=state.getComponent(componentID);
  SparqlKnowledgeSource ks=(SparqlKnowledgeSource)component;
  SPARQLTasks task=ks.getSPARQLTasks();
  AutomaticNegativeExampleFinderSPARQL finder=new AutomaticNegativeExampleFinderSPARQL(positiveSet,task,filterSet);
  finder.makeNegativeExamplesFromNearbyClasses(positiveSet,sparqlResultSetLimit);
  SortedSet<String> negExamples=finder.getNegativeExamples(results);
  if (negExamples.isEmpty()) {
    finder.makeNegativeExamplesFromParallelClasses(positiveSet,sparqlResultSetLimit);
    negExamples=finder.getNegativeExamples(results);
    if (negExamples.isEmpty()) {
      finder.makeNegativeExamplesFromRelatedInstances(positiveSet,namespace);
      negExamples=finder.getNegativeExamples(results);
      if (negExamples.isEmpty()) {
        finder.makeNegativeExamplesFromSuperClassesOfInstances(positiveSet,sparqlResultSetLimit);
        negExamples=finder.getNegativeExamples(results);
        if (negExamples.isEmpty()) {
          finder.makeNegativeExamplesFromRandomInstances();
          negExamples=finder.getNegativeExamples(results);
        }
      }
    }
  }
  return negExamples.toArray(new String[negExamples.size()]);
}

Fixed version (ground truth):
@WebMethod public String[] getNegativeExamples(int sessionID,int componentID,String[] positives,int results,String namespace,String[] filterClasses) throws ClientNotKnownException {
  System.out.println(filterClasses.length);
  int sparqlResultSetLimit=500;
  SortedSet<String> positiveSet=new TreeSet<String>(Arrays.asList(positives));
  SortedSet<String> filterSet=new TreeSet<String>(Arrays.asList(filterClasses));
  ClientState state=getState(sessionID);
  Component component=state.getComponent(componentID);
  SparqlKnowledgeSource ks=(SparqlKnowledgeSource)component;
  SPARQLTasks task=ks.getSPARQLTasks();
  AutomaticNegativeExampleFinderSPARQL finder=new AutomaticNegativeExampleFinderSPARQL(positiveSet,task,filterSet);
  finder.makeNegativeExamplesFromNearbyClasses(positiveSet,sparqlResultSetLimit);
  SortedSet<String> negExamples=finder.getNegativeExamples(results);
  if (negExamples.isEmpty()) {
    finder.makeNegativeExamplesFromParallelClasses(positiveSet,sparqlResultSetLimit);
    negExamples=finder.getNegativeExamples(results);
    if (negExamples.isEmpty()) {
      finder.makeNegativeExamplesFromRelatedInstances(positiveSet,namespace);
      negExamples=finder.getNegativeExamples(results);
      if (negExamples.isEmpty()) {
        finder.makeNegativeExamplesFromSuperClassesOfInstances(positiveSet,sparqlResultSetLimit);
        negExamples=finder.getNegativeExamples(results);
        if (negExamples.isEmpty()) {
          finder.makeNegativeExamplesFromRandomInstances();
          negExamples=finder.getNegativeExamples(results);
        }
      }
    }
  }
  return negExamples.toArray(new String[negExamples.size()]);
}