Netcentric / accesscontroltool

Rights and roles management for AEM made easy
Eclipse Public License 1.0
150 stars 92 forks source link

751 Expose isEmpty and isBlank for EL evaluation #752

Closed Positronic-Brain closed 1 month ago

Positronic-Brain commented 1 month ago

This would implement issue #751

ghenzler commented 1 month ago

there isn't much that speaks against linking these two methods, but we could also just document the empty operator that EL provides out of the box (see https://docs.oracle.com/cd/E17802_01/j2ee/j2ee/1.4/docs/tutorial-update6/doc/JSPIntro7.html#wp71089)

Positronic-Brain commented 1 month ago

Yeah, empty is a bit redundant, but since I was already exposing "isBlank" I decided to add its related method for consistency.

ghenzler commented 1 month ago

@Positronic-Brain so I just checked and empty ' ' really does not return true (which I thought would be the case for EL). So fair enough to add the two methods, but I probably would also add https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/StringUtils.html#defaultIfBlank-T-T- then (as we have defaultIfEmpty(..) already)

Positronic-Brain commented 1 month ago

@Positronic-Brain so I just checked and empty ' ' really does not return true (which I thought would be the case for EL). So fair enough to add the two methods, but I probably would also add https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/StringUtils.html#defaultIfBlank-T-T- then (as we have defaultIfEmpty(..) already)

Sounds reasonable. Will do.

sonarcloud[bot] commented 1 month ago

Quality Gate Passed Quality Gate passed

Issues
3 New issues
0 Accepted issues

Measures
0 Security Hotspots
100.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud