nus-yam/ex-repair huggingface dataset:
Program: 14319
Project: 14319
Buggy source:
public static LoadBalancer addLoadbalancer(UserFullName user,String lbName,String scheme) throws LoadBalancingException {
  final EntityTransaction db=Entities.get(LoadBalancer.class);
  try {
    try {
      if (Entities.uniqueResult(LoadBalancer.named(user,lbName)) != null)       throw new LoadBalancingException(LoadBalancingException.DUPLICATE_LOADBALANCER_EXCEPTION);
    }
 catch (    NoSuchElementException e) {
      final LoadBalancer lb=LoadBalancer.newInstance(user,lbName);
      if (scheme != null)       lb.setScheme(scheme);
      Entities.persist(lb);
      db.commit();
      return lb;
    }
  }
 catch (  Exception ex) {
    db.rollback();
    LOG.error("String_Node_Str",ex);
    throw new LoadBalancingException("String_Node_Str" + ex.getMessage(),ex);
  }
  throw new LoadBalancingException("String_Node_Str");
}

Fixed version (ground truth):
public static LoadBalancer addLoadbalancer(UserFullName user,String lbName,String scheme) throws LoadBalancingException {
  final EntityTransaction db=Entities.get(LoadBalancer.class);
  try {
    try {
      if (Entities.uniqueResult(LoadBalancer.named(user.getAccountName(),lbName)) != null)       throw new LoadBalancingException(LoadBalancingException.DUPLICATE_LOADBALANCER_EXCEPTION);
    }
 catch (    NoSuchElementException e) {
      final LoadBalancer lb=LoadBalancer.newInstance(user,lbName);
      if (scheme != null)       lb.setScheme(scheme);
      Entities.persist(lb);
      db.commit();
      return lb;
    }
  }
 catch (  Exception ex) {
    db.rollback();
    LOG.error("String_Node_Str",ex);
    throw new LoadBalancingException("String_Node_Str" + ex.getMessage(),ex);
  }
  throw new LoadBalancingException("String_Node_Str");
}
Program: 14320
Project: 14320
Buggy source:
@Override public Long apply(final OwnerFullName input){
  final EntityTransaction db=Entities.get(LoadBalancer.class);
  try {
    return Entities.count(LoadBalancer.named(input,null));
  }
  finally {
    db.rollback();
  }
}

Fixed version (ground truth):
@Override public Long apply(final OwnerFullName input){
  final EntityTransaction db=Entities.get(LoadBalancer.class);
  try {
    return Entities.count(LoadBalancer.named(input.getAccountName(),null));
  }
  finally {
    db.rollback();
  }
}
Program: 14322
Project: 14322
Buggy source:
@Override public DispatchingClient<EucalyptusMessage,Eucalyptus> getClient(){
  try {
    final EucalyptusClient client=new EucalyptusClient(this.getUserId());
    client.init();
    return client;
  }
 catch (  Exception e) {
    throw Exceptions.toUndeclared(e);
  }
}

Fixed version (ground truth):
@Override public DispatchingClient<EucalyptusMessage,Eucalyptus> getClient(){
  try {
    EucalyptusClient client=new EucalyptusClient(this.userId);
    client.init();
    return client;
  }
 catch (  Exception e) {
    throw Exceptions.toUndeclared(e);
  }
}
Program: 14323
Project: 14323
Buggy source:
@Override public String getUserId(){
  try {
    return Accounts.lookupSystemAdmin().getUserId();
  }
 catch (  AuthException ex) {
    throw Exceptions.toUndeclared(ex);
  }
}

Fixed version (ground truth):
@Override public String getUserId(){
  return this.userId;
}
Program: 14326
Project: 14326
Buggy source:
@Override public Class load(final Class instanceClass) throws Exception {
  final List<Class<?>> interfaces=Lists.newArrayList();
  for (  final Class clazz : Classes.interfaceAncestors().apply(instanceClass)) {
    interfaces.add(clazz);
  }
  Collections.reverse(interfaces);
  return Iterables.find(interfaces,Predicates.and(Predicates.not(Predicates.<Class<?>>equalTo(AutoScalingMetadata.class)),Classes.subclassOf(AutoScalingMetadata.class)));
}

Fixed version (ground truth):
@Override public Class load(final Class instanceClass){
  final List<Class<?>> interfaces=Lists.newArrayList();
  for (  final Class clazz : Classes.interfaceAncestors().apply(instanceClass)) {
    interfaces.add(clazz);
  }
  Collections.reverse(interfaces);
  return Iterables.find(interfaces,Predicates.and(Predicates.not(Predicates.<Class<?>>equalTo(AutoScalingMetadata.class)),Classes.subclassOf(AutoScalingMetadata.class)));
}
Program: 14327
Project: 14327
Buggy source:
@SuppressWarnings("String_Node_Str") private static Class<? extends AutoScalingMetadata> subclassFor(Class<? extends AutoScalingMetadata> metadataInstance){
  return metadataClassMap.get(metadataInstance);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private static Class<? extends AutoScalingMetadata> subclassFor(Class<? extends AutoScalingMetadata> metadataInstance){
  return metadataClassMap.getUnchecked(metadataInstance);
}
Program: 14328
Project: 14328
Buggy source:
@Override public Class load(final Class instanceClass) throws Exception {
  final List<Class<?>> interfaces=Lists.newArrayList();
  for (  final Class clazz : Classes.interfaceAncestors().apply(instanceClass)) {
    interfaces.add(clazz);
  }
  Collections.reverse(interfaces);
  return Iterables.find(interfaces,Predicates.and(Predicates.not(Predicates.<Class<?>>equalTo(CloudMetadata.class)),Classes.subclassOf(CloudMetadata.class)));
}

Fixed version (ground truth):
@Override public Class load(final Class instanceClass){
  final List<Class<?>> interfaces=Lists.newArrayList();
  for (  final Class clazz : Classes.interfaceAncestors().apply(instanceClass)) {
    interfaces.add(clazz);
  }
  Collections.reverse(interfaces);
  return Iterables.find(interfaces,Predicates.and(Predicates.not(Predicates.<Class<?>>equalTo(CloudMetadata.class)),Classes.subclassOf(CloudMetadata.class)));
}
Program: 14329
Project: 14329
Buggy source:
@SuppressWarnings("String_Node_Str") private static Class<? extends CloudMetadata> subclassFor(Class<? extends CloudMetadata> metadataInstance){
  return metadataClassMap.get(metadataInstance);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private static Class<? extends CloudMetadata> subclassFor(Class<? extends CloudMetadata> metadataInstance){
  return metadataClassMap.getUnchecked(metadataInstance);
}
Program: 14330
Project: 14330
Buggy source:
private PersistentMap(Function<K,V> getFunction){
  super();
  LoadingCache<K,V> map=CacheBuilder.build(CacheLoader.from(getFunction));
  this.backingMap=map;
  Class valueType=Classes.genericsToClasses(getFunction).get(1);
  this.getFunction=Entities.asTransaction(getFunction);
  this.putFunction=Entities.asTransaction(valueType,new Persister<V>());
  this.removeFunction=Entities.asTransaction(valueType,new Deleter<V>());
}

Fixed version (ground truth):
private PersistentMap(Function<K,V> getFunction){
  super();
  LoadingCache<K,V> map=CacheBuilder.newBuilder().build(CacheLoader.from(getFunction));
  this.backingMap=map.asMap();
  Class valueType=Classes.genericsToClasses(getFunction).get(1);
  this.getFunction=Entities.asTransaction(getFunction);
  this.putFunction=Entities.asTransaction(valueType,new Persister<V>());
  this.removeFunction=Entities.asTransaction(valueType,new Deleter<V>());
}
Program: 14331
Project: 14331
Buggy source:
public static UserFullName getInstance(final User user,final String... relativePath){
  try {
    if ((user != null) && !Principals.isFakeIdentify(user.getUserId())) {
      if (!userIdMap.containsKey(user.getUserId())) {
        userIdMap.put(user.getUserId(),new UserFullName(user));
      }
      return userIdMap.get(user.getUserId());
    }
 else     if (Principals.systemUser().equals(user)) {
      return new UserFullName(Principals.systemUser());
    }
 else {
      return new UserFullName(Principals.nobodyUser());
    }
  }
 catch (  final AuthException ex) {
    LOG.error(ex.getMessage());
    try {
      return new UserFullName(Principals.nobodyUser());
    }
 catch (    final AuthException ex1) {
      LOG.error(ex1,ex1);
      throw Exceptions.toUndeclared(ex);
    }
  }
catch (  final Exception ex) {
    throw Exceptions.toUndeclared(ex);
  }
}

Fixed version (ground truth):
public static UserFullName getInstance(final User user,final String... relativePath){
  try {
    if ((user != null) && !Principals.isFakeIdentify(user.getUserId())) {
      if (!userIdMap.asMap().containsKey(user.getUserId())) {
        userIdMap.put(user.getUserId(),new UserFullName(user));
      }
      return userIdMap.getIfPresent(user.getUserId());
    }
 else     if (Principals.systemUser().equals(user)) {
      return new UserFullName(Principals.systemUser());
    }
 else {
      return new UserFullName(Principals.nobodyUser());
    }
  }
 catch (  final AuthException ex) {
    LOG.error(ex.getMessage());
    try {
      return new UserFullName(Principals.nobodyUser());
    }
 catch (    final AuthException ex1) {
      LOG.error(ex1,ex1);
      throw Exceptions.toUndeclared(ex);
    }
  }
catch (  final Exception ex) {
    throw Exceptions.toUndeclared(ex);
  }
}
Program: 14332
Project: 14332
Buggy source:
public static Partition lookupByName(String partitionName){
  return partitionMap.get(partitionName);
}

Fixed version (ground truth):
public static Partition lookupByName(String partitionName){
  return partitionMap.getUnchecked(partitionName);
}
Program: 14333
Project: 14333
Buggy source:
@Override public Partition load(final String input) throws Exception {
  try {
    Databases.awaitSynchronized();
    EntityTransaction db=Entities.get(Partition.class);
    Partition p=null;
    try {
      p=Entities.uniqueResult(Partition.newInstanceNamed(input));
      db.commit();
      return p;
    }
 catch (    NoSuchElementException ex) {
      db.rollback();
      throw ex;
    }
catch (    Exception ex) {
      db.rollback();
      throw Exceptions.toUndeclared(ex);
    }
  }
 catch (  NoSuchElementException ex) {
    throw ex;
  }
catch (  DatabaseStateException ex) {
    Databases.awaitSynchronized();
    return INSTANCE.apply(input);
  }
catch (  RuntimeException ex) {
    throw ex;
  }
}

Fixed version (ground truth):
@Override public Partition load(final String input){
  try {
    Databases.awaitSynchronized();
    EntityTransaction db=Entities.get(Partition.class);
    Partition p=null;
    try {
      p=Entities.uniqueResult(Partition.newInstanceNamed(input));
      db.commit();
      return p;
    }
 catch (    NoSuchElementException ex) {
      db.rollback();
      throw ex;
    }
catch (    Exception ex) {
      db.rollback();
      throw Exceptions.toUndeclared(ex);
    }
  }
 catch (  NoSuchElementException ex) {
    throw ex;
  }
catch (  DatabaseStateException ex) {
    Databases.awaitSynchronized();
    return load(input);
  }
catch (  RuntimeException ex) {
    throw ex;
  }
}
Program: 14334
Project: 14334
Buggy source:
public static ServiceTransitionCallback map(TransitionActions transition){
  return map.get(transition);
}

Fixed version (ground truth):
public static ServiceTransitionCallback map(TransitionActions transition){
  return map.getUnchecked(transition);
}
Program: 14335
Project: 14335
Buggy source:
@Override public Function<ServiceConfiguration,ServiceConfiguration> apply(final State input){
  for (  final Transitions c : Transitions.values()) {
    if (input.equals(c.state)) {
      return c;
    }
 else     if (input.name().startsWith(c.name())) {
      return c;
    }
  }
  return Transitions.CHECK;
}

Fixed version (ground truth):
@Override public ServiceConfiguration apply(final ServiceConfiguration input){
  State nextState=null;
  if ((nextState=this.findNextCheckState(input.lookupState())) == null) {
    return input;
  }
 else {
    return this.doTopologyChange(input,nextState);
  }
}
Program: 14336
Project: 14336
Buggy source:
@Override public Class load(final Class instanceClass) throws Exception {
  final List<Class<?>> interfaces=Lists.newArrayList();
  for (  final Class clazz : Classes.interfaceAncestors().apply(instanceClass)) {
    interfaces.add(clazz);
  }
  Collections.reverse(interfaces);
  return Iterables.find(interfaces,Predicates.and(Predicates.not(Predicates.<Class<?>>equalTo(AutoScalingMetadata.class)),Classes.subclassOf(AutoScalingMetadata.class)));
}

Fixed version (ground truth):
@Override public Class load(final Class instanceClass){
  final List<Class<?>> interfaces=Lists.newArrayList();
  for (  final Class clazz : Classes.interfaceAncestors().apply(instanceClass)) {
    interfaces.add(clazz);
  }
  Collections.reverse(interfaces);
  return Iterables.find(interfaces,Predicates.and(Predicates.not(Predicates.<Class<?>>equalTo(AutoScalingMetadata.class)),Classes.subclassOf(AutoScalingMetadata.class)));
}
Program: 14337
Project: 14337
Buggy source:
@SuppressWarnings("String_Node_Str") private static Class<? extends AutoScalingMetadata> subclassFor(Class<? extends AutoScalingMetadata> metadataInstance){
  return metadataClassMap.get(metadataInstance);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private static Class<? extends AutoScalingMetadata> subclassFor(Class<? extends AutoScalingMetadata> metadataInstance){
  return metadataClassMap.getUnchecked(metadataInstance);
}
Program: 14338
Project: 14338
Buggy source:
@Override public Class load(final Class instanceClass) throws Exception {
  final List<Class<?>> interfaces=Lists.newArrayList();
  for (  final Class clazz : Classes.interfaceAncestors().apply(instanceClass)) {
    interfaces.add(clazz);
  }
  Collections.reverse(interfaces);
  return Iterables.find(interfaces,Predicates.and(Predicates.not(Predicates.<Class<?>>equalTo(CloudMetadata.class)),Classes.subclassOf(CloudMetadata.class)));
}

Fixed version (ground truth):
@Override public Class load(final Class instanceClass){
  final List<Class<?>> interfaces=Lists.newArrayList();
  for (  final Class clazz : Classes.interfaceAncestors().apply(instanceClass)) {
    interfaces.add(clazz);
  }
  Collections.reverse(interfaces);
  return Iterables.find(interfaces,Predicates.and(Predicates.not(Predicates.<Class<?>>equalTo(CloudMetadata.class)),Classes.subclassOf(CloudMetadata.class)));
}
Program: 14339
Project: 14339
Buggy source:
@SuppressWarnings("String_Node_Str") private static Class<? extends CloudMetadata> subclassFor(Class<? extends CloudMetadata> metadataInstance){
  return metadataClassMap.get(metadataInstance);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private static Class<? extends CloudMetadata> subclassFor(Class<? extends CloudMetadata> metadataInstance){
  return metadataClassMap.getUnchecked(metadataInstance);
}
Program: 14340
Project: 14340
Buggy source:
private PersistentMap(Function<K,V> getFunction){
  super();
  LoadingCache<K,V> map=CacheBuilder.build(CacheLoader.from(getFunction));
  this.backingMap=map;
  Class valueType=Classes.genericsToClasses(getFunction).get(1);
  this.getFunction=Entities.asTransaction(getFunction);
  this.putFunction=Entities.asTransaction(valueType,new Persister<V>());
  this.removeFunction=Entities.asTransaction(valueType,new Deleter<V>());
}

Fixed version (ground truth):
private PersistentMap(Function<K,V> getFunction){
  super();
  LoadingCache<K,V> map=CacheBuilder.newBuilder().build(CacheLoader.from(getFunction));
  this.backingMap=map.asMap();
  Class valueType=Classes.genericsToClasses(getFunction).get(1);
  this.getFunction=Entities.asTransaction(getFunction);
  this.putFunction=Entities.asTransaction(valueType,new Persister<V>());
  this.removeFunction=Entities.asTransaction(valueType,new Deleter<V>());
}
Program: 14341
Project: 14341
Buggy source:
public static UserFullName getInstance(final User user,final String... relativePath){
  try {
    if ((user != null) && !Principals.isFakeIdentify(user.getUserId())) {
      if (!userIdMap.containsKey(user.getUserId())) {
        userIdMap.put(user.getUserId(),new UserFullName(user));
      }
      return userIdMap.get(user.getUserId());
    }
 else     if (Principals.systemUser().equals(user)) {
      return new UserFullName(Principals.systemUser());
    }
 else {
      return new UserFullName(Principals.nobodyUser());
    }
  }
 catch (  final AuthException ex) {
    LOG.error(ex.getMessage());
    try {
      return new UserFullName(Principals.nobodyUser());
    }
 catch (    final AuthException ex1) {
      LOG.error(ex1,ex1);
      throw Exceptions.toUndeclared(ex);
    }
  }
catch (  final Exception ex) {
    throw Exceptions.toUndeclared(ex);
  }
}

Fixed version (ground truth):
public static UserFullName getInstance(final User user,final String... relativePath){
  try {
    if ((user != null) && !Principals.isFakeIdentify(user.getUserId())) {
      if (!userIdMap.asMap().containsKey(user.getUserId())) {
        userIdMap.put(user.getUserId(),new UserFullName(user));
      }
      return userIdMap.getIfPresent(user.getUserId());
    }
 else     if (Principals.systemUser().equals(user)) {
      return new UserFullName(Principals.systemUser());
    }
 else {
      return new UserFullName(Principals.nobodyUser());
    }
  }
 catch (  final AuthException ex) {
    LOG.error(ex.getMessage());
    try {
      return new UserFullName(Principals.nobodyUser());
    }
 catch (    final AuthException ex1) {
      LOG.error(ex1,ex1);
      throw Exceptions.toUndeclared(ex);
    }
  }
catch (  final Exception ex) {
    throw Exceptions.toUndeclared(ex);
  }
}
Program: 14342
Project: 14342
Buggy source:
public static Partition lookupByName(String partitionName){
  return partitionMap.get(partitionName);
}

Fixed version (ground truth):
public static Partition lookupByName(String partitionName){
  return partitionMap.getUnchecked(partitionName);
}
Program: 14343
Project: 14343
Buggy source:
@Override public Partition load(final String input) throws Exception {
  try {
    Databases.awaitSynchronized();
    EntityTransaction db=Entities.get(Partition.class);
    Partition p=null;
    try {
      p=Entities.uniqueResult(Partition.newInstanceNamed(input));
      db.commit();
      return p;
    }
 catch (    NoSuchElementException ex) {
      db.rollback();
      throw ex;
    }
catch (    Exception ex) {
      db.rollback();
      throw Exceptions.toUndeclared(ex);
    }
  }
 catch (  NoSuchElementException ex) {
    throw ex;
  }
catch (  DatabaseStateException ex) {
    Databases.awaitSynchronized();
    return INSTANCE.apply(input);
  }
catch (  RuntimeException ex) {
    throw ex;
  }
}

Fixed version (ground truth):
@Override public Partition load(final String input){
  try {
    Databases.awaitSynchronized();
    EntityTransaction db=Entities.get(Partition.class);
    Partition p=null;
    try {
      p=Entities.uniqueResult(Partition.newInstanceNamed(input));
      db.commit();
      return p;
    }
 catch (    NoSuchElementException ex) {
      db.rollback();
      throw ex;
    }
catch (    Exception ex) {
      db.rollback();
      throw Exceptions.toUndeclared(ex);
    }
  }
 catch (  NoSuchElementException ex) {
    throw ex;
  }
catch (  DatabaseStateException ex) {
    Databases.awaitSynchronized();
    return load(input);
  }
catch (  RuntimeException ex) {
    throw ex;
  }
}
Program: 14344
Project: 14344
Buggy source:
public static ServiceTransitionCallback map(TransitionActions transition){
  return map.get(transition);
}

Fixed version (ground truth):
public static ServiceTransitionCallback map(TransitionActions transition){
  return map.getUnchecked(transition);
}
Program: 14345
Project: 14345
Buggy source:
@Override public Function<ServiceConfiguration,ServiceConfiguration> apply(final State input){
  for (  final Transitions c : Transitions.values()) {
    if (input.equals(c.state)) {
      return c;
    }
 else     if (input.name().startsWith(c.name())) {
      return c;
    }
  }
  return Transitions.CHECK;
}

Fixed version (ground truth):
@Override public ServiceConfiguration apply(final ServiceConfiguration input){
  State nextState=null;
  if ((nextState=this.findNextCheckState(input.lookupState())) == null) {
    return input;
  }
 else {
    return this.doTopologyChange(input,nextState);
  }
}
Program: 14348
Project: 14348
Buggy source:
public static Zone getInstanceInternalZone(){
  try {
    Name name=getInternalName();
    long serial=1;
    long refresh=86400;
    long retry=ttl;
    long expires=2419200;
    long minimum=600;
    Record soarec=new SOARecord(name,DClass.IN,ttl,name,Name.fromString("String_Node_Str" + name.toString()),serial,refresh,retry,expires,minimum);
    long nsTTL=604800;
    Record nsrec=new NSRecord(name,DClass.IN,nsTTL,Name.fromString(Internets.localHostInetAddress().getCanonicalHostName() + "String_Node_Str"));
    return new TransientZone(name,new Record[]{soarec,nsrec});
  }
 catch (  Exception e) {
    LOG.error(e,e);
    return null;
  }
}

Fixed version (ground truth):
public static Zone getInstanceInternalZone(){
  try {
    Name name=getInternalName();
    Name host=Name.fromString("String_Node_Str" + name.toString());
    Name admin=Name.fromString(Internets.localHostInetAddress().getCanonicalHostName() + "String_Node_Str" + name.toString());
    Name target=Name.fromString(Internets.localHostInetAddress().getCanonicalHostName() + "String_Node_Str" + name.toString());
    long serial=1;
    long refresh=86400;
    long retry=ttl;
    long expires=2419200;
    long minimum=600;
    Record soarec=new SOARecord(name,DClass.IN,ttl,host,admin,serial,refresh,retry,expires,minimum);
    long nsTTL=604800;
    Record nsrec=new NSRecord(name,DClass.IN,nsTTL,target);
    return new TransientZone(name,new Record[]{soarec,nsrec});
  }
 catch (  Exception e) {
    LOG.error(e,e);
    return null;
  }
}
Program: 14349
Project: 14349
Buggy source:
public static Name getExternalName() throws TextParseException {
  String externalNameString=SystemConfiguration.getSystemConfiguration().getDnsDomain() + "String_Node_Str";
  Name externalName=Name.fromString(externalNameString);
  return externalName;
}

Fixed version (ground truth):
public static Name getExternalName() throws TextParseException {
  String externalNameString=VmInstances.INSTANCE_SUBDOMAIN + "String_Node_Str" + SystemConfiguration.getSystemConfiguration().getDnsDomain()+ "String_Node_Str";
  externalNameString=externalNameString.startsWith("String_Node_Str") ? externalNameString.replaceFirst("String_Node_Str","String_Node_Str") : externalNameString;
  Name externalName=Name.fromString(externalNameString);
  return externalName;
}
Program: 14350
Project: 14350
Buggy source:
public static Zone getInstanceExternalZone(){
  try {
    Name name=getExternalName();
    long serial=1;
    long refresh=86400;
    long retry=ttl;
    long expires=2419200;
    long minimum=600;
    Record soarec=new SOARecord(name,DClass.IN,ttl,name,Name.fromString("String_Node_Str" + name.toString()),serial,refresh,retry,expires,minimum);
    long nsTTL=604800;
    Record nsrec=new NSRecord(name,DClass.IN,nsTTL,Name.fromString(Internets.localHostInetAddress().getCanonicalHostName() + "String_Node_Str"));
    return new TransientZone(name,new Record[]{soarec,nsrec});
  }
 catch (  Exception e) {
    LOG.error(e,e);
    return null;
  }
}

Fixed version (ground truth):
public static Zone getInstanceExternalZone(){
  try {
    Name name=getExternalName();
    Name host=Name.fromString("String_Node_Str" + name.toString());
    Name admin=Name.fromString(Internets.localHostInetAddress().getCanonicalHostName() + "String_Node_Str" + name.toString());
    Name target=Name.fromString(Internets.localHostInetAddress().getCanonicalHostName() + "String_Node_Str" + name.toString());
    long serial=1;
    long refresh=86400;
    long retry=ttl;
    long expires=2419200;
    long minimum=600;
    Record soarec=new SOARecord(name,DClass.IN,ttl,host,admin,serial,refresh,retry,expires,minimum);
    long nsTTL=604800;
    Record nsrec=new NSRecord(name,DClass.IN,nsTTL,target);
    return new TransientZone(name,new Record[]{soarec,nsrec});
  }
 catch (  Exception e) {
    LOG.error(e,e);
    return null;
  }
}
Program: 14353
Project: 14353
Buggy source:
/** 
 * Create or update a tag. <P>Caller must have active transaction for tags.</P>
 * @param tag The tag to create or update
 * @return The tag instance
 */
public static Tag createOrUpdate(final Tag tag){
  Tag result;
  String originalValue=tag.getValue();
  try {
    tag.setValue(null);
    final Tag existing=lookup(tag);
    existing.setValue(originalValue);
    result=existing;
  }
 catch (  final NoSuchMetadataException e) {
    tag.setValue(originalValue);
    Entities.persist(tag);
    result=tag;
  }
 finally {
    tag.setValue(originalValue);
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Create or update a tag. <P>Caller must have active transaction for tags.</P>
 * @param tag The tag to create or update
 * @return The tag instance
 */
public static Tag createOrUpdate(final Tag tag){
  Tag result;
  String originalValue=tag.getValue();
  String originalUserId=tag.getOwnerUserId();
  String originalUserName=tag.getOwnerUserName();
  try {
    tag.setValue(null);
    tag.setOwnerUserId(null);
    tag.setOwnerUserName(null);
    tag.setValue(null);
    final Tag existing=lookup(tag);
    existing.setValue(originalValue);
    result=existing;
  }
 catch (  final NoSuchMetadataException e) {
    tag.setValue(originalValue);
    tag.setOwnerUserId(originalUserId);
    tag.setOwnerUserName(originalUserName);
    Entities.persist(tag);
    result=tag;
  }
 finally {
    tag.setValue(originalValue);
    tag.setOwnerUserId(originalUserId);
    tag.setOwnerUserName(originalUserName);
  }
  return result;
}
Program: 14354
Project: 14354
Buggy source:
public static void delete(final Tag example) throws NoSuchMetadataException {
  final EntityTransaction db=Entities.get(Tag.class);
  try {
    final Tag entity=Entities.uniqueResult(example);
    Entities.delete(entity);
    db.commit();
  }
 catch (  Exception ex) {
    Logs.exhaust().error(ex,ex);
    db.rollback();
    throw new NoSuchMetadataException("String_Node_Str" + example.getKey() + "String_Node_Str"+ example.getOwner(),ex);
  }
}

Fixed version (ground truth):
public static void delete(final Tag example,final Criterion criterion,final Map<String,String> aliases) throws NoSuchMetadataException {
  final EntityTransaction db=Entities.get(Tag.class);
  try {
    final List<Tag> entities=Entities.query(example,false,criterion,aliases);
    if (entities.size() == 0) {
      throw new NoSuchMetadataException("String_Node_Str" + example.getKey() + "String_Node_Str"+ example.getOwner());
    }
 else     if (entities.size() < 1) {
      throw new NoSuchMetadataException("String_Node_Str" + example.getKey() + "String_Node_Str"+ example.getOwner());
    }
    Entities.delete(entities.get(0));
    db.commit();
  }
 catch (  NoSuchMetadataException e) {
    throw e;
  }
catch (  Exception ex) {
    Logs.exhaust().error(ex,ex);
    db.rollback();
    throw new NoSuchMetadataException("String_Node_Str" + example.getKey() + "String_Node_Str"+ example.getOwner(),ex);
  }
}
Program: 14355
Project: 14355
Buggy source:
/** 
 * Count the matching entities for the given example.
 * @param example The example entity
 * @return The number of matching entities
 */
public static long count(final Object example){
  final Example qbe=Example.create(example);
  final Number count=(Number)getTransaction(example).getTxState().getSession().createCriteria(example.getClass()).setReadOnly(true).setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY).setCacheable(false).add(qbe).setProjection(Projections.rowCount()).uniqueResult();
  return count.longValue();
}

Fixed version (ground truth):
/** 
 * Count the matching entities for the given example.
 * @param example The example entity
 * @param criterion Additional restrictions for the query
 * @param aliases Any aliases necessary for the given criterion
 * @return The number of matching entities
 */
public static long count(final Object example,final Criterion criterion,final Map<String,String> aliases){
  final Example qbe=Example.create(example);
  final Criteria criteria=getTransaction(example).getTxState().getSession().createCriteria(example.getClass()).setReadOnly(true).setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY).setCacheable(false).add(qbe).add(criterion).setProjection(Projections.rowCount());
  for (  final Map.Entry<String,String> aliasEntry : aliases.entrySet()) {
    criteria.createAlias(aliasEntry.getKey(),aliasEntry.getValue());
  }
  final Number count=(Number)criteria.uniqueResult();
  return count.longValue();
}
Program: 14356
Project: 14356
Buggy source:
public static LoadBalancerBackendInstance named(final String vmId){
  LoadBalancerBackendInstance instance=new LoadBalancerBackendInstance();
  instance.setOwner(null);
  instance.setState(null);
  instance.setDisplayName(vmId);
  return instance;
}

Fixed version (ground truth):
public static LoadBalancerBackendInstance named(final LoadBalancer lb,final String vmId){
  LoadBalancerBackendInstance instance=new LoadBalancerBackendInstance();
  instance.setOwner(null);
  instance.setState(null);
  instance.setDisplayName(vmId);
  instance.loadbalancer=lb;
  return instance;
}
Program: 14359
Project: 14359
Buggy source:
public static LoadBalancerDnsRecord named(String dnsName){
  final LoadBalancerDnsRecord instance=new LoadBalancerDnsRecord();
  instance.dnsName=dnsName;
  instance.dnsZone=LOADBALANCER_DNS_SUBDOMAIN;
  return instance;
}

Fixed version (ground truth):
public static LoadBalancerDnsRecord named(final LoadBalancer lb){
  final LoadBalancerDnsRecord instance=new LoadBalancerDnsRecord(lb);
  instance.dnsName=lb.getDisplayName();
  instance.dnsZone=LOADBALANCER_DNS_SUBDOMAIN;
  instance.uniqueName=instance.createUniqueName();
  return instance;
}
Program: 14360
Project: 14360
Buggy source:
private String createUniqueName(){
  return String.format("String_Node_Str",this.dnsZone,this.dnsName);
}

Fixed version (ground truth):
protected String createUniqueName(){
  return String.format("String_Node_Str",this.loadbalancer.getDisplayName(),this.getDnsName());
}
Program: 14361
Project: 14361
Buggy source:
@PrePersist private void generateOnCommit(){
  this.uniqueName=createUniqueName();
}

Fixed version (ground truth):
@PrePersist private void generateOnCommit(){
  if (this.uniqueName == null)   this.uniqueName=createUniqueName();
}
Program: 14362
Project: 14362
Buggy source:
@Override public String toString(){
  return this.uniqueName;
}

Fixed version (ground truth):
@Override public String toString(){
  String name="String_Node_Str";
  if (this.dnsName != null && this.dnsZone != null)   name=String.format("String_Node_Str",getDnsName());
  return name;
}
Program: 14363
Project: 14363
Buggy source:
public LoadBalancerDnsRecord(final LoadBalancer lb,String name){
  this.loadbalancer=lb;
  this.dnsName=name;
  this.dnsZone=LOADBALANCER_DNS_SUBDOMAIN;
}

Fixed version (ground truth):
private LoadBalancerDnsRecord(final LoadBalancer lb){
  this.loadbalancer=lb;
}
Program: 14364
Project: 14364
Buggy source:
public LoadBalancerSecurityGroup(LoadBalancer lb,String groupName){
  this.loadbalancer=lb;
  this.groupName=groupName;
  this.state=STATE.InService.name();
}

Fixed version (ground truth):
private LoadBalancerSecurityGroup(LoadBalancer lb,String groupName){
  this.loadbalancer=lb;
  this.groupName=groupName;
  this.state=STATE.InService.name();
}
Program: 14365
Project: 14365
Buggy source:
public static LoadBalancerSecurityGroup named(String groupName,STATE state){
  final LoadBalancerSecurityGroup instance=new LoadBalancerSecurityGroup();
  instance.groupName=groupName;
  instance.state=state.name();
  return instance;
}

Fixed version (ground truth):
public static LoadBalancerSecurityGroup named(LoadBalancer lb,String groupName,STATE state){
  final LoadBalancerSecurityGroup instance=new LoadBalancerSecurityGroup(lb,groupName);
  instance.state=state.name();
  instance.uniqueName=instance.createUniqueName();
  return instance;
}
Program: 14366
Project: 14366
Buggy source:
private String createUniqueName(){
  return String.format("String_Node_Str",this.groupName);
}

Fixed version (ground truth):
private String createUniqueName(){
  return String.format("String_Node_Str",this.loadbalancer,this.groupName);
}
Program: 14367
Project: 14367
Buggy source:
@PrePersist private void generateOnCommit(){
  this.uniqueName=createUniqueName();
}

Fixed version (ground truth):
@PrePersist private void generateOnCommit(){
  if (this.uniqueName == null)   this.uniqueName=createUniqueName();
}
Program: 14368
Project: 14368
Buggy source:
private LoadBalancerZone(final LoadBalancer lb,final String zone){
  this.loadbalancer=lb;
  this.zoneName=zone;
}

Fixed version (ground truth):
private LoadBalancerZone(final LoadBalancer lb,final String zone){
  this.loadbalancer=lb;
  this.zoneName=zone;
  this.uniqueName=this.createUniqueName();
}
Program: 14369
Project: 14369
Buggy source:
@PrePersist private void generateOnCommit(){
  this.uniqueName=createUniqueName();
}

Fixed version (ground truth):
@PrePersist private void generateOnCommit(){
  if (this.uniqueName == null)   this.uniqueName=createUniqueName();
}
Program: 14370
Project: 14370
Buggy source:
private String createUniqueName(){
  return String.format("String_Node_Str",this.loadbalancer.getDisplayName(),this.zoneName);
}

Fixed version (ground truth):
protected String createUniqueName(){
  return String.format("String_Node_Str",this.loadbalancer.getDisplayName(),this.zoneName);
}
Program: 14371
Project: 14371
Buggy source:
@Override public String toString(){
  return this.uniqueName;
}

Fixed version (ground truth):
@Override public String toString(){
  String name="String_Node_Str";
  if (this.loadbalancer != null && this.zoneName != null)   name=String.format("String_Node_Str",this.loadbalancer.getDisplayName(),this.zoneName);
  return name;
}
Program: 14372
Project: 14372
Buggy source:
public static LoadBalancerDnsRecord getDnsRecord(final LoadBalancer lb) throws LoadBalancingException {
  final EntityTransaction db=Entities.get(LoadBalancerDnsRecord.class);
  try {
    LoadBalancerDnsRecord exist=Entities.uniqueResult(LoadBalancerDnsRecord.named(lb.getDisplayName()));
    db.commit();
    return exist;
  }
 catch (  NoSuchElementException ex) {
    final LoadBalancerDnsRecord newRec=LoadBalancerDnsRecord.named(lb.getDisplayName());
    newRec.setLoadbalancer(lb);
    Entities.persist(newRec);
    db.commit();
    return newRec;
  }
catch (  Exception ex) {
    throw new LoadBalancingException("String_Node_Str",ex);
  }
}

Fixed version (ground truth):
public static LoadBalancerDnsRecord getDnsRecord(final LoadBalancer lb) throws LoadBalancingException {
  final EntityTransaction db=Entities.get(LoadBalancerDnsRecord.class);
  try {
    LoadBalancerDnsRecord exist=Entities.uniqueResult(LoadBalancerDnsRecord.named(lb.getDisplayName()));
    db.commit();
    return exist;
  }
 catch (  NoSuchElementException ex) {
    final LoadBalancerDnsRecord newRec=LoadBalancerDnsRecord.named(lb.getDisplayName());
    newRec.setLoadbalancer(lb);
    Entities.persist(newRec);
    db.commit();
    return newRec;
  }
catch (  Exception ex) {
    db.rollback();
    throw new LoadBalancingException("String_Node_Str",ex);
  }
}
Program: 14373
Project: 14373
Buggy source:
public void execute(T evt) throws EventHandlerChainException {
  LinkedList<EventHandler<T>> reverseHandler=Lists.newLinkedList();
  for (  EventHandler<T> handler : this.handlers) {
    try {
      reverseHandler.addFirst(handler);
      handler.apply(evt);
    }
 catch (    Exception e) {
      LOG.warn("String_Node_Str");
      EventHandlerChainException toThrow=new EventHandlerChainException(String.format("String_Node_Str",evt,handler),e,true);
      for (      EventHandler<T> h : reverseHandler) {
        try {
          h.rollback();
        }
 catch (        Exception ex) {
          LOG.warn("String_Node_Str" + h.toString());
          toThrow.setRollback(false);
        }
      }
      throw toThrow;
    }
  }
}

Fixed version (ground truth):
public void execute(T evt) throws EventHandlerChainException {
  LinkedList<EventHandler<T>> reverseHandler=Lists.newLinkedList();
  for (  EventHandler<T> handler : this.handlers) {
    try {
      reverseHandler.addFirst(handler);
      handler.apply(evt);
    }
 catch (    Exception e) {
      LOG.warn("String_Node_Str");
      EventHandlerChainException toThrow=new EventHandlerChainException(String.format("String_Node_Str",evt,handler),e,true);
      for (      EventHandler<T> h : reverseHandler) {
        try {
          h.rollback();
        }
 catch (        Exception ex) {
          LOG.warn("String_Node_Str" + h.toString());
          toThrow.setRollback(false);
        }
      }
      LOG.info("String_Node_Str");
      throw toThrow;
    }
  }
}
Program: 14376
Project: 14376
Buggy source:
public static EventHandlerChain<RegisterInstancesEvent> onRegisterInstances(){
  if (onRegisterInstancesChain == null) {
    onRegisterInstancesChain=new EventHandlerChain<RegisterInstancesEvent>(){
      @Override public EventHandlerChain<RegisterInstancesEvent> build(){
        return this;
      }
    }
.build();
  }
  return onRegisterInstancesChain;
}

Fixed version (ground truth):
public static EventHandlerChain<RegisterInstancesEvent> onRegisterInstances(){
  return new EventHandlerChain<RegisterInstancesEvent>(){
    @Override public EventHandlerChain<RegisterInstancesEvent> build(){
      return this;
    }
  }
.build();
}
Program: 14377
Project: 14377
Buggy source:
public static EventHandlerChain<DeleteListenerEvent> onDeleteListener(){
  if (onDeleteListenerChain == null) {
    onDeleteListenerChain=(new EventHandlerChainDeleteListeners()).build();
  }
  return onDeleteListenerChain;
}

Fixed version (ground truth):
public static EventHandlerChain<DeleteListenerEvent> onDeleteListener(){
  return (new EventHandlerChainDeleteListeners()).build();
}
Program: 14378
Project: 14378
Buggy source:
public static EventHandlerChain<CreateListenerEvent> onCreateListener(){
  if (onCreateListenerChain == null) {
    onCreateListenerChain=(new EventHandlerChainNewListeners()).build();
  }
  return onCreateListenerChain;
}

Fixed version (ground truth):
public static EventHandlerChain<CreateListenerEvent> onCreateListener(){
  return (new EventHandlerChainNewListeners()).build();
}
Program: 14379
Project: 14379
Buggy source:
public static EventHandlerChain<DeleteLoadbalancerEvent> onDeleteLoadbalancer(){
  if (onDeleteLoadbalancerChain == null) {
    onDeleteLoadbalancerChain=(new EventHandlerChainDelete()).build();
  }
  return onDeleteLoadbalancerChain;
}

Fixed version (ground truth):
public static EventHandlerChain<DeleteLoadbalancerEvent> onDeleteLoadbalancer(){
  return (new EventHandlerChainDelete()).build();
}
Program: 14380
Project: 14380
Buggy source:
public static EventHandlerChain<DeregisterInstancesEvent> onDeregisterInstances(){
  if (onDeregisterInstancesChain == null) {
    onDeregisterInstancesChain=new EventHandlerChain<DeregisterInstancesEvent>(){
      @Override public EventHandlerChain<DeregisterInstancesEvent> build(){
        return this;
      }
    }
.build();
  }
  return onDeregisterInstancesChain;
}

Fixed version (ground truth):
public static EventHandlerChain<DeregisterInstancesEvent> onDeregisterInstances(){
  return new EventHandlerChain<DeregisterInstancesEvent>(){
    @Override public EventHandlerChain<DeregisterInstancesEvent> build(){
      return this;
    }
  }
.build();
}
Program: 14381
Project: 14381
Buggy source:
public static EventHandlerChain<NewLoadbalancerEvent> onNewLoadbalancer(){
  if (onNewLoadbalancerChain == null) {
    onNewLoadbalancerChain=(new EventHandlerChainNew()).build();
  }
  return onNewLoadbalancerChain;
}

Fixed version (ground truth):
public static EventHandlerChain<NewLoadbalancerEvent> onNewLoadbalancer(){
  return (new EventHandlerChainNew()).build();
}
Program: 14382
Project: 14382
Buggy source:
private LoadBalancerServoInstance(final LoadBalancerZone lbzone,final LoadBalancerSecurityGroup group,final LoadBalancerDnsRecord dns){
  this.state=STATE.Pending.name();
  this.zone=lbzone;
  this.loadbalancer=zone.getLoadbalancer();
  this.group=group;
  this.dns=dns;
}

Fixed version (ground truth):
private LoadBalancerServoInstance(final LoadBalancerZone lbzone,final LoadBalancerSecurityGroup group,final LoadBalancerDnsRecord dns){
  this.state=STATE.Pending.name();
  this.zone=lbzone;
  this.loadbalancer=zone.getLoadbalancer();
  this.security_group=group;
  this.dns=dns;
}
Program: 14383
Project: 14383
Buggy source:
public void setSecurityGroup(LoadBalancerSecurityGroup group){
  this.group=group;
}

Fixed version (ground truth):
public void setSecurityGroup(LoadBalancerSecurityGroup group){
  this.security_group=group;
}
Program: 14384
Project: 14384
Buggy source:
public void handle(ExceptionMessage muleMsg){
  try {
    Object requestMsg=muleMsg.getPayload();
    String requestString=requestMsg.toString();
    BaseMessage msg=(BaseMessage)BindingManager.getBinding("String_Node_Str").fromOM(requestString);
    Throwable ex=muleMsg.getException().getCause();
    BaseMessage errMsg;
    errMsg=new EucalyptusErrorMessageType(muleMsg.getComponentName(),msg,ex.getMessage());
    replies.putMessage(errMsg);
  }
 catch (  Exception e) {
    LOG.error(e);
  }
}

Fixed version (ground truth):
public void handle(ExceptionMessage muleMsg){
  try {
    Object requestMsg=muleMsg.getPayload();
    String requestString=requestMsg.toString();
    BaseMessage msg=(BaseMessage)BindingManager.getDefaultBinding().fromOM(requestString);
    Throwable ex=muleMsg.getException().getCause();
    BaseMessage errMsg;
    errMsg=new EucalyptusErrorMessageType(muleMsg.getComponentName(),msg,ex.getMessage());
    replies.putMessage(errMsg);
  }
 catch (  Exception e) {
    LOG.error(e);
  }
}
Program: 14386
Project: 14386
Buggy source:
public void processClass(Class klass){
  if (this.out == null) {
    if (this.outFile.exists()) {
      this.outFile.delete();
    }
    try {
      this.out=new PrintWriter(this.outFile);
    }
 catch (    FileNotFoundException e) {
      e.printStackTrace(System.err);
      System.exit(-1);
    }
    this.bindingName=this.ns.replaceAll("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str");
    this.out.write("String_Node_Str" + this.ns + "String_Node_Str"+ this.bindingName+ "String_Node_Str");
    this.out.write("String_Node_Str" + this.ns + "String_Node_Str");
    this.out.flush();
  }
  if (!classNames.contains(klass.getName())) {
    classNames.add(klass.getName());
    final String mapping=new RootObjectTypeBinding(klass).process();
    this.out.write(mapping);
    this.out.flush();
  }
 else {
    Logs.extreme().debug("String_Node_Str" + klass);
  }
}

Fixed version (ground truth):
public void processClass(Class klass){
  if (this.out == null) {
    if (this.outFile.exists()) {
      this.outFile.delete();
    }
    try {
      this.out=new PrintWriter(this.outFile);
    }
 catch (    FileNotFoundException e) {
      e.printStackTrace(System.err);
      System.exit(-1);
    }
    this.bindingName=this.ns.replaceAll("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str");
    this.out.write("String_Node_Str" + this.ns + "String_Node_Str"+ this.bindingName+ "String_Node_Str");
    this.out.write("String_Node_Str" + this.ns + "String_Node_Str");
    this.out.flush();
  }
  if (!classNames.contains(klass.getName())) {
    classNames.add(klass.getName());
    final String mapping=new RootObjectTypeBinding(klass).process();
    this.out.write(mapping);
    this.out.flush();
  }
 else {
    Logs.extreme().debug("String_Node_Str" + klass);
  }
}
Program: 14388
Project: 14388
Buggy source:
public RestfulMarshallingHandler(String namespacePattern,String defaultVersion){
  this(namespacePattern);
  this.defaultBindingNamespace=String.format(namespacePattern,defaultVersion);
  this.defaultBinding=BindingManager.getBinding(BindingManager.sanitizeNamespace(this.defaultBindingNamespace));
}

Fixed version (ground truth):
public RestfulMarshallingHandler(String namespacePattern,String defaultVersion){
  this(namespacePattern);
  this.defaultBindingNamespace=String.format(namespacePattern,defaultVersion);
  this.defaultBinding=BindingManager.getBinding(this.defaultBindingNamespace);
}
Program: 14389
Project: 14389
Buggy source:
protected void setNamespace(String namespace){
  this.namespace=namespace;
  this.binding=BindingManager.getBinding(BindingManager.sanitizeNamespace(this.namespace));
}

Fixed version (ground truth):
protected void setNamespace(String namespace){
  this.namespace=namespace;
  this.binding=BindingManager.getBinding(this.namespace);
}
Program: 14390
Project: 14390
Buggy source:
private BaseMessage parsePayload(final Object payload) throws PayloadParseException {
  if (payload instanceof BaseMessage) {
    return (BaseMessage)payload;
  }
 else   if (payload instanceof String) {
    try {
      return (BaseMessage)BindingManager.getBinding(BindingManager.sanitizeNamespace(namespace)).fromOM((String)payload);
    }
 catch (    Exception e) {
      throw new PayloadParseException(e);
    }
  }
  return new EucalyptusErrorMessageType(getClass().getSimpleName(),LogUtil.dumpObject(payload));
}

Fixed version (ground truth):
private BaseMessage parsePayload(final Object payload) throws PayloadParseException {
  if (payload instanceof BaseMessage) {
    return (BaseMessage)payload;
  }
 else   if (payload instanceof String) {
    try {
      return (BaseMessage)BindingManager.getBinding(namespace).fromOM((String)payload);
    }
 catch (    Exception e) {
      throw new PayloadParseException(e);
    }
  }
  return new EucalyptusErrorMessageType(getClass().getSimpleName(),LogUtil.dumpObject(payload));
}
Program: 14391
Project: 14391
Buggy source:
private BaseMessage convert(Object payload){
  BaseMessage ret=null;
  if (payload instanceof BaseMessage) {
    ret=(BaseMessage)payload;
  }
 else   if (payload instanceof HasRequest) {
    ret=((HasRequest)payload).getRequest();
  }
 else   if (payload instanceof String) {
    try {
      ret=(BaseMessage)BindingManager.getBinding("String_Node_Str").fromOM((String)payload);
    }
 catch (    Exception ex) {
      LOG.error(ex,ex);
    }
  }
 else {
    payload=RequestContext.getEvent().getMessage().getPayload();
    if (payload instanceof BaseMessage) {
      ret=(BaseMessage)payload;
    }
 else     if (payload instanceof String) {
      try {
        ret=(BaseMessage)BindingManager.getBinding("String_Node_Str").fromOM((String)payload);
      }
 catch (      Exception ex) {
        LOG.error(ex,ex);
      }
    }
  }
  return ret;
}

Fixed version (ground truth):
private BaseMessage convert(Object payload){
  BaseMessage ret=null;
  if (payload instanceof BaseMessage) {
    ret=(BaseMessage)payload;
  }
 else   if (payload instanceof HasRequest) {
    ret=((HasRequest)payload).getRequest();
  }
 else   if (payload instanceof String) {
    try {
      ret=(BaseMessage)BindingManager.getDefaultBinding().fromOM((String)payload);
    }
 catch (    Exception ex) {
      LOG.error(ex,ex);
    }
  }
 else {
    payload=RequestContext.getEvent().getMessage().getPayload();
    if (payload instanceof BaseMessage) {
      ret=(BaseMessage)payload;
    }
 else     if (payload instanceof String) {
      try {
        ret=(BaseMessage)BindingManager.getDefaultBinding().fromOM((String)payload);
      }
 catch (      Exception ex) {
        LOG.error(ex,ex);
      }
    }
  }
  return ret;
}
Program: 14392
Project: 14392
Buggy source:
private static BaseMessage parsePayload(final Object payload) throws PayloadParseException {
  if (payload instanceof BaseMessage) {
    return (BaseMessage)payload;
  }
 else   if (payload instanceof String) {
    try {
      return (BaseMessage)BindingManager.getBinding(BindingManager.sanitizeNamespace(ReportingQueryBinding.REPORTING_DEFAULT_NAMESPACE)).fromOM((String)payload);
    }
 catch (    Exception e) {
      throw new PayloadParseException(e);
    }
  }
  return new EucalyptusErrorMessageType("String_Node_Str",LogUtil.dumpObject(payload));
}

Fixed version (ground truth):
private static BaseMessage parsePayload(final Object payload) throws PayloadParseException {
  if (payload instanceof BaseMessage) {
    return (BaseMessage)payload;
  }
 else   if (payload instanceof String) {
    try {
      return (BaseMessage)BindingManager.getBinding(ReportingQueryBinding.REPORTING_DEFAULT_NAMESPACE).fromOM((String)payload);
    }
 catch (    Exception e) {
      throw new PayloadParseException(e);
    }
  }
  return new EucalyptusErrorMessageType("String_Node_Str",LogUtil.dumpObject(payload));
}