Skip to content

Structure leaves always one element in ThreadLocal set #413

@sjappig

Description

@sjappig

StructureSet does never remove the element at index 0:

public boolean remove(Object o) {
    int idx = indexOf(o);
    if (idx != -1) {
        if (--count > 0) {
            elements[idx] = elements[count];
            elements[count] = null;
        }
        return true;
    }
    return false;
}

Can be fixed by moving the null assign outside of the if-block or by changing the > to >=.

Metadata

Metadata

Assignees

No one assigned

    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