Program: 74373
Project: 74373
Buggy source:
private static LibraryAttribute _importActorLibrary(Tableau tableau,LibraryAttribute gtLibrary){
  if (gtLibrary != null) {
    try {
      Configuration configuration=(Configuration)tableau.toplevel();
      CompositeEntity actorLibrary=(CompositeEntity)configuration.getEntity("String_Node_Str");
      CompositeEntity library=gtLibrary.getLibrary();
      for (      String optionalActorClass : OPTIONAL_ACTORS) {
        try {
          Class<?> clazz=Class.forName(optionalActorClass);
          boolean ignore=false;
          for (          Object entity : library.entityList()) {
            if (entity.getClass().equals(clazz)) {
              ignore=true;
              break;
            }
          }
          if (ignore) {
            continue;
          }
          Constructor<?>[] constructors=clazz.getConstructors();
          NamedObj object=null;
          String name=null;
          for (          Constructor<?> constructor : constructors) {
            Class<?>[] types=constructor.getParameterTypes();
            if (types.length == 2 && types[0].isInstance(library) && types[1].equals(String.class)) {
              name=library.uniqueName(clazz.getSimpleName());
              object=(NamedObj)constructor.newInstance(library,name);
              break;
            }
          }
          if (object != null) {
            List<?> entities=library.entityList();
            int i=0;
            for (            Object entity : entities) {
              if (entity instanceof EntityLibrary || ((NamedObj)entity).getName().compareTo(name) > 0) {
                break;
              }
              i++;
            }
            object.moveToIndex(i);
          }
        }
 catch (        Exception e) {
        }
      }
      Workspace workspace=actorLibrary.workspace();
      try {
        workspace.getReadAccess();
        for (        Object entityObject : actorLibrary.entityList()) {
          try {
            ComponentEntity libraryEntity=(ComponentEntity)entityObject;
            ComponentEntity entity=(ComponentEntity)libraryEntity.clone(library.workspace());
            entity.setContainer(library);
          }
 catch (          Exception e) {
          }
        }
      }
  finally {
        workspace.doneReading();
      }
      EntityLibrary utilitiesLibrary=(EntityLibrary)library.getEntity("String_Node_Str");
      for (      Object entityObject : utilitiesLibrary.entityList()) {
        if (entityObject instanceof CompositeActor) {
          CompositeActor actor=(CompositeActor)entityObject;
          if (actor.attributeList(GTTableau.Factory.class).isEmpty()) {
            new GTTableau.Factory(actor,actor.uniqueName("String_Node_Str"));
          }
        }
      }
      gtLibrary.setLibrary(library);
    }
 catch (    Exception e) {
    }
  }
  return gtLibrary;
}

Fixed version (ground truth):
private static LibraryAttribute _importActorLibrary(Tableau tableau,LibraryAttribute gtLibrary){
  if (gtLibrary != null) {
    try {
      Configuration configuration=(Configuration)tableau.toplevel();
      CompositeEntity actorLibrary=(CompositeEntity)configuration.getEntity("String_Node_Str");
      CompositeEntity library=gtLibrary.getLibrary();
      for (      String optionalActorClass : OPTIONAL_ACTORS) {
        try {
          Class<?> clazz=Class.forName(optionalActorClass);
          boolean ignore=false;
          for (          Object entity : library.entityList()) {
            if (entity.getClass().equals(clazz)) {
              ignore=true;
              break;
            }
          }
          if (ignore) {
            continue;
          }
          Constructor<?>[] constructors=clazz.getConstructors();
          NamedObj object=null;
          String name=null;
          for (          Constructor<?> constructor : constructors) {
            Class<?>[] types=constructor.getParameterTypes();
            if (types.length == 2 && types[0].isInstance(library) && types[1].equals(String.class)) {
              name=library.uniqueName(clazz.getSimpleName());
              object=(NamedObj)constructor.newInstance(library,name);
              break;
            }
          }
          if (object != null) {
            List<?> entities=library.entityList();
            int i=0;
            for (            Object entity : entities) {
              if (entity instanceof EntityLibrary || ((NamedObj)entity).getName().compareTo(name) > 0) {
                break;
              }
              i++;
            }
            object.moveToIndex(i);
          }
        }
 catch (        Throwable t) {
        }
      }
      Workspace workspace=actorLibrary.workspace();
      try {
        workspace.getReadAccess();
        for (        Object entityObject : actorLibrary.entityList()) {
          try {
            ComponentEntity libraryEntity=(ComponentEntity)entityObject;
            ComponentEntity entity=(ComponentEntity)libraryEntity.clone(library.workspace());
            entity.setContainer(library);
          }
 catch (          Exception e) {
          }
        }
      }
  finally {
        workspace.doneReading();
      }
      EntityLibrary utilitiesLibrary=(EntityLibrary)library.getEntity("String_Node_Str");
      for (      Object entityObject : utilitiesLibrary.entityList()) {
        if (entityObject instanceof CompositeActor) {
          CompositeActor actor=(CompositeActor)entityObject;
          if (actor.attributeList(GTTableau.Factory.class).isEmpty()) {
            new GTTableau.Factory(actor,actor.uniqueName("String_Node_Str"));
          }
        }
      }
      gtLibrary.setLibrary(library);
    }
 catch (    Exception e) {
    }
  }
  return gtLibrary;
}