Program: 6580
Project: 6580
Buggy source:
/** 
 * Create an AttributeContainer.Restriction object according to the restrictions, which are set in the provided type object. This way we can add restrictions to a container class and take them into account, when we do the source code write-out.
 * @param type FSimpleType object (may be restricted)
 * @return Restriction object for AttributeContainer
 */
private AttributeContainer.Restriction createRestrictions(final FSimpleType type){
  AttributeContainer.Restriction restrictions=new AttributeContainer.Restriction();
  FSchemaRestrictions schemaRestrictions=type.getRestrictions();
  List<Integer> validFacets=type.getValidFacets();
  for (  Integer facet : validFacets) {
switch (facet) {
case SchemaType.FACET_LENGTH:
      if (schemaRestrictions.hasRestriction(facet)) {
        restrictions.length=schemaRestrictions.getStringValue(facet);
      }
    break;
case SchemaType.FACET_MIN_LENGTH:
  if (schemaRestrictions.hasRestriction(facet)) {
    restrictions.minLength=schemaRestrictions.getStringValue(facet);
  }
break;
case SchemaType.FACET_MAX_LENGTH:
if (schemaRestrictions.hasRestriction(facet)) {
restrictions.maxLength=schemaRestrictions.getStringValue(facet);
}
break;
case SchemaType.FACET_MIN_INCLUSIVE:
if (schemaRestrictions.hasRestriction(facet)) {
restrictions.minInclusive=schemaRestrictions.getStringValue(facet);
}
break;
case SchemaType.FACET_MAX_INCLUSIVE:
if (schemaRestrictions.hasRestriction(facet)) {
restrictions.maxInclusive=schemaRestrictions.getStringValue(facet);
}
break;
case SchemaType.FACET_MIN_EXCLUSIVE:
if (schemaRestrictions.hasRestriction(facet)) {
restrictions.minExclusive=schemaRestrictions.getStringValue(facet);
}
break;
case SchemaType.FACET_MAX_EXCLUSIVE:
if (schemaRestrictions.hasRestriction(facet)) {
restrictions.maxExclusive=schemaRestrictions.getStringValue(facet);
}
break;
case SchemaType.FACET_PATTERN:
if (schemaRestrictions.hasRestriction(facet)) {
restrictions.pattern=schemaRestrictions.getStringValue(facet);
}
break;
case SchemaType.FACET_WHITE_SPACE:
if (schemaRestrictions.hasRestriction(facet)) {
restrictions.whiteSpace=this.translateWhiteSpaceRestriction(schemaRestrictions.getIntegerValue(facet));
}
break;
case SchemaType.FACET_TOTAL_DIGITS:
if (schemaRestrictions.hasRestriction(facet)) {
restrictions.totalDigits=schemaRestrictions.getStringValue(facet);
}
break;
case SchemaType.FACET_FRACTION_DIGITS:
if (schemaRestrictions.hasRestriction(facet)) {
restrictions.fractionDigits=schemaRestrictions.getStringValue(facet);
}
break;
default :
break;
}
}
return restrictions;
}

Fixed version (ground truth):
/** 
 * Create an AttributeContainer.Restriction object according to the restrictions, which are set in the provided type object. This way we can add restrictions to a container class and take them into account, when we do the source code write-out.
 * @param type FSimpleType object (may be restricted)
 * @return Restriction object for AttributeContainer
 */
private AttributeContainer.Restriction createRestrictions(final FSimpleType type){
  AttributeContainer.Restriction restrictions=new AttributeContainer.Restriction();
  FSchemaRestrictions schemaRestrictions=type.getRestrictions();
  List<Integer> validFacets=type.getValidFacets();
  for (  Integer facet : validFacets) {
switch (facet) {
case SchemaType.FACET_LENGTH:
      if (schemaRestrictions.hasRestriction(facet)) {
        restrictions.length=schemaRestrictions.getStringValue(facet);
      }
    break;
case SchemaType.FACET_MIN_LENGTH:
  if (schemaRestrictions.hasRestriction(facet)) {
    restrictions.minLength=schemaRestrictions.getStringValue(facet);
  }
break;
case SchemaType.FACET_MAX_LENGTH:
if (schemaRestrictions.hasRestriction(facet)) {
restrictions.maxLength=schemaRestrictions.getStringValue(facet);
}
break;
case SchemaType.FACET_MIN_INCLUSIVE:
if (schemaRestrictions.hasRestriction(facet)) {
restrictions.minInclusive=schemaRestrictions.getStringValue(facet);
}
break;
case SchemaType.FACET_MAX_INCLUSIVE:
if (schemaRestrictions.hasRestriction(facet)) {
restrictions.maxInclusive=schemaRestrictions.getStringValue(facet);
}
break;
case SchemaType.FACET_MIN_EXCLUSIVE:
if (schemaRestrictions.hasRestriction(facet)) {
restrictions.minExclusive=schemaRestrictions.getStringValue(facet);
}
break;
case SchemaType.FACET_MAX_EXCLUSIVE:
if (schemaRestrictions.hasRestriction(facet)) {
restrictions.maxExclusive=schemaRestrictions.getStringValue(facet);
}
break;
case SchemaType.FACET_PATTERN:
if (schemaRestrictions.hasRestriction(facet)) {
restrictions.pattern=schemaRestrictions.getStringValue(facet);
}
break;
case SchemaType.FACET_WHITE_SPACE:
if (schemaRestrictions.hasRestriction(facet)) {
restrictions.whiteSpace=this.translateWhiteSpaceRestriction(schemaRestrictions.getStringValue(facet));
}
break;
case SchemaType.FACET_TOTAL_DIGITS:
if (schemaRestrictions.hasRestriction(facet)) {
restrictions.totalDigits=schemaRestrictions.getStringValue(facet);
}
break;
case SchemaType.FACET_FRACTION_DIGITS:
if (schemaRestrictions.hasRestriction(facet)) {
restrictions.fractionDigits=schemaRestrictions.getStringValue(facet);
}
break;
default :
break;
}
}
return restrictions;
}