bug CS-14785: String equality should be through equals function....what was i thinking !!!.

This commit is contained in:
Nitin Mehta 2012-05-08 14:38:38 +05:30
parent 9228a70913
commit 56f4dec1e2
2 changed files with 6 additions and 2 deletions

View File

@ -214,7 +214,11 @@ public class DownloadListener implements Listener {
}
public void logDisconnect() {
s_logger.warn("Unable to monitor download progress of " + template.getName() + " at host " + sserver.getName());
if (template != null){
s_logger.warn("Unable to monitor download progress of " + template.getName() + " at host " + sserver.getName());
}else {
s_logger.warn("Unable to monitor download progress of " + volume.getName() + " at host " + sserver.getName());
}
}
public synchronized void updateDatabase(Status state, String errorString) {

View File

@ -591,7 +591,7 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
}else {
try {
// Format of data disk should be the same as root disk
if(_storageMgr.getSupportedImageFormatForCluster(rootDiskPool.getClusterId()) != volHostVO.getFormat().getFileExtension()){
if( ! volHostVO.getFormat().getFileExtension().equals(_storageMgr.getSupportedImageFormatForCluster(rootDiskPool.getClusterId())) ){
throw new InvalidParameterValueException("Failed to attach volume to VM since volumes format " +volHostVO.getFormat().getFileExtension()+
" is not compatible with the vm hypervisor type" );
}