File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
api/src/main/java/com/cloud/agent/api/to
core/src/main/java/com/cloud/agent/api/routing Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -185,8 +185,9 @@ public LoadBalancerConfigTO[] getLbConfigs() {
185185 }
186186
187187 public void setLbConfigs (List <? extends LoadBalancerConfig > lbConfigs ) {
188- if (lbConfigs == null ) {
189- lbConfigs = new ArrayList <LoadBalancerConfig >();
188+ if (lbConfigs == null || lbConfigs .size () == 0 ) {
189+ this .lbConfigs = new LoadBalancerConfigTO [0 ];
190+ return ;
190191 }
191192 this .lbConfigs = new LoadBalancerConfigTO [lbConfigs .size ()];
192193 int i = 0 ;
Original file line number Diff line number Diff line change 2525
2626import org .apache .cloudstack .network .lb .LoadBalancerConfig ;
2727
28- import java .util .ArrayList ;
2928import java .util .List ;
3029
3130/**
@@ -88,8 +87,9 @@ public LoadBalancerConfigTO[] getNetworkLbConfigs() {
8887 }
8988
9089 public void setNetworkLbConfigs (List <? extends LoadBalancerConfig > networkLbConfigs ) {
91- if (networkLbConfigs == null ) {
92- networkLbConfigs = new ArrayList <LoadBalancerConfig >();
90+ if (networkLbConfigs == null || networkLbConfigs .size () == 0 ) {
91+ this .networkLbConfigs = new LoadBalancerConfigTO [0 ];
92+ return ;
9393 }
9494 this .networkLbConfigs = new LoadBalancerConfigTO [networkLbConfigs .size ()];
9595 int i = 0 ;
You can’t perform that action at this time.
0 commit comments