elvis pattern refinement (was Syntax patterns)

Ruslan Shevchenko rssh at gradsoft.com.ua
Fri Apr 24 08:58:58 PDT 2009


Hi, Stephen

//At first - in previous letter I forgott to say thanks for refinement.

I just commited elvis1 definition, which is exaclty what you write.

http://redmine.gradsoft.ua/repositories/entry/javachecker/trunk/JavaChecker/etc/checkers_elvis.def

But I mean this is incorrect, becouse it does not cover case of
'null-safe method call' (which is often used for describing elvis).
So, for example, in jetty we see only one matching for four patterns.

More - rereading  proposal, I see that I implement check for 'safe method
call' but in proposal we have 'safe index; safe field access, .. etc)

So, let's explicit define all aviable patterns.

First question: is 'safe-method call': i. e.
(a==null ? b : a.method(...)) pattern is correct ?
// Which can be rewritten as    a?.method() ?: b









More information about the coin-dev mailing list