ukcrpb6/guava-postfix-plugin

Wrong wrapping and suggestion for multiline ?: statements

mattnathan opened this issue · 3 comments

Given the following code:

String s = "";
Object o = s.isEmpty() ? s.concat("a").cnn| :
           s.concat("b");

One of the suggested wrappings results in

String s = "";
Object o = checkNotNull(s.isEmpty() ? s.concat("a")):
           s.concat("b");

Appears this is more complicated that originally thought:

  1. start with the first code sample
  2. begin completion of cnn but escape/cancel without applying it
  3. note that the space between the .cnn and the : is now missing
  4. Try completion again
  5. Notice the suggestions are now incorrect

If you continue cancelling and retrying you get more and more incorrect suggestions, and exceptions in the log

Interesting - with 128.1029 I can reproduce the partial teranary selection issue but not the exception issue.

screenshot 2014-07-15 10 40 07

fixed