Program: 92251
Project: 92251
Buggy source:
/** 
 * Computes all transient fields (  {@link #assignableTo},   {@link #byName},   {@link #indices},   {@link #isSimple}). <p>As a side effect, this method checks for missing or duplicated names.</p>
 * @throws IllegalArgumentException if two properties have the same name.
 */
private void computeTransientFields(){
  final int capacity=Containers.hashMapCapacity(properties.size());
  byName=new LinkedHashMap<>(capacity);
  indices=new HashMap<>(capacity);
  assignableTo=new HashSet<>(4);
  assignableTo.add(getName());
  scanPropertiesFrom(this);
  byName=compact(byName);
  assignableTo=CollectionsExt.unmodifiableOrCopy(assignableTo);
  allProperties=byName.values();
  if (byName instanceof HashMap<?,?>) {
    allProperties=Collections.unmodifiableCollection(allProperties);
  }
  isSimple=true;
  int mandatory=0;
  for (  final Map.Entry<String,PropertyType> entry : byName.entrySet()) {
    final int minimumOccurs, maximumOccurs;
    final PropertyType property=entry.getValue();
    if (property instanceof DefaultAttributeType<?>) {
      minimumOccurs=((DefaultAttributeType<?>)property).getMinimumOccurs();
      maximumOccurs=((DefaultAttributeType<?>)property).getMaximumOccurs();
      isSimple&=(minimumOccurs == maximumOccurs);
    }
 else     if (property instanceof FieldType) {
      minimumOccurs=((FieldType)property).getMinimumOccurs();
      maximumOccurs=((FieldType)property).getMaximumOccurs();
      isSimple=false;
    }
 else {
      continue;
    }
    if (maximumOccurs != 0) {
      isSimple&=(maximumOccurs == 1);
      indices.put(entry.getKey(),indices.size());
      if (minimumOccurs != 0) {
        mandatory++;
      }
    }
  }
  indices=compact(indices);
  final int n=indices.size();
  isSparse=(n > 24) && (mandatory <= n / 2);
}

Fixed version (ground truth):
/** 
 * Computes all transient fields (  {@link #assignableTo},   {@link #byName},   {@link #indices},   {@link #isSimple}). <p>As a side effect, this method checks for missing or duplicated names.</p>
 * @throws IllegalArgumentException if two properties have the same name.
 */
private void computeTransientFields(){
  final int capacity=Containers.hashMapCapacity(properties.size());
  byName=new LinkedHashMap<>(capacity);
  indices=new LinkedHashMap<>(capacity);
  assignableTo=new HashSet<>(4);
  assignableTo.add(getName());
  scanPropertiesFrom(this);
  byName=compact(byName);
  assignableTo=CollectionsExt.unmodifiableOrCopy(assignableTo);
  allProperties=byName.values();
  if (byName instanceof HashMap<?,?>) {
    allProperties=Collections.unmodifiableCollection(allProperties);
  }
  isSimple=true;
  int mandatory=0;
  for (  final Map.Entry<String,PropertyType> entry : byName.entrySet()) {
    final int minimumOccurs, maximumOccurs;
    final PropertyType property=entry.getValue();
    if (property instanceof DefaultAttributeType<?>) {
      minimumOccurs=((DefaultAttributeType<?>)property).getMinimumOccurs();
      maximumOccurs=((DefaultAttributeType<?>)property).getMaximumOccurs();
      isSimple&=(minimumOccurs == maximumOccurs);
    }
 else     if (property instanceof FieldType) {
      minimumOccurs=((FieldType)property).getMinimumOccurs();
      maximumOccurs=((FieldType)property).getMaximumOccurs();
      isSimple=false;
    }
 else {
      continue;
    }
    if (maximumOccurs != 0) {
      isSimple&=(maximumOccurs == 1);
      indices.put(entry.getKey(),indices.size());
      if (minimumOccurs != 0) {
        mandatory++;
      }
    }
  }
  indices=compact(indices);
  final int n=indices.size();
  isSparse=(n > 24) && (mandatory <= n / 2);
}