[jira] [Commented] (CLOUDSTACK-10156) Fix Coverity new problems CID(1349987, 1349986, 1347248)

2017-11-23 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-10156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16264117#comment-16264117
 ] 

ASF GitHub Bot commented on CLOUDSTACK-10156:
-

rafaelweingartner commented on issue #2332: [CLOUDSTACK-10156] Fix Coverity new 
problems CID(1349987, 1349986, 1347248)
URL: https://github.com/apache/cloudstack/pull/2332#issuecomment-346578881
 
 
   Thanks @rhtyd !
   I am using ACS eclipse code formatter, I will check next time if it has some 
misconfiguration, or if I disabled something in the save actions.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Fix Coverity new problems CID(1349987, 1349986, 1347248) 
> -
>
> Key: CLOUDSTACK-10156
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10156
> Project: CloudStack
>  Issue Type: Improvement
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>Reporter: Rafael Weingärtner
>Assignee: Rafael Weingärtner
>Priority: Minor
>
> Solving Coverity new problems CID(1349987, 1349986, 1347248).
> This is  basically the removal of dead code.
> The PR used to solve those problems is: 
> https://github.com/apache/cloudstack/pull/2332



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (CLOUDSTACK-10156) Fix Coverity new problems CID(1349987, 1349986, 1347248)

2017-11-22 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-10156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16263853#comment-16263853
 ] 

ASF GitHub Bot commented on CLOUDSTACK-10156:
-

rhtyd commented on issue #2332: [CLOUDSTACK-10156] Fix Coverity new problems 
CID(1349987, 1349986, 1347248)
URL: https://github.com/apache/cloudstack/pull/2332#issuecomment-346537900
 
 
   @rafaelweingartner I've fixed a minor spacing/styling issue. LGTM merging. 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Fix Coverity new problems CID(1349987, 1349986, 1347248) 
> -
>
> Key: CLOUDSTACK-10156
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10156
> Project: CloudStack
>  Issue Type: Improvement
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>Reporter: Rafael Weingärtner
>Assignee: Rafael Weingärtner
>Priority: Minor
>
> Solving Coverity new problems CID(1349987, 1349986, 1347248).
> This is  basically the removal of dead code.
> The PR used to solve those problems is: 
> https://github.com/apache/cloudstack/pull/2332



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (CLOUDSTACK-10156) Fix Coverity new problems CID(1349987, 1349986, 1347248)

2017-11-22 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-10156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16263854#comment-16263854
 ] 

ASF GitHub Bot commented on CLOUDSTACK-10156:
-

rhtyd closed pull request #2332: [CLOUDSTACK-10156] Fix Coverity new problems 
CID(1349987, 1349986, 1347248)
URL: https://github.com/apache/cloudstack/pull/2332
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaStatementCmd.java
 
b/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaStatementCmd.java
index 3efdf113da5..ebf3f1c636b 100644
--- 
a/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaStatementCmd.java
+++ 
b/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaStatementCmd.java
@@ -21,7 +21,6 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.BaseCmd;
@@ -29,10 +28,10 @@
 import org.apache.cloudstack.api.response.AccountResponse;
 import org.apache.cloudstack.api.response.DomainResponse;
 import org.apache.cloudstack.api.response.QuotaResponseBuilder;
+import org.apache.cloudstack.api.response.QuotaStatementItemResponse;
 import org.apache.cloudstack.api.response.QuotaStatementResponse;
-import org.apache.cloudstack.context.CallContext;
 import org.apache.cloudstack.quota.vo.QuotaUsageVO;
-import org.apache.cloudstack.api.response.QuotaStatementItemResponse;
+import org.apache.log4j.Logger;
 
 import com.cloud.user.Account;
 
@@ -62,7 +61,7 @@
 private Long accountId;
 
 @Inject
-QuotaResponseBuilder _responseBuilder;
+private QuotaResponseBuilder _responseBuilder;
 
 public Long getAccountId() {
 return accountId;
@@ -119,9 +118,9 @@ public String getCommandName() {
 
 @Override
 public long getEntityOwnerId() {
-Long accountId = _accountService.getActiveAccountByName(accountName, 
domainId).getAccountId();
-if (accountId == null) {
-return CallContext.current().getCallingAccount().getId();
+Account activeAccountByName = 
_accountService.getActiveAccountByName(accountName, domainId);
+if (activeAccountByName != null) {
+return activeAccountByName.getAccountId();
 }
 return Account.ACCOUNT_ID_SYSTEM;
 }
diff --git 
a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/xen610/XenServer610MigrateWithStorageReceiveCommandWrapper.java
 
b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/xen610/XenServer610MigrateWithStorageReceiveCommandWrapper.java
index fdcb7b5ffbe..803e24bb439 100644
--- 
a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/xen610/XenServer610MigrateWithStorageReceiveCommandWrapper.java
+++ 
b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/xen610/XenServer610MigrateWithStorageReceiveCommandWrapper.java
@@ -21,10 +21,9 @@
 
 import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.Map;
 import java.util.List;
+import java.util.Map;
 
-import com.google.gson.Gson;
 import org.apache.log4j.Logger;
 
 import com.cloud.agent.api.Answer;
@@ -39,8 +38,8 @@
 import com.cloud.network.Networks.TrafficType;
 import com.cloud.resource.CommandWrapper;
 import com.cloud.resource.ResourceWrapper;
-import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.Pair;
+import com.cloud.utils.exception.CloudRuntimeException;
 import com.xensource.xenapi.Connection;
 import com.xensource.xenapi.Host;
 import com.xensource.xenapi.Network;
@@ -66,7 +65,6 @@ public Answer execute(final MigrateWithStorageReceiveCommand 
command, final XenS
 // agent attache. Seriliaze the SR and Network objects here to a 
string and pass in
 // the answer object. It'll be deserialzed and object created in 
migrate with
 // storage send command execution.
-Gson gson = new Gson();
 // Get a map of all the SRs to which the vdis will be migrated.
 final List> volumeToSr = new ArrayList<>();
 
@@ -76,7 +74,6 @@ public Answer execute(final MigrateWithStorageReceiveCommand 
command, final XenS
 
 volumeToSr.add(new Pair(entry.first(), sr));
 }
-
 // Get the list of networks to which the vifs will attach.
 final List> nicToNetwork = new 
ArrayList>();
 for (final NicTO nicTo : vmSpec.getNics()) {
diff 

[jira] [Commented] (CLOUDSTACK-10156) Fix Coverity new problems CID(1349987, 1349986, 1347248)

2017-11-22 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-10156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16263855#comment-16263855
 ] 

ASF subversion and git services commented on CLOUDSTACK-10156:
--

Commit cb9c7adddf11c859852c4cd5e4e3013b482c317e in cloudstack's branch 
refs/heads/master from [~rafaelweingartner]
[ https://gitbox.apache.org/repos/asf?p=cloudstack.git;h=cb9c7ad ]

CLOUDSTACK-10156: Fix Coverity new problems CID(1349987, 1349986, 1347248) 
(#2332)

Fix Coverity new problems CID(1349987, 1349986, 1347248).

> Fix Coverity new problems CID(1349987, 1349986, 1347248) 
> -
>
> Key: CLOUDSTACK-10156
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10156
> Project: CloudStack
>  Issue Type: Improvement
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>Reporter: Rafael Weingärtner
>Assignee: Rafael Weingärtner
>Priority: Minor
>
> Solving Coverity new problems CID(1349987, 1349986, 1347248).
> This is  basically the removal of dead code.
> The PR used to solve those problems is: 
> https://github.com/apache/cloudstack/pull/2332



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (CLOUDSTACK-10156) Fix Coverity new problems CID(1349987, 1349986, 1347248)

2017-11-22 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-10156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16263417#comment-16263417
 ] 

ASF GitHub Bot commented on CLOUDSTACK-10156:
-

rafaelweingartner commented on issue #2332: [CLOUDSTACK-10156] Fix Coverity new 
problems CID(1349987, 1349986, 1347248)
URL: https://github.com/apache/cloudstack/pull/2332#issuecomment-346484103
 
 
   @rhtyd done!


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Fix Coverity new problems CID(1349987, 1349986, 1347248) 
> -
>
> Key: CLOUDSTACK-10156
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10156
> Project: CloudStack
>  Issue Type: Improvement
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>Reporter: Rafael Weingärtner
>Assignee: Rafael Weingärtner
>Priority: Minor
>
> Solving Coverity new problems CID(1349987, 1349986, 1347248).
> This is  basically the removal of dead code.
> The PR used to solve those problems is: 
> https://github.com/apache/cloudstack/pull/2332



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)