elvis pattern refinement (was Syntax patterns)

Stephen Colebourne scolebourne at joda.org
Fri Apr 24 16:25:33 PDT 2009


2009/4/24 Ruslan Shevchenko <rssh at gradsoft.com.ua>:
> next question:
>  a!=null ? a.method() : null
> must be counted or not ?

Yes, that would be another pattern.

But so would multiple tests:

if (a != null && a.b() != null) {
  a.b().c();
}

if (a != null && a.b() != null) {
  result = a.b().c();
}


BTW, I'd prefer to see separate figures for Elvis and Null-Safe
operators. Thus that means two 'define's in the def file.

Stephen



More information about the coin-dev mailing list