Marc Knaup
12/23/2019, 12:54 PMwasyl
12/23/2019, 1:10 PMMarc Knaup
12/23/2019, 1:54 PMnull
and not simply skip some code.
It does make sense in some cases, but the âweak warningâ here can suggest new developers that using return is always the better option.Marc Knaup
12/23/2019, 1:55 PMnull
to avoid the !!
đAlowaniak
12/23/2019, 2:03 PMMarc Knaup
12/23/2019, 2:31 PMwasyl
12/23/2019, 2:50 PMPaul Woitaschek
12/23/2019, 2:59 PM?
callsnapperley
12/23/2019, 8:03 PMval a = number ?: 0
.Marc Knaup
12/24/2019, 6:55 AM!!
in the first place, because the value is expected to be non-null.
Treating it as a warning with the suggestion to change it either to ?: return
or ?: default
will completely change the intention from âexpected to be non-nullâ to âlegit to be null so do something else in that caseâ.
Hence the inspection is almost always misleading.Marc Knaup
12/24/2019, 6:56 AMMarc Knaup
12/24/2019, 7:11 AMcedric
12/24/2019, 5:56 PMnapperley
12/24/2019, 9:11 PM!!
is good in Unit testing since if there are null
issues you want to pick them up quickly, before they create a larger issue in a program/library.bjonnh
01/08/2020, 9:53 PMcedric
01/08/2020, 9:56 PMbjonnh
01/08/2020, 10:15 PMbjonnh
01/08/2020, 10:16 PMtmg
01/09/2020, 1:29 PMtmg
01/09/2020, 1:32 PM