Program: 180306
Project: 180306
Buggy source:
@Override public InitialSampling getObject(Node source) throws XMLFormatException {
  if (!source.getNodeName().equals(INITIAL_SAMPLING_NAME)) {
    throw new XMLFormatException("String_Node_Str" + INITIAL_SAMPLING_NAME + "String_Node_Str"+ source.getNodeName()+ "String_Node_Str");
  }
  Map<String,Integer> varSampling=new HashMap<>();
  Map<String,Integer> paramSampling=new HashMap<>();
  Collection<Expression> toRelease=new ArrayList<>();
  NodeList children=source.getChildNodes();
  for (int i=0; i < children.getLength(); i++) {
    Node child=children.item(i);
switch (child.getNodeName()) {
case VARIABLE_NAME:
{
        int s=Integer.parseInt(child.getAttributes().getNamedItem(ATTRIBUTE_SAMPLING).getTextContent());
        String name=child.getAttributes().getNamedItem(ATTRIBUTE_NAME).getTextContent();
        varSampling.put(name,s);
        break;
      }
case PARAMETER_NAME:
{
      int s=Integer.parseInt(child.getAttributes().getNamedItem(ATTRIBUTE_SAMPLING).getTextContent());
      String name=child.getAttributes().getNamedItem(ATTRIBUTE_NAME).getTextContent();
      paramSampling.put(name,s);
      toRelease.add(odeSystem.getAvailableParameters().get(name));
      break;
    }
default :
  throw new XMLFormatException("String_Node_Str" + child.getNodeName());
}
}
OdeSystem releasedOdeSystem=odeSystem.release(toRelease);
int[] sampling=new int[releasedOdeSystem.dimension()];
for (int dim=0; dim < releasedOdeSystem.dimension(); dim++) {
if (releasedOdeSystem.isVariable(dim)) {
Variable var=releasedOdeSystem.getVariable(dim);
sampling[dim]=varSampling.containsKey(var.getName()) ? varSampling.get(var.getName()) : 1;
}
 else {
Parameter param=releasedOdeSystem.getParameter(dim);
sampling[dim]=paramSampling.containsKey(param.getName()) ? paramSampling.get(param.getName()) : 1;
}
}
return new ArrayInitialSampling(releasedOdeSystem,sampling);
}

Fixed version (ground truth):
@Override public InitialSampling getObject(Node source) throws XMLFormatException {
  if (!source.getNodeName().equals(INITIAL_SAMPLING_NAME)) {
    throw new XMLFormatException("String_Node_Str" + INITIAL_SAMPLING_NAME + "String_Node_Str"+ source.getNodeName()+ "String_Node_Str");
  }
  Map<String,Integer> varSampling=new HashMap<>();
  Map<String,Integer> paramSampling=new HashMap<>();
  Collection<Expression> toRelease=new ArrayList<>();
  NodeList children=source.getChildNodes();
  for (int i=0; i < children.getLength(); i++) {
    Node child=children.item(i);
switch (child.getNodeName()) {
case VARIABLE_NAME:
{
        int s=Integer.parseInt(child.getAttributes().getNamedItem(ATTRIBUTE_SAMPLING).getTextContent());
        String name=child.getAttributes().getNamedItem(ATTRIBUTE_NAME).getTextContent();
        varSampling.put(name,s);
        break;
      }
case PARAMETER_NAME:
{
      int s=Integer.parseInt(child.getAttributes().getNamedItem(ATTRIBUTE_SAMPLING).getTextContent());
      String name=child.getAttributes().getNamedItem(ATTRIBUTE_NAME).getTextContent();
      paramSampling.put(name,s);
      Parameter parameter=odeSystem.getAvailableParameters().get(name);
      if (parameter.isSubstituted()) {
        toRelease.add(odeSystem.getAvailableParameters().get(name));
      }
      break;
    }
default :
  throw new XMLFormatException("String_Node_Str" + child.getNodeName());
}
}
OdeSystem releasedOdeSystem=odeSystem.release(toRelease);
int[] sampling=new int[releasedOdeSystem.dimension()];
for (int dim=0; dim < releasedOdeSystem.dimension(); dim++) {
if (releasedOdeSystem.isVariable(dim)) {
Variable var=releasedOdeSystem.getVariable(dim);
sampling[dim]=varSampling.containsKey(var.getName()) ? varSampling.get(var.getName()) : 1;
}
 else {
Parameter param=releasedOdeSystem.getParameter(dim);
sampling[dim]=paramSampling.containsKey(param.getName()) ? paramSampling.get(param.getName()) : 1;
}
}
return new ArrayInitialSampling(releasedOdeSystem,sampling);
}