Skip to content

Consistent null, empty and blank String logic #1622

@jonathanaustin

Description

@jonathanaustin

WComponents uses a custom String helper class com.github.bordertech.wcomponents.util.Util to check and manipulate Strings.

This utility class has a method empty(String) which is misleading as it is testing if the String is blank (ie all whitespaces) instead of empty (ie length == 0). The use of the empty method through out WComponents needs to be reviewed to see if it is actually checking for null, empty or blank.

WComponents no longer needs to have a custom String library. Where possible the Util class should be replaced with the org.apache.commons.lang3.StringUtils.

The Util class should be deleted but as projects directly use it, it will need to be deprecated. However its internal logic can be replaced by making calls to StringUtils.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions