nus-yam/ex-repair huggingface dataset:
Program: 92211
Project: 92211
Buggy source:
/** 
 * Returns the scope to which the metadata applies.
 * @return Scope to which the metadata applies.
 * @deprecated As of ISO 19115:2014, replaced by {@link #getMetadataScopes()}followed by   {@link DefaultMetadataScope#getResourceScope()}.
 */
@Override @Deprecated @XmlElement(name="String_Node_Str") public final Collection<ScopeCode> getHierarchyLevels(){
  return new ScopeAdapter<ScopeCode>(getMetadataScopes()){
    /** 
 * Stores a legacy value into the new kind of value. 
 */
    @Override protected MetadataScope wrap(    final ScopeCode value){
      return new DefaultMetadataScope(value);
    }
    /** 
 * Extracts the legacy value from the new kind of value. 
 */
    @Override protected ScopeCode unwrap(    final MetadataScope container){
      return container.getResourceScope();
    }
    /** 
 * Updates the legacy value in an existing instance of the new kind of value. 
 */
    @Override protected boolean update(    final MetadataScope container,    final ScopeCode value){
      if (container instanceof DefaultMetadataScope) {
        ((DefaultMetadataScope)container).setResourceScope(value);
        return true;
      }
      return false;
    }
  }
.validOrNull();
}

Fixed version (ground truth):
/** 
 * Returns the scope to which the metadata applies.
 * @return Scope to which the metadata applies.
 * @deprecated As of ISO 19115:2014, replaced by {@link #getMetadataScopes()}followed by   {@link DefaultMetadataScope#getResourceScope()}.
 */
@Override @Deprecated @XmlElement(name="String_Node_Str") public final Collection<ScopeCode> getHierarchyLevels(){
  return new MetadataScopeAdapter<ScopeCode>(getMetadataScopes()){
    /** 
 * Stores a legacy value into the new kind of value. 
 */
    @Override protected MetadataScope wrap(    final ScopeCode value){
      return new DefaultMetadataScope(value);
    }
    /** 
 * Extracts the legacy value from the new kind of value. 
 */
    @Override protected ScopeCode unwrap(    final MetadataScope container){
      return container.getResourceScope();
    }
    /** 
 * Updates the legacy value in an existing instance of the new kind of value. 
 */
    @Override protected boolean update(    final MetadataScope container,    final ScopeCode value){
      if (container instanceof DefaultMetadataScope) {
        ((DefaultMetadataScope)container).setResourceScope(value);
        return true;
      }
      return false;
    }
  }
.validOrNull();
}
Program: 92212
Project: 92212
Buggy source:
/** 
 * Returns the name of the hierarchy levels for which the metadata is provided.
 * @return Hierarchy levels for which the metadata is provided.
 * @deprecated As of ISO 19115:2014, replaced by {@link #getMetadataScopes()}followed by   {@link DefaultMetadataScope#getName()}.
 */
@Override @Deprecated @XmlElement(name="String_Node_Str") public final Collection<String> getHierarchyLevelNames(){
  return new ScopeAdapter<String>(getMetadataScopes()){
    /** 
 * Stores a legacy value into the new kind of value. 
 */
    @Override protected MetadataScope wrap(    final String value){
      final DefaultMetadataScope scope=new DefaultMetadataScope();
      scope.setName(new SimpleInternationalString(value));
      return scope;
    }
    /** 
 * Extracts the legacy value from the new kind of value. 
 */
    @Override protected String unwrap(    final MetadataScope container){
      final InternationalString name=container.getName();
      return (name != null) ? name.toString() : null;
    }
    /** 
 * Updates the legacy value in an existing instance of the new kind of value. 
 */
    @Override protected boolean update(    final MetadataScope container,    final String value){
      if (container instanceof DefaultMetadataScope) {
        ((DefaultMetadataScope)container).setName(new SimpleInternationalString(value));
        return true;
      }
      return false;
    }
  }
.validOrNull();
}

Fixed version (ground truth):
/** 
 * Returns the name of the hierarchy levels for which the metadata is provided.
 * @return Hierarchy levels for which the metadata is provided.
 * @deprecated As of ISO 19115:2014, replaced by {@link #getMetadataScopes()}followed by   {@link DefaultMetadataScope#getName()}.
 */
@Override @Deprecated @XmlElement(name="String_Node_Str") public final Collection<String> getHierarchyLevelNames(){
  return new MetadataScopeAdapter<String>(getMetadataScopes()){
    /** 
 * Stores a legacy value into the new kind of value. 
 */
    @Override protected MetadataScope wrap(    final String value){
      final DefaultMetadataScope scope=new DefaultMetadataScope();
      scope.setName(new SimpleInternationalString(value));
      return scope;
    }
    /** 
 * Extracts the legacy value from the new kind of value. 
 */
    @Override protected String unwrap(    final MetadataScope container){
      final InternationalString name=container.getName();
      return (name != null) ? name.toString() : null;
    }
    /** 
 * Updates the legacy value in an existing instance of the new kind of value. 
 */
    @Override protected boolean update(    final MetadataScope container,    final String value){
      if (container instanceof DefaultMetadataScope) {
        ((DefaultMetadataScope)container).setName(value != null ? new SimpleInternationalString(value) : null);
        return true;
      }
      return false;
    }
  }
.validOrNull();
}
Program: 92213
Project: 92213
Buggy source:
/** 
 * Updates the legacy value in an existing instance of the new kind of value. 
 */
@Override protected boolean update(final MetadataScope container,final String value){
  if (container instanceof DefaultMetadataScope) {
    ((DefaultMetadataScope)container).setName(new SimpleInternationalString(value));
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Updates the legacy value in an existing instance of the new kind of value. 
 */
@Override protected boolean update(final MetadataScope container,final String value){
  if (container instanceof DefaultMetadataScope) {
    ((DefaultMetadataScope)container).setName(value != null ? new SimpleInternationalString(value) : null);
    return true;
  }
  return false;
}
Program: 92214
Project: 92214
Buggy source:
/** 
 * Returns the feature instances to which the information applies. <div class="note"><b>Example:</b> If a new bridge is constructed in a road network, the change can be recorded at   {@link ScopeCode#FEATURE} level with a“<cite>Administrative area A — New bridge</cite>” description. </div>
 * @return Feature instances to which the information applies.{@section Conditions}This method returns a modifiable collection only if no other property is set. Otherwise, this method returns an unmodifiable empty collection.
 */
@Override public Set<CharSequence> getFeatureInstances(){
  return getProperty(FEATURE_INSTANCES);
}

Fixed version (ground truth):
/** 
 * Returns the feature instances to which the information applies. <div class="note"><b>Example:</b> If a new bridge is constructed in a road network, the change can be recorded at   {@link ScopeCode#FEATURE} level with a“<cite>Administrative area A — New bridge</cite>” description. </div> {@section Conditions}This method returns a modifiable collection only if no other property is set. Otherwise, this method returns an unmodifiable empty collection.
 * @return Feature instances to which the information applies.
 */
@Override public Set<CharSequence> getFeatureInstances(){
  return getProperty(FEATURE_INSTANCES);
}
Program: 92215
Project: 92215
Buggy source:
/** 
 * Returns the attribute types to which the information applies. <div class="note"><b>Example:</b> If an administrative area detects an anomaly in all overhead clearance of the road survey, the correction can be recorded at   {@link ScopeCode#ATTRIBUTE_TYPE} level with a“<cite>Administrative area A — Overhead clearance</cite>” description. </div>
 * @return Attribute types to which the information applies.{@section Conditions}This method returns a modifiable collection only if no other property is set. Otherwise, this method returns an unmodifiable empty collection.
 */
@Override public Set<CharSequence> getAttributes(){
  return getProperty(ATTRIBUTES);
}

Fixed version (ground truth):
/** 
 * Returns the attribute types to which the information applies. <div class="note"><b>Example:</b> If an administrative area detects an anomaly in all overhead clearance of the road survey, the correction can be recorded at   {@link ScopeCode#ATTRIBUTE_TYPE} level with a“<cite>Administrative area A — Overhead clearance</cite>” description. </div> {@section Conditions}This method returns a modifiable collection only if no other property is set. Otherwise, this method returns an unmodifiable empty collection.
 * @return Attribute types to which the information applies.
 */
@Override public Set<CharSequence> getAttributes(){
  return getProperty(ATTRIBUTES);
}
Program: 92216
Project: 92216
Buggy source:
/** 
 * Returns the feature types to which the information applies. <div class="note"><b>Example:</b> If an administrative area performs a complete re-survey of the road network, the change can be recorded at   {@link ScopeCode#FEATURE_TYPE} level with a“<cite>Administrative area A — Road network</cite>” description. </div>
 * @return Feature types to which the information applies.{@section Conditions}This method returns a modifiable collection only if no other property is set. Otherwise, this method returns an unmodifiable empty collection.
 */
@Override public Set<CharSequence> getFeatures(){
  return getProperty(FEATURES);
}

Fixed version (ground truth):
/** 
 * Returns the feature types to which the information applies. <div class="note"><b>Example:</b> If an administrative area performs a complete re-survey of the road network, the change can be recorded at   {@link ScopeCode#FEATURE_TYPE} level with a“<cite>Administrative area A — Road network</cite>” description. </div> {@section Conditions}This method returns a modifiable collection only if no other property is set. Otherwise, this method returns an unmodifiable empty collection.
 * @return Feature types to which the information applies.
 */
@Override public Set<CharSequence> getFeatures(){
  return getProperty(FEATURES);
}
Program: 92217
Project: 92217
Buggy source:
/** 
 * Returns the attribute instances to which the information applies. <div class="note"><b>Example:</b> If the overhead clearance of a new bridge was wrongly recorded, the correction can be recorded at   {@link ScopeCode#ATTRIBUTE} level with a“<cite>Administrative area A — New bridge — Overhead clearance</cite>” description. </div>
 * @return Attribute instances to which the information applies.{@section Conditions}This method returns a modifiable collection only if no other property is set. Otherwise, this method returns an unmodifiable empty collection.
 */
@Override public Set<CharSequence> getAttributeInstances(){
  return getProperty(ATTRIBUTE_INSTANCES);
}

Fixed version (ground truth):
/** 
 * Returns the attribute instances to which the information applies. <div class="note"><b>Example:</b> If the overhead clearance of a new bridge was wrongly recorded, the correction can be recorded at   {@link ScopeCode#ATTRIBUTE} level with a“<cite>Administrative area A — New bridge — Overhead clearance</cite>” description. </div> {@section Conditions}This method returns a modifiable collection only if no other property is set. Otherwise, this method returns an unmodifiable empty collection.
 * @return Attribute instances to which the information applies.
 */
@Override public Set<CharSequence> getAttributeInstances(){
  return getProperty(ATTRIBUTE_INSTANCES);
}
Program: 92218
Project: 92218
Buggy source:
/** 
 * Returns scoped identifier of the resource in the context of the given service instance.
 * @return identifier of the resource, or {@code null} if none.
 */
@Override @XmlElement(name="String_Node_Str") public ScopedName getScopedName(){
  return scopedName;
}

Fixed version (ground truth):
/** 
 * Returns scoped identifier of the resource in the context of the given service instance.
 * @return identifier of the resource, or {@code null} if none.
 */
@Override @XmlElementRef @XmlJavaTypeAdapter(GO_ScopedName.class) public ScopedName getScopedName(){
  return scopedName;
}
Program: 92219
Project: 92219
Buggy source:
/** 
 * Returns the tightly coupled resources.
 * @return tightly coupled resources.
 */
@Override @XmlElement(name="String_Node_Str") public Collection<DataIdentification> getResources(){
  return resources=nonNullCollection(resources,DataIdentification.class);
}

Fixed version (ground truth):
/** 
 * Returns the tightly coupled resources.
 * @return tightly coupled resources.
 */
@Override public Collection<DataIdentification> getResources(){
  return resources=nonNullCollection(resources,DataIdentification.class);
}
Program: 92220
Project: 92220
Buggy source:
/** 
 * Returns the service operation.
 * @return The service operation, or {@code null} if none.
 */
@Override @XmlElement(name="String_Node_Str") public OperationMetadata getOperation(){
  return operation;
}

Fixed version (ground truth):
/** 
 * Returns the service operation.
 * @return The service operation, or {@code null} if none.
 */
@Override public OperationMetadata getOperation(){
  return operation;
}
Program: 92221
Project: 92221
Buggy source:
/** 
 * Returns references to the resource on which the services operates.
 * @return References to the resource on which the services operates.
 */
@Override @XmlElement(name="String_Node_Str") public Collection<Citation> getResourceReferences(){
  return resourceReferences=nonNullCollection(resourceReferences,Citation.class);
}

Fixed version (ground truth):
/** 
 * Returns references to the resource on which the services operates.
 * @return References to the resource on which the services operates.
 */
@Override public Collection<Citation> getResourceReferences(){
  return resourceReferences=nonNullCollection(resourceReferences,Citation.class);
}
Program: 92222
Project: 92222
Buggy source:
/** 
 * Sets the parameters that are required for this interface.
 * @param newValues The new set of parameters that are required for this interface.
 */
public void setParameters(final Set<? extends Parameter> newValues){
  parameters=writeSet(newValues,parameters,Parameter.class);
}

Fixed version (ground truth):
/** 
 * Sets the parameters that are required for this interface.
 * @param newValues The new set of parameters that are required for this interface.
 */
public void setParameters(final Collection<? extends Parameter> newValues){
  parameters=writeCollection(newValues,parameters,Parameter.class);
}
Program: 92223
Project: 92223
Buggy source:
/** 
 * Returns the parameters that are required for this interface.
 * @return The parameters that are required for this interface, or an empty collection if none.
 */
@Override @XmlElement(name="String_Node_Str") public Set<Parameter> getParameters(){
  return parameters=nonNullSet(parameters,Parameter.class);
}

Fixed version (ground truth):
/** 
 * Returns the parameters that are required for this interface.
 * @return The parameters that are required for this interface, or an empty collection if none.
 */
@Override @XmlElement(name="String_Node_Str") public Collection<Parameter> getParameters(){
  return parameters=nonNullCollection(parameters,Parameter.class);
}
Program: 92224
Project: 92224
Buggy source:
/** 
 * Wraps the given value.
 * @param e The value to wrap.
 * @return The wrapped value.
 */
@Override public final SV_ParameterDirection marshal(final ParameterDirection e){
  final SV_ParameterDirection wrapper=new SV_ParameterDirection();
  wrapper.value=value(e);
  return wrapper;
}

Fixed version (ground truth):
/** 
 * Wraps the given value.
 * @param e The value to wrap.
 * @return The wrapped value.
 */
@Override public final SV_ParameterDirection marshal(final ParameterDirection e){
  if (e == null) {
    return null;
  }
  final SV_ParameterDirection wrapper=new SV_ParameterDirection();
  wrapper.value=value(e);
  return wrapper;
}
Program: 92225
Project: 92225
Buggy source:
/** 
 * Wraps the given value.
 * @param e The value to wrap.
 * @return The wrapped value.
 */
@Override public final SV_ParameterDirection marshal(final ParameterDirection e){
  final SV_ParameterDirection wrapper=new SV_ParameterDirection();
  wrapper.value=value(e);
  return wrapper;
}

Fixed version (ground truth):
/** 
 * Wraps the given value.
 * @param e The value to wrap.
 * @return The wrapped value.
 */
@Override public final SV_ParameterDirection marshal(final ParameterDirection e){
  if (e == null) {
    return null;
  }
  final SV_ParameterDirection wrapper=new SV_ParameterDirection();
  wrapper.value=value(e);
  return wrapper;
}
Program: 92226
Project: 92226
Buggy source:
/** 
 * Invoked by JAXB on marshalling.
 * @return The value to be marshalled.
 */
@Override @XmlElement(name="String_Node_Str") public CodeListProxy getElement(){
  return proxy;
}

Fixed version (ground truth):
/** 
 * Invoked by JAXB on marshalling.
 * @return The value to be marshalled.
 */
@Override @XmlElement(name="String_Node_Str",namespace=Namespaces.SRV) public CodeListProxy getElement(){
  return proxy;
}
Program: 92227
Project: 92227
Buggy source:
/** 
 * Invoked by JAXB on marshalling.
 * @return The value to be marshalled.
 */
@Override @XmlElement(name="String_Node_Str") public CodeListProxy getElement(){
  return proxy;
}

Fixed version (ground truth):
/** 
 * Invoked by JAXB on marshalling.
 * @return The value to be marshalled.
 */
@Override @XmlElement(name="String_Node_Str",namespace=Namespaces.SRV) public CodeListProxy getElement(){
  return proxy;
}
Program: 92228
Project: 92228
Buggy source:
/** 
 * Tries to append a small unit of information like number, date, boolean, code list, character string or an array of those. The key difference between this method and   {@link #appendElement(Object)} isthat the values formatted by this  {@code appendValue(Object)} method do not have keyword.
 * @return {@code true} on success, or {@code false} if the given type is not recognized.
 */
final boolean appendValue(final Object value){
  if (value.getClass().isArray()) {
    appendSeparator();
    buffer.appendCodePoint(symbols.getOpenSequence());
    final int length=Array.getLength(value);
    for (int i=0; i < length; i++) {
      appendAny(Array.get(value,i));
    }
    buffer.appendCodePoint(symbols.getCloseSequence());
  }
 else   if (value instanceof Number) {
    final Number number=(Number)value;
    if (Numbers.isInteger(number.getClass())) {
      append(number.longValue());
    }
 else {
      append(number.doubleValue());
    }
  }
 else   if (value instanceof CodeList<?>)   append((CodeList<?>)value);
 else   if (value instanceof Date)   append((Date)value);
 else   if (value instanceof Boolean)   append((Boolean)value);
 else   if (value instanceof CharSequence) {
    append((value instanceof InternationalString) ? ((InternationalString)value).toString(locale) : value.toString(),null);
  }
 else {
    return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Tries to append a small unit of information like number, date, boolean, code list, character string or an array of those. The key difference between this method and   {@link #appendElement(Object)} isthat the values formatted by this  {@code appendValue(Object)} method do not have keyword.
 * @return {@code true} on success, or {@code false} if the given type is not recognized.
 */
final boolean appendValue(final Object value){
  if (value.getClass().isArray()) {
    appendSeparator();
    buffer.appendCodePoint(symbols.getOpenSequence());
    final int length=Array.getLength(value);
    for (int i=0; i < length; i++) {
      appendAny(Array.get(value,i));
    }
    buffer.appendCodePoint(symbols.getCloseSequence());
  }
 else   if (value instanceof Number) {
    final Number number=(Number)value;
    if (Numbers.isInteger(number.getClass())) {
      append(number.longValue());
    }
 else {
      append(number.doubleValue());
    }
  }
 else   if (value instanceof Enumerated)   append((Enumerated)value);
 else   if (value instanceof Date)   append((Date)value);
 else   if (value instanceof Boolean)   append((Boolean)value);
 else   if (value instanceof CharSequence) {
    append((value instanceof InternationalString) ? ((InternationalString)value).toString(locale) : value.toString(),null);
  }
 else {
    return false;
  }
  return true;
}
Program: 92230
Project: 92230
Buggy source:
/** 
 * Returns the parameters that are required for this interface.
 * @return The parameters that are required for this interface, or an empty collection if none.
 */
@Override @XmlElement(name="String_Node_Str") public Set<Parameter> getParameters(){
  return nonNullSet(parameters,Parameter.class);
}

Fixed version (ground truth):
/** 
 * Returns the parameters that are required for this interface.
 * @return The parameters that are required for this interface, or an empty collection if none.
 */
@Override @XmlElement(name="String_Node_Str") public Set<Parameter> getParameters(){
  return parameters=nonNullSet(parameters,Parameter.class);
}
Program: 92231
Project: 92231
Buggy source:
/** 
 * Returns the name, as used by the service for this parameter.
 * @return The name, as used by the service for this parameter.
 */
@Override @XmlElement(name="String_Node_Str",required=true) public MemberName getName(){
  return name;
}

Fixed version (ground truth):
/** 
 * Returns the name, as used by the service for this parameter.
 * @return The name, as used by the service for this parameter.
 */
@Override @XmlJavaTypeAdapter(GO_MemberName.class) @XmlElement(name="String_Node_Str",required=true) public MemberName getName(){
  return name;
}
Program: 92233
Project: 92233
Buggy source:
/** 
 * Adds a new element.
 * @param element The element to add.
 * @return {@code true} if the element has been added.
 */
@Override public boolean add(final L element){
  ArgumentChecks.ensureNonNull("String_Node_Str",element);
  return elements.add(wrap(element));
}

Fixed version (ground truth):
/** 
 * Adds a new element.
 * @param element The element to add.
 * @return {@code true} if the element has been added.
 */
@Override public final boolean add(final L element){
  ArgumentChecks.ensureNonNull("String_Node_Str",element);
  return elements.add(wrap(element));
}
Program: 92234
Project: 92234
Buggy source:
/** 
 * Returns the next element. 
 */
@Override public L next(){
  L n=next;
  if (n == null) {
    if (!hasNext()) {
      throw new NoSuchElementException();
    }
    n=next;
  }
  next=null;
  return n;
}

Fixed version (ground truth):
/** 
 * Returns the next element. 
 */
@Override public final L next(){
  L n=next;
  if (n == null) {
    if (!hasNext()) {
      throw new NoSuchElementException();
    }
    n=next;
  }
  next=null;
  return n;
}
Program: 92235
Project: 92235
Buggy source:
/** 
 * Returns an iterator over the legacy elements.
 * @return Iterator over the legacy elements.
 */
@Override public Iterator<L> iterator(){
  final Iterator<N> it=elements.iterator();
  return new Iterator<L>(){
    /** 
 * The next value to return, or   {@code null} if not yet verified. 
 */
    private L next;
    /** 
 * Returns   {@code true} if there is more elements to iterator. 
 */
    @Override public boolean hasNext(){
      if (next != null) {
        return true;
      }
      while (it.hasNext()) {
        next=unwrap(it.next());
        if (next != null) {
          return true;
        }
      }
      return false;
    }
    /** 
 * Returns the next element. 
 */
    @Override public L next(){
      L n=next;
      if (n == null) {
        if (!hasNext()) {
          throw new NoSuchElementException();
        }
        n=next;
      }
      next=null;
      return n;
    }
    /** 
 * Removes the last element returned by   {@link #next()}. 
 */
    @Override public void remove(){
      it.remove();
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Returns an iterator over the legacy elements.
 * @return Iterator over the legacy elements.
 */
@Override public final Iterator<L> iterator(){
  final Iterator<N> it=elements.iterator();
  return new Iterator<L>(){
    /** 
 * The next value to return, or   {@code null} if not yet verified. 
 */
    private L next;
    /** 
 * Returns   {@code true} if there is more elements to iterator. 
 */
    @Override public final boolean hasNext(){
      if (next != null) {
        return true;
      }
      while (it.hasNext()) {
        next=unwrap(it.next());
        if (next != null) {
          return true;
        }
      }
      return false;
    }
    /** 
 * Returns the next element. 
 */
    @Override public final L next(){
      L n=next;
      if (n == null) {
        if (!hasNext()) {
          throw new NoSuchElementException();
        }
        n=next;
      }
      next=null;
      return n;
    }
    /** 
 * Removes the last element returned by   {@link #next()}. 
 */
    @Override public final void remove(){
      it.remove();
    }
  }
;
}
Program: 92236
Project: 92236
Buggy source:
/** 
 * Count the number of non-null elements.
 * @return Number of non-null elements.
 */
@Override public final int size(){
  int count=0;
  final Iterator<L> it=iterator();
  while (it.hasNext()) {
    it.next();
    count++;
  }
  return count;
}

Fixed version (ground truth):
/** 
 * Counts the number of non-null elements.
 * @return Number of non-null elements.
 */
@Override public final int size(){
  int count=0;
  final Iterator<L> it=iterator();
  while (it.hasNext()) {
    it.next();
    count++;
  }
  return count;
}
Program: 92237
Project: 92237
Buggy source:
/** 
 * Returns   {@code true} if there is more elements to iterator. 
 */
@Override public boolean hasNext(){
  if (next != null) {
    return true;
  }
  while (it.hasNext()) {
    next=unwrap(it.next());
    if (next != null) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Returns   {@code true} if there is more elements to iterator. 
 */
@Override public final boolean hasNext(){
  if (next != null) {
    return true;
  }
  while (it.hasNext()) {
    next=unwrap(it.next());
    if (next != null) {
      return true;
    }
  }
  return false;
}
Program: 92238
Project: 92238
Buggy source:
/** 
 * Removes the last element returned by   {@link #next()}. 
 */
@Override public void remove(){
  it.remove();
}

Fixed version (ground truth):
/** 
 * Removes the last element returned by   {@link #next()}. 
 */
@Override public final void remove(){
  it.remove();
}
Program: 92239
Project: 92239
Buggy source:
/** 
 * Returns additional information about the range or extent of the resource.
 * @return Additional information about the range or extent of the resource.
 * @deprecated As of ISO 19115:2014, {@link #getUpdateScopes()} and {@code getUpdateScopeDescriptions()}were combined into   {@link #getMaintenanceScopes()} in order to allow specifying a scopethat includes a spatial and temporal extent.
 */
@Override @Deprecated @XmlElement(name="String_Node_Str") public Collection<ScopeDescription> getUpdateScopeDescriptions(){
  return new LegacyProperties<ScopeDescription,Scope>(getMaintenanceScopes()){
    @Override protected Scope wrap(    final ScopeDescription code){
      final DefaultScope scope=new DefaultScope();
      scope.setLevelDescription(Collections.singleton(code));
      return scope;
    }
    @Override protected ScopeDescription unwrap(    final Scope scope){
      final Iterator<? extends ScopeDescription> i=scope.getLevelDescription().iterator();
      return (i.hasNext()) ? i.next() : null;
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Returns additional information about the range or extent of the resource.
 * @return Additional information about the range or extent of the resource.
 * @deprecated As of ISO 19115:2014, {@link #getUpdateScopes()} and {@code getUpdateScopeDescriptions()}were combined into   {@link #getMaintenanceScopes()} in order to allow specifying a scopethat includes a spatial and temporal extent.
 */
@Override @Deprecated @XmlElement(name="String_Node_Str") public Collection<ScopeDescription> getUpdateScopeDescriptions(){
  return new LegacyProperties<ScopeDescription,Scope>(getMaintenanceScopes()){
    private boolean warningOccurred;
    @Override protected Scope wrap(    final ScopeDescription code){
      final DefaultScope scope=new DefaultScope();
      scope.setLevelDescription(Collections.singleton(code));
      return scope;
    }
    @Override protected ScopeDescription unwrap(    final Scope scope){
      final Iterator<? extends ScopeDescription> it=scope.getLevelDescription().iterator();
      if (!it.hasNext()) {
        return null;
      }
      final ScopeDescription description=it.next();
      if (!warningOccurred && it.hasNext()) {
        warningOccurred=true;
        MetadataUtilities.warning(DefaultMaintenanceInformation.class,"String_Node_Str",Messages.Keys.IgnoredPropertiesAfterFirst_1,ScopeDescription.class);
      }
      return description;
    }
  }
;
}
Program: 92240
Project: 92240
Buggy source:
@Override protected ScopeDescription unwrap(final Scope scope){
  final Iterator<? extends ScopeDescription> i=scope.getLevelDescription().iterator();
  return (i.hasNext()) ? i.next() : null;
}

Fixed version (ground truth):
@Override protected ScopeDescription unwrap(final Scope scope){
  final Iterator<? extends ScopeDescription> it=scope.getLevelDescription().iterator();
  if (!it.hasNext()) {
    return null;
  }
  final ScopeDescription description=it.next();
  if (!warningOccurred && it.hasNext()) {
    warningOccurred=true;
    MetadataUtilities.warning(DefaultMaintenanceInformation.class,"String_Node_Str",Messages.Keys.IgnoredPropertiesAfterFirst_1,ScopeDescription.class);
  }
  return description;
}
Program: 92241
Project: 92241
Buggy source:
/** 
 * Sets the scheduled revision date for resource.
 * @param newValue The new date of next update.
 */
@Deprecated public void setDateOfNextUpdate(final Date newValue){
  if (newValue != null) {
    getMaintenanceDates().add(new DefaultCitationDate(newValue,DateType.NEXT_UPDATE));
  }
}

Fixed version (ground truth):
/** 
 * Sets the scheduled revision date for resource.
 * @param newValue The new date of next update.
 */
@Deprecated public void setDateOfNextUpdate(final Date newValue){
  if (newValue != null) {
    if (maintenanceDates != null) {
      for (      final CitationDate date : maintenanceDates) {
        if (date instanceof DefaultCitationDate && DateType.NEXT_UPDATE.equals(date.getDateType())) {
          ((DefaultCitationDate)date).setDate(newValue);
          return;
        }
      }
    }
    getMaintenanceDates().add(new DefaultCitationDate(newValue,DateType.NEXT_UPDATE));
  }
}
Program: 92242
Project: 92242
Buggy source:
/** 
 * Adds a new element.
 * @param element The element to add.
 * @return {@code true} if the element has been added.
 */
@Override public boolean add(final L element){
  ArgumentChecks.ensureNonNull("String_Node_Str",element);
  return elements.add(wrap(element));
}

Fixed version (ground truth):
/** 
 * Adds a new element.
 * @param element The element to add.
 * @return {@code true} if the element has been added.
 */
@Override public final boolean add(final L element){
  ArgumentChecks.ensureNonNull("String_Node_Str",element);
  return elements.add(wrap(element));
}
Program: 92243
Project: 92243
Buggy source:
/** 
 * Returns the next element. 
 */
@Override public L next(){
  L n=next;
  if (n == null) {
    if (!hasNext()) {
      throw new NoSuchElementException();
    }
    n=next;
  }
  next=null;
  return n;
}

Fixed version (ground truth):
/** 
 * Returns the next element. 
 */
@Override public final L next(){
  L n=next;
  if (n == null) {
    if (!hasNext()) {
      throw new NoSuchElementException();
    }
    n=next;
  }
  next=null;
  return n;
}
Program: 92244
Project: 92244
Buggy source:
/** 
 * Returns an iterator over the legacy elements.
 * @return Iterator over the legacy elements.
 */
@Override public Iterator<L> iterator(){
  final Iterator<N> it=elements.iterator();
  return new Iterator<L>(){
    /** 
 * The next value to return, or   {@code null} if not yet verified. 
 */
    private L next;
    /** 
 * Returns   {@code true} if there is more elements to iterator. 
 */
    @Override public boolean hasNext(){
      if (next != null) {
        return true;
      }
      while (it.hasNext()) {
        next=unwrap(it.next());
        if (next != null) {
          return true;
        }
      }
      return false;
    }
    /** 
 * Returns the next element. 
 */
    @Override public L next(){
      L n=next;
      if (n == null) {
        if (!hasNext()) {
          throw new NoSuchElementException();
        }
        n=next;
      }
      next=null;
      return n;
    }
    /** 
 * Removes the last element returned by   {@link #next()}. 
 */
    @Override public void remove(){
      it.remove();
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Returns an iterator over the legacy elements.
 * @return Iterator over the legacy elements.
 */
@Override public final Iterator<L> iterator(){
  final Iterator<N> it=elements.iterator();
  return new Iterator<L>(){
    /** 
 * The next value to return, or   {@code null} if not yet verified. 
 */
    private L next;
    /** 
 * Returns   {@code true} if there is more elements to iterator. 
 */
    @Override public final boolean hasNext(){
      if (next != null) {
        return true;
      }
      while (it.hasNext()) {
        next=unwrap(it.next());
        if (next != null) {
          return true;
        }
      }
      return false;
    }
    /** 
 * Returns the next element. 
 */
    @Override public final L next(){
      L n=next;
      if (n == null) {
        if (!hasNext()) {
          throw new NoSuchElementException();
        }
        n=next;
      }
      next=null;
      return n;
    }
    /** 
 * Removes the last element returned by   {@link #next()}. 
 */
    @Override public final void remove(){
      it.remove();
    }
  }
;
}
Program: 92245
Project: 92245
Buggy source:
/** 
 * Count the number of non-null elements.
 * @return Number of non-null elements.
 */
@Override public final int size(){
  int count=0;
  final Iterator<L> it=iterator();
  while (it.hasNext()) {
    it.next();
    count++;
  }
  return count;
}

Fixed version (ground truth):
/** 
 * Counts the number of non-null elements.
 * @return Number of non-null elements.
 */
@Override public final int size(){
  int count=0;
  final Iterator<L> it=iterator();
  while (it.hasNext()) {
    it.next();
    count++;
  }
  return count;
}
Program: 92246
Project: 92246
Buggy source:
/** 
 * Returns   {@code true} if there is more elements to iterator. 
 */
@Override public boolean hasNext(){
  if (next != null) {
    return true;
  }
  while (it.hasNext()) {
    next=unwrap(it.next());
    if (next != null) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Returns   {@code true} if there is more elements to iterator. 
 */
@Override public final boolean hasNext(){
  if (next != null) {
    return true;
  }
  while (it.hasNext()) {
    next=unwrap(it.next());
    if (next != null) {
      return true;
    }
  }
  return false;
}
Program: 92247
Project: 92247
Buggy source:
/** 
 * Removes the last element returned by   {@link #next()}. 
 */
@Override public void remove(){
  it.remove();
}

Fixed version (ground truth):
/** 
 * Removes the last element returned by   {@link #next()}. 
 */
@Override public final void remove(){
  it.remove();
}
Program: 92248
Project: 92248
Buggy source:
/** 
 * Returns additional information about the range or extent of the resource.
 * @return Additional information about the range or extent of the resource.
 * @deprecated As of ISO 19115:2014, {@link #getUpdateScopes()} and {@code getUpdateScopeDescriptions()}were combined into   {@link #getMaintenanceScopes()} in order to allow specifying a scopethat includes a spatial and temporal extent.
 */
@Override @Deprecated @XmlElement(name="String_Node_Str") public Collection<ScopeDescription> getUpdateScopeDescriptions(){
  return new LegacyProperties<ScopeDescription,Scope>(getMaintenanceScopes()){
    @Override protected Scope wrap(    final ScopeDescription code){
      final DefaultScope scope=new DefaultScope();
      scope.setLevelDescription(Collections.singleton(code));
      return scope;
    }
    @Override protected ScopeDescription unwrap(    final Scope scope){
      final Iterator<? extends ScopeDescription> i=scope.getLevelDescription().iterator();
      return (i.hasNext()) ? i.next() : null;
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Returns additional information about the range or extent of the resource.
 * @return Additional information about the range or extent of the resource.
 * @deprecated As of ISO 19115:2014, {@link #getUpdateScopes()} and {@code getUpdateScopeDescriptions()}were combined into   {@link #getMaintenanceScopes()} in order to allow specifying a scopethat includes a spatial and temporal extent.
 */
@Override @Deprecated @XmlElement(name="String_Node_Str") public Collection<ScopeDescription> getUpdateScopeDescriptions(){
  return new LegacyProperties<ScopeDescription,Scope>(getMaintenanceScopes()){
    private boolean warningOccurred;
    @Override protected Scope wrap(    final ScopeDescription code){
      final DefaultScope scope=new DefaultScope();
      scope.setLevelDescription(Collections.singleton(code));
      return scope;
    }
    @Override protected ScopeDescription unwrap(    final Scope scope){
      final Iterator<? extends ScopeDescription> it=scope.getLevelDescription().iterator();
      if (!it.hasNext()) {
        return null;
      }
      final ScopeDescription description=it.next();
      if (!warningOccurred && it.hasNext()) {
        warningOccurred=true;
        MetadataUtilities.warning(DefaultMaintenanceInformation.class,"String_Node_Str",Messages.Keys.IgnoredPropertiesAfterFirst_1,ScopeDescription.class);
      }
      return description;
    }
  }
;
}
Program: 92249
Project: 92249
Buggy source:
@Override protected ScopeDescription unwrap(final Scope scope){
  final Iterator<? extends ScopeDescription> i=scope.getLevelDescription().iterator();
  return (i.hasNext()) ? i.next() : null;
}

Fixed version (ground truth):
@Override protected ScopeDescription unwrap(final Scope scope){
  final Iterator<? extends ScopeDescription> it=scope.getLevelDescription().iterator();
  if (!it.hasNext()) {
    return null;
  }
  final ScopeDescription description=it.next();
  if (!warningOccurred && it.hasNext()) {
    warningOccurred=true;
    MetadataUtilities.warning(DefaultMaintenanceInformation.class,"String_Node_Str",Messages.Keys.IgnoredPropertiesAfterFirst_1,ScopeDescription.class);
  }
  return description;
}
Program: 92250
Project: 92250
Buggy source:
/** 
 * Sets the scheduled revision date for resource.
 * @param newValue The new date of next update.
 */
@Deprecated public void setDateOfNextUpdate(final Date newValue){
  if (newValue != null) {
    getMaintenanceDates().add(new DefaultCitationDate(newValue,DateType.NEXT_UPDATE));
  }
}

Fixed version (ground truth):
/** 
 * Sets the scheduled revision date for resource.
 * @param newValue The new date of next update.
 */
@Deprecated public void setDateOfNextUpdate(final Date newValue){
  if (newValue != null) {
    if (maintenanceDates != null) {
      for (      final CitationDate date : maintenanceDates) {
        if (date instanceof DefaultCitationDate && DateType.NEXT_UPDATE.equals(date.getDateType())) {
          ((DefaultCitationDate)date).setDate(newValue);
          return;
        }
      }
    }
    getMaintenanceDates().add(new DefaultCitationDate(newValue,DateType.NEXT_UPDATE));
  }
}
Program: 92252
Project: 92252
Buggy source:
/** 
 * Verifies if all current properties met the constraints defined by the feature type. This method returns  {@linkplain org.apache.sis.metadata.iso.quality.DefaultDataQuality#getReports() reports} for all invalidproperties, if any.
 */
@Override public DataQuality quality(){
  if (valuesKind == VALUES) {
    final Validator v=new Validator(ScopeCode.FEATURE);
    for (    final Map.Entry<String,Object> entry : properties.entrySet()) {
      v.validateAny(getPropertyType(entry.getKey()),entry.getValue());
    }
    return v.quality;
  }
  return super.quality();
}

Fixed version (ground truth):
/** 
 * Verifies if all current properties met the constraints defined by the feature type. This method returns  {@linkplain org.apache.sis.metadata.iso.quality.DefaultDataQuality#getReports() reports} for all invalidproperties, if any.
 */
@Override public DataQuality quality(){
  if (valuesKind == VALUES) {
    final Validator v=new Validator(ScopeCode.FEATURE);
    for (    final String name : super.getType().indices().keySet()) {
      v.validateAny(getPropertyType(name),properties.get(name));
    }
    return v.quality;
  }
  return super.quality();
}
Program: 92253
Project: 92253
Buggy source:
/** 
 * Tests the   {@link AbstractFeature#getPropertyValue(String)} method on a simple feature without super-types.This method also tests that attempts to set a value of the wrong type throw an exception and leave the previous value unchanged, that the feature is cloneable and that serialization works.
 */
@Test public void testSimpleValues(){
  feature=createFeature(DefaultFeatureTypeTest.city());
  setAttributeValue("String_Node_Str","String_Node_Str","String_Node_Str");
  try {
    feature.setPropertyValue("String_Node_Str",2000);
  }
 catch (  ClassCastException e) {
    final String message=e.getMessage();
    assertTrue(message,message.contains("String_Node_Str"));
    assertTrue(message,message.contains("String_Node_Str"));
  }
  assertEquals("String_Node_Str","String_Node_Str",getAttributeValue("String_Node_Str"));
  setAttributeValue("String_Node_Str",null,1000);
  assertValid();
  testSerialization();
  try {
    testClone("String_Node_Str",1000,1500);
  }
 catch (  CloneNotSupportedException e) {
    throw new AssertionError(e);
  }
}

Fixed version (ground truth):
/** 
 * Tests the   {@link AbstractFeature#getPropertyValue(String)} method on a simple feature without super-types.This method also tests that attempts to set a value of the wrong type throw an exception and leave the previous value unchanged, that the feature is cloneable and that serialization works.
 */
@Test public void testSimpleValues(){
  feature=createFeature(DefaultFeatureTypeTest.city());
  setAttributeValue("String_Node_Str","String_Node_Str","String_Node_Str");
  try {
    feature.setPropertyValue("String_Node_Str",2000);
  }
 catch (  ClassCastException e) {
    final String message=e.getMessage();
    assertTrue(message,message.contains("String_Node_Str"));
    assertTrue(message,message.contains("String_Node_Str"));
  }
  assertEquals("String_Node_Str","String_Node_Str",getAttributeValue("String_Node_Str"));
  assertQualityReports("String_Node_Str","String_Node_Str");
  setAttributeValue("String_Node_Str",null,1000);
  assertQualityReports(null,null);
  testSerialization();
  try {
    testClone("String_Node_Str",1000,1500);
  }
 catch (  CloneNotSupportedException e) {
    throw new AssertionError(e);
  }
}
Program: 92254
Project: 92254
Buggy source:
/** 
 * Tests   {@link AbstractFeature#getProperty(String)} and {@link AbstractFeature#getPropertyValue(String)}on a "complex" feature, involving inheritance and property overriding.
 */
@Test @DependsOnMethod({"String_Node_Str","String_Node_Str"}) public void testComplexFeature(){
  feature=createFeature(DefaultFeatureTypeTest.worldMetropolis());
  setAttributeValue("String_Node_Str","String_Node_Str","String_Node_Str");
  setAttributeValue("String_Node_Str",null,8405837);
  getValuesFromProperty=true;
  setAttributeValue("String_Node_Str",null,Boolean.TRUE);
  final SimpleInternationalString region=new SimpleInternationalString("String_Node_Str");
  setAttributeValue("String_Node_Str",null,region);
  try {
    feature.setPropertyValue("String_Node_Str","String_Node_Str");
  }
 catch (  ClassCastException e) {
    final String message=e.getMessage();
    assertTrue(message,message.contains("String_Node_Str"));
    assertTrue(message,message.contains("String_Node_Str"));
  }
  assertSame("String_Node_Str",region,getAttributeValue("String_Node_Str"));
  assertValid();
  testSerialization();
  try {
    testClone("String_Node_Str",8405837,8405838);
  }
 catch (  CloneNotSupportedException e) {
    throw new AssertionError(e);
  }
}

Fixed version (ground truth):
/** 
 * Tests   {@link AbstractFeature#getProperty(String)} and {@link AbstractFeature#getPropertyValue(String)}on a "complex" feature, involving inheritance and property overriding.
 */
@Test @DependsOnMethod({"String_Node_Str","String_Node_Str"}) public void testComplexFeature(){
  feature=createFeature(DefaultFeatureTypeTest.worldMetropolis());
  setAttributeValue("String_Node_Str","String_Node_Str","String_Node_Str");
  setAttributeValue("String_Node_Str",null,8405837);
  getValuesFromProperty=true;
  final SimpleInternationalString region=new SimpleInternationalString("String_Node_Str");
  setAttributeValue("String_Node_Str",null,region);
  try {
    feature.setPropertyValue("String_Node_Str","String_Node_Str");
  }
 catch (  ClassCastException e) {
    final String message=e.getMessage();
    assertTrue(message,message.contains("String_Node_Str"));
    assertTrue(message,message.contains("String_Node_Str"));
  }
  assertSame("String_Node_Str",region,getAttributeValue("String_Node_Str"));
  assertQualityReports("String_Node_Str","String_Node_Str");
  setAttributeValue("String_Node_Str",null,Boolean.TRUE);
  assertQualityReports(null,null);
  testSerialization();
  try {
    testClone("String_Node_Str",8405837,8405838);
  }
 catch (  CloneNotSupportedException e) {
    throw new AssertionError(e);
  }
}