File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
agents-common/src/main/java/org/apache/ranger/plugin/store Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 2727import java .util .List ;
2828
2929public class SecurityZonePredicateUtil extends AbstractPredicateUtil {
30-
3130 public SecurityZonePredicateUtil () {
3231 super ();
3332 }
@@ -107,6 +106,9 @@ public boolean evaluate(Object object) {
107106 }
108107
109108 private Predicate addPredicateForMatchingZoneName (final String zoneName , List <Predicate > predicates ) {
109+ if (StringUtils .isEmpty (zoneName )) {
110+ return null ;
111+ }
110112
111113 Predicate ret = new Predicate () {
112114 @ Override
@@ -137,6 +139,9 @@ public boolean evaluate(Object object) {
137139 }
138140
139141 private Predicate addPredicateForNonMatchingZoneName (final String zoneName , List <Predicate > predicates ) {
142+ if (StringUtils .isEmpty (zoneName )) {
143+ return null ;
144+ }
140145
141146 Predicate ret = new Predicate () {
142147 @ Override
@@ -150,7 +155,7 @@ public boolean evaluate(Object object) {
150155 if (object instanceof RangerSecurityZone ) {
151156 RangerSecurityZone securityZone = (RangerSecurityZone ) object ;
152157
153- if (StringUtils . isEmpty ( zoneName ) || !StringUtils .equals (zoneName , securityZone .getName ())) {
158+ if (!StringUtils .equals (zoneName , securityZone .getName ())) {
154159 ret = true ;
155160 }
156161 }
You can’t perform that action at this time.
0 commit comments