nosql-java-sdk icon indicating copy to clipboard operation
nosql-java-sdk copied to clipboard

TO DO: "Sort empty types?"

Open ronaldngounou opened this issue 9 months ago • 0 comments

Hello Oracle,

When reading the nosql-java-sdk, I noticed there is a TO DO in the src/main/java/oracle/nosql/driver/values/NullValue.java file and I would like to work on it.

To my understanding, the NullValue class inherits from FieldValue. In the code below, the compareTo method is used to compare two FieldValue objects, returning a value indicating whether the current object (this) is less than, equal to, or greater than the other object. If the other object is a NullValue object, then return 0 else -1.

    @Override
    public int compareTo(FieldValue other) {
        if (other instanceof NullValue) {
            return 0;
        }
        /* TODO: sort empty types? */
        return -1;
    }

Although I did not understand the reason to 'sort empty types' comment, I would like to open this issue to suggest a solution. The final solution should improve the base code to satisty edge cases.

ronaldngounou avatar Jan 24 '25 04:01 ronaldngounou