commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: [LANG] Save to remove @SuppressWarnings("null") from StrBuilder?
Date Fri, 03 May 2013 10:29:14 GMT
On 3 May 2013 08:44, Emmanuel Bourg <ebourg@apache.org> wrote:

> Le 02/05/2013 21:54, sebb a écrit :
>
> > But the code can be (has been) rewritten to avoid the issue, as per
> >
> >  URL: http://svn.apache.org/r1478506
> > Log:
> > Rewrite to avoid (im)possible NPE warning
>
>
> With IntelliJ I don't get a warning when @SuppressWarnings("null") is
> removed (with both forms).
>
>
The warning won't occur in any IDE in the current form as the reference is
obviously protected by the conditional.

For the earlier version, the warning will depend on the IDE settings, as
well as how clever the IDE is at following the code path.
The IDE would have to realise that strlen == 0 for the null case.


> Emmanuel Bourg
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message