File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
api/src/main/java/org/apache/cloudstack/api/command/user/firewall Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 1919import java .util .ArrayList ;
2020import java .util .List ;
2121
22+ import org .apache .commons .collections .CollectionUtils ;
23+ import org .apache .commons .lang3 .StringUtils ;
2224import org .apache .log4j .Logger ;
2325
2426import org .apache .cloudstack .acl .RoleType ;
@@ -103,14 +105,13 @@ public String getProtocol() {
103105
104106 @ Override
105107 public List <String > getSourceCidrList () {
106- if (cidrlist != null ) {
108+ if (CollectionUtils . isNotEmpty ( cidrlist ) && ( cidrlist . size () == 1 && StringUtils . isNotBlank ( cidrlist . get ( 0 ))) ) {
107109 return cidrlist ;
108110 } else {
109- List <String > oneCidrList = new ArrayList <String >();
111+ List <String > oneCidrList = new ArrayList <>();
110112 oneCidrList .add (NetUtils .ALL_IP4_CIDRS );
111113 return oneCidrList ;
112114 }
113-
114115 }
115116
116117 // ///////////////////////////////////////////////////
You can’t perform that action at this time.
0 commit comments