nus-yam/ex-repair huggingface dataset:
Program: 101890
Project: 101890
Buggy source:
private void checkForUpdate(){
  if (verbose) {
    logger.log(Level.INFO,"String_Node_Str");
  }
  URL url=null;
  URLConnection urlConn=null;
  InputStreamReader inStream=null;
  BufferedReader buff=null;
  String v="String_Node_Str";
  try {
    url=new URL("String_Node_Str");
    urlConn=url.openConnection();
    inStream=new InputStreamReader(urlConn.getInputStream());
  }
 catch (  Exception ex) {
  }
  buff=new BufferedReader(inStream);
  try {
    v=buff.readLine();
    urlConn=null;
    inStream=null;
    buff.close();
    buff=null;
  }
 catch (  Exception ex) {
  }
  if (!this.getDescription().getVersion().equalsIgnoreCase(v)) {
    String version=this.getDescription().getVersion();
    if (version.endsWith("String_Node_Str") || version.endsWith("String_Node_Str")) {
      if (version.replaceAll("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str").equalsIgnoreCase(v)) {
        update=true;
        if (verbose) {
          logger.log(Level.INFO,"String_Node_Str");
        }
      }
 else {
        update=false;
        if (verbose) {
          logger.log(Level.INFO,"String_Node_Str");
        }
      }
    }
 else {
      update=true;
      if (verbose) {
        logger.log(Level.INFO,"String_Node_Str");
      }
    }
  }
 else {
    if (verbose) {
      logger.log(Level.INFO,"String_Node_Str");
    }
    update=false;
  }
}

Fixed version (ground truth):
private void checkForUpdate(){
  if (verbose) {
    logger.log(Level.INFO,"String_Node_Str");
  }
  URL url;
  URLConnection urlConn;
  InputStreamReader inStream=null;
  BufferedReader buff;
  String v="String_Node_Str";
  try {
    url=new URL("String_Node_Str");
    urlConn=url.openConnection();
    inStream=new InputStreamReader(urlConn.getInputStream());
  }
 catch (  Exception ex) {
  }
  buff=new BufferedReader(inStream);
  try {
    v=buff.readLine();
    urlConn=null;
    inStream=null;
    buff.close();
    buff=null;
  }
 catch (  Exception ex) {
  }
  if (!this.getDescription().getVersion().equalsIgnoreCase(v)) {
    String version=this.getDescription().getVersion();
    if (version.endsWith("String_Node_Str") || version.endsWith("String_Node_Str")) {
      if (version.replaceAll("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str").equalsIgnoreCase(v)) {
        update=true;
        if (verbose) {
          logger.log(Level.INFO,"String_Node_Str");
        }
      }
 else {
        update=false;
        if (verbose) {
          logger.log(Level.INFO,"String_Node_Str");
        }
      }
    }
 else {
      update=true;
      if (verbose) {
        logger.log(Level.INFO,"String_Node_Str");
      }
    }
  }
 else {
    if (verbose) {
      logger.log(Level.INFO,"String_Node_Str");
    }
    update=false;
  }
}
Program: 101892
Project: 101892
Buggy source:
public boolean checkWaterWalk(Player player,double x,double z){
  Block block=player.getLocation().getBlock();
  if (block.isLiquid() && player.getVehicle() == null) {
    if (isInWater.contains(player.getName())) {
      if (isInWaterCache.contains(player.getName())) {
        if (x > XZ_SPEED_MAX_WATER || z > XZ_SPEED_MAX_WATER && !Utilities.sprintFly(player) && player.getNearbyEntities(1,1,1).isEmpty()) {
          return true;
        }
 else         if (x > XZ_SPEED_MAX_WATER_SPRINT || z > XZ_SPEED_MAX_WATER_SPRINT) {
          return true;
        }
      }
 else {
        isInWaterCache.add(player.getName());
        return false;
      }
    }
 else {
      isInWater.add(player.getName());
      return false;
    }
  }
  isInWater.remove(player.getName());
  isInWaterCache.remove(player.getName());
  return false;
}

Fixed version (ground truth):
public boolean checkWaterWalk(Player player,double x,double z){
  Block block=player.getLocation().getBlock();
  if (player.getVehicle() == null && !player.isFlying()) {
    if (block.isLiquid() && block.getRelative(BlockFace.DOWN).isLiquid()) {
      if (isInWater.contains(player.getName())) {
        if (isInWaterCache.contains(player.getName())) {
          if (player.getNearbyEntities(1,1,1).isEmpty()) {
            boolean b=false;
            if (!Utilities.sprintFly(player) && x > XZ_SPEED_MAX_WATER || z > XZ_SPEED_MAX_WATER) {
              b=true;
            }
 else             if (x > XZ_SPEED_MAX_WATER_SPRINT || z > XZ_SPEED_MAX_WATER_SPRINT) {
              b=true;
            }
            if (b) {
              if (waterSpeedViolation.containsKey(player.getName())) {
                int v=waterSpeedViolation.get(player.getName());
                if (v >= WATER_SPEED_VIOLATION_MAX) {
                  waterSpeedViolation.put(player.getName(),0);
                  return true;
                }
 else {
                  waterSpeedViolation.put(player.getName(),v + 1);
                }
              }
 else {
                waterSpeedViolation.put(player.getName(),1);
              }
            }
          }
        }
 else {
          isInWaterCache.add(player.getName());
          return false;
        }
      }
 else {
        isInWater.add(player.getName());
        return false;
      }
    }
 else     if (block.getRelative(BlockFace.DOWN).isLiquid() && isAscending(player) && Utilities.cantStandAt(block)&& Utilities.cantStandAt(block.getRelative(BlockFace.DOWN))) {
      if (waterAscensionViolation.containsKey(player.getName())) {
        int v=waterAscensionViolation.get(player.getName());
        if (v >= WATER_ASCENSION_VIOLATION_MAX) {
          waterAscensionViolation.put(player.getName(),0);
          return true;
        }
 else {
          waterAscensionViolation.put(player.getName(),v + 1);
        }
      }
 else {
        waterAscensionViolation.put(player.getName(),1);
      }
    }
 else {
      isInWater.remove(player.getName());
      isInWaterCache.remove(player.getName());
    }
  }
  return false;
}
Program: 101893
Project: 101893
Buggy source:
private static boolean cantStandFar(Block block){
  return !canStand(block.getRelative(BlockFace.NORTH_WEST)) && !canStand(block.getRelative(BlockFace.NORTH_EAST)) && !canStand(block.getRelative(BlockFace.SOUTH_WEST))&& !canStand(block.getRelative(BlockFace.SOUTH_EAST));
}

Fixed version (ground truth):
public static boolean cantStandFar(Block block){
  return !canStand(block.getRelative(BlockFace.NORTH_WEST)) && !canStand(block.getRelative(BlockFace.NORTH_EAST)) && !canStand(block.getRelative(BlockFace.SOUTH_WEST))&& !canStand(block.getRelative(BlockFace.SOUTH_EAST));
}
Program: 101894
Project: 101894
Buggy source:
private static boolean cantStandClose(Block block){
  return !canStand(block.getRelative(BlockFace.NORTH)) && !canStand(block.getRelative(BlockFace.EAST)) && !canStand(block.getRelative(BlockFace.SOUTH))&& !canStand(block.getRelative(BlockFace.WEST));
}

Fixed version (ground truth):
public static boolean cantStandClose(Block block){
  return !canStand(block.getRelative(BlockFace.NORTH)) && !canStand(block.getRelative(BlockFace.EAST)) && !canStand(block.getRelative(BlockFace.SOUTH))&& !canStand(block.getRelative(BlockFace.WEST));
}
Program: 101895
Project: 101895
Buggy source:
public void logTeleport(final Player player){
  logEvent(movingExempt,player,TELEPORT_TIME);
}

Fixed version (ground truth):
public void logTeleport(final Player player){
  logEvent(movingExempt,player,TELEPORT_TIME);
  nofallViolation.remove(player.getName());
  flightViolation.remove(player.getName());
  yAxisViolations.remove(player.getName());
  yAxisLastViolation.remove(player.getName());
  lastYcoord.remove(player.getName());
  lastYtime.remove(player.getName());
}
Program: 101896
Project: 101896
Buggy source:
@Override public void onEnable(){
  plugin=this;
  config=AnticheatManager.CONFIGURATION;
  verbose=config.verboseStartup();
  updateFolder=config.updateFolder();
  checkForUpdate();
  if (!new File("String_Node_Str").exists()) {
    if (verbose) {
      logger.log(Level.INFO,"String_Node_Str");
    }
    saveDefaultConfig();
  }
  eventList.add(new PlayerListener());
  eventList.add(new BlockListener());
  eventList.add(new EntityListener());
  eventList.add(new VehicleListener());
  if (config.logXRay()) {
    eventList.add(new XRayListener());
  }
  for (  Listener listener : eventList) {
    getServer().getPluginManager().registerEvents(listener,this);
    if (verbose) {
      logger.log(Level.INFO,"String_Node_Str".concat(listener.toString()));
    }
  }
  getCommand("String_Node_Str").setExecutor(new CommandHandler());
  if (verbose) {
    logger.log(Level.INFO,"String_Node_Str");
    logger.log(Level.INFO,"String_Node_Str");
  }
  if (update && config.autoUpdate()) {
    if (verbose) {
      logger.log(Level.INFO,"String_Node_Str");
    }
    File file=new File("String_Node_Str" + updateFolder);
    if (!file.exists()) {
      try {
        file.mkdir();
      }
 catch (      Exception ex) {
      }
    }
    try {
      saveFile(file.getCanonicalPath() + "String_Node_Str","String_Node_Str");
    }
 catch (    IOException ex) {
    }
  }
}

Fixed version (ground truth):
@Override public void onEnable(){
  plugin=this;
  if (!new File(this.getDataFolder() + "String_Node_Str").exists()) {
    saveDefaultConfig();
    if (verbose) {
      logger.log(Level.INFO,"String_Node_Str");
    }
  }
  config=AnticheatManager.CONFIGURATION;
  verbose=config.verboseStartup();
  updateFolder=config.updateFolder();
  checkForUpdate();
  eventList.add(new PlayerListener());
  eventList.add(new BlockListener());
  eventList.add(new EntityListener());
  eventList.add(new VehicleListener());
  if (config.logXRay()) {
    eventList.add(new XRayListener());
  }
  for (  Listener listener : eventList) {
    getServer().getPluginManager().registerEvents(listener,this);
    if (verbose) {
      logger.log(Level.INFO,"String_Node_Str".concat(listener.toString()));
    }
  }
  getCommand("String_Node_Str").setExecutor(new CommandHandler());
  if (verbose) {
    logger.log(Level.INFO,"String_Node_Str");
    logger.log(Level.INFO,"String_Node_Str");
  }
  if (update && config.autoUpdate()) {
    if (verbose) {
      logger.log(Level.INFO,"String_Node_Str");
    }
    File file=new File("String_Node_Str" + updateFolder);
    if (!file.exists()) {
      try {
        file.mkdir();
      }
 catch (      Exception ex) {
      }
    }
    try {
      saveFile(file.getCanonicalPath() + "String_Node_Str","String_Node_Str");
    }
 catch (    IOException ex) {
    }
  }
}
Program: 101897
Project: 101897
Buggy source:
@Override public Builder<?> select(List<Builder<?>> aBuilders){
  try {
    JsonToken _token=reader.peek();
    String _name=names.isEmpty() ? "String_Node_Str" : names.peek();
    for (    Builder<?> _b : aBuilders) {
      Name _n=_b.getName();
      String _bn=(_n.getAlias() != null) ? _n.getAlias() : _n.getName();
      if (_name.equals(_bn)) {
        return _b;
      }
    }
    return null;
  }
 catch (  IOException anExc) {
    throw new ParsingException(anExc);
  }
}

Fixed version (ground truth):
@Override public Builder<?> select(List<Builder<?>> aBuilders){
  String _name=names.isEmpty() ? "String_Node_Str" : names.peek();
  for (  Builder<?> _b : aBuilders) {
    if ((_name.equals(_b.getName().getName())) || (_b.getName().equals(Name.MISSING) && aBuilders.size() == 1)) {
      return _b;
    }
  }
  return null;
}
Program: 101900
Project: 101900
Buggy source:
@Override public UnNamedArray<R> of(UnNamedArray<?> aContent){
  array=aContent;
  array.onAttach(List.class,reflector,JsonDocumentDefinition.this);
  return this;
}

Fixed version (ground truth):
@Override public UnNamedArray<R> of(UnNamedArray<?> aContent){
  array=aContent;
  return this;
}
Program: 101901
Project: 101901
Buggy source:
@Override public Name alias(final String aName,final String anAlias){
  return new Name(){
    @Override public String getNamespace(){
      return "String_Node_Str";
    }
    @Override public String getName(){
      return aName;
    }
    @Override public String getAlias(){
      return anAlias;
    }
    @Override public String toString(){
      return "String_Node_Str" + aName + "String_Node_Str"+ anAlias+ "String_Node_Str";
    }
    @Override public int hashCode(){
      return getClass().hashCode() ^ aName.hashCode() ^ anAlias.hashCode();
    }
    @Override public boolean equals(    Object anObject){
      if (anObject instanceof Name) {
        Name _other=(Name)anObject;
        return ((aName != null) && (aName.equals(_other.getName()))) && ((anAlias != null) && (anAlias.equals(_other.getAlias())));
      }
      return false;
    }
  }
;
}

Fixed version (ground truth):
@Override public Name alias(final String aName,final String anAlias){
  return new Name(){
    @Override public String getNamespace(){
      return "String_Node_Str";
    }
    @Override public String getName(){
      return aName;
    }
    @Override public String getAlias(){
      return (anAlias != null) ? anAlias : aName;
    }
    @Override public String toString(){
      return "String_Node_Str" + aName + "String_Node_Str"+ anAlias+ "String_Node_Str";
    }
    @Override public int hashCode(){
      return getClass().hashCode() ^ aName.hashCode() ^ anAlias.hashCode();
    }
    @Override public boolean equals(    Object anObject){
      if (anObject instanceof Name) {
        Name _other=(Name)anObject;
        return ((aName != null) && (aName.equals(_other.getName()))) && ((anAlias != null) && (anAlias.equals(_other.getAlias())));
      }
      return false;
    }
  }
;
}
Program: 101903
Project: 101903
Buggy source:
@Override public String getAlias(){
  return anAlias;
}

Fixed version (ground truth):
@Override public String getAlias(){
  return (anAlias != null) ? anAlias : aName;
}
Program: 101907
Project: 101907
Buggy source:
private GsonDocumentReader<Member2> createMember2Reader(){
  return new GsonDocumentReader<Member2>(new JsonDocumentDefinition<Member2>(){
{
      registerConverters(new ThreadSafeDateStringConverter("String_Node_Str"));
      mapping(Member2.class).with(object("String_Node_Str",Member2.Identifier.class).with(property("String_Node_Str")),property("String_Node_Str"),object("String_Node_Str",Member2.Person.class).with(object("String_Node_Str",Member2.Identifier.class).with(property("String_Node_Str")),property("String_Node_Str"),property("String_Node_Str"),property("String_Node_Str"),property("String_Node_Str")),object("String_Node_Str",Member2.Social.class).with(property("String_Node_Str"),property("String_Node_Str"),property("String_Node_Str")),number("String_Node_Str",Integer.class));
    }
  }
);
}

Fixed version (ground truth):
private GsonDocumentReader<Member2> createMember2Reader(){
  return new GsonDocumentReader<Member2>(new JsonDocumentDefinition<Member2>(){
{
      registerConverters(new ThreadSafeDateStringConverter("String_Node_Str"));
      converting(Member2.Identifier.class).to(ImmutableIdentifier.class).using(new Converter<Member2.Identifier,ImmutableIdentifier>(){
        public ImmutableIdentifier convert(        Member2.Identifier aFrom){
          return ImmutableIdentifier.create(aFrom);
        }
      }
);
      mapping(Member2.class).with(object("String_Node_Str",ImmutableIdentifier.class).via(Member2.Identifier.class).with(property("String_Node_Str")),property("String_Node_Str"),object("String_Node_Str",Member2.Person.class).with(object("String_Node_Str",ImmutableIdentifier.class).via(Member2.Identifier.class).with(property("String_Node_Str")),property("String_Node_Str"),property("String_Node_Str"),property("String_Node_Str"),property("String_Node_Str")),object("String_Node_Str",Member2.Social.class).with(property("String_Node_Str"),property("String_Node_Str"),property("String_Node_Str")),number("String_Node_Str",Integer.class));
    }
  }
);
}
Program: 101909
Project: 101909
Buggy source:
@Override public boolean canConvertFrom(Class<?> aClass){
  return aClass.isAssignableFrom(CharSequence.class);
}

Fixed version (ground truth):
@Override public boolean canConvertFrom(Class<?> aClass){
  return CharSequence.class.isAssignableFrom(aClass);
}
Program: 101910
Project: 101910
Buggy source:
void registerConverters(Converter<?>... converters);

Fixed version (ground truth):
void registerConverters(StringConverter<?>... converters);
Program: 101911
Project: 101911
Buggy source:
@Override public void registerConverters(Converter<?>... aConverters){
  converters.addAll(0,Arrays.asList(aConverters));
}

Fixed version (ground truth):
@Override public void registerConverters(com.sjl.dsl4xml.support.StringConverter<?>... aConverters){
  converters.addAll(0,Arrays.asList(aConverters));
}
Program: 101912
Project: 101912
Buggy source:
public GsonContext(JsonReader aReader){
  reader=aReader;
  stack=new Stack<Object>();
  names=new Stack<String>();
  converters=new ArrayList<Converter<?>>();
  registerConverters(new PrimitiveBooleanConverter(),new DecimalToByteConverter(),new DecimalToShortConverter(),new DecimalToIntConverter(),new DecimalToLongConverter(),new PrimitiveCharConverter(),new PrimitiveFloatConverter(),new PrimitiveDoubleConverter(),new BooleanConverter(),new ByteConverter(),new ShortConverter(),new IntegerConverter(),new LongConverter(),new CharacterConverter(),new FloatConverter(),new DoubleConverter(),new ClassConverter(),new StringConverter());
}

Fixed version (ground truth):
public GsonContext(JsonReader aReader){
  reader=aReader;
  stack=new Stack<Object>();
  names=new Stack<String>();
  converters=new ArrayList<com.sjl.dsl4xml.support.StringConverter<?>>();
  registerConverters(new PrimitiveBooleanStringConverter(),new DecimalToByteStringConverter(),new DecimalToShortStringConverter(),new DecimalToIntStringConverter(),new DecimalToLongStringConverter(),new PrimitiveCharStringConverter(),new PrimitiveFloatStringConverter(),new PrimitiveDoubleStringConverter(),new BooleanStringConverter(),new ByteStringConverter(),new ShortStringConverter(),new IntegerStringConverter(),new LongStringConverter(),new CharacterStringConverter(),new FloatStringConverter(),new DoubleStringConverter(),new ClassStringConverter(),new StringStringConverter());
}
Program: 101913
Project: 101913
Buggy source:
@Override public <T>Converter<T> getConverter(Class<T> aArgType){
  for (  Converter<?> _c : converters) {
    if (_c.canConvertTo(aArgType)) {
      return (Converter<T>)_c;
    }
  }
  throw new RuntimeException("String_Node_Str" + aArgType);
}

Fixed version (ground truth):
@Override public <T>com.sjl.dsl4xml.support.StringConverter<T> getConverter(Class<T> aArgType){
  for (  com.sjl.dsl4xml.support.StringConverter<?> _c : converters) {
    if (_c.canConvertTo(aArgType)) {
      return (com.sjl.dsl4xml.support.StringConverter<T>)_c;
    }
  }
  throw new RuntimeException("String_Node_Str" + aArgType);
}
Program: 101914
Project: 101914
Buggy source:
protected DocumentReader<Person> newPersonUnmarshaller(){
  DocumentReader<Person> _r=mappingOf(Person.class).to(property("String_Node_Str"),property("String_Node_Str"),property("String_Node_Str"));
  _r.registerConverters(new ThreadUnsafeDateConverter("String_Node_Str"));
  return _r;
}

Fixed version (ground truth):
protected DocumentReader<Person> newPersonUnmarshaller(){
  DocumentReader<Person> _r=mappingOf(Person.class).to(property("String_Node_Str"),property("String_Node_Str"),property("String_Node_Str"));
  _r.registerConverters(new ThreadUnsafeDateStringConverter("String_Node_Str"));
  return _r;
}
Program: 101915
Project: 101915
Buggy source:
public void invoke(String aKey,Object anOn,String aWith){
  try {
    if (twoArgSetter) {
      method.invoke(anOn,aKey,converter.convert(aWith));
    }
 else {
      method.invoke(anOn,converter.convert(aWith));
    }
  }
 catch (  ParsingException anExc) {
    throw anExc;
  }
catch (  IllegalArgumentException anExc) {
    throw new ParsingException("String_Node_Str" + method + "String_Node_Str"+ anOn+ "String_Node_Str"+ ((aKey != null) ? aKey + "String_Node_Str" : "String_Node_Str")+ aWith+ "String_Node_Str"+ converter,anExc);
  }
catch (  Exception anExc) {
    throw new RuntimeException(anExc);
  }
}

Fixed version (ground truth):
public void invoke(String aKey,Object anOn,String aWith){
  try {
    if (twoArgSetter) {
      method.invoke(anOn,aKey,converter.convert(aWith));
    }
 else {
      method.invoke(anOn,converter.convert(aWith));
    }
  }
 catch (  ParsingException anExc) {
    throw anExc;
  }
catch (  IllegalArgumentException anExc) {
    throw new ParsingException(anExc.getMessage() + "String_Node_Str" + method+ "String_Node_Str"+ anOn+ "String_Node_Str"+ ((aKey != null) ? aKey + "String_Node_Str" : "String_Node_Str")+ aWith+ "String_Node_Str"+ converter,anExc);
  }
catch (  Exception anExc) {
    throw new RuntimeException(anExc);
  }
}
Program: 101916
Project: 101916
Buggy source:
@Override public JsonToken next(){
  try {
    token=reader.peek();
    System.out.println(token);
switch (token) {
case NAME:
      value=null;
    name=names.push(reader.nextName());
  token=reader.peek();
break;
case BEGIN_OBJECT:
value=null;
reader.beginObject();
break;
case END_OBJECT:
value=null;
reader.endObject();
if (!names.isEmpty()) {
names.pop();
if (!names.isEmpty()) name=names.peek();
 else name=null;
}
 else {
name=null;
}
break;
case BEGIN_ARRAY:
reader.beginArray();
value=null;
token=reader.peek();
break;
case END_ARRAY:
value=null;
reader.endArray();
if (!names.isEmpty()) {
names.pop();
if (!names.isEmpty()) name=names.peek();
 else name=null;
}
 else {
name=null;
}
token=reader.peek();
break;
case STRING:
value=reader.nextString();
name=names.pop();
break;
case BOOLEAN:
value=String.valueOf(reader.nextBoolean());
name=names.pop();
break;
case NUMBER:
value=String.valueOf(reader.nextDouble());
name=names.pop();
break;
case NULL:
value=null;
reader.nextNull();
name=names.pop();
break;
}
return token;
}
 catch (IOException anExc) {
throw new ParsingException(anExc);
}
}

Fixed version (ground truth):
@Override public JsonToken next(){
  try {
    token=reader.peek();
switch (token) {
case NAME:
      value=null;
    name=names.push(reader.nextName());
  token=reader.peek();
break;
case BEGIN_OBJECT:
value=null;
reader.beginObject();
break;
case END_OBJECT:
value=null;
reader.endObject();
if (!names.isEmpty()) {
names.pop();
if (!names.isEmpty()) name=names.peek();
 else name=null;
}
 else {
name=null;
}
break;
case BEGIN_ARRAY:
reader.beginArray();
value=null;
token=reader.peek();
break;
case END_ARRAY:
value=null;
reader.endArray();
if (!names.isEmpty()) {
names.pop();
if (!names.isEmpty()) name=names.peek();
 else name=null;
}
 else {
name=null;
}
token=reader.peek();
break;
case STRING:
value=reader.nextString();
name=names.pop();
break;
case BOOLEAN:
value=String.valueOf(reader.nextBoolean());
name=names.pop();
break;
case NUMBER:
value=String.valueOf(reader.nextDouble());
name=names.pop();
break;
case NULL:
value=null;
reader.nextNull();
name=names.pop();
break;
}
return token;
}
 catch (IOException anExc) {
throw new ParsingException(anExc);
}
}
Program: 101917
Project: 101917
Buggy source:
public String getId();

Fixed version (ground truth):
public Identifier getId();
Program: 101918
Project: 101918
Buggy source:
@Test public void parsesComplexMemberJson(){
  GsonDocumentReader<Member> _reader=mappingOf(Member.class).to(property("String_Node_Str"),property("String_Node_Str"),object("String_Node_Str",Member.Person.class).with(property("String_Node_Str"),property("String_Node_Str"),property("String_Node_Str"),property("String_Node_Str"),property("String_Node_Str")),object("String_Node_Str",Member.Social.class).with(property("String_Node_Str"),property("String_Node_Str"),property("String_Node_Str")),property("String_Node_Str"));
  _reader.registerConverters(new ThreadSafeDateConverter("String_Node_Str"));
  Member _result=_reader.read(new InputStreamReader(getClass().getResourceAsStream("String_Node_Str")));
  Assert.assertNotNull(_result);
}

Fixed version (ground truth):
@Test public void parsesComplexMemberJson() throws Exception {
  GsonDocumentReader<Member1> _reader=mappingOf(Member1.class).to(property("String_Node_Str"),property("String_Node_Str"),object("String_Node_Str",Member1.Person.class).with(property("String_Node_Str"),property("String_Node_Str"),property("String_Node_Str"),property("String_Node_Str"),property("String_Node_Str")),object("String_Node_Str",Member1.Social.class).with(property("String_Node_Str"),property("String_Node_Str"),property("String_Node_Str")),property("String_Node_Str"));
  _reader.registerConverters(new ThreadSafeDateConverter("String_Node_Str"));
  Member1 _result=_reader.read(new InputStreamReader(getClass().getResourceAsStream("String_Node_Str")));
  Assert.assertNotNull(_result);
  Assert.assertEquals("String_Node_Str",_result.getId());
  Assert.assertEquals(new SimpleDateFormat("String_Node_Str").parse("String_Node_Str"),_result.getRegistrationDate());
  Member1.Person _person=_result.getPerson();
  Assert.assertNotNull(_person);
  Assert.assertEquals("String_Node_Str",_person.getId());
  Assert.assertEquals("String_Node_Str",_person.getFirstname());
  Assert.assertEquals("String_Node_Str",_person.getLastname());
  Assert.assertNull(_person.getEmail());
  Assert.assertNull(_person.getTitle());
  Member1.Social _social=_result.getSocial();
  Assert.assertNotNull(_social);
  Assert.assertEquals("String_Node_Str",_social.getProviderId());
  Assert.assertEquals("String_Node_Str",_social.getProviderUserId());
  Assert.assertEquals("String_Node_Str",_social.getImageUrl());
  Assert.assertEquals(50,_result.getPointsAccrued());
}
Program: 101919
Project: 101919
Buggy source:
private void startSyncingPicutres_async(){
  new Thread(new Runnable(){
    @Override public void run(){
      SharedPreferences preferences=PreferenceManager.getDefaultSharedPreferences(PictureSync.this);
      final boolean useProfilePic=preferences.getBoolean("String_Node_Str",false);
      final boolean cropPictures=preferences.getBoolean("String_Node_Str",true);
      for (      SyncObject soh : syncObjects) {
        if (soh.url == null || soh.url.equals("String_Node_Str"))         continue;
        lastPicture=null;
        if (!useProfilePic) {
          String largeURL=getLargeProfilePictureURL(soh.uid);
          if (largeURL != null)           lastPicture=Tools.downloadBitmap(largeURL);
        }
        if (lastPicture == null)         lastPicture=Tools.downloadBitmap(soh.url);
        if (cropPictures)         lastPicture=cropPictureToSquare(lastPicture);
        lastName=soh.name;
        updateProgressCounterHandler.sendEmptyMessage(0);
        if (lastPicture != null)         ContactHandler.setContactPicture(PictureSync.this,soh.contactID,lastPicture);
      }
      EasyTracker.getTracker().trackEvent("String_Node_Str","String_Node_Str","String_Node_Str",syncObjects.size());
      syncingDoneHandler.sendEmptyMessage(0);
    }
  }
).start();
}

Fixed version (ground truth):
private void startSyncingPicutres_async(){
  new Thread(new Runnable(){
    @Override public void run(){
      SharedPreferences preferences=PreferenceManager.getDefaultSharedPreferences(PictureSync.this);
      final boolean useProfilePic=preferences.getBoolean("String_Node_Str",false);
      final boolean cropPictures=preferences.getBoolean("String_Node_Str",true);
      for (      SyncObject soh : syncObjects) {
        if (soh.url == null || soh.url.equals("String_Node_Str"))         continue;
        lastPicture=null;
        if (!useProfilePic) {
          String largeURL=getLargeProfilePictureURL(soh.uid);
          if (largeURL != null)           lastPicture=Tools.downloadBitmap(largeURL);
        }
        if (lastPicture == null)         lastPicture=Tools.downloadBitmap(soh.url);
        if (lastPicture != null && cropPictures)         lastPicture=cropPictureToSquare(lastPicture);
        lastName=soh.name;
        updateProgressCounterHandler.sendEmptyMessage(0);
        if (lastPicture != null)         ContactHandler.setContactPicture(PictureSync.this,soh.contactID,lastPicture);
      }
      EasyTracker.getTracker().trackEvent("String_Node_Str","String_Node_Str","String_Node_Str",syncObjects.size());
      syncingDoneHandler.sendEmptyMessage(0);
    }
  }
).start();
}
Program: 101920
Project: 101920
Buggy source:
@Override public void run(){
  SharedPreferences preferences=PreferenceManager.getDefaultSharedPreferences(PictureSync.this);
  final boolean useProfilePic=preferences.getBoolean("String_Node_Str",false);
  final boolean cropPictures=preferences.getBoolean("String_Node_Str",true);
  for (  SyncObject soh : syncObjects) {
    if (soh.url == null || soh.url.equals("String_Node_Str"))     continue;
    lastPicture=null;
    if (!useProfilePic) {
      String largeURL=getLargeProfilePictureURL(soh.uid);
      if (largeURL != null)       lastPicture=Tools.downloadBitmap(largeURL);
    }
    if (lastPicture == null)     lastPicture=Tools.downloadBitmap(soh.url);
    if (cropPictures)     lastPicture=cropPictureToSquare(lastPicture);
    lastName=soh.name;
    updateProgressCounterHandler.sendEmptyMessage(0);
    if (lastPicture != null)     ContactHandler.setContactPicture(PictureSync.this,soh.contactID,lastPicture);
  }
  EasyTracker.getTracker().trackEvent("String_Node_Str","String_Node_Str","String_Node_Str",syncObjects.size());
  syncingDoneHandler.sendEmptyMessage(0);
}

Fixed version (ground truth):
@Override public void run(){
  SharedPreferences preferences=PreferenceManager.getDefaultSharedPreferences(PictureSync.this);
  final boolean useProfilePic=preferences.getBoolean("String_Node_Str",false);
  final boolean cropPictures=preferences.getBoolean("String_Node_Str",true);
  for (  SyncObject soh : syncObjects) {
    if (soh.url == null || soh.url.equals("String_Node_Str"))     continue;
    lastPicture=null;
    if (!useProfilePic) {
      String largeURL=getLargeProfilePictureURL(soh.uid);
      if (largeURL != null)       lastPicture=Tools.downloadBitmap(largeURL);
    }
    if (lastPicture == null)     lastPicture=Tools.downloadBitmap(soh.url);
    if (lastPicture != null && cropPictures)     lastPicture=cropPictureToSquare(lastPicture);
    lastName=soh.name;
    updateProgressCounterHandler.sendEmptyMessage(0);
    if (lastPicture != null)     ContactHandler.setContactPicture(PictureSync.this,soh.contactID,lastPicture);
  }
  EasyTracker.getTracker().trackEvent("String_Node_Str","String_Node_Str","String_Node_Str",syncObjects.size());
  syncingDoneHandler.sendEmptyMessage(0);
}
Program: 101921
Project: 101921
Buggy source:
public static void matchContactsToFriends(ArrayList<Friend> friends,Context context){
  Cursor people=context.getContentResolver().query(ContactsContract.Contacts.CONTENT_URI,null,null,null,null);
  while (people.moveToNext()) {
    String ID=null, name=null;
    int columnIndex=people.getColumnIndex(ContactsContract.Contacts._ID);
    if (columnIndex != -1)     ID=people.getString(columnIndex);
    columnIndex=people.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME);
    if (columnIndex != -1)     name=people.getString(columnIndex);
    if (name == null)     continue;
    for (    Friend f : friends) {
      if (f.isMatchedWithContact())       continue;
      if (f.getName().equals(name)) {
        f.setContactID(ID);
        f.setContactPicture(getPhoto(context,ID));
        break;
      }
    }
  }
  people.close();
}

Fixed version (ground truth):
public static void matchContactsToFriends(ArrayList<Friend> friends,Context context){
  Cursor people=context.getContentResolver().query(ContactsContract.Contacts.CONTENT_URI,null,null,null,null);
  while (people.moveToNext()) {
    String ID=null, name=null;
    int columnIndex=people.getColumnIndex(ContactsContract.Contacts._ID);
    if (columnIndex != -1)     ID=people.getString(columnIndex);
    columnIndex=people.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME);
    if (columnIndex != -1)     name=people.getString(columnIndex);
    if (name == null)     continue;
    for (    Friend f : friends) {
      if (f.isMatchedWithContact())       continue;
      if (f.getName().equals(name)) {
        f.setContactID(ID);
        Bitmap contactPhoto=getPhoto(context,ID);
        if (contactPhoto != null)         f.setContactPicture(contactPhoto);
        break;
      }
    }
  }
  people.close();
}
Program: 101922
Project: 101922
Buggy source:
public void setContactPicture(Bitmap contactPicture){
  Pair<Integer,Integer> size=getSmallSize(contactPicture);
  this.contactPicture=Bitmap.createScaledBitmap(contactPicture,size.first,size.second,true);
}

Fixed version (ground truth):
public void setContactPicture(Bitmap contactPicture){
  if (contactPicture == null)   return;
  Pair<Integer,Integer> size=getSmallSize(contactPicture);
  this.contactPicture=Bitmap.createScaledBitmap(contactPicture,size.first,size.second,true);
}
Program: 101923
Project: 101923
Buggy source:
public void savePictureHash(){
  profilePictureSyncHash=profilePicture.hashCode();
}

Fixed version (ground truth):
public void savePictureHash(){
  profilePictureSyncHash=profilePicture != null ? profilePicture.hashCode() : 0;
}
Program: 101924
Project: 101924
Buggy source:
@Override public void onComplete(Bundle values){
  saveFacebookAccess();
}

Fixed version (ground truth):
@Override public void onComplete(Bundle values){
  saveFacebookAccess();
  launchFriendList();
}
Program: 101925
Project: 101925
Buggy source:
protected void authorizeWithFacebook(){
  facebook.authorize(this,new String[]{"String_Node_Str"},new DialogListener(){
    @Override public void onComplete(    Bundle values){
      saveFacebookAccess();
    }
    @Override public void onFacebookError(    FacebookError error){
      showError(getString(R.string.login_failed_text) + "String_Node_Str" + error.toString()+ "String_Node_Str");
    }
    @Override public void onError(    DialogError e){
      showError(getString(R.string.login_failed_text) + "String_Node_Str" + e.toString()+ "String_Node_Str");
    }
    @Override public void onCancel(){
      showError(getString(R.string.login_failed_text) + "String_Node_Str" + getString(R.string.login_canceled_text)+ "String_Node_Str");
    }
  }
);
}

Fixed version (ground truth):
protected void authorizeWithFacebook(){
  facebook.authorize(this,new String[]{"String_Node_Str"},new DialogListener(){
    @Override public void onComplete(    Bundle values){
      saveFacebookAccess();
      launchFriendList();
    }
    @Override public void onFacebookError(    FacebookError error){
      showError(getString(R.string.login_failed_text) + "String_Node_Str" + error.toString()+ "String_Node_Str");
    }
    @Override public void onError(    DialogError e){
      showError(getString(R.string.login_failed_text) + "String_Node_Str" + e.toString()+ "String_Node_Str");
    }
    @Override public void onCancel(){
      showError(getString(R.string.login_failed_text) + "String_Node_Str" + getString(R.string.login_canceled_text)+ "String_Node_Str");
    }
  }
);
}
Program: 101926
Project: 101926
Buggy source:
@Override public void onActivityResult(int requestCode,int resultCode,Intent data){
  super.onActivityResult(requestCode,resultCode,data);
  facebook.authorizeCallback(requestCode,resultCode,data);
  if (facebook.isSessionValid()) {
    saveFacebookAccess();
    launchFriendList();
  }
}

Fixed version (ground truth):
@Override public void onActivityResult(int requestCode,int resultCode,Intent data){
  super.onActivityResult(requestCode,resultCode,data);
  facebook.authorizeCallback(requestCode,resultCode,data);
}
Program: 101928
Project: 101928
Buggy source:
@Override public void handleMessage(Message msg){
  AlertDialog.Builder builder=new AlertDialog.Builder(PictureSync.this);
  builder.setMessage(getString(R.string.syncing_done_text)).setCancelable(false).setPositiveButton("String_Node_Str",new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int id){
      PictureSync.this.finish();
    }
  }
);
  builder.create().show();
}

Fixed version (ground truth):
@Override public void handleMessage(Message msg){
  AlertDialog.Builder builder=new AlertDialog.Builder(PictureSync.this);
  builder.setMessage(getString(R.string.syncing_done_text)).setCancelable(false).setPositiveButton("String_Node_Str",new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int id){
      PictureSync.this.finish();
    }
  }
);
  try {
    builder.create().show();
  }
 catch (  BadTokenException bte) {
    bte.printStackTrace();
  }
}
Program: 101929
Project: 101929
Buggy source:
private void loadAllFriendLinks(){
  for (  Friend f : friends) {
    File file=new File(getCacheDir(),f.getSaveContactIDFileName());
    String ID=Tools.getStringFromFile(file);
    if (ID == null)     continue;
    f.setContactID(ID);
    ContactHandler.setContactPicture(f,this);
  }
  friendListAdapter.notifyDataSetChanged();
}

Fixed version (ground truth):
public void loadAllFriendLinks(){
  for (  Friend f : friends) {
    File file=new File(getCacheDir(),f.getSaveContactIDFileName());
    String ID=Tools.getStringFromFile(file);
    if (ID == null)     continue;
    f.setContactID(ID);
    ContactHandler.setContactPicture(f,this);
  }
}
Program: 101930
Project: 101930
Buggy source:
@Override public boolean onOptionsItemSelected(MenuItem item){
switch (item.getItemId()) {
case R.id.menu_unlink_all:
    for (    Friend f : friends)     f.setContactID(null);
  friendListAdapter.notifyDataSetChanged();
return true;
case R.id.menu_smartmatch:
dialog.show();
matchContactToFriends_async(false);
return true;
case R.id.menu_syncpictures:
startSyncingActivity();
return true;
case R.id.menu_savelinks:
saveAllFriendLinks();
return true;
case R.id.menu_loadlinks:
loadAllFriendLinks();
return true;
default :
return super.onOptionsItemSelected(item);
}
}

Fixed version (ground truth):
@Override public boolean onOptionsItemSelected(MenuItem item){
switch (item.getItemId()) {
case R.id.menu_unlink_all:
    for (    Friend f : friends)     f.setContactID(null);
  friendListAdapter.notifyDataSetChanged();
return true;
case R.id.menu_smartmatch:
dialog.show();
matchContactToFriends_async(false);
return true;
case R.id.menu_syncpictures:
startSyncingActivity();
return true;
case R.id.menu_savelinks:
saveAllFriendLinks();
return true;
case R.id.menu_loadlinks:
loadAllFriendLinks();
friendListAdapter.notifyDataSetChanged();
return true;
default :
return super.onOptionsItemSelected(item);
}
}
Program: 101931
Project: 101931
Buggy source:
public void setProfilePic(Bitmap b){
  this.profilePicture=Bitmap.createScaledBitmap(b,Constants.size_Profile_Picture_Width,Constants.size_Profile_Picture_Heigth,true);
}

Fixed version (ground truth):
public void setProfilePic(Bitmap b){
  this.profilePicture=Bitmap.createScaledBitmap(b,Constants.size_Profile_Picture,Constants.size_Profile_Picture,true);
}
Program: 101932
Project: 101932
Buggy source:
public void setContactPicture(Bitmap contactPicture){
  this.contactPicture=contactPicture;
}

Fixed version (ground truth):
public void setContactPicture(Bitmap contactPicture){
  Pair<Integer,Integer> size=getSmallSize(contactPicture);
  this.contactPicture=Bitmap.createScaledBitmap(contactPicture,size.first,size.second,true);
}
Program: 101933
Project: 101933
Buggy source:
public FriendListAdapter(Context context,ArrayList<Friend> friends){
  super(context,R.layout.list_item_friend,friends);
  this.context=context;
  this.friends=friends;
  Resources r=this.getContext().getResources();
  Bitmap b=BitmapFactory.decodeResource(r,R.drawable.mr_unknown);
  mr_unknown=Bitmap.createScaledBitmap(b,Constants.size_Profile_Picture_Width,Constants.size_Profile_Picture_Heigth,true);
  createKeyIndex();
}

Fixed version (ground truth):
public FriendListAdapter(Context context,ArrayList<Friend> friends){
  super(context,R.layout.list_item_friend,friends);
  this.context=context;
  this.friends=friends;
  Resources r=this.getContext().getResources();
  Bitmap b=BitmapFactory.decodeResource(r,R.drawable.mr_unknown);
  mr_unknown=Bitmap.createScaledBitmap(b,Constants.size_Profile_Picture,Constants.size_Profile_Picture,true);
  createKeyIndex();
}
Program: 101934
Project: 101934
Buggy source:
public void setProfilePic(Bitmap b){
  this.profilePicture=Bitmap.createScaledBitmap(b,80,80,true);
}

Fixed version (ground truth):
public void setProfilePic(Bitmap b){
  this.profilePicture=Bitmap.createScaledBitmap(b,Constants.size_Profile_Picture_Width,Constants.size_Profile_Picture_Heigth,true);
}
Program: 101935
Project: 101935
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  requestWindowFeature(Window.FEATURE_NO_TITLE);
  setContentView(R.layout.friend_list);
  final Intent recieve_intent=getIntent();
  String access_token=recieve_intent.getStringExtra(Constants.bundle_Access_Token);
  long expires=recieve_intent.getLongExtra(Constants.bundle_Access_Expires,0);
  if (access_token != null)   facebook.setAccessToken(access_token);
  if (expires != 0)   facebook.setAccessExpires(expires);
  dialog=ProgressDialog.show(FriendList.this,"String_Node_Str",getString(R.string.downloading_friends_text),true);
  dialog.setCancelable(false);
  dialog.show();
  downloadFacebookFriends_async();
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  requestWindowFeature(Window.FEATURE_NO_TITLE);
  setContentView(R.layout.friend_list);
  final Intent recieve_intent=getIntent();
  String access_token=recieve_intent.getStringExtra(Constants.bundle_Access_Token);
  long expires=recieve_intent.getLongExtra(Constants.bundle_Access_Expires,0);
  if (access_token != null)   facebook.setAccessToken(access_token);
  if (expires != 0)   facebook.setAccessExpires(expires);
  dialog=ProgressDialog.show(FriendList.this,"String_Node_Str",getString(R.string.downloading_friends_text),true);
  dialog.setCancelable(false);
  dialog.show();
  friends=new ArrayList<Friend>();
  friendListAdapter=new FriendListAdapter(FriendList.this,friends);
  friendListView=(ListView)findViewById(R.id.friend_list);
  friendListView.setAdapter(friendListAdapter);
  downloadFacebookFriends_async();
}
Program: 101936
Project: 101936
Buggy source:
@Override public void handleMessage(Message msg){
  friendListAdapter=new FriendListAdapter(FriendList.this,friends);
  friendListView=(ListView)findViewById(R.id.friend_list);
  friendListView.setAdapter(friendListAdapter);
  downloadProfilePictures_async();
  dialog.cancel();
}

Fixed version (ground truth):
@Override public void handleMessage(Message msg){
  friendListAdapter.notifyDataSetChanged();
  downloadProfilePictures_async();
  dialog.cancel();
}
Program: 101937
Project: 101937
Buggy source:
protected void downloadFacebookFriends_async(){
  new Thread(new Runnable(){
    @Override public void run(){
      Bundle params=new Bundle();
      params.putString("String_Node_Str","String_Node_Str");
      params.putString("String_Node_Str","String_Node_Str");
      friends=new ArrayList<Friend>();
      try {
        String response=facebook.request(params);
        System.out.println(response);
        JSONArray array=new JSONArray(response);
        for (int i=0; i < array.length(); i++) {
          System.out.println(array.getJSONObject(i).get("String_Node_Str") + "String_Node_Str" + array.getJSONObject(i).getString("String_Node_Str"));
          friends.add(new Friend(array.getJSONObject(i)));
        }
      }
 catch (      MalformedURLException e) {
        e.printStackTrace();
      }
catch (      IOException e) {
        e.printStackTrace();
      }
catch (      JSONException e) {
        e.printStackTrace();
      }
      downloadCompleteHandler.sendEmptyMessage(0);
    }
  }
).start();
}

Fixed version (ground truth):
protected void downloadFacebookFriends_async(){
  new Thread(new Runnable(){
    @Override public void run(){
      Bundle params=new Bundle();
      params.putString("String_Node_Str","String_Node_Str");
      params.putString("String_Node_Str","String_Node_Str");
      try {
        String response=facebook.request(params);
        JSONArray array=new JSONArray(response);
        for (int i=0; i < array.length(); i++) {
          friends.add(new Friend(array.getJSONObject(i)));
        }
      }
 catch (      MalformedURLException e) {
        e.printStackTrace();
      }
catch (      IOException e) {
        e.printStackTrace();
      }
catch (      JSONException e) {
        e.printStackTrace();
      }
      downloadCompleteHandler.sendEmptyMessage(0);
    }
  }
).start();
}
Program: 101938
Project: 101938
Buggy source:
@Override public int getSectionForPosition(int position){
  return 1;
}

Fixed version (ground truth):
@Override public int getSectionForPosition(int arg0){
  return 0;
}
Program: 101939
Project: 101939
Buggy source:
public FriendListAdapter(Context context,ArrayList<Friend> friends){
  super(context,R.layout.list_item_friend,friends);
  this.context=context;
  this.friends=friends;
  letterIndex=new HashMap<Character,Integer>();
  for (int i=friends.size() - 1; i > 0; i--) {
    letterIndex.put(friends.get(i).getName().charAt(0),i);
  }
  Set<Character> keys=letterIndex.keySet();
  ArrayList<Character> keyList=new ArrayList<Character>();
  for (  Character c : keys)   keyList.add(c);
  Collections.sort(keyList);
  sections=new Character[keyList.size()];
  keyList.toArray(sections);
}

Fixed version (ground truth):
public FriendListAdapter(Context context,ArrayList<Friend> friends){
  super(context,R.layout.list_item_friend,friends);
  this.context=context;
  this.friends=friends;
}
Program: 101941
Project: 101941
Buggy source:
/** 
 * Set the description on the EMF object.  Looks up annotation - if not found then the annotation is created.
 * @param eObject the target object
 * @param description the description
 * @param modelResource the model resource
 */
public void setDescription(EObject eObject,String description,ModelResource modelResource){
  System.out.println("String_Node_Str" + description + "String_Node_Str"+ eObject);
  if (description != null && description.trim().length() > 0) {
    try {
      AnnotationContainer annotations=null;
      final Iterator contents=modelResource.getEmfResource().getContents().iterator();
      while (contents.hasNext()) {
        final Object next=contents.next();
        if (next instanceof AnnotationContainer) {
          annotations=(AnnotationContainer)next;
          break;
        }
      }
      if (annotations == null) {
        annotations=CoreFactory.eINSTANCE.createAnnotationContainer();
        modelResource.getEmfResource().getContents().add(annotations);
      }
      Annotation annotation=annotations.findAnnotation(eObject);
      if (annotation == null) {
        annotation=CoreFactory.eINSTANCE.createAnnotation();
        annotations.getAnnotations().add(annotation);
        annotation.setAnnotatedObject(eObject);
      }
      annotation.setDescription(description);
    }
 catch (    ModelWorkspaceException e) {
      RelationalPlugin.Util.log(IStatus.ERROR,NLS.bind(Messages.emfModelGenerator_error_adding_desciption_to_0,eObject));
    }
  }
}

Fixed version (ground truth):
/** 
 * Set the description on the EMF object.  Looks up annotation - if not found then the annotation is created.
 * @param eObject the target object
 * @param description the description
 * @param modelResource the model resource
 */
public void setDescription(EObject eObject,String description,ModelResource modelResource){
  if (description != null && description.trim().length() > 0) {
    try {
      AnnotationContainer annotations=null;
      final Iterator contents=modelResource.getEmfResource().getContents().iterator();
      while (contents.hasNext()) {
        final Object next=contents.next();
        if (next instanceof AnnotationContainer) {
          annotations=(AnnotationContainer)next;
          break;
        }
      }
      if (annotations == null) {
        annotations=CoreFactory.eINSTANCE.createAnnotationContainer();
        modelResource.getEmfResource().getContents().add(annotations);
      }
      Annotation annotation=annotations.findAnnotation(eObject);
      if (annotation == null) {
        annotation=CoreFactory.eINSTANCE.createAnnotation();
        annotations.getAnnotations().add(annotation);
        annotation.setAnnotatedObject(eObject);
      }
      annotation.setDescription(description);
    }
 catch (    ModelWorkspaceException e) {
      RelationalPlugin.Util.log(IStatus.ERROR,NLS.bind(Messages.emfModelGenerator_error_adding_desciption_to_0,eObject));
    }
  }
}