Changing the semantics of the hasValue method


This page should only be used if script asks you to manually migrate dataholder.20210701.HASVALUE

A developer will be required for this manual migration.

If assisted migration has brought you to this page, it's because you're using - in your java sources and/or personal scripts in WEB-INF/param/scripts - DataHolder methods whose semantics have changed.

Part 1

First, search for all occurrences of hasValue, hasLocalValue and hasExternalValue.
For each of them, we need to ask ourselves the following question "should the test answer true for a value that would be empty?"
If so, you must replace these methods with hasValueOrEmpty, hasLocalValueOrEmpty and hasExternalValueOrEmpty.

As a reminder:
- a repeater is considered empty if the node is present but has no entries.
- a composite is considered empty if the node is present but has no entries.

Common case:
hasValue is often called before a removeValue. The removeValue method has been modified so that it no longer throws an exception when there is no data. So you can simply delete the call to hasValue and call removeValue directly.

Part 2

In a 2nd step, search for all occurrences of hasNonEmptyValue, hasNonEmptyLocalValue and hasNonEmptyExternalValue and replace them with hasValue, hasLocalValue and hasExternalValue.

The methods hasNonEmpty**Value no longer exist, you should have compilation errors for each of them.

Back to top