Skip to content

Why the the pos must be greater than 0? #101

@Foreveorjizhi

Description

@Foreveorjizhi

In AbstractCompletionProvider.java:
Function: protected List getCompletionsImpl(JTextComponent comp):

Line 184 to 188:
while (pos>0 &&
comparator.compare(completions.get(pos), text)==0) {
retVal.add(completions.get(pos));
pos--;
}

In the loop condition, 'pos' must be greater than 0, but the index of 'completions' includes 0, which will result in never searching the first element. Is that right?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions