AutoComplete
AutoComplete copied to clipboard
Circular comparison order in FunctionCompletion
Test case:
@Test
public void testCompletionOrdering1()
{
DefaultCompletionProvider provider = new DefaultCompletionProvider();
final Completion c1 = new FunctionCompletion(provider, "add", "int");
final Completion c2 = new VariableCompletion(provider, "indx", "int");
final Completion c3 = new FunctionCompletion(provider, "Sub", "int");
Assert.assertTrue(c1.compareTo(c2) < 0);
Assert.assertTrue(c2.compareTo(c3) < 0);
// (c1 < c2) and (c2 < c3), then it is implied that (c1 < c3)
Assert.assertTrue(c1.compareTo(c3) < 0);
}
Fixed in the pull request.