File tree Expand file tree Collapse file tree
core/src/com/cloud/agent/api/routing Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616// under the License.
1717package com .cloud .agent .api .routing ;
1818
19+ import java .util .Arrays ;
20+
1921import com .cloud .agent .api .Answer ;
2022
2123public class SetStaticRouteAnswer extends Answer {
@@ -26,11 +28,16 @@ protected SetStaticRouteAnswer() {
2628
2729 public SetStaticRouteAnswer (SetStaticRouteCommand cmd , boolean success , String [] results ) {
2830 super (cmd , success , null );
29- assert (cmd .getStaticRoutes ().length == results .length ) : "Static routes and their results should be the same length" ;
30- this .results = results ;
31+ if (results != null ) {
32+ assert (cmd .getStaticRoutes ().length == results .length ) : "Static routes and their results should be the same length" ;
33+ this .results = Arrays .copyOf (results , results .length );
34+ }
3135 }
3236
3337 public String [] getResults () {
34- return results ;
38+ if (results != null ) {
39+ return Arrays .copyOf (results , results .length );
40+ }
41+ return null ;
3542 }
3643}
You can’t perform that action at this time.
0 commit comments