mirror of https://github.com/apache/cloudstack.git
Fixed few coverity defects
This commit is contained in:
parent
ac80535574
commit
4a6560a9ee
|
|
@ -134,14 +134,23 @@ public class DeployDestination implements Serializable {
|
|||
destination.append("Host(").append(hostId).append(")").append("-");
|
||||
destination.append("Storage(");
|
||||
if (_storage != null) {
|
||||
String storageStr = "";
|
||||
StringBuffer storageBuf = new StringBuffer();
|
||||
//String storageStr = "";
|
||||
for (Volume vol : _storage.keySet()) {
|
||||
if (!storageStr.equals("")) {
|
||||
storageStr = storageStr + ", ";
|
||||
if (!storageBuf.toString().equals("")) {
|
||||
storageBuf.append(storageBuf.toString());
|
||||
storageBuf.append(", ");
|
||||
}
|
||||
storageStr = storageStr + "Volume(" + vol.getId() + "|" + vol.getVolumeType().name() + "-->Pool(" + _storage.get(vol).getId() + ")";
|
||||
storageBuf.append(storageBuf);
|
||||
storageBuf.append("Volume(");
|
||||
storageBuf.append(vol.getId());
|
||||
storageBuf.append("|");
|
||||
storageBuf.append(vol.getVolumeType().name());
|
||||
storageBuf.append("-->Pool(");
|
||||
storageBuf.append(_storage.get(vol).getId());
|
||||
storageBuf.append(")");
|
||||
}
|
||||
destination.append(storageStr);
|
||||
destination.append(storageBuf.toString());
|
||||
}
|
||||
return destination.append(")]").toString();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -112,8 +112,12 @@ public class CreateVpnConnectionCmd extends BaseAsyncCreateCmd {
|
|||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
Vpc vpc = _entityMgr.findById(Vpc.class, getVpnGateway().getVpcId());
|
||||
return vpc.getAccountId();
|
||||
Site2SiteVpnGateway vpnGw = getVpnGateway();
|
||||
if (vpnGw != null) {
|
||||
Vpc vpc = _entityMgr.findById(Vpc.class, getVpnGateway().getVpcId());
|
||||
return vpc.getAccountId();
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -167,7 +171,12 @@ public class CreateVpnConnectionCmd extends BaseAsyncCreateCmd {
|
|||
|
||||
@Override
|
||||
public Long getSyncObjId() {
|
||||
return getVpnGateway().getVpcId();
|
||||
Site2SiteVpnGateway vpnGw = getVpnGateway();
|
||||
if (vpnGw != null)
|
||||
{
|
||||
return vpnGw.getVpcId();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private Site2SiteVpnGateway getVpnGateway() {
|
||||
|
|
|
|||
|
|
@ -87,8 +87,6 @@ public class MultiPartUploadsDaoImpl extends GenericDaoBase<MultiPartUploadsVO,
|
|||
@Override
|
||||
public List<MultiPartUploadsVO> getInitiatedUploads(String bucketName, int maxParts, String prefix, String keyMarker, String uploadIdMarker) {
|
||||
|
||||
List<MultiPartUploadsVO> uploadList = new ArrayList<MultiPartUploadsVO>();
|
||||
|
||||
SearchBuilder<MultiPartUploadsVO> byBucket = createSearchBuilder();
|
||||
byBucket.and("BucketName", byBucket.entity().getBucketName(), SearchCriteria.Op.EQ);
|
||||
|
||||
|
|
|
|||
|
|
@ -139,6 +139,7 @@ public class TestMessageBus extends TestCase {
|
|||
int count = 0;
|
||||
while (count < 2) {
|
||||
detector.waitAny(1000);
|
||||
count = count + 1;
|
||||
}
|
||||
} finally {
|
||||
detector.close();
|
||||
|
|
|
|||
|
|
@ -668,9 +668,10 @@ public class CiscoVnmcResource implements ServerResource {
|
|||
s_logger.error(msg, e);
|
||||
return new Answer(cmd, false, msg);
|
||||
} finally {
|
||||
helper.disconnect();
|
||||
if( helper != null) {
|
||||
helper.disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
return new Answer(cmd, true, "Success");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue