Program: 75353
Project: 75353
Buggy source:
private int _isShadowedImplementation(NamedObj object,NamedObj propagatingContext){
  if (object.isModifiedFromClass()) {
    if (_DEBUG) {
      System.out.println("String_Node_Str" + "String_Node_Str" + object.getFullName());
    }
    return 2;
  }
  if (!propagatingContext.deepContains(object)) {
    throw new InternalErrorException("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  }
  String relativeName=object.getName(propagatingContext);
  if (_DEBUG) {
    System.out.println("String_Node_Str" + object.getFullName());
  }
  NamedObj context=propagatingContext;
  String relativeContextName=null;
  while (context != null) {
    if (!(context instanceof Prototype)) {
      if (relativeContextName == null) {
        relativeContextName=context.getName();
      }
 else {
        relativeContextName=context.getName() + "String_Node_Str" + relativeContextName;
      }
      context=(NamedObj)context.getContainer();
      continue;
    }
    Prototype defersTo=((Prototype)context).getDeferTo();
    if (defersTo == null) {
      if (relativeContextName == null) {
        relativeContextName=context.getName();
      }
 else {
        relativeContextName=context.getName() + "String_Node_Str" + relativeContextName;
      }
      context=(NamedObj)context.getContainer();
      continue;
    }
    NamedObj trueContext=defersTo;
    if (relativeContextName != null) {
      if (!(defersTo instanceof CompositeEntity)) {
        throw new InternalErrorException("String_Node_Str" + "String_Node_Str");
      }
      trueContext=((CompositeEntity)defersTo).getEntity(relativeContextName);
    }
    if (trueContext == _context) {
      if (_DEBUG) {
        System.out.println("String_Node_Str" + defersTo.getFullName() + "String_Node_Str"+ _context.getFullName());
      }
      return 1;
    }
    NamedObj possibleShadow=null;
    if (object instanceof Attribute) {
      possibleShadow=trueContext.getAttribute(relativeName);
    }
 else     if (object instanceof ComponentEntity && trueContext instanceof CompositeEntity) {
      possibleShadow=((CompositeEntity)trueContext).getEntity(relativeName);
    }
    if (possibleShadow == null) {
      throw new InternalErrorException("String_Node_Str" + defersTo.getFullName() + "String_Node_Str"+ "String_Node_Str"+ relativeName+ "String_Node_Str"+ object.getFullName()+ "String_Node_Str"+ propagatingContext.getFullName());
    }
    if (possibleShadow.isModifiedFromClass()) {
      if (_DEBUG) {
        System.out.println("String_Node_Str" + object.getFullName() + "String_Node_Str"+ possibleShadow.getFullName());
      }
      return 2;
    }
    if (_DEBUG) {
      System.out.println("String_Node_Str" + possibleShadow.getFullName());
    }
    int result=_isShadowedImplementation(possibleShadow,trueContext);
    if (result == 2) {
      if (_DEBUG) {
        System.out.println("String_Node_Str" + object.getFullName() + "String_Node_Str"+ possibleShadow.getFullName());
      }
      return 2;
    }
 else     if (result == 1) {
      return 1;
    }
    if (relativeContextName == null) {
      relativeContextName=context.getName();
    }
 else {
      relativeContextName=context.getName() + "String_Node_Str" + relativeContextName;
    }
    context=(NamedObj)context.getContainer();
  }
  if (_DEBUG) {
    System.out.println("String_Node_Str" + object.getFullName() + "String_Node_Str");
  }
  return 0;
}

Fixed version (ground truth):
private int _isShadowedImplementation(NamedObj object,NamedObj propagatingContext){
  if (object.isModifiedFromClass()) {
    if (_DEBUG) {
      System.out.println("String_Node_Str" + "String_Node_Str" + object.getFullName());
    }
    return 2;
  }
  if (!propagatingContext.deepContains(object)) {
    throw new InternalErrorException("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  }
  String relativeName=object.getName(propagatingContext);
  if (_DEBUG) {
    System.out.println("String_Node_Str" + object.getFullName());
  }
  NamedObj context=propagatingContext;
  String relativeContextName=null;
  while (context != null) {
    if (!(context instanceof Prototype)) {
      if (relativeContextName == null) {
        relativeContextName=context.getName();
      }
 else {
        relativeContextName=context.getName() + "String_Node_Str" + relativeContextName;
      }
      context=(NamedObj)context.getContainer();
      continue;
    }
    Prototype defersTo=((Prototype)context).getDeferTo();
    if (defersTo == null) {
      if (relativeContextName == null) {
        relativeContextName=context.getName();
      }
 else {
        relativeContextName=context.getName() + "String_Node_Str" + relativeContextName;
      }
      context=(NamedObj)context.getContainer();
      continue;
    }
    NamedObj trueContext=defersTo;
    if (relativeContextName != null) {
      if (!(defersTo instanceof CompositeEntity)) {
        throw new InternalErrorException("String_Node_Str" + "String_Node_Str");
      }
      if (_context instanceof ComponentEntity) {
        trueContext=((CompositeEntity)defersTo).getEntity(relativeContextName);
      }
 else       if (_context instanceof Attribute) {
        trueContext=defersTo.getAttribute(relativeContextName);
      }
 else       if (_context instanceof Port) {
        trueContext=((Entity)defersTo).getPort(relativeContextName);
      }
 else       if (_context instanceof Relation) {
        trueContext=((CompositeEntity)defersTo).getRelation(relativeContextName);
      }
      if (trueContext == null) {
        throw new InternalErrorException("String_Node_Str" + defersTo.getFullName() + "String_Node_Str"+ "String_Node_Str"+ relativeContextName);
      }
    }
    if (trueContext == _context) {
      if (_DEBUG) {
        System.out.println("String_Node_Str" + defersTo.getFullName() + "String_Node_Str"+ _context.getFullName());
      }
      return 1;
    }
    NamedObj possibleShadow=null;
    if (object instanceof Attribute) {
      possibleShadow=trueContext.getAttribute(relativeName);
    }
 else     if (object instanceof ComponentEntity && trueContext instanceof CompositeEntity) {
      possibleShadow=((CompositeEntity)trueContext).getEntity(relativeName);
    }
    if (possibleShadow == null) {
      throw new InternalErrorException("String_Node_Str" + defersTo.getFullName() + "String_Node_Str"+ "String_Node_Str"+ relativeName+ "String_Node_Str"+ object.getFullName()+ "String_Node_Str"+ propagatingContext.getFullName());
    }
    if (possibleShadow.isModifiedFromClass()) {
      if (_DEBUG) {
        System.out.println("String_Node_Str" + object.getFullName() + "String_Node_Str"+ possibleShadow.getFullName());
      }
      return 2;
    }
    if (_DEBUG) {
      System.out.println("String_Node_Str" + possibleShadow.getFullName());
    }
    int result=_isShadowedImplementation(possibleShadow,trueContext);
    if (result == 2) {
      if (_DEBUG) {
        System.out.println("String_Node_Str" + object.getFullName() + "String_Node_Str"+ possibleShadow.getFullName());
      }
      return 2;
    }
 else     if (result == 1) {
      return 1;
    }
    if (relativeContextName == null) {
      relativeContextName=context.getName();
    }
 else {
      relativeContextName=context.getName() + "String_Node_Str" + relativeContextName;
    }
    context=(NamedObj)context.getContainer();
  }
  if (_DEBUG) {
    System.out.println("String_Node_Str" + object.getFullName() + "String_Node_Str");
  }
  return 0;
}