DaanHoogland commented on a change in pull request #2239: CLOUDSTACK-9993:
Securing Agents Communications
URL: https://github.com/apache/cloudstack/pull/2239#discussion_r134405232
##########
File path: agent/src/com/cloud/agent/Agent.java
##########
@@ -464,7 +493,7 @@ protected void processRequest(final Request request, final
Link link) {
for (int i = 0; i < cmds.length; i++) {
final Command cmd = cmds[i];
- Answer answer;
+ Answer answer = null;
Review comment:
not a new bug but this explicit nulling sparks the thought that at line 574,
we might have a nullpointer in answer.getResult(). By the looks each branch is
covered, though. The null is used for the "unsupported" situation. Does it make
sense to set the unsupported answer here and then override it if it is
supported anyway?
i.e. create the unsupported answer outside the loop and assign it on this
line in every iteration, with a setCmd() kind of call.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services