Skip to content

UseStringIsEmptyRule false positive case #1510

@volodya-lombrozo

Description

@volodya-lombrozo

I have the following java code:

final int sub;
if (text.length() > 1 && text.charAt(1) == ' ') {
    sub = 2;
} else {
    sub = 1;
}

and for the second line if (text.length() > 1 && text.charAt(1) == ' ') { I get the following exception:

[INFO] PMD: eo-parser/src/main/java/org/eolang/parser/XeEoListener.java[1127-1127]: Use String.isEmpty() when checking for empty string (UseStringIsEmptyRule)

But I don't check for string emptiness here.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions