Program: 15349
Project: 15349
Buggy source:
public static ImageInfo createFromManifest(UserFullName creator,String imageNameArg,String imageDescription,String eki,String eri,ImageManifest manifest) throws EucalyptusCloudException {
  PutGetImageInfo ret=null;
  String imageName=(imageNameArg != null) ? imageNameArg : manifest.getName();
  eki=(eki != null) ? eki : manifest.getKernelId();
  eki=(eki != null) ? eki : ImageConfiguration.getInstance().getDefaultKernelId();
  eri=(eri != null) ? eri : manifest.getRamdiskId();
  eri=(eri != null) ? eri : ImageConfiguration.getInstance().getDefaultRamdiskId();
switch (manifest.getImageType()) {
case kernel:
    ret=new KernelImageInfo(creator,ImageUtil.newImageId(Image.Type.kernel.getTypePrefix(),manifest.getImageLocation()),imageName,imageDescription,manifest.getImageLocation(),manifest.getSize(),manifest.getBundledSize(),manifest.getArchitecture(),manifest.getPlatform());
  break;
case ramdisk:
ret=new RamdiskImageInfo(creator,ImageUtil.newImageId(Image.Type.ramdisk.getTypePrefix(),manifest.getImageLocation()),imageName,imageDescription,manifest.getImageLocation(),manifest.getSize(),manifest.getBundledSize(),manifest.getArchitecture(),manifest.getPlatform());
break;
case machine:
ret=new MachineImageInfo(creator,ImageUtil.newImageId(Image.Type.machine.getTypePrefix(),manifest.getImageLocation()),imageName,imageDescription,manifest.getImageLocation(),manifest.getSize(),manifest.getBundledSize(),manifest.getArchitecture(),manifest.getPlatform(),eki,eri);
break;
}
if (ret == null) {
throw new IllegalArgumentException("String_Node_Str" + manifest);
}
 else {
ret.setSignature(manifest.getSignature());
ret.setState(Image.State.available);
EntityWrapper<PutGetImageInfo> db=EntityWrapper.get(PutGetImageInfo.class);
try {
ret=db.merge(ret);
db.commit();
LOG.info("String_Node_Str" + ret.getDisplayName() + "String_Node_Str"+ creator);
}
 catch (Exception e) {
db.rollback();
throw new EucalyptusCloudException("String_Node_Str" + manifest + "String_Node_Str"+ e.getMessage(),e);
}
LOG.info("String_Node_Str" + ret.getDisplayName());
if (ret instanceof Image.StaticDiskImage) {
WalrusUtil.triggerCaching((StaticDiskImage)ret);
}
return ret;
}
}

Fixed version (ground truth):
public static ImageInfo createFromManifest(UserFullName creator,String imageNameArg,String imageDescription,String eki,String eri,ImageManifest manifest) throws EucalyptusCloudException {
  PutGetImageInfo ret=null;
  String imageName=(imageNameArg != null) ? imageNameArg : manifest.getName();
  eki=(eki != null) ? eki : manifest.getKernelId();
  eki=(eki != null) ? eki : ImageConfiguration.getInstance().getDefaultKernelId();
  eri=(eri != null) ? eri : manifest.getRamdiskId();
  eri=(eri != null) ? eri : ImageConfiguration.getInstance().getDefaultRamdiskId();
switch (manifest.getImageType()) {
case kernel:
    ret=new KernelImageInfo(creator,ImageUtil.newImageId(Image.Type.kernel.getTypePrefix(),manifest.getImageLocation()),imageName,imageDescription,manifest.getSize(),manifest.getArchitecture(),manifest.getPlatform(),manifest.getImageLocation(),manifest.getBundledSize());
  break;
case ramdisk:
ret=new RamdiskImageInfo(creator,ImageUtil.newImageId(Image.Type.ramdisk.getTypePrefix(),manifest.getImageLocation()),imageName,imageDescription,manifest.getSize(),manifest.getArchitecture(),manifest.getPlatform(),manifest.getImageLocation(),manifest.getBundledSize());
break;
case machine:
ret=new MachineImageInfo(creator,ImageUtil.newImageId(Image.Type.machine.getTypePrefix(),manifest.getImageLocation()),imageName,imageDescription,manifest.getSize(),manifest.getArchitecture(),manifest.getPlatform(),manifest.getImageLocation(),manifest.getBundledSize(),eki,eri);
break;
}
if (ret == null) {
throw new IllegalArgumentException("String_Node_Str" + manifest);
}
 else {
ret.setSignature(manifest.getSignature());
ret.setState(Image.State.available);
EntityWrapper<PutGetImageInfo> db=EntityWrapper.get(PutGetImageInfo.class);
try {
ret=db.merge(ret);
db.commit();
LOG.info("String_Node_Str" + ret.getDisplayName() + "String_Node_Str"+ creator);
}
 catch (Exception e) {
db.rollback();
throw new EucalyptusCloudException("String_Node_Str" + manifest + "String_Node_Str"+ e.getMessage(),e);
}
LOG.info("String_Node_Str" + ret.getDisplayName());
if (ret instanceof Image.StaticDiskImage) {
WalrusUtil.triggerCaching((StaticDiskImage)ret);
}
return ret;
}
}