nus-yam/ex-repair huggingface dataset:
Program: 14393
Project: 14393
Buggy source:
@Override public ChannelPipeline getPipeline() throws Exception {
  final ChannelPipeline pipeline=Channels.pipeline();
  for (  Map.Entry<String,ChannelHandler> e : Handlers.channelMonitors(TimeUnit.SECONDS,StackConfiguration.CLIENT_INTERNAL_TIMEOUT_SECS).entrySet()) {
    pipeline.addLast(e.getKey(),e.getValue());
  }
  pipeline.addLast("String_Node_Str",Handlers.newHttpResponseDecoder());
  pipeline.addLast("String_Node_Str",Handlers.newHttpChunkAggregator());
  pipeline.addLast("String_Node_Str",Handlers.httpRequestEncoder());
  pipeline.addLast("String_Node_Str",Handlers.soapMarshalling());
  pipeline.addLast("String_Node_Str",InternalClientPipeline.wssecHandler);
  pipeline.addLast("String_Node_Str",Handlers.addressingHandler());
  pipeline.addLast("String_Node_Str",Handlers.soapHandler());
  pipeline.addLast("String_Node_Str",Handlers.bindingHandler("String_Node_Str"));
  return pipeline;
}

Fixed version (ground truth):
@Override public ChannelPipeline getPipeline() throws Exception {
  final ChannelPipeline pipeline=Channels.pipeline();
  for (  Map.Entry<String,ChannelHandler> e : Handlers.channelMonitors(TimeUnit.SECONDS,StackConfiguration.CLIENT_INTERNAL_TIMEOUT_SECS).entrySet()) {
    pipeline.addLast(e.getKey(),e.getValue());
  }
  pipeline.addLast("String_Node_Str",Handlers.newHttpResponseDecoder());
  pipeline.addLast("String_Node_Str",Handlers.newHttpChunkAggregator());
  pipeline.addLast("String_Node_Str",Handlers.httpRequestEncoder());
  pipeline.addLast("String_Node_Str",Handlers.soapMarshalling());
  pipeline.addLast("String_Node_Str",InternalClientPipeline.wssecHandler);
  pipeline.addLast("String_Node_Str",Handlers.addressingHandler());
  pipeline.addLast("String_Node_Str",Handlers.soapHandler());
  pipeline.addLast("String_Node_Str",Handlers.bindingHandler());
  return pipeline;
}
Program: 14394
Project: 14394
Buggy source:
@Override public void incomingMessage(final MessageEvent event) throws Exception {
  if (event.getMessage() instanceof MappingHttpMessage) {
    MappingHttpMessage httpMessage=(MappingHttpMessage)event.getMessage();
    BaseMessage msg=null;
    OMElement elem=httpMessage.getOmMessage();
    OMNamespace omNs=elem.getNamespace();
    String namespace=omNs.getNamespaceURI();
    Class msgType=null;
    try {
      this.binding=BindingManager.getBinding(BindingManager.sanitizeNamespace(namespace));
      msgType=this.binding.getElementClass(httpMessage.getOmMessage().getLocalName());
    }
 catch (    Exception e1) {
      if (this.binding == null) {
        throw new WebServicesException(e1);
      }
 else {
        throw new WebServicesException("String_Node_Str" + namespace + "String_Node_Str"+ e1.getMessage(),e1);
      }
    }
    try {
      if (httpMessage instanceof MappingHttpRequest) {
        if (msgType != null)         msg=(BaseMessage)this.binding.fromOM(httpMessage.getOmMessage(),msgType);
 else         msg=(BaseMessage)this.binding.fromOM(httpMessage.getOmMessage());
      }
 else {
        msg=(BaseMessage)this.binding.fromOM(httpMessage.getOmMessage());
      }
    }
 catch (    Exception e1) {
      LOG.fatal("String_Node_Str" + httpMessage.getMessageString());
      throw new WebServicesException(e1);
    }
    httpMessage.setMessage(msg);
  }
}

Fixed version (ground truth):
@Override public void incomingMessage(final MessageEvent event) throws Exception {
  if (event.getMessage() instanceof MappingHttpMessage) {
    MappingHttpMessage httpMessage=(MappingHttpMessage)event.getMessage();
    BaseMessage msg=null;
    OMElement elem=httpMessage.getOmMessage();
    OMNamespace omNs=elem.getNamespace();
    String namespace=omNs.getNamespaceURI();
    Class msgType=null;
    try {
      this.binding=BindingManager.getBinding(namespace);
      msgType=this.binding.getElementClass(httpMessage.getOmMessage().getLocalName());
    }
 catch (    Exception e1) {
      if (this.binding == null) {
        throw new WebServicesException(e1);
      }
 else {
        throw new WebServicesException("String_Node_Str" + namespace + "String_Node_Str"+ e1.getMessage(),e1);
      }
    }
    try {
      if (httpMessage instanceof MappingHttpRequest) {
        if (msgType != null)         msg=(BaseMessage)this.binding.fromOM(httpMessage.getOmMessage(),msgType);
 else         msg=(BaseMessage)this.binding.fromOM(httpMessage.getOmMessage());
      }
 else {
        msg=(BaseMessage)this.binding.fromOM(httpMessage.getOmMessage());
      }
    }
 catch (    Exception e1) {
      LOG.fatal("String_Node_Str" + httpMessage.getMessageString());
      throw new WebServicesException(e1);
    }
    httpMessage.setMessage(msg);
  }
}
Program: 14396
Project: 14396
Buggy source:
@Override public void outgoingMessage(ChannelHandlerContext ctx,MessageEvent event) throws Exception {
  if (event.getMessage() instanceof MappingHttpResponse) {
    MappingHttpResponse httpResponse=(MappingHttpResponse)event.getMessage();
    BaseMessage msg=(BaseMessage)httpResponse.getMessage();
    Binding binding;
    if (!(msg instanceof EucalyptusErrorMessageType) && !(msg instanceof ExceptionResponseType)) {
      binding=BindingManager.getBinding(BindingManager.sanitizeNamespace(super.getNamespace()));
      if (putQueue != null) {
        putQueue=null;
      }
    }
 else {
      binding=BindingManager.getBinding(BindingManager.sanitizeNamespace("String_Node_Str"));
      if (putQueue != null) {
        putQueue=null;
      }
    }
    if (msg != null) {
      ByteArrayOutputStream byteOut=new ByteArrayOutputStream();
      binding.toStream(byteOut,msg);
      byte[] req=byteOut.toByteArray();
      ChannelBuffer buffer=ChannelBuffers.wrappedBuffer(req);
      httpResponse.addHeader(HttpHeaders.Names.CONTENT_LENGTH,String.valueOf(buffer.readableBytes()));
      httpResponse.addHeader(HttpHeaders.Names.CONTENT_TYPE,"String_Node_Str");
      httpResponse.setContent(buffer);
    }
  }
}

Fixed version (ground truth):
@Override public void outgoingMessage(ChannelHandlerContext ctx,MessageEvent event) throws Exception {
  if (event.getMessage() instanceof MappingHttpResponse) {
    MappingHttpResponse httpResponse=(MappingHttpResponse)event.getMessage();
    BaseMessage msg=(BaseMessage)httpResponse.getMessage();
    Binding binding;
    if (!(msg instanceof EucalyptusErrorMessageType) && !(msg instanceof ExceptionResponseType)) {
      binding=BindingManager.getBinding(super.getNamespace());
      if (putQueue != null) {
        putQueue=null;
      }
    }
 else {
      binding=BindingManager.getDefaultBinding();
      if (putQueue != null) {
        putQueue=null;
      }
    }
    if (msg != null) {
      ByteArrayOutputStream byteOut=new ByteArrayOutputStream();
      binding.toStream(byteOut,msg);
      byte[] req=byteOut.toByteArray();
      ChannelBuffer buffer=ChannelBuffers.wrappedBuffer(req);
      httpResponse.addHeader(HttpHeaders.Names.CONTENT_LENGTH,String.valueOf(buffer.readableBytes()));
      httpResponse.addHeader(HttpHeaders.Names.CONTENT_TYPE,"String_Node_Str");
      httpResponse.setContent(buffer);
    }
  }
}
Program: 14397
Project: 14397
Buggy source:
private BaseMessage parsePayload(Object payload) throws Exception {
  if (payload instanceof BaseMessage) {
    return (BaseMessage)payload;
  }
 else   if (payload instanceof String) {
    return (BaseMessage)BindingManager.getBinding(BindingManager.sanitizeNamespace("String_Node_Str")).fromOM((String)payload);
  }
  return new EucalyptusErrorMessageType("String_Node_Str",LogUtil.dumpObject(payload));
}

Fixed version (ground truth):
private BaseMessage parsePayload(Object payload) throws Exception {
  if (payload instanceof BaseMessage) {
    return (BaseMessage)payload;
  }
 else   if (payload instanceof String) {
    return (BaseMessage)BindingManager.getBinding("String_Node_Str").fromOM((String)payload);
  }
  return new EucalyptusErrorMessageType("String_Node_Str",LogUtil.dumpObject(payload));
}
Program: 14401
Project: 14401
Buggy source:
private static void ensureAllocated(final Address addr,final VmInstance vm){
  long lastUpdate=addr.lastUpdateMillis();
  if (lastUpdate > 60L * 1000 * AddressingConfiguration.getInstance().getOrphanGrace()) {
    if (!addr.isAllocated() && !addr.isPending()) {
      try {
        if (!addr.isAssigned() && !addr.isPending()) {
          addr.pendingAssignment();
          try {
            addr.assign(vm).clearPending();
          }
 catch (          final Exception e1) {
            LOG.debug(e1,e1);
          }
        }
      }
 catch (      final Exception e1) {
        LOG.debug(e1,e1);
      }
    }
 else     if (!addr.isAssigned()) {
      try {
        addr.assign(vm).clearPending();
      }
 catch (      final Exception e1) {
        LOG.debug(e1,e1);
      }
    }
 else {
      LOG.debug("String_Node_Str" + addr);
    }
  }
}

Fixed version (ground truth):
private static void ensureAllocated(final Address addr,final VmInstance vm){
  long lastUpdate=addr.lastUpdateMillis();
  if (lastUpdate > 60L * 1000 * AddressingConfiguration.getInstance().getOrphanGrace()) {
    if (!addr.isAllocated() && !addr.isPending()) {
      try {
        if (!addr.isAssigned() && !addr.isPending()) {
          addr.pendingAssignment();
          try {
            addr.assign(vm).clearPending();
          }
 catch (          final Exception e1) {
            LOG.debug(e1,e1);
          }
        }
      }
 catch (      final Exception e1) {
        LOG.debug(e1,e1);
      }
    }
 else     if (!addr.isAssigned() && !addr.isPending()) {
      try {
        addr.assign(vm).clearPending();
      }
 catch (      final Exception e1) {
        LOG.debug(e1,e1);
      }
    }
 else {
      LOG.debug("String_Node_Str" + addr);
    }
  }
}
Program: 14402
Project: 14402
Buggy source:
private boolean transition(State expectedState,State newState,boolean expectedMark,boolean newMark,SplitTransition transition){
  this.transition=transition;
  if (!this.atomicState.compareAndSet(expectedState,newState,expectedMark,newMark)) {
    throw new IllegalStateException(String.format("String_Node_Str",transition.getName(),expectedState,expectedMark,newState,newMark,this.atomicState.getReference(),this.atomicState.isMarked(),this.toString()));
  }
  EventRecord.caller(this.getClass(),EventType.ADDRESS_STATE,"String_Node_Str",this.toString()).info();
  try {
    this.transition.top();
  }
 catch (  RuntimeException ex) {
    LOG.error(ex);
    Logs.extreme().error(ex,ex);
    throw ex;
  }
  return true;
}

Fixed version (ground truth):
private boolean transition(State expectedState,State newState,boolean expectedMark,boolean newMark,SplitTransition transition){
  if (!this.atomicState.compareAndSet(expectedState,newState,expectedMark,newMark)) {
    throw new IllegalStateException(String.format("String_Node_Str",transition.getName(),expectedState,expectedMark,newState,newMark,this.atomicState.getReference(),this.atomicState.isMarked(),this.toString()));
  }
  this.transition=transition;
  EventRecord.caller(this.getClass(),EventType.ADDRESS_STATE,"String_Node_Str",this.toString()).info();
  try {
    this.transition.top();
  }
 catch (  RuntimeException ex) {
    LOG.error(ex);
    Logs.extreme().error(ex,ex);
    throw ex;
  }
  return true;
}
Program: 14404
Project: 14404
Buggy source:
@Override public String prepareSnapshot(String snapshotId,int sizeExpected) throws EucalyptusCloudException {
  return DirectStorageInfo.getStorageInfo().getVolumesDir() + File.separator + snapshotId;
}

Fixed version (ground truth):
@Override public String prepareSnapshot(String snapshotId,int sizeExpected,long actualSizeInMB) throws EucalyptusCloudException {
  String deviceName=null;
  VolumeEntityWrapperManager volumeManager=new VolumeEntityWrapperManager();
  LVMVolumeInfo foundSnapshotInfo=volumeManager.getVolumeInfo(snapshotId);
  if (null == foundSnapshotInfo) {
    LVMVolumeInfo snapshotInfo=volumeManager.getVolumeInfo();
    snapshotInfo.setVolumeId(snapshotId);
    snapshotInfo.setSize(sizeExpected);
    snapshotInfo.setLoFileName(DirectStorageInfo.getStorageInfo().getVolumesDir() + File.separator + snapshotId);
    deviceName=snapshotInfo.getLoFileName();
    volumeManager.add(snapshotInfo);
  }
  volumeManager.finish();
  return deviceName;
}
Program: 14405
Project: 14405
Buggy source:
private String createSnapshotLogicalVolume(String lvName,String snapLvName,int size) throws EucalyptusCloudException {
  return SystemUtil.run(new String[]{EUCA_ROOT_WRAPPER,"String_Node_Str","String_Node_Str",snapLvName,"String_Node_Str","String_Node_Str",String.valueOf(size) + "String_Node_Str",lvName});
}

Fixed version (ground truth):
private String createSnapshotLogicalVolume(String lvName,String snapLvName,long size) throws EucalyptusCloudException {
  return SystemUtil.run(new String[]{EUCA_ROOT_WRAPPER,"String_Node_Str","String_Node_Str",snapLvName,"String_Node_Str","String_Node_Str",String.valueOf(size) + "String_Node_Str",lvName});
}
Program: 14407
Project: 14407
Buggy source:
@Override public boolean getFromBackend(String snapshotId) throws EucalyptusCloudException {
  return false;
}

Fixed version (ground truth):
@Override public boolean getFromBackend(String snapshotId,int size) throws EucalyptusCloudException {
  return false;
}
Program: 14409
Project: 14409
Buggy source:
@Override public void finishVolume(String snapshotId) throws EucalyptusCloudException {
}

Fixed version (ground truth):
@Override public void finishVolume(String snapshotId) throws EucalyptusCloudException {
  VolumeEntityWrapperManager volumeManager=new VolumeEntityWrapperManager();
  LVMVolumeInfo foundSnapshotInfo=volumeManager.getVolumeInfo(snapshotId);
  if (null != foundSnapshotInfo) {
    foundSnapshotInfo.setStatus(StorageProperties.Status.available.toString());
  }
  volumeManager.finish();
}
Program: 14410
Project: 14410
Buggy source:
public void createLogicalVolume(String lvName,int size) throws EucalyptusCloudException {
  if (volumeGroup != null) {
    String returnValue=createLogicalVolume(volumeGroup,lvName,size);
    if (returnValue.length() == 0) {
      throw new EucalyptusCloudException("String_Node_Str" + lvName + "String_Node_Str"+ volumeGroup);
    }
  }
 else {
    throw new EucalyptusCloudException("String_Node_Str");
  }
}

Fixed version (ground truth):
public void createLogicalVolume(String lvName,long size) throws EucalyptusCloudException {
  if (volumeGroup != null) {
    String returnValue=createLogicalVolume(volumeGroup,lvName,size);
    if (returnValue.length() == 0) {
      throw new EucalyptusCloudException("String_Node_Str" + lvName + "String_Node_Str"+ volumeGroup);
    }
  }
 else {
    throw new EucalyptusCloudException("String_Node_Str");
  }
}
Program: 14411
Project: 14411
Buggy source:
private void checkAndAddUser(){
  EntityWrapper<CHAPUserInfo> dbUser=StorageProperties.getEntityWrapper();
  try {
    CHAPUserInfo userInfo=dbUser.getUnique(new CHAPUserInfo("String_Node_Str"));
    if (!checkUser("String_Node_Str")) {
      try {
        addUser("String_Node_Str",BlockStorageUtil.decryptSCTargetPassword(userInfo.getEncryptedPassword()));
      }
 catch (      EucalyptusCloudException e1) {
        LOG.error(e1);
        return;
      }
    }
  }
 catch (  EucalyptusCloudException ex) {
    String password=Hashes.getRandom(16);
    password=password.substring(0,16);
    try {
      addUser("String_Node_Str",password);
    }
 catch (    EucalyptusCloudException e1) {
      LOG.error(e1);
      dbUser.rollback();
      return;
    }
    CHAPUserInfo userInfo;
    try {
      userInfo=new CHAPUserInfo("String_Node_Str",BlockStorageUtil.encryptSCTargetPassword(password));
      dbUser.add(userInfo);
    }
 catch (    EucalyptusCloudException e) {
      LOG.error(e);
    }
  }
 finally {
    dbUser.commit();
  }
}

Fixed version (ground truth):
private void checkAndAddUser(){
  EntityWrapper<CHAPUserInfo> dbUser=StorageProperties.getEntityWrapper();
  try {
    CHAPUserInfo userInfo=dbUser.getUnique(new CHAPUserInfo("String_Node_Str"));
    if (!checkUser("String_Node_Str")) {
      try {
        addUser("String_Node_Str",BlockStorageUtil.decryptSCTargetPassword(userInfo.getEncryptedPassword()));
      }
 catch (      EucalyptusCloudException e1) {
        LOG.error(e1);
        return;
      }
    }
  }
 catch (  EucalyptusCloudException ex) {
    boolean addUser=true;
    String encryptedPassword=null;
    if (checkUser("String_Node_Str")) {
      try {
        LOG.debug("String_Node_Str");
        CHAPUserInfo uesrInfo=new CHAPUserInfo("String_Node_Str");
        uesrInfo.setScName(null);
        CHAPUserInfo currentUserInfo=dbUser.getUnique(uesrInfo);
        if (null != currentUserInfo && null != currentUserInfo.getEncryptedPassword()) {
          LOG.debug("String_Node_Str");
          addUser=false;
          encryptedPassword=currentUserInfo.getEncryptedPassword();
        }
      }
 catch (      Exception e1) {
        LOG.debug("String_Node_Str");
        try {
          deleteUser("String_Node_Str");
        }
 catch (        Exception e) {
          LOG.error("String_Node_Str",e);
        }
      }
    }
    if (addUser) {
      String password=Hashes.getRandom(16);
      password=password.substring(0,16);
      try {
        addUser("String_Node_Str",password);
        encryptedPassword=BlockStorageUtil.encryptSCTargetPassword(password);
      }
 catch (      Exception e) {
        LOG.error("String_Node_Str",e);
        return;
      }
    }
    try {
      dbUser.add(new CHAPUserInfo("String_Node_Str",encryptedPassword));
    }
 catch (    Exception e) {
      dbUser.rollback();
      LOG.error(e);
    }
  }
 finally {
    dbUser.commit();
  }
}
Program: 14412
Project: 14412
Buggy source:
public boolean getFromBackend(String snapshotId) throws EucalyptusCloudException ;

Fixed version (ground truth):
public boolean getFromBackend(String snapshotId,int size) throws EucalyptusCloudException ;
Program: 14413
Project: 14413
Buggy source:
public String prepareSnapshot(String snapshotId,int sizeExpected) throws EucalyptusCloudException ;

Fixed version (ground truth):
public String prepareSnapshot(String snapshotId,int sizeExpected,long actualSizeInMB) throws EucalyptusCloudException ;
Program: 14414
Project: 14414
Buggy source:
/** 
 * Configure the block storage backend based on the blockstoragemanager found in the DB.
 */
@Override public void fireLoad(ServiceConfiguration parent) throws ServiceRegistrationException {
  try {
    if (parent.isVmLocal()) {
      LOG.info("String_Node_Str" + parent.getName());
      EntityTransaction tx=Entities.get(parent);
      try {
        parent=Entities.merge(parent);
        tx.commit();
      }
 catch (      Exception ex) {
        tx.rollback();
      }
      String propertyBackend=((StorageControllerConfiguration)parent).getBlockStorageManager();
      StorageManagers.getInstance(propertyBackend);
    }
  }
 catch (  Exception ex) {
    throw Exceptions.toUndeclared(ex);
  }
}

Fixed version (ground truth):
/** 
 * Configure the block storage backend based on the blockstoragemanager found in the DB.
 */
@Override public void fireLoad(ServiceConfiguration parent) throws ServiceRegistrationException {
  try {
    if (parent.isVmLocal()) {
      LOG.info("String_Node_Str" + parent.getName());
      EntityTransaction tx=Entities.get(parent);
      try {
        parent=Entities.merge(parent);
        ((StorageControllerConfiguration)parent).setAvailableBackends(Joiner.on("String_Node_Str").join(StorageManagers.list()));
        tx.commit();
      }
 catch (      Exception ex) {
        LOG.debug("String_Node_Str");
        tx.rollback();
      }
      String propertyBackend=((StorageControllerConfiguration)parent).getBlockStorageManager();
      StorageManagers.getInstance(propertyBackend);
    }
  }
 catch (  Exception ex) {
    throw Exceptions.toUndeclared(ex);
  }
}
Program: 14415
Project: 14415
Buggy source:
@Override public void fireChange(ConfigurableProperty t,String newValue) throws ConfigurablePropertyException {
  String existingValue=(String)t.getValue();
  if (existingValue != null && !"String_Node_Str".equals(existingValue)) {
    throw new ConfigurablePropertyException("String_Node_Str");
  }
 else   if (!StorageManagers.contains(newValue)) {
    throw new ConfigurablePropertyException("String_Node_Str" + t.getAlias() + "String_Node_Str"+ "String_Node_Str"+ Joiner.on("String_Node_Str").join(StorageManagers.list()));
  }
}

Fixed version (ground truth):
@Override public void fireChange(ConfigurableProperty t,String newValue) throws ConfigurablePropertyException {
  String existingValue=(String)t.getValue();
  if (existingValue != null && !"String_Node_Str".equals(existingValue)) {
    throw new ConfigurablePropertyException("String_Node_Str");
  }
 else {
    String probablePartitionName=((MultiDatabasePropertyEntry)t).getEntrySetName();
    if (probablePartitionName == null) {
      throw new ConfigurablePropertyException("String_Node_Str");
    }
    String[] parts=probablePartitionName.split("String_Node_Str");
    if (parts == null || parts.length == 0) {
      throw new ConfigurablePropertyException("String_Node_Str" + probablePartitionName);
    }
    probablePartitionName=parts[0];
    List<ServiceConfiguration> scConfigs=null;
    try {
      scConfigs=ServiceConfigurations.listPartition(Storage.class,probablePartitionName);
    }
 catch (    NoSuchElementException e) {
      throw new ConfigurablePropertyException("String_Node_Str" + probablePartitionName);
    }
    final String proposedValue=newValue;
    final Set<String> validEntries=Sets.newHashSet();
    EntityTransaction tx=Entities.get(StorageControllerConfiguration.class);
    try {
      if (!Iterables.any(scConfigs,new Predicate<ServiceConfiguration>(){
        @Override public boolean apply(        ServiceConfiguration config){
          if (config.isVmLocal()) {
            validEntries.addAll(StorageManagers.list());
            return StorageManagers.contains(proposedValue);
          }
 else {
            try {
              StorageControllerConfiguration scConfig=Entities.uniqueResult((StorageControllerConfiguration)config);
              for (              String entry : Splitter.on("String_Node_Str").split(scConfig.getAvailableBackends())) {
                validEntries.add(entry);
              }
              return validEntries.contains(proposedValue);
            }
 catch (            Exception e) {
              return false;
            }
          }
        }
      }
)) {
        throw new ConfigurablePropertyException("String_Node_Str" + t.getQualifiedName() + "String_Node_Str"+ t.getFieldName()+ "String_Node_Str"+ "String_Node_Str"+ Joiner.on("String_Node_Str").join(validEntries));
      }
    }
  finally {
      tx.rollback();
    }
  }
}
Program: 14416
Project: 14416
Buggy source:
/** 
 * Configure the block storage backend based on the blockstoragemanager found in the DB.
 */
@Override public void fireLoad(ServiceConfiguration parent) throws ServiceRegistrationException {
  try {
    if (parent.isVmLocal()) {
      LOG.info("String_Node_Str" + parent.getName());
      EntityTransaction tx=Entities.get(parent);
      try {
        parent=Entities.merge(parent);
        tx.commit();
      }
 catch (      Exception ex) {
        tx.rollback();
      }
      String propertyBackend=((StorageControllerConfiguration)parent).getBlockStorageManager();
      StorageManagers.getInstance(propertyBackend);
    }
  }
 catch (  Exception ex) {
    throw Exceptions.toUndeclared(ex);
  }
}

Fixed version (ground truth):
/** 
 * Configure the block storage backend based on the blockstoragemanager found in the DB.
 */
@Override public void fireLoad(ServiceConfiguration parent) throws ServiceRegistrationException {
  try {
    if (parent.isVmLocal()) {
      LOG.info("String_Node_Str" + parent.getName());
      EntityTransaction tx=Entities.get(parent);
      try {
        parent=Entities.merge(parent);
        ((StorageControllerConfiguration)parent).setAvailableBackends(Joiner.on("String_Node_Str").join(StorageManagers.list()));
        tx.commit();
      }
 catch (      Exception ex) {
        LOG.debug("String_Node_Str");
        tx.rollback();
      }
      String propertyBackend=((StorageControllerConfiguration)parent).getBlockStorageManager();
      StorageManagers.getInstance(propertyBackend);
    }
  }
 catch (  Exception ex) {
    throw Exceptions.toUndeclared(ex);
  }
}
Program: 14417
Project: 14417
Buggy source:
@Override public void fireChange(ConfigurableProperty t,String newValue) throws ConfigurablePropertyException {
  String existingValue=(String)t.getValue();
  if (existingValue != null && !"String_Node_Str".equals(existingValue)) {
    throw new ConfigurablePropertyException("String_Node_Str");
  }
 else   if (!StorageManagers.contains(newValue)) {
    throw new ConfigurablePropertyException("String_Node_Str" + t.getAlias() + "String_Node_Str"+ "String_Node_Str"+ Joiner.on("String_Node_Str").join(StorageManagers.list()));
  }
}

Fixed version (ground truth):
@Override public void fireChange(ConfigurableProperty t,String newValue) throws ConfigurablePropertyException {
  String existingValue=(String)t.getValue();
  if (existingValue != null && !"String_Node_Str".equals(existingValue)) {
    throw new ConfigurablePropertyException("String_Node_Str");
  }
 else {
    String probablePartitionName=((MultiDatabasePropertyEntry)t).getEntrySetName();
    if (probablePartitionName == null) {
      throw new ConfigurablePropertyException("String_Node_Str");
    }
    String[] parts=probablePartitionName.split("String_Node_Str");
    if (parts == null || parts.length == 0) {
      throw new ConfigurablePropertyException("String_Node_Str" + probablePartitionName);
    }
    probablePartitionName=parts[0];
    List<ServiceConfiguration> scConfigs=null;
    try {
      scConfigs=ServiceConfigurations.listPartition(Storage.class,probablePartitionName);
    }
 catch (    NoSuchElementException e) {
      throw new ConfigurablePropertyException("String_Node_Str" + probablePartitionName);
    }
    final String proposedValue=newValue;
    final Set<String> validEntries=Sets.newHashSet();
    EntityTransaction tx=Entities.get(StorageControllerConfiguration.class);
    try {
      if (!Iterables.any(scConfigs,new Predicate<ServiceConfiguration>(){
        @Override public boolean apply(        ServiceConfiguration config){
          if (config.isVmLocal()) {
            validEntries.addAll(StorageManagers.list());
            return StorageManagers.contains(proposedValue);
          }
 else {
            try {
              StorageControllerConfiguration scConfig=Entities.uniqueResult((StorageControllerConfiguration)config);
              for (              String entry : Splitter.on("String_Node_Str").split(scConfig.getAvailableBackends())) {
                validEntries.add(entry);
              }
              return validEntries.contains(proposedValue);
            }
 catch (            Exception e) {
              return false;
            }
          }
        }
      }
)) {
        throw new ConfigurablePropertyException("String_Node_Str" + t.getQualifiedName() + "String_Node_Str"+ t.getFieldName()+ "String_Node_Str"+ "String_Node_Str"+ Joiner.on("String_Node_Str").join(validEntries));
      }
    }
  finally {
      tx.rollback();
    }
  }
}
Program: 14419
Project: 14419
Buggy source:
@Override public boolean apply(final ReportingVolumeSnapshotCreateEvent createEvent){
  long endTime=snapshotEndTimes.containsKey(createEvent.getUuid()) ? snapshotEndTimes.get(createEvent.getUuid()) : report.getEndMs();
  if (createEvent.getTimestampMs() <= report.getEndMs() && endTime >= report.getBeginMs() && volumeCreateEvents.containsKey(createEvent.getVolumeUuid())) {
    VolumeSnapshotUsageArtEntity usage=new VolumeSnapshotUsageArtEntity();
    usage.setSizeGB(createEvent.getSizeGB());
    usage.setSnapshotNum(1);
    long durationMs=Math.min(report.getEndMs(),endTime) - Math.max(report.getBeginMs(),createEvent.getTimestampMs());
    usage.setGBSecs(createEvent.getSizeGB() * (durationMs / 1000));
    VolumeArtEntity vol=addParentNodes(report,volumeCreateEvents.get(createEvent.getVolumeUuid()));
    vol.getSnapshotUsage().put(createEvent.getId(),usage);
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean apply(final ReportingVolumeSnapshotCreateEvent createEvent){
  long endTime=snapshotEndTimes.containsKey(createEvent.getUuid()) ? snapshotEndTimes.get(createEvent.getUuid()) : report.getEndMs();
  if (createEvent.getTimestampMs() <= report.getEndMs() && endTime >= report.getBeginMs() && volumeCreateEvents.containsKey(createEvent.getVolumeUuid())) {
    VolumeSnapshotUsageArtEntity usage=new VolumeSnapshotUsageArtEntity();
    usage.setSizeGB(createEvent.getSizeGB());
    usage.setSnapshotNum(1);
    long durationMs=Math.min(report.getEndMs(),endTime) - Math.max(report.getBeginMs(),createEvent.getTimestampMs());
    usage.setGBSecs(createEvent.getSizeGB() * (durationMs / 1000));
    VolumeArtEntity vol=addParentNodes(report,volumeCreateEvents.get(createEvent.getVolumeUuid()));
    vol.getSnapshotUsage().put(createEvent.getVolumeSnapshotId(),usage);
  }
  return true;
}
Program: 14421
Project: 14421
Buggy source:
@Override public boolean apply(final ReportingVolumeSnapshotDeleteEvent deleteEvent){
  if (snapshotEntities.containsKey(deleteEvent.getUuid())) {
    VolumeSnapshotUsageArtEntity snap=snapshotEntities.get(deleteEvent.getUuid());
    long startTimeMs=snapshotStartTimes.get(deleteEvent.getUuid()).longValue();
    long duration=DurationCalculator.boundDuration(report.getBeginMs(),report.getEndMs(),startTimeMs,deleteEvent.getTimestampMs()) / 1000;
    snap.setGBSecs(snap.getSizeGB() * duration);
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean apply(final ReportingVolumeSnapshotCreateEvent createEvent){
  long endTime=snapshotEndTimes.containsKey(createEvent.getUuid()) ? snapshotEndTimes.get(createEvent.getUuid()) : report.getEndMs();
  if (createEvent.getTimestampMs() <= report.getEndMs() && endTime >= report.getBeginMs() && volumeCreateEvents.containsKey(createEvent.getVolumeUuid())) {
    VolumeSnapshotUsageArtEntity usage=new VolumeSnapshotUsageArtEntity();
    usage.setSizeGB(createEvent.getSizeGB());
    usage.setSnapshotNum(1);
    long durationMs=Math.min(report.getEndMs(),endTime) - Math.max(report.getBeginMs(),createEvent.getTimestampMs());
    usage.setGBSecs(createEvent.getSizeGB() * (durationMs / 1000));
    VolumeArtEntity vol=addParentNodes(report,volumeCreateEvents.get(createEvent.getVolumeUuid()));
    vol.getSnapshotUsage().put(createEvent.getId(),usage);
  }
  return true;
}
Program: 14426
Project: 14426
Buggy source:
@Override public InstanceUsageEvent get(){
  return new InstanceUsageEvent(sensorData.getResourceUuid(),sensorData.getResourceName(),metricType.getMetricName(),currentSeqNum,dimensionType.getDimensionName(),usageValue,usageTimestamp);
}

Fixed version (ground truth):
@Override public InstanceUsageEvent get(){
  return new InstanceUsageEvent(sensorData.getResourceUuid(),sensorData.getResourceName(),metricType.getMetricName(),sequenceNumber,dimensionType.getDimensionName(),usageValue,usageTimestamp);
}
Program: 14428
Project: 14428
Buggy source:
@Override public void fireEvent(Hertz event){
  COLLECTION_INTERVAL_TIME_MS=(((int)TimeUnit.MINUTES.toMillis(DEFAULT_POLL_INTERVAL_MINS)) / HISTORY_SIZE) * 2;
  if (COLLECTION_INTERVAL_TIME_MS <= MAX_WRITE_INTERVAL_MS) {
    try {
      if (event.isAsserted(DEFAULT_POLL_INTERVAL_MINS)) {
        if (Bootstrap.isFinished() && Hosts.isCoordinator()) {
          for (          final ServiceConfiguration ccConfig : Topology.enabledServices(ClusterController.class)) {
            AsyncRequests.newRequest(new DescribeSensorCallback(HISTORY_SIZE,COLLECTION_INTERVAL_TIME_MS)).dispatch(ccConfig);
            LOG.debug("String_Node_Str");
          }
        }
      }
    }
 catch (    Exception ex) {
      LOG.error("String_Node_Str",ex);
    }
  }
 else {
    LOG.error("String_Node_Str" + DEFAULT_POLL_INTERVAL_MINS + "String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void fireEvent(Hertz event){
  COLLECTION_INTERVAL_TIME_MS=((int)TimeUnit.MINUTES.toMillis(DEFAULT_POLL_INTERVAL_MINS) / 2);
  if (COLLECTION_INTERVAL_TIME_MS <= MAX_WRITE_INTERVAL_MS) {
    try {
      if (event.isAsserted(TimeUnit.MINUTES.toSeconds(DEFAULT_POLL_INTERVAL_MINS))) {
        if (Bootstrap.isFinished() && Hosts.isCoordinator()) {
          for (          final ServiceConfiguration ccConfig : Topology.enabledServices(ClusterController.class)) {
            AsyncRequests.newRequest(new DescribeSensorCallback(HISTORY_SIZE,COLLECTION_INTERVAL_TIME_MS)).dispatch(ccConfig);
            LOG.debug("String_Node_Str");
          }
        }
      }
    }
 catch (    Exception ex) {
      LOG.error("String_Node_Str",ex);
    }
  }
 else {
    LOG.error("String_Node_Str" + DEFAULT_POLL_INTERVAL_MINS + "String_Node_Str");
  }
}
Program: 14429
Project: 14429
Buggy source:
@Override public void run(){
  if (null != dbPools) {
    for (    DBPoolInfo dbPool : this.dbPools) {
      try {
        LOG.debug("String_Node_Str" + pollInterval + "String_Node_Str"+ dbPool.getThreshold());
        if (dbPool.getMaximumConnections() - dbPool.getActiveConnections() < dbPool.getThreshold()) {
          if (!this.alreadyFaulted.contains(dbPool)) {
            FaultSubsystem.forComponent(this.componentIdClass).havingId(OUT_OF_DB_CONNECTIONS_FAULT_ID).withVar("String_Node_Str",ComponentIds.lookup(componentIdClass).getFaultLogPrefix()).withVar("String_Node_Str",dbPool.getAlias()).log();
            this.alreadyFaulted.add(dbPool);
          }
 else {
          }
        }
 else {
          this.alreadyFaulted.remove(dbPool);
        }
      }
 catch (      Exception ex) {
        LOG.error("String_Node_Str" + dbPool.getAlias(),ex);
      }
    }
  }
 else {
  }
}

Fixed version (ground truth):
@Override public void run(){
  if (null != dbPools) {
    for (    DBPoolInfo dbPool : this.dbPools) {
      try {
        LOG.debug("String_Node_Str" + dbPool.getAlias() + "String_Node_Str"+ pollInterval+ "String_Node_Str"+ dbPool.getThreshold());
        if (dbPool.getMaximumConnections() - dbPool.getActiveConnections() < dbPool.getThreshold()) {
          if (!this.alreadyFaulted.contains(dbPool)) {
            FaultSubsystem.forComponent(this.componentIdClass).havingId(OUT_OF_DB_CONNECTIONS_FAULT_ID).withVar("String_Node_Str",ComponentIds.lookup(componentIdClass).getFaultLogPrefix()).withVar("String_Node_Str",dbPool.getAlias()).log();
            this.alreadyFaulted.add(dbPool);
          }
 else {
          }
        }
 else {
          this.alreadyFaulted.remove(dbPool);
        }
      }
 catch (      Exception ex) {
        LOG.error("String_Node_Str" + dbPool.getAlias(),ex);
      }
    }
  }
 else {
  }
}
Program: 14430
Project: 14430
Buggy source:
@Override public void run(){
  if (null != locations) {
    for (    LocationInfo location : this.locations) {
      LOG.debug("String_Node_Str" + pollInterval + "String_Node_Str"+ location.getThreshold());
      try {
        long usableSpace=location.getFile().getUsableSpace();
        if (usableSpace < location.getThreshold()) {
          if (!this.alreadyFaulted.contains(location)) {
            FaultSubsystem.forComponent(this.componentIdClass).havingId(OUT_OF_DISK_SPACE_FAULT_ID).withVar("String_Node_Str",ComponentIds.lookup(this.componentIdClass).getFaultLogPrefix()).withVar("String_Node_Str",location.getFile().getAbsolutePath()).log();
            this.alreadyFaulted.add(location);
          }
 else {
          }
        }
 else {
          this.alreadyFaulted.remove(location);
        }
      }
 catch (      Exception ex) {
        LOG.error("String_Node_Str" + location.getFile().getAbsolutePath(),ex);
      }
    }
  }
 else {
  }
}

Fixed version (ground truth):
@Override public void run(){
  if (null != locations) {
    for (    LocationInfo location : this.locations) {
      LOG.debug("String_Node_Str" + location.getFile() + "String_Node_Str"+ pollInterval+ "String_Node_Str"+ location.getThreshold());
      try {
        long usableSpace=location.getFile().getUsableSpace();
        if (usableSpace < location.getThreshold()) {
          if (!this.alreadyFaulted.contains(location)) {
            FaultSubsystem.forComponent(this.componentIdClass).havingId(OUT_OF_DISK_SPACE_FAULT_ID).withVar("String_Node_Str",ComponentIds.lookup(this.componentIdClass).getFaultLogPrefix()).withVar("String_Node_Str",location.getFile().getAbsolutePath()).log();
            this.alreadyFaulted.add(location);
          }
 else {
          }
        }
 else {
          this.alreadyFaulted.remove(location);
        }
      }
 catch (      Exception ex) {
        LOG.error("String_Node_Str" + location.getFile().getAbsolutePath(),ex);
      }
    }
  }
 else {
  }
}
Program: 14431
Project: 14431
Buggy source:
public MemoryChecker(MemoryInfo info,Class<? extends ComponentId> componentIdClass,long pollInterval){
  this.memoryInfo=memoryInfo;
  this.pollInterval=pollInterval;
  this.componentIdClass=componentIdClass;
}

Fixed version (ground truth):
public MemoryChecker(MemoryInfo memoryInfo,Class<? extends ComponentId> componentIdClass,long pollInterval){
  this.memoryInfo=memoryInfo;
  this.pollInterval=pollInterval;
  this.componentIdClass=componentIdClass;
}
Program: 14432
Project: 14432
Buggy source:
public static void resetMXBeanMemoryCheck(){
  String threshold=TroubleshootingBootstrapper.SIMPLE_MEMORY_CHECK_THRESHOLD;
  String pollTime=TroubleshootingBootstrapper.SIMPLE_MEMORY_CHECK_POLL_TIME;
  if (mxBeanMemoryCheckerScheduledFuture != null) {
    mxBeanMemoryCheckerScheduledFuture.cancel(true);
  }
  MXBeanInfo info=null;
  if (threshold.endsWith("String_Node_Str")) {
    info=new MXBeanInfo(Double.parseDouble(threshold.substring(0,threshold.length() - 1)));
  }
 else {
    info=new MXBeanInfo(Long.parseLong(threshold));
  }
  MXBeanMemoryChecker checker=new MXBeanMemoryChecker(info,Eucalyptus.class,Long.parseLong(pollTime));
  mxBeanMemoryCheckerScheduledFuture=MXBeanMemoryResourceCheck.start(checker);
}

Fixed version (ground truth):
public static void resetMXBeanMemoryCheck(){
  String threshold=TroubleshootingBootstrapper.MXBEAN_MEMORY_CHECK_THRESHOLD;
  String pollTime=TroubleshootingBootstrapper.MXBEAN_MEMORY_CHECK_POLL_TIME;
  if (mxBeanMemoryCheckerScheduledFuture != null) {
    mxBeanMemoryCheckerScheduledFuture.cancel(true);
  }
  MXBeanInfo info=null;
  if (threshold.endsWith("String_Node_Str")) {
    info=new MXBeanInfo(Double.parseDouble(threshold.substring(0,threshold.length() - 1)));
  }
 else {
    info=new MXBeanInfo(Long.parseLong(threshold));
  }
  MXBeanMemoryChecker checker=new MXBeanMemoryChecker(info,Eucalyptus.class,Long.parseLong(pollTime));
  mxBeanMemoryCheckerScheduledFuture=MXBeanMemoryResourceCheck.start(checker);
}
Program: 14433
Project: 14433
Buggy source:
public static Document addUsageCols(final Document doc,final InstanceUsageArtEntity entity,final Units units) throws IOException {
  doc.addValCol((long)entity.getInstanceCnt());
  doc.addValCol(UnitUtil.convertTime(entity.getDurationMs(),TimeUnit.MS,units.getTimeUnit()));
  if (entity.getDurationMs() > 0) {
    doc.addValCol(entity.getCpuUtilizationMs() == null ? null : ((double)entity.getCpuUtilizationMs() / (double)entity.getDurationMs()));
  }
 else {
    doc.addValCol(0d);
  }
  doc.addValCol(UnitUtil.convertSize(entity.getNetTotalInMegs(),SizeUnit.MB,units.getSizeUnit()));
  doc.addValCol(UnitUtil.convertSize(entity.getNetTotalOutMegs(),SizeUnit.MB,units.getSizeUnit()));
  doc.addValCol(UnitUtil.convertSize(entity.getDiskReadMegs(),SizeUnit.MB,units.getSizeUnit()));
  doc.addValCol(UnitUtil.convertSize(entity.getDiskWriteMegs(),SizeUnit.MB,units.getSizeUnit()));
  doc.addValCol(entity.getDiskReadOps() / 1000000);
  doc.addValCol(entity.getDiskWriteOps() / 1000000);
  doc.addValCol(UnitUtil.convertTime(entity.getDiskReadTime(),TimeUnit.MS,TimeUnit.values()[units.getTimeUnit().ordinal() - 1]));
  doc.addValCol(UnitUtil.convertTime(entity.getDiskWriteTime(),TimeUnit.MS,TimeUnit.values()[units.getTimeUnit().ordinal() - 1]));
  return doc;
}

Fixed version (ground truth):
public static Document addUsageCols(final Document doc,final InstanceUsageArtEntity entity,final Units units) throws IOException {
  doc.addValCol((long)entity.getInstanceCnt());
  doc.addValCol(UnitUtil.convertTime(entity.getDurationMs(),TimeUnit.MS,units.getTimeUnit()));
  if (entity.getDurationMs() > 0) {
    doc.addValCol(entity.getCpuUtilizationMs() == null ? null : ((double)entity.getCpuUtilizationMs() / (double)entity.getDurationMs()));
  }
 else {
    doc.addValCol(0d);
  }
  doc.addValCol(UnitUtil.convertSize(entity.getNetTotalInMegs(),SizeUnit.MB,units.getSizeUnit()));
  doc.addValCol(UnitUtil.convertSize(entity.getNetTotalOutMegs(),SizeUnit.MB,units.getSizeUnit()));
  doc.addValCol(UnitUtil.convertSize(entity.getDiskReadMegs(),SizeUnit.MB,units.getSizeUnit()));
  doc.addValCol(UnitUtil.convertSize(entity.getDiskWriteMegs(),SizeUnit.MB,units.getSizeUnit()));
  doc.addValCol(entity.getDiskReadOps() == null ? null : ((double)entity.getDiskReadOps() / 1000000d));
  doc.addValCol(entity.getDiskWriteOps() == null ? null : ((double)entity.getDiskWriteOps() / 1000000d));
  doc.addValCol(UnitUtil.convertTime(entity.getDiskReadTime(),TimeUnit.MS,TimeUnit.values()[units.getTimeUnit().ordinal() - 1]));
  doc.addValCol(UnitUtil.convertTime(entity.getDiskWriteTime(),TimeUnit.MS,TimeUnit.values()[units.getTimeUnit().ordinal() - 1]));
  return doc;
}
Program: 14436
Project: 14436
Buggy source:
public static Document addUsageCols(final Document doc,final InstanceUsageArtEntity entity,final Units units) throws IOException {
  doc.addValCol((long)entity.getInstanceCnt());
  doc.addValCol(UnitUtil.convertTime(entity.getDurationMs(),TimeUnit.MS,units.getTimeUnit()));
  doc.addValCol(entity.getCpuUtilizationMs() == null ? null : ((double)entity.getCpuUtilizationMs() / (double)entity.getDurationMs()));
  doc.addValCol(UnitUtil.convertSize(entity.getNetTotalInMegs(),SizeUnit.MB,units.getSizeUnit()));
  doc.addValCol(UnitUtil.convertSize(entity.getNetTotalOutMegs(),SizeUnit.MB,units.getSizeUnit()));
  doc.addValCol(UnitUtil.convertSize(entity.getDiskReadMegs(),SizeUnit.MB,units.getSizeUnit()));
  doc.addValCol(UnitUtil.convertSize(entity.getDiskWriteMegs(),SizeUnit.MB,units.getSizeUnit()));
  doc.addValCol(entity.getDiskReadOps());
  doc.addValCol(entity.getDiskWriteOps());
  doc.addValCol(UnitUtil.convertTime(entity.getDiskReadTime(),TimeUnit.MS,TimeUnit.SECS));
  doc.addValCol(UnitUtil.convertTime(entity.getDiskWriteTime(),TimeUnit.MS,TimeUnit.SECS));
  return doc;
}

Fixed version (ground truth):
public static Document addUsageCols(final Document doc,final InstanceUsageArtEntity entity,final Units units) throws IOException {
  doc.addValCol((long)entity.getInstanceCnt());
  doc.addValCol(UnitUtil.convertTime(entity.getDurationMs(),TimeUnit.MS,units.getTimeUnit()));
  if (entity.getDurationMs() > 0) {
    doc.addValCol(entity.getCpuUtilizationMs() == null ? null : ((double)entity.getCpuUtilizationMs() / (double)entity.getDurationMs()));
  }
 else {
    doc.addValCol(0d);
  }
  doc.addValCol(UnitUtil.convertSize(entity.getNetTotalInMegs(),SizeUnit.MB,units.getSizeUnit()));
  doc.addValCol(UnitUtil.convertSize(entity.getNetTotalOutMegs(),SizeUnit.MB,units.getSizeUnit()));
  doc.addValCol(UnitUtil.convertSize(entity.getDiskReadMegs(),SizeUnit.MB,units.getSizeUnit()));
  doc.addValCol(UnitUtil.convertSize(entity.getDiskWriteMegs(),SizeUnit.MB,units.getSizeUnit()));
  doc.addValCol(entity.getDiskReadOps() / 1000000);
  doc.addValCol(entity.getDiskWriteOps() / 1000000);
  doc.addValCol(UnitUtil.convertTime(entity.getDiskReadTime(),TimeUnit.MS,TimeUnit.values()[units.getTimeUnit().ordinal() - 1]));
  doc.addValCol(UnitUtil.convertTime(entity.getDiskWriteTime(),TimeUnit.MS,TimeUnit.values()[units.getTimeUnit().ordinal() - 1]));
  return doc;
}
Program: 14439
Project: 14439
Buggy source:
private static void addMetricValueToUsageEntity(InstanceUsageArtEntity usage,String metric,String dim,double val){
  long value=new Double(val).longValue();
  long valueMB=value << 20;
  if (metric.equals(METRIC_NET_IN_BYTES) && dim.equals(DIM_TOTAL)) {
    usage.addNetTotalInMegs(valueMB);
  }
 else   if (metric.equals(METRIC_NET_OUT_BYTES) && dim.equals(DIM_TOTAL)) {
    usage.addNetTotalOutMegs(valueMB);
  }
 else   if (metric.equals(METRIC_DISK_IN_BYTES)) {
    usage.addDiskReadMegs(valueMB);
  }
 else   if (metric.equals(METRIC_DISK_OUT_BYTES)) {
    usage.addDiskWriteMegs(valueMB);
  }
 else   if (metric.equals(METRIC_DISK_READ_OPS)) {
    usage.addDiskReadOps(value);
  }
 else   if (metric.equals(METRIC_DISK_WRITE_OPS)) {
    usage.addDiskWriteOps(value);
  }
 else   if (metric.equals(METRIC_VOLUME_READ)) {
    usage.addDiskReadTime(value);
  }
 else   if (metric.equals(METRIC_VOLUME_WRITE)) {
    usage.addDiskWriteTime(value);
  }
 else   if (metric.equals(METRIC_CPU_USAGE_MS) && (dim.equals(DIM_DEFAULT))) {
    usage.addCpuUtilizationMs(value);
  }
 else {
    log.debug("String_Node_Str" + metric + "String_Node_Str"+ dim);
  }
}

Fixed version (ground truth):
private static void addMetricValueToUsageEntity(InstanceUsageArtEntity usage,String metric,String dim,double val){
  long value=new Double(val).longValue();
  long valueMB=value >> 20;
  if (metric.equals(METRIC_NET_IN_BYTES) && dim.equals(DIM_TOTAL)) {
    usage.addNetTotalInMegs(valueMB);
  }
 else   if (metric.equals(METRIC_NET_OUT_BYTES) && dim.equals(DIM_TOTAL)) {
    usage.addNetTotalOutMegs(valueMB);
  }
 else   if (metric.equals(METRIC_DISK_IN_BYTES)) {
    usage.addDiskReadMegs(valueMB);
  }
 else   if (metric.equals(METRIC_DISK_OUT_BYTES)) {
    usage.addDiskWriteMegs(valueMB);
  }
 else   if (metric.equals(METRIC_DISK_READ_OPS)) {
    usage.addDiskReadOps(value);
  }
 else   if (metric.equals(METRIC_DISK_WRITE_OPS)) {
    usage.addDiskWriteOps(value);
  }
 else   if (metric.equals(METRIC_VOLUME_READ)) {
    usage.addDiskReadTime(value);
  }
 else   if (metric.equals(METRIC_VOLUME_WRITE)) {
    usage.addDiskWriteTime(value);
  }
 else   if (metric.equals(METRIC_CPU_USAGE_MS) && (dim.equals(DIM_DEFAULT))) {
    usage.addCpuUtilizationMs(value);
  }
 else {
    log.debug("String_Node_Str" + metric + "String_Node_Str"+ dim);
  }
}
Program: 14441
Project: 14441
Buggy source:
public static Document addUsageCols(final Document doc,final InstanceUsageArtEntity entity,final Units units) throws IOException {
  doc.addValCol((long)entity.getInstanceCnt());
  doc.addValCol(UnitUtil.convertTime(entity.getDurationMs(),TimeUnit.MS,units.getTimeUnit()));
  doc.addValCol(entity.getCpuUtilizationMs() == null ? null : ((double)entity.getCpuUtilizationMs() / (double)entity.getDurationMs()));
  doc.addValCol(UnitUtil.convertSize(entity.getNetTotalInMegs(),SizeUnit.MB,units.getSizeUnit()));
  doc.addValCol(UnitUtil.convertSize(entity.getNetTotalOutMegs(),SizeUnit.MB,units.getSizeUnit()));
  doc.addValCol(UnitUtil.convertSize(entity.getDiskReadMegs(),SizeUnit.MB,units.getSizeUnit()));
  doc.addValCol(UnitUtil.convertSize(entity.getDiskWriteMegs(),SizeUnit.MB,units.getSizeUnit()));
  doc.addValCol(entity.getDiskReadOps() == null ? null : entity.getDiskReadOps() / (entity.getDurationMs() / 1000));
  doc.addValCol(entity.getDiskWriteOps() == null ? null : entity.getDiskWriteOps() / (entity.getDurationMs() / 1000));
  doc.addValCol(UnitUtil.convertTime(entity.getDiskReadTime(),TimeUnit.MS,TimeUnit.SECS));
  doc.addValCol(UnitUtil.convertTime(entity.getDiskWriteTime(),TimeUnit.MS,TimeUnit.SECS));
  return doc;
}

Fixed version (ground truth):
public static Document addUsageCols(final Document doc,final InstanceUsageArtEntity entity,final Units units) throws IOException {
  doc.addValCol((long)entity.getInstanceCnt());
  doc.addValCol(UnitUtil.convertTime(entity.getDurationMs(),TimeUnit.MS,units.getTimeUnit()));
  doc.addValCol(entity.getCpuUtilizationMs() == null ? null : ((double)entity.getCpuUtilizationMs() / (double)entity.getDurationMs()));
  doc.addValCol(UnitUtil.convertSize(entity.getNetTotalInMegs(),SizeUnit.MB,units.getSizeUnit()));
  doc.addValCol(UnitUtil.convertSize(entity.getNetTotalOutMegs(),SizeUnit.MB,units.getSizeUnit()));
  doc.addValCol(UnitUtil.convertSize(entity.getDiskReadMegs(),SizeUnit.MB,units.getSizeUnit()));
  doc.addValCol(UnitUtil.convertSize(entity.getDiskWriteMegs(),SizeUnit.MB,units.getSizeUnit()));
  doc.addValCol(entity.getDiskReadOps());
  doc.addValCol(entity.getDiskWriteOps());
  doc.addValCol(UnitUtil.convertTime(entity.getDiskReadTime(),TimeUnit.MS,TimeUnit.SECS));
  doc.addValCol(UnitUtil.convertTime(entity.getDiskWriteTime(),TimeUnit.MS,TimeUnit.SECS));
  return doc;
}