nus-yam/ex-repair huggingface dataset:
Program: 93694
Project: 93694
Buggy source:
/** 
 * Creates the   {@link DiffElement} corresponding to an unique reference's value update.
 * @param left Left element of the reference change.
 * @param right Right element of the reference change.
 * @param reference {@link EReference} target of the operation.
 * @param addedValue Value which has been added for the reference.
 * @param deletedValue Value that has been deleted from the reference.
 * @return The {@link DiffElement} corresponding to an unique reference's value update
 */
private UpdateReference createUpdatedReferenceOperation(EObject left,EObject right,EReference reference,EObject addedValue,EObject deletedValue){
  final UpdateReference operation=DiffFactory.eINSTANCE.createUpdateReference();
  operation.setLeftElement(left);
  operation.setRightElement(right);
  operation.setReference(reference);
  EObject leftTarget=getMatchedEObject(addedValue);
  EObject rightTarget=getMatchedEObject(deletedValue);
  if (leftTarget == null) {
    leftTarget=addedValue;
  }
  if (rightTarget == null) {
    rightTarget=deletedValue;
  }
  operation.setLeftTarget(leftTarget);
  operation.setRightTarget(rightTarget);
  return operation;
}

Fixed version (ground truth):
/** 
 * Creates the   {@link DiffElement} corresponding to an unique reference's value update.
 * @param left Left element of the reference change.
 * @param right Right element of the reference change.
 * @param reference {@link EReference} target of the operation.
 * @param addedValue Value which has been added for the reference.
 * @param deletedValue Value that has been deleted from the reference.
 * @return The {@link DiffElement} corresponding to an unique reference's value update
 */
private UpdateReference createUpdatedReferenceOperation(EObject left,EObject right,EReference reference,EObject addedValue,EObject deletedValue){
  final UpdateReference operation=DiffFactory.eINSTANCE.createUpdateReference();
  operation.setLeftElement(left);
  operation.setRightElement(right);
  operation.setReference(reference);
  EObject rightTarget=getMatchedEObject(addedValue);
  EObject leftTarget=getMatchedEObject(deletedValue);
  if (leftTarget == null) {
    leftTarget=addedValue;
  }
  if (rightTarget == null) {
    rightTarget=deletedValue;
  }
  operation.setLeftTarget(leftTarget);
  operation.setRightTarget(rightTarget);
  return operation;
}
Program: 93696
Project: 93696
Buggy source:
/** 
 * {@inheritDoc}
 * @see org.eclipse.jface.viewers.AbstractTreeViewer#inputChanged(java.lang.Object,java.lang.Object)
 */
@Override protected void inputChanged(Object input,Object oldInput){
  final TreePath[] expandedTreePaths=getExpandedTreePaths();
  super.inputChanged(input,oldInput);
  expandAll();
  setExpandedTreePaths(expandedTreePaths);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 * @see org.eclipse.jface.viewers.AbstractTreeViewer#inputChanged(java.lang.Object,java.lang.Object)
 */
@Override protected void inputChanged(Object input,Object oldInput){
  if (input != oldInput) {
    final TreePath[] expandedTreePaths=getExpandedTreePaths();
    super.inputChanged(input,oldInput);
    expandAll();
    setExpandedTreePaths(expandedTreePaths);
  }
}
Program: 93699
Project: 93699
Buggy source:
/** 
 * This will create and populate a   {@link List} with all the references from the<code>leftReferences</code>  {@link List} that cannot be matched in the <code>rightReferences</code>{@link List}.
 * @param leftReferences List of the left element reference values.
 * @param rightReferences List of the right element reference values.
 * @return {@link List} of all the references that have been added in the left (local) element since theright (distant) element.
 */
private List<EObject> computeAddedReferences(List<EObject> leftReferences,List<EObject> rightReferences){
  final List<EObject> deletedReferences=new ArrayList<EObject>();
  final List<EObject> addedReferences=new ArrayList<EObject>();
  final double similarReferenceURIThreshold=0.8d;
  if (leftReferences != null) {
    addedReferences.addAll(leftReferences);
  }
  if (rightReferences != null) {
    deletedReferences.addAll(rightReferences);
  }
  final List<EObject> matchedOldReferences=getMatchedReferences(deletedReferences);
  addedReferences.removeAll(matchedOldReferences);
  for (  final EObject added : new ArrayList<EObject>(addedReferences)) {
    for (    final EObject deleted : deletedReferences) {
      final double uriSimilarity=ResourceSimilarity.computeURISimilarity(EcoreUtil.getURI(added),EcoreUtil.getURI(deleted));
      if (uriSimilarity > similarReferenceURIThreshold) {
        addedReferences.remove(added);
      }
    }
  }
  return addedReferences;
}

Fixed version (ground truth):
/** 
 * This will create and populate a   {@link List} with all the references from the<code>leftReferences</code>  {@link List} that cannot be matched in the <code>rightReferences</code>{@link List}.
 * @param leftReferences List of the left element reference values.
 * @param rightReferences List of the right element reference values.
 * @return {@link List} of all the references that have been added in the left (local) element since theright (distant) element.
 */
private List<EObject> computeAddedReferences(List<EObject> leftReferences,List<EObject> rightReferences){
  final List<EObject> deletedReferences=new ArrayList<EObject>();
  final List<EObject> addedReferences=new ArrayList<EObject>();
  final double similarReferenceURIThreshold=0.8d;
  if (leftReferences != null) {
    addedReferences.addAll(leftReferences);
  }
  if (rightReferences != null) {
    deletedReferences.addAll(rightReferences);
  }
  final List<EObject> matchedOldReferences=getMatchedReferences(deletedReferences);
  addedReferences.removeAll(matchedOldReferences);
  for (  final EObject added : new ArrayList<EObject>(addedReferences)) {
    for (    final EObject deleted : deletedReferences) {
      final EObject matched=getMatchedEObject(added);
      if (matched != null) {
        if (matched == deleted) {
          addedReferences.remove(added);
        }
      }
 else {
        final double uriSimilarity=ResourceSimilarity.computeURISimilarity(EcoreUtil.getURI(added),EcoreUtil.getURI(deleted));
        if (uriSimilarity > similarReferenceURIThreshold) {
          addedReferences.remove(added);
        }
      }
    }
  }
  return addedReferences;
}
Program: 93701
Project: 93701
Buggy source:
/** 
 * This is the core of the diff computing for three way comparison. This will call for checks on attributes, references and model elements to check for updates/changes.
 * @param root {@link DiffGroup root} of the {@link DiffModel} to create.
 * @param match {@link Match3Elements root} of the {@link MatchModel} to analyze.
 */
private void doDiffDelegate(DiffGroup root,Match3Elements match){
  DiffGroup current=DiffFactory.eINSTANCE.createDiffGroup();
  current.setRightParent(match.getRightElement());
  try {
    checkForDiffs(current,match);
  }
 catch (  final FactoryException e) {
    EMFComparePlugin.log(e,false);
  }
  final List<DiffElement> shouldAddToList=new ArrayList<DiffElement>();
  if (current.getSubDiffElements().size() > 0) {
    final Iterator<DiffElement> it2=current.getSubDiffElements().iterator();
    while (it2.hasNext()) {
      final DiffElement diff=it2.next();
      if (!(diff instanceof DiffGroup)) {
        shouldAddToList.add(diff);
      }
    }
    for (    final DiffElement diff : shouldAddToList) {
      addInContainerPackage(root,diff,current.getRightParent());
    }
  }
 else {
    current=root;
  }
  final Iterator<MatchElement> it=match.getSubMatchElements().iterator();
  while (it.hasNext()) {
    final MatchElement element=it.next();
    if (element instanceof Match3Elements) {
      doDiffDelegate(root,(Match3Elements)element);
    }
 else {
      doDiffDelegate(root,(Match2Elements)element);
    }
  }
}

Fixed version (ground truth):
/** 
 * This is the core of the diff computing for three way comparison. This will call for checks on attributes, references and model elements to check for updates/changes.
 * @param root {@link DiffGroup root} of the {@link DiffModel} to create.
 * @param match {@link Match3Elements root} of the {@link MatchModel} to analyze.
 */
private void doDiffDelegate(DiffGroup root,Match3Elements match){
  final DiffGroup current=DiffFactory.eINSTANCE.createDiffGroup();
  current.setRightParent(match.getRightElement());
  try {
    checkForDiffs(current,match);
  }
 catch (  final FactoryException e) {
    EMFComparePlugin.log(e,false);
  }
  final List<DiffElement> shouldAddToList=new ArrayList<DiffElement>();
  if (current.getSubDiffElements().size() > 0) {
    final Iterator<DiffElement> it2=current.getSubDiffElements().iterator();
    while (it2.hasNext()) {
      final DiffElement diff=it2.next();
      if (!(diff instanceof DiffGroup)) {
        shouldAddToList.add(diff);
      }
    }
    for (    final DiffElement diff : shouldAddToList) {
      addInContainerPackage(root,diff,current.getRightParent());
    }
  }
  final Iterator<MatchElement> it=match.getSubMatchElements().iterator();
  while (it.hasNext()) {
    final MatchElement element=it.next();
    if (element instanceof Match3Elements) {
      doDiffDelegate(root,(Match3Elements)element);
    }
 else {
      doDiffDelegate(root,(Match2Elements)element);
    }
  }
}
Program: 93704
Project: 93704
Buggy source:
/** 
 * This will copy the given <tt>value</tt> to the reference <tt>targetReference</tt> of <tt>target</tt>.
 * @param targetReference The reference to add a value to.
 * @param target The object to copy to.
 * @param value The value that is to be copied.
 * @param matchedValue Matched value of <tt>value</tt> if it is know. Will behave like {@link #copyReferenceValue(EReference,EObject,EObject)} if <code>null</code>.
 */
@SuppressWarnings("String_Node_Str") public void copyReferenceValue(EReference targetReference,EObject target,EObject value,EObject matchedValue){
  if (matchedValue != null) {
    put(value,matchedValue);
    ((List<Object>)target.eGet(targetReference)).add(matchedValue);
  }
 else   copyReferenceValue(targetReference,target,value);
}

Fixed version (ground truth):
/** 
 * This will copy the given <tt>value</tt> to the reference <tt>targetReference</tt> of <tt>target</tt>.
 * @param targetReference The reference to add a value to.
 * @param target The object to copy to.
 * @param value The value that is to be copied.
 * @param matchedValue Matched value of <tt>value</tt> if it is know. Will behave like {@link #copyReferenceValue(EReference,EObject,EObject)} if <code>null</code>.
 */
@SuppressWarnings("String_Node_Str") public void copyReferenceValue(EReference targetReference,EObject target,EObject value,EObject matchedValue){
  if (matchedValue != null) {
    put(value,matchedValue);
    ((List<Object>)target.eGet(targetReference)).add(matchedValue);
  }
 else {
    copyReferenceValue(targetReference,target,value);
  }
}
Program: 93705
Project: 93705
Buggy source:
/** 
 * {@inheritDoc}
 * @see org.eclipse.emf.ecore.util.EcoreUtil$Copier#copyReferences()
 */
@Override public void copyReferences(){
  final Set<Map.Entry<EObject,EObject>> entrySetCopy=new HashSet<Map.Entry<EObject,EObject>>(entrySet());
  for (  Map.Entry<EObject,EObject> entry : entrySetCopy) {
    final EObject eObject=entry.getKey();
    final EObject copyEObject=entry.getValue();
    final EClass eClass=eObject.eClass();
    for (int j=0; j < eClass.getFeatureCount(); ++j) {
      final EStructuralFeature eStructuralFeature=eClass.getEStructuralFeature(j);
      if (eStructuralFeature.isChangeable() && !eStructuralFeature.isDerived()) {
        if (eStructuralFeature instanceof EReference) {
          final EReference eReference=(EReference)eStructuralFeature;
          if (!eReference.isContainment() && !eReference.isContainer()) {
            copyReference(eReference,eObject,copyEObject);
          }
        }
 else         if (FeatureMapUtil.isFeatureMap(eStructuralFeature)) {
          copyFeatureMap(eObject,eStructuralFeature);
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 * @see org.eclipse.emf.ecore.util.EcoreUtil$Copier#copyReferences()
 */
@Override public void copyReferences(){
  final Set<Map.Entry<EObject,EObject>> entrySetCopy=new HashSet<Map.Entry<EObject,EObject>>(entrySet());
  for (  final Map.Entry<EObject,EObject> entry : entrySetCopy) {
    final EObject eObject=entry.getKey();
    final EObject copyEObject=entry.getValue();
    final EClass eClass=eObject.eClass();
    for (int j=0; j < eClass.getFeatureCount(); ++j) {
      final EStructuralFeature eStructuralFeature=eClass.getEStructuralFeature(j);
      if (eStructuralFeature.isChangeable() && !eStructuralFeature.isDerived()) {
        if (eStructuralFeature instanceof EReference) {
          final EReference eReference=(EReference)eStructuralFeature;
          if (!eReference.isContainment() && !eReference.isContainer()) {
            copyReference(eReference,eObject,copyEObject);
          }
        }
 else         if (FeatureMapUtil.isFeatureMap(eStructuralFeature)) {
          copyFeatureMap(eObject,eStructuralFeature);
        }
      }
    }
  }
}
Program: 93706
Project: 93706
Buggy source:
/** 
 * Ensures the original and copied objects all share the same XMI ID.
 */
public void copyXMIIDs(){
  for (  Map.Entry<EObject,EObject> entry : entrySet()) {
    final EObject original=entry.getKey();
    final EObject copy=entry.getValue();
    if (original.eResource() instanceof XMIResource && copy.eResource() instanceof XMIResource) {
      final XMIResource originResource=(XMIResource)original.eResource();
      final XMIResource copyResource=(XMIResource)copy.eResource();
      if (originResource.getID(original) != null)       copyResource.setID(copy,originResource.getID(original));
    }
  }
}

Fixed version (ground truth):
/** 
 * Ensures the original and copied objects all share the same XMI ID.
 */
public void copyXMIIDs(){
  for (  final Map.Entry<EObject,EObject> entry : entrySet()) {
    final EObject original=entry.getKey();
    final EObject copy=entry.getValue();
    if (original.eResource() instanceof XMIResource && copy.eResource() instanceof XMIResource) {
      final XMIResource originResource=(XMIResource)original.eResource();
      final XMIResource copyResource=(XMIResource)copy.eResource();
      if (originResource.getID(original) != null) {
        copyResource.setID(copy,originResource.getID(original));
      }
    }
  }
}
Program: 93707
Project: 93707
Buggy source:
/** 
 * Returns the merger class that is best suited for the given   {@link DiffElement}. Merger classes can be managed via   {@link #addMergerType(Class,Class)} and {@link #removeMergerType(Class)}.
 * @param element {@link DiffElement} we want a merger for.
 * @return The merger class that is best suited for the given {@link DiffElement}.
 */
private static Class<? extends IMerger> getBestMerger(DiffElement element){
  Class<? extends IMerger> mergerClass=DefaultMerger.class;
  EObject rightElement=(EObject)ClassUtils.invokeMethod(element,"String_Node_Str");
  if (rightElement == null) {
    rightElement=(EObject)ClassUtils.invokeMethod(element,"String_Node_Str");
  }
  String resourceFileExtension=null;
  if (rightElement != null && rightElement.eResource() != null) {
    resourceFileExtension=rightElement.eResource().getURI().fileExtension();
  }
  if (resourceFileExtension == null) {
    resourceFileExtension=ALL_EXTENSIONS;
  }
  final Map<Class<? extends DiffElement>,Class<? extends IMerger>> mergersMap;
  if (EMFPlugin.IS_ECLIPSE_RUNNING) {
    mergersMap=getMergerTypes(resourceFileExtension);
  }
 else {
    mergersMap=MERGER_TYPES;
  }
  if (mergersMap.containsKey(element.getClass())) {
    mergerClass=mergersMap.get(element.getClass());
  }
 else {
    for (    final Class<? extends DiffElement> clazz : mergersMap.keySet()) {
      if (clazz.isInstance(element)) {
        mergerClass=mergersMap.get(clazz);
        break;
      }
    }
  }
  return mergerClass;
}

Fixed version (ground truth):
/** 
 * Returns the merger class that is best suited for the given   {@link DiffElement}. Merger classes can be managed via   {@link #addMergerType(Class,Class)} and {@link #removeMergerType(Class)}.
 * @param element {@link DiffElement} we want a merger for.
 * @return The merger class that is best suited for the given {@link DiffElement}.
 */
private static Class<? extends IMerger> getBestMerger(DiffElement element){
  Class<? extends IMerger> mergerClass=DefaultMerger.class;
  EObject rightElement=(EObject)ClassUtils.invokeMethod(element,"String_Node_Str");
  if (rightElement == null) {
    rightElement=(EObject)ClassUtils.invokeMethod(element,"String_Node_Str");
  }
  String resourceFileExtension=null;
  if (rightElement != null && rightElement.eResource() != null) {
    resourceFileExtension=rightElement.eResource().getURI().fileExtension();
  }
  if (resourceFileExtension == null) {
    resourceFileExtension=ALL_EXTENSIONS;
  }
  final Map<Class<? extends DiffElement>,Class<? extends IMerger>> mergersMap;
  if (EMFPlugin.IS_ECLIPSE_RUNNING) {
    mergersMap=getMergerTypes(resourceFileExtension);
  }
 else {
    mergersMap=MERGER_TYPES;
  }
  if (mergersMap.containsKey(element.getClass())) {
    mergerClass=mergersMap.get(element.getClass());
  }
 else {
    for (    final Entry<Class<? extends DiffElement>,Class<? extends IMerger>> entry : mergersMap.entrySet()) {
      if (entry.getKey().isInstance(element)) {
        mergerClass=entry.getValue();
        break;
      }
    }
  }
  return mergerClass;
}
Program: 93708
Project: 93708
Buggy source:
/** 
 * Returns the value of the attribute <code>name</code> of this descriptor's configuration element. if the attribute hasn't been set, we'll return <code>defaultValue</code> instead.
 * @param name Name of the attribute we seek the value of.
 * @param defaultValue Value to return if the attribute hasn't been set.
 * @return The value of the attribute <code>name</code>, <code>defaultValue</code> if it hasn't beenset.
 */
private String getAttribute(String name,String defaultValue){
  final String value=element.getAttribute(name);
  if (value != null)   return value;
  if (defaultValue != null)   return defaultValue;
  throw new IllegalArgumentException(EMFCompareDiffMessages.getString("String_Node_Str",name));
}

Fixed version (ground truth):
/** 
 * Returns the value of the attribute <code>name</code> of this descriptor's configuration element. if the attribute hasn't been set, we'll return <code>defaultValue</code> instead.
 * @param name Name of the attribute we seek the value of.
 * @param defaultValue Value to return if the attribute hasn't been set.
 * @return The value of the attribute <code>name</code>, <code>defaultValue</code> if it hasn't been set.
 */
private String getAttribute(String name,String defaultValue){
  final String value=element.getAttribute(name);
  if (value != null)   return value;
  if (defaultValue != null)   return defaultValue;
  throw new IllegalArgumentException(EMFCompareDiffMessages.getString("String_Node_Str",name));
}
Program: 93709
Project: 93709
Buggy source:
/** 
 * {@inheritDoc}
 * @see java.lang.Object#hashCode()
 */
@Override public int hashCode(){
  final int prime=31;
  int classNameHash=0;
  if (mergerProviderClassName != null)   classNameHash=mergerProviderClassName.hashCode();
  int extensionHash=0;
  if (fileExtension != null)   extensionHash=fileExtension.hashCode();
  int priorityHash=0;
  if (priority != null)   priorityHash=priority.hashCode();
  return (((prime + classNameHash) * prime) + extensionHash) * prime + priorityHash;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 * @see java.lang.Object#hashCode()
 */
@Override public int hashCode(){
  final int prime=31;
  int classNameHash=0;
  if (mergerProviderClassName != null) {
    classNameHash=mergerProviderClassName.hashCode();
  }
  int extensionHash=0;
  if (fileExtension != null) {
    extensionHash=fileExtension.hashCode();
  }
  int priorityHash=0;
  if (priority != null) {
    priorityHash=priority.hashCode();
  }
  return (((prime + classNameHash) * prime) + extensionHash) * prime + priorityHash;
}
Program: 93710
Project: 93710
Buggy source:
/** 
 * {@inheritDoc}
 * @see java.lang.Object#equals(java.lang.Object)
 */
@Override public boolean equals(Object obj){
  boolean isEqual=true;
  if (this == obj) {
    isEqual=true;
  }
 else   if (obj == null || getClass() != obj.getClass()) {
    isEqual=false;
  }
 else   if (obj instanceof MergerProviderDescriptor) {
    final MergerProviderDescriptor other=(MergerProviderDescriptor)obj;
    if (mergerProviderClassName == null && other.mergerProviderClassName != null) {
      isEqual=false;
    }
 else     if (!mergerProviderClassName.equals(other.mergerProviderClassName)) {
      isEqual=false;
    }
 else     if (fileExtension == null && other.fileExtension != null) {
      isEqual=false;
    }
 else     if (!fileExtension.equals(other.fileExtension)) {
      isEqual=false;
    }
 else     if (priority == null && other.priority != null) {
      isEqual=false;
    }
 else     if (!priority.equals(other.priority)) {
      isEqual=false;
    }
  }
 else {
    isEqual=false;
  }
  return isEqual;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 * @see java.lang.Object#equals(java.lang.Object)
 */
@Override public boolean equals(Object obj){
  boolean isEqual=true;
  if (this == obj) {
    isEqual=true;
  }
 else   if (obj == null || getClass() != obj.getClass()) {
    isEqual=false;
  }
 else   if (obj instanceof MergerProviderDescriptor) {
    final MergerProviderDescriptor other=(MergerProviderDescriptor)obj;
    if (mergerProviderClassName == null && other.mergerProviderClassName != null) {
      isEqual=false;
    }
 else     if (mergerProviderClassName != null && !mergerProviderClassName.equals(other.mergerProviderClassName)) {
      isEqual=false;
    }
 else     if (fileExtension == null && other.fileExtension != null) {
      isEqual=false;
    }
 else     if (fileExtension != null && !fileExtension.equals(other.fileExtension)) {
      isEqual=false;
    }
 else     if (priority == null && other.priority != null) {
      isEqual=false;
    }
 else     if (priority != null && !priority.equals(other.priority)) {
      isEqual=false;
    }
  }
 else {
    isEqual=false;
  }
  return isEqual;
}
Program: 93711
Project: 93711
Buggy source:
/** 
 * Returns the engine instance.
 * @return The engine instance.
 */
public IMergerProvider getMergerProviderInstance(){
  if (mergerProvider == null) {
    try {
      mergerProvider=(IMergerProvider)element.createExecutableExtension("String_Node_Str");
    }
 catch (    CoreException e) {
      EMFComparePlugin.log(e,false);
    }
  }
  return mergerProvider;
}

Fixed version (ground truth):
/** 
 * Returns the engine instance.
 * @return The engine instance.
 */
public IMergerProvider getMergerProviderInstance(){
  if (mergerProvider == null) {
    try {
      mergerProvider=(IMergerProvider)element.createExecutableExtension("String_Node_Str");
    }
 catch (    final CoreException e) {
      EMFComparePlugin.log(e,false);
    }
  }
  return mergerProvider;
}
Program: 93712
Project: 93712
Buggy source:
/** 
 * This will retain the visible differences in the given list.
 * @param leftVisible Items visible on the left part.
 * @param rightVisible Items visible on the right part.
 * @return Filtered list of DiffElements.
 */
protected List<DiffElement> retainVisibleDiffs(List<ModelContentMergeTabItem> leftVisible,List<ModelContentMergeTabItem> rightVisible){
  if (!leftVisible.equals(lastLeftVisible) || !rightVisible.equals(lastRightVisible)) {
    lastVisibleDiffs=new ArrayList<DiffElement>(leftVisible.size() + rightVisible.size());
    for (    ModelContentMergeTabItem left : leftVisible) {
      lastVisibleDiffs.add(left.getDiff());
    }
    for (    ModelContentMergeTabItem right : rightVisible) {
      lastVisibleDiffs.add(right.getDiff());
    }
  }
  return lastVisibleDiffs;
}

Fixed version (ground truth):
/** 
 * This will retain the visible differences in the given list.
 * @param leftVisible Items visible on the left part.
 * @param rightVisible Items visible on the right part.
 * @return Filtered list of DiffElements.
 */
protected List<DiffElement> retainVisibleDiffs(List<ModelContentMergeTabItem> leftVisible,List<ModelContentMergeTabItem> rightVisible){
  final List<DiffElement> visibleDiffs=new ArrayList<DiffElement>(leftVisible.size() + rightVisible.size());
  for (  final ModelContentMergeTabItem left : leftVisible) {
    visibleDiffs.add(left.getDiff());
  }
  for (  final ModelContentMergeTabItem right : rightVisible) {
    visibleDiffs.add(right.getDiff());
  }
  return visibleDiffs;
}
Program: 93713
Project: 93713
Buggy source:
/** 
 * Paints this component using double-buffering.
 * @param dest Destination  {@link GC graphics}.
 */
void doubleBufferedPaint(GC dest){
  final Point size=getSize();
  if (size.x <= 0 || size.y <= 0)   return;
  if (buffer != null) {
    final Rectangle bufferBounds=buffer.getBounds();
    if (bufferBounds.width != size.x || bufferBounds.height != size.y) {
      buffer.dispose();
      buffer=null;
    }
  }
  if (buffer == null)   buffer=new Image(getDisplay(),size.x,size.y);
  final GC gc=new GC(buffer);
  gc.setForeground(getDisplay().getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW));
  gc.drawLine(0,0,0,getBounds().height);
  gc.drawLine(getBounds().width - 1,0,getBounds().width - 1,getBounds().height);
  try {
    gc.setBackground(getBackground());
    gc.fillRectangle(0,0,size.x,size.y);
    doPaint(gc);
  }
  finally {
    gc.dispose();
  }
  dest.drawImage(buffer,0,0);
}

Fixed version (ground truth):
/** 
 * Paints this component using double-buffering.
 * @param dest Destination  {@link GC graphics}.
 */
void doubleBufferedPaint(GC dest){
  final Point size=getSize();
  if (size.x <= 0 || size.y <= 0)   return;
  if (buffer != null) {
    final Rectangle bufferBounds=buffer.getBounds();
    if (bufferBounds.width != size.x || bufferBounds.height != size.y) {
      buffer.dispose();
      buffer=null;
    }
  }
  if (buffer == null) {
    buffer=new Image(getDisplay(),size.x,size.y);
  }
  final GC gc=new GC(buffer);
  gc.setForeground(getDisplay().getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW));
  gc.drawLine(0,0,0,getBounds().height);
  gc.drawLine(getBounds().width - 1,0,getBounds().width - 1,getBounds().height);
  try {
    gc.setBackground(getBackground());
    gc.fillRectangle(0,0,size.x,size.y);
    doPaint(gc);
  }
  finally {
    gc.dispose();
  }
  dest.drawImage(buffer,0,0);
}
Program: 93714
Project: 93714
Buggy source:
/** 
 * Draws a line connecting the given right and left items.
 * @param gc {@link GC graphics configuration} on which to actually draw.
 * @param leftItem Left of the two items to connect.
 * @param rightItem Right of the items to connect.
 */
protected void drawLine(GC gc,ModelContentMergeTabItem leftItem,ModelContentMergeTabItem rightItem){
  if (leftItem == null || rightItem == null)   return;
  final Rectangle drawingBounds=getBounds();
  RGB color=ModelContentMergeViewer.getColor(leftItem.getCurveColor());
  if (rightItem.getCurveColor() != leftItem.getCurveColor() && rightItem.getCurveColor() != EMFCompareConstants.PREFERENCES_KEY_CHANGED_COLOR)   color=ModelContentMergeViewer.getColor(rightItem.getCurveColor());
  final int treeTabBorder=5;
  final int leftX=0;
  final int rightX=drawingBounds.width;
  final int leftY;
  final int rightY;
  if (System.getProperty("String_Node_Str").contains("String_Node_Str")) {
    leftY=leftItem.getCurveY() + treeTabBorder;
    rightY=rightItem.getCurveY() + treeTabBorder;
  }
 else {
    leftY=leftItem.getCurveY() + leftItem.getHeaderHeight() + treeTabBorder;
    rightY=rightItem.getCurveY() + rightItem.getHeaderHeight() + treeTabBorder;
  }
  final int lineWidth=leftItem.getCurveSize();
  gc.setForeground(new Color(getDisplay(),color));
  gc.setLineWidth(lineWidth);
  gc.setLineStyle(SWT.LINE_SOLID);
  final int[] points=getCenterCurvePoints(leftX,leftY,rightX,rightY);
  for (int i=1; i < points.length; i++) {
    gc.drawLine(leftX + i - 1,points[i - 1],leftX + i,points[i]);
  }
}

Fixed version (ground truth):
/** 
 * Draws a line connecting the given right and left items.
 * @param gc {@link GC graphics configuration} on which to actually draw.
 * @param leftItem Left of the two items to connect.
 * @param rightItem Right of the items to connect.
 */
protected void drawLine(GC gc,ModelContentMergeTabItem leftItem,ModelContentMergeTabItem rightItem){
  if (leftItem == null || rightItem == null)   return;
  final Rectangle drawingBounds=getBounds();
  RGB color=ModelContentMergeViewer.getColor(leftItem.getCurveColor());
  if (rightItem.getCurveColor() != leftItem.getCurveColor() && rightItem.getCurveColor() != EMFCompareConstants.PREFERENCES_KEY_CHANGED_COLOR) {
    color=ModelContentMergeViewer.getColor(rightItem.getCurveColor());
  }
  final int treeTabBorder=5;
  final int leftX=0;
  final int rightX=drawingBounds.width;
  final int leftY;
  final int rightY;
  if (System.getProperty("String_Node_Str").contains("String_Node_Str")) {
    leftY=leftItem.getCurveY() + treeTabBorder;
    rightY=rightItem.getCurveY() + treeTabBorder;
  }
 else {
    leftY=leftItem.getCurveY() + leftItem.getHeaderHeight() + treeTabBorder;
    rightY=rightItem.getCurveY() + rightItem.getHeaderHeight() + treeTabBorder;
  }
  final int lineWidth=leftItem.getCurveSize();
  gc.setForeground(new Color(getDisplay(),color));
  gc.setLineWidth(lineWidth);
  gc.setLineStyle(SWT.LINE_SOLID);
  final int[] points=getCenterCurvePoints(leftX,leftY,rightX,rightY);
  for (int i=1; i < points.length; i++) {
    gc.drawLine(leftX + i - 1,points[i - 1],leftX + i,points[i]);
  }
}
Program: 93716
Project: 93716
Buggy source:
public void treeExpanded(TreeEvent e){
  ((TreeItem)e.item).setExpanded(true);
  e.doit=false;
  parentViewer.update();
  expanded=true;
}

Fixed version (ground truth):
public void treeExpanded(TreeEvent e){
  ((TreeItem)e.item).setExpanded(true);
  e.doit=false;
  parentViewer.update();
}
Program: 93717
Project: 93717
Buggy source:
public void treeCollapsed(TreeEvent e){
  ((TreeItem)e.item).setExpanded(false);
  e.doit=false;
  parentViewer.update();
  expanded=true;
}

Fixed version (ground truth):
public void treeCollapsed(TreeEvent e){
  ((TreeItem)e.item).setExpanded(false);
  e.doit=false;
  parentViewer.update();
}
Program: 93718
Project: 93718
Buggy source:
/** 
 * Instantiates a   {@link ModelContentMergeTabFolder} given its parent {@link Composite} and its side.
 * @param viewer Parent viewer of this viewer part.
 * @param composite Parent  {@link Composite} for this part.
 * @param side Comparison side of this part. Must be one of  {@link EMFCompareConstants#LEFT EMFCompareConstants.RIGHT},   {@link EMFCompareConstants#RIGHT EMFCompareConstants.LEFT} or{@link EMFCompareConstants#ANCESTOR EMFCompareConstants.ANCESTOR}.
 */
public ModelContentMergeTabFolder(ModelContentMergeViewer viewer,Composite composite,int side){
  if (side != EMFCompareConstants.RIGHT && side != EMFCompareConstants.LEFT && side != EMFCompareConstants.ANCESTOR)   throw new IllegalArgumentException(EMFCompareUIMessages.getString("String_Node_Str",side));
  parentViewer=viewer;
  partSide=side;
  createContents(composite);
}

Fixed version (ground truth):
/** 
 * Instantiates a   {@link ModelContentMergeTabFolder} given its parent {@link Composite} and its side.
 * @param viewer Parent viewer of this viewer part.
 * @param composite Parent  {@link Composite} for this part.
 * @param side Comparison side of this part. Must be one of  {@link EMFCompareConstants#LEFT EMFCompareConstants.RIGHT},   {@link EMFCompareConstants#RIGHT EMFCompareConstants.LEFT} or{@link EMFCompareConstants#ANCESTOR EMFCompareConstants.ANCESTOR}.
 */
public ModelContentMergeTabFolder(ModelContentMergeViewer viewer,Composite composite,int side){
  if (side != EMFCompareConstants.RIGHT && side != EMFCompareConstants.LEFT && side != EMFCompareConstants.ANCESTOR) {
    throw new IllegalArgumentException(EMFCompareUIMessages.getString("String_Node_Str",side));
  }
  parentViewer=viewer;
  partSide=side;
  createContents(composite);
}
Program: 93719
Project: 93719
Buggy source:
/** 
 * Ensures the first item of the given list of   {@link DiffElement}s is visible, and sets the selection of the tree to all those items.
 * @param diffs Items to select.
 */
public void navigateToDiff(List<DiffElement> diffs){
  EObject target=null;
  if (partSide == EMFCompareConstants.LEFT) {
    target=EMFCompareEObjectUtils.getLeftElement(diffs.get(0));
  }
 else   if (partSide == EMFCompareConstants.RIGHT) {
    if (diffs.get(0) instanceof DiffGroup && EMFCompareEObjectUtils.getLeftElement(diffs.get(0)) != null) {
      target=EMFCompareEObjectUtils.getRightElement(findMatchFromElement(EMFCompareEObjectUtils.getLeftElement(diffs.get(0))));
    }
 else     if (!(diffs.get(0) instanceof DiffGroup)) {
      target=EMFCompareEObjectUtils.getRightElement(diffs.get(0));
    }
 else     return;
  }
 else {
    target=EMFCompareEObjectUtils.getAncestorElement(findMatchFromElement(EMFCompareEObjectUtils.getLeftElement(diffs.get(0))));
  }
  tabs.get(tabFolder.getSelectionIndex()).showItems(diffs);
  properties.setReflectiveInput(findMatchFromElement(target));
  parentViewer.getConfiguration().setProperty(EMFCompareConstants.PROPERTY_CONTENT_SELECTION,diffs.get(0));
  parentViewer.updateCenter();
  expanded=true;
}

Fixed version (ground truth):
/** 
 * Ensures the first item of the given list of   {@link DiffElement}s is visible, and sets the selection of the tree to all those items.
 * @param diffs Items to select.
 */
public void navigateToDiff(List<DiffElement> diffs){
  EObject target=null;
  if (partSide == EMFCompareConstants.LEFT) {
    target=EMFCompareEObjectUtils.getLeftElement(diffs.get(0));
  }
 else   if (partSide == EMFCompareConstants.RIGHT) {
    if (diffs.get(0) instanceof DiffGroup && EMFCompareEObjectUtils.getLeftElement(diffs.get(0)) != null) {
      target=EMFCompareEObjectUtils.getRightElement(findMatchFromElement(EMFCompareEObjectUtils.getLeftElement(diffs.get(0))));
    }
 else     if (!(diffs.get(0) instanceof DiffGroup)) {
      target=EMFCompareEObjectUtils.getRightElement(diffs.get(0));
    }
 else     return;
  }
 else {
    target=EMFCompareEObjectUtils.getAncestorElement(findMatchFromElement(EMFCompareEObjectUtils.getLeftElement(diffs.get(0))));
  }
  tabs.get(tabFolder.getSelectionIndex()).showItems(diffs);
  properties.setReflectiveInput(findMatchFromElement(target));
  parentViewer.getConfiguration().setProperty(EMFCompareConstants.PROPERTY_CONTENT_SELECTION,diffs.get(0));
  parentViewer.updateCenter();
}
Program: 93721
Project: 93721
Buggy source:
/** 
 * {@inheritDoc}
 * @see org.eclipse.jface.viewers.AbstractTreeViewer#inputChanged(java.lang.Object,java.lang.Object)
 */
@Override protected void inputChanged(Object input,Object oldInput){
  final TreePath[] expandedPaths=getExpandedTreePaths();
  super.inputChanged(input,oldInput);
  if (input != null) {
    if (!(input instanceof ComparisonSnapshot) && input != oldInput) {
      final ComparisonSnapshot snapshot=ModelComparator.getComparator(configuration).getComparisonResult();
      final Object match;
      if (snapshot instanceof ComparisonResourceSetSnapshot) {
        match=((ComparisonResourceSetSnapshot)snapshot).getMatchResourceSet();
      }
 else {
        match=((ComparisonResourceSnapshot)snapshot).getMatch();
      }
      if (match != null) {
        setInput(snapshot);
      }
 else {
        setInput(null);
      }
    }
    updateToolItems();
    setExpandedTreePaths(expandedPaths);
  }
 else {
    hideStructurePane();
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 * @see org.eclipse.jface.viewers.AbstractTreeViewer#inputChanged(java.lang.Object,java.lang.Object)
 */
@Override protected void inputChanged(Object input,Object oldInput){
  final TreePath[] expandedPaths=getExpandedTreePaths();
  super.inputChanged(input,oldInput);
  if (input != null) {
    if (!(input instanceof ComparisonSnapshot) && input != oldInput) {
      final ComparisonSnapshot snapshot=ModelComparator.getComparator(configuration).getComparisonResult();
      final Object match;
      match=((ComparisonResourceSetSnapshot)snapshot).getMatchResourceSet();
      if (match != null) {
        setInput(snapshot);
      }
 else {
        setInput(null);
      }
    }
    updateToolItems();
    setExpandedTreePaths(expandedPaths);
  }
 else {
    hideStructurePane();
  }
}
Program: 93723
Project: 93723
Buggy source:
/** 
 * Counts all the   {@link EStructuralFeature features} of the given {@link EObject} that are<code>null</code> or initialized to the empty  {@link String} &quot;&quot;.
 * @param eobj {@link EObject} we need to count the empty features of.
 * @return The number of features not initialized to <code>null</code> or the empty String.
 */
private int nonNullFeaturesCount(EObject eobj){
  Integer nonNullFeatures=nonNullFeatureCounts.get(eobj);
  if (nonNullFeatures == null) {
    int count=0;
    final Iterator<EStructuralFeature> features=eobj.eClass().getEAllStructuralFeatures().iterator();
    while (features.hasNext()) {
      final EStructuralFeature feature=features.next();
      if (eobj.eGet(feature) != null && !"String_Node_Str".equals(eobj.eGet(feature).toString())) {
        count++;
      }
    }
    nonNullFeatures=new Integer(count);
    nonNullFeatureCounts.put(eobj,nonNullFeatures);
  }
  return nonNullFeatures.intValue();
}

Fixed version (ground truth):
/** 
 * Counts all the   {@link EStructuralFeature features} of the given {@link EObject} that are<code>null</code> or initialized to the empty  {@link String} &quot;&quot;.
 * @param eobj {@link EObject} we need to count the empty features of.
 * @return The number of features not initialized to <code>null</code> or the empty String.
 */
private int nonNullFeaturesCount(EObject eobj){
  Integer nonNullFeatures=nonNullFeatureCounts.get(eobj);
  if (nonNullFeatures == null) {
    int count=0;
    final Iterator<EStructuralFeature> features=eobj.eClass().getEAllStructuralFeatures().iterator();
    while (features.hasNext()) {
      final EStructuralFeature feature=features.next();
      if (eobj.eGet(feature) != null && !"String_Node_Str".equals(eobj.eGet(feature).toString())) {
        count++;
      }
    }
    nonNullFeatures=Integer.valueOf(count);
    nonNullFeatureCounts.put(eobj,nonNullFeatures);
  }
  return nonNullFeatures.intValue();
}
Program: 93724
Project: 93724
Buggy source:
/** 
 * Creates   {@link UnmatchElement}s and   {@link RemoteUnmatchElement}s wrapped around all the elements of the given   {@link List}.
 * @param root Root of the  {@link MatchModel} under which to insert all these elements.
 * @param unmatchedElements {@link List} containing all the elements we haven't been able to match.
 * @param leftSide If set to <code>true</code>, the unmatched element will be set to be from the left side.
 * @throws FactoryException Thrown if we cannot add elements under the given  {@link MatchModel root}.
 */
private void createThreeWayUnmatchElements(MatchModel root,Map<EObject,Boolean> unmatchedElements,boolean leftSide) throws FactoryException {
  for (  final EObject element : unmatchedElements.keySet()) {
    if (!unmatchedElements.containsKey(element.eContainer())) {
      final UnmatchElement unMap=MatchFactory.eINSTANCE.createUnmatchElement();
      unMap.setElement(element);
      if (unmatchedElements.get(element)) {
        unMap.setRemote(true);
      }
      if (leftSide) {
        unMap.setSide(Side.LEFT);
      }
 else {
        unMap.setSide(Side.RIGHT);
      }
      redirectedAdd(root,UNMATCH_ELEMENT_NAME,unMap);
    }
  }
  unmatchedElements.clear();
}

Fixed version (ground truth):
/** 
 * Creates   {@link UnmatchElement}s and   {@link RemoteUnmatchElement}s wrapped around all the elements of the given   {@link List}.
 * @param root Root of the  {@link MatchModel} under which to insert all these elements.
 * @param unmatchedElements {@link List} containing all the elements we haven't been able to match.
 * @param leftSide If set to <code>true</code>, the unmatched element will be set to be from the left side.
 * @throws FactoryException Thrown if we cannot add elements under the given  {@link MatchModel root}.
 */
private void createThreeWayUnmatchElements(MatchModel root,Map<EObject,Boolean> unmatchedElements,boolean leftSide) throws FactoryException {
  for (  final Entry<EObject,Boolean> entry : unmatchedElements.entrySet()) {
    if (!unmatchedElements.containsKey(entry.getKey().eContainer())) {
      final UnmatchElement unMap=MatchFactory.eINSTANCE.createUnmatchElement();
      unMap.setElement(entry.getKey());
      if (entry.getValue()) {
        unMap.setRemote(true);
      }
      if (leftSide) {
        unMap.setSide(Side.LEFT);
      }
 else {
        unMap.setSide(Side.RIGHT);
      }
      redirectedAdd(root,UNMATCH_ELEMENT_NAME,unMap);
    }
  }
  unmatchedElements.clear();
}
Program: 93725
Project: 93725
Buggy source:
/** 
 * Returns the engine instance.
 * @return The engine instance.
 */
public IMatchEngine getEngineInstance(){
  if (engine == null) {
    try {
      engine=(IMatchEngine)element.createExecutableExtension("String_Node_Str");
    }
 catch (    final CoreException e) {
      EMFComparePlugin.log(e,false);
    }
  }
  engine.reset();
  return engine;
}

Fixed version (ground truth):
/** 
 * Returns the engine instance.
 * @return The engine instance.
 */
public IMatchEngine getEngineInstance(){
  if (engine == null) {
    try {
      engine=(IMatchEngine)element.createExecutableExtension("String_Node_Str");
    }
 catch (    final CoreException e) {
      EMFComparePlugin.log(e,false);
    }
  }
  if (engine != null) {
    engine.reset();
  }
  return engine;
}
Program: 93726
Project: 93726
Buggy source:
/** 
 * {@inheritDoc}
 * @see java.lang.Object#equals(java.lang.Object)
 */
@Override public boolean equals(Object obj){
  boolean isEqual=true;
  if (this == obj) {
    isEqual=true;
  }
 else   if (obj == null || getClass() != obj.getClass()) {
    isEqual=false;
  }
 else {
    final MatchEngineDescriptor other=(MatchEngineDescriptor)obj;
    if (engineClassName == null && other.engineClassName != null) {
      isEqual=false;
    }
 else     if (!engineClassName.equals(other.engineClassName)) {
      isEqual=false;
    }
 else     if (fileExtension == null && other.fileExtension != null) {
      isEqual=false;
    }
 else     if (!fileExtension.equals(other.fileExtension)) {
      isEqual=false;
    }
 else     if (priority == null && other.priority != null) {
      isEqual=false;
    }
 else     if (!priority.equals(other.priority)) {
      isEqual=false;
    }
  }
  return isEqual;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 * @see java.lang.Object#equals(java.lang.Object)
 */
@Override public boolean equals(Object obj){
  boolean isEqual=true;
  if (this == obj) {
    isEqual=true;
  }
 else   if (obj == null || getClass() != obj.getClass()) {
    isEqual=false;
  }
 else {
    final MatchEngineDescriptor other=(MatchEngineDescriptor)obj;
    if (engineClassName == null && other.engineClassName != null) {
      isEqual=false;
    }
 else     if (engineClassName != null && !engineClassName.equals(other.engineClassName)) {
      isEqual=false;
    }
 else     if (fileExtension == null && other.fileExtension != null) {
      isEqual=false;
    }
 else     if (fileExtension != null && !fileExtension.equals(other.fileExtension)) {
      isEqual=false;
    }
 else     if (priority == null && other.priority != null) {
      isEqual=false;
    }
 else     if (priority != null && !priority.equals(other.priority)) {
      isEqual=false;
    }
  }
  return isEqual;
}
Program: 93728
Project: 93728
Buggy source:
/** 
 * Returns the feature which seems to be the name of the given   {@link EObject}.
 * @param current {@link EObject} we seek the name feature of.
 * @return The feature which seems to be the name of the given {@link EObject}.
 */
public static EAttribute findNameFeature(EObject current){
  final EClass eclass=current.eClass();
  EAttribute bestFeature=NAME_FEATURE_CACHE.get(eclass.getName() + eclass.hashCode());
  if (bestFeature == null) {
    List<EAttribute> eClassAttributes=new ArrayList<EAttribute>();
    eClassAttributes=eclass.getEAllAttributes();
    if (eClassAttributes.size() > 0) {
      bestFeature=eClassAttributes.get(0);
    }
    if (eClassAttributes.size() > 0) {
      double max=0d;
      for (      final EAttribute attribute : eClassAttributes) {
        final String attributeName=attribute.getName();
        if (nameSimilarityMetric(attributeName,EOBJECT_NAME_FEATURE) > max) {
          max=nameSimilarityMetric(attributeName,EOBJECT_NAME_FEATURE);
          bestFeature=attribute;
        }
      }
      NAME_FEATURE_CACHE.put(eclass.getName() + eclass.hashCode(),bestFeature);
    }
  }
  return bestFeature;
}

Fixed version (ground truth):
/** 
 * Returns the feature which seems to be the name of the given   {@link EObject}.
 * @param current {@link EObject} we seek the name feature of.
 * @return The feature which seems to be the name of the given {@link EObject}.
 */
public static EAttribute findNameFeature(EObject current){
  final EClass eclass=current.eClass();
  EAttribute bestFeature=NAME_FEATURE_CACHE.get(eclass.getName() + eclass.hashCode());
  if (bestFeature == null) {
    final List<EAttribute> eClassAttributes=eclass.getEAllAttributes();
    if (eClassAttributes.size() > 0) {
      bestFeature=eClassAttributes.get(0);
    }
    if (eClassAttributes.size() > 0) {
      double max=0d;
      for (      final EAttribute attribute : eClassAttributes) {
        final String attributeName=attribute.getName();
        if (nameSimilarityMetric(attributeName,EOBJECT_NAME_FEATURE) > max) {
          max=nameSimilarityMetric(attributeName,EOBJECT_NAME_FEATURE);
          bestFeature=attribute;
        }
      }
      NAME_FEATURE_CACHE.put(eclass.getName() + eclass.hashCode(),bestFeature);
    }
  }
  return bestFeature;
}
Program: 93730
Project: 93730
Buggy source:
/** 
 * Stores the given descriptor in the list of known   {@link MergerProviderDescriptor}s.
 * @param desc Descriptor to be added to the list of all know descriptors.
 */
private static void storeProviderDescriptor(MergerProviderDescriptor desc){
  if (desc.getFileExtension() == null)   return;
  final String[] extensions=desc.getFileExtension().split("String_Node_Str");
  for (  String mergerExtension : extensions) {
    if (!PARSED_PROVIDERS.containsKey(mergerExtension)) {
      PARSED_PROVIDERS.put(mergerExtension,new ArrayList<MergerProviderDescriptor>());
    }
    final List<MergerProviderDescriptor> set=PARSED_PROVIDERS.get(mergerExtension);
    set.add(desc);
  }
}

Fixed version (ground truth):
/** 
 * Stores the given descriptor in the list of known   {@link MergerProviderDescriptor}s.
 * @param desc Descriptor to be added to the list of all know descriptors.
 */
private static void storeProviderDescriptor(MergerProviderDescriptor desc){
  if (desc.getFileExtension() == null)   return;
  final String[] extensions=desc.getFileExtension().split("String_Node_Str");
  for (  final String mergerExtension : extensions) {
    if (!PARSED_PROVIDERS.containsKey(mergerExtension)) {
      PARSED_PROVIDERS.put(mergerExtension,new ArrayList<MergerProviderDescriptor>());
    }
    final List<MergerProviderDescriptor> set=PARSED_PROVIDERS.get(mergerExtension);
    set.add(desc);
  }
}