mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
Findbugs : NP_NULL_PARAM_DEREF_NONVIRTUAL fixed
This commit is contained in:
parent
26b32141a8
commit
091694ceb2
@ -16,6 +16,8 @@
|
||||
// under the License.
|
||||
package com.cloud.agent.api.routing;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import com.cloud.agent.api.Answer;
|
||||
|
||||
public class SetStaticRouteAnswer extends Answer {
|
||||
@ -26,11 +28,16 @@ public class SetStaticRouteAnswer extends Answer {
|
||||
|
||||
public SetStaticRouteAnswer(SetStaticRouteCommand cmd, boolean success, String[] results) {
|
||||
super(cmd, success, null);
|
||||
assert (cmd.getStaticRoutes().length == results.length) : "Static routes and their results should be the same length";
|
||||
this.results = results;
|
||||
if (results != null) {
|
||||
assert (cmd.getStaticRoutes().length == results.length) : "Static routes and their results should be the same length";
|
||||
this.results = Arrays.copyOf(results, results.length);
|
||||
}
|
||||
}
|
||||
|
||||
public String[] getResults() {
|
||||
return results;
|
||||
if (results != null) {
|
||||
return Arrays.copyOf(results, results.length);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user