WALA/com.ibm.wala.cast.java
Ben Liblit cb6d3b282a Fix Eclipse warnings about redundant null checks and assignments
Most of these are harmless, and are best fixed simply by removing the
redundant check or assignment.  The one in FlowType.compareBlocks,
however, revealed a real problem.  This code checks for nullness of
`a` *after* having called a method on `a`.  Assuming that `a` can
indeed be `null` here, the check must come first to avoid a
`NullPointerException`.

In several places, I saw code of this form:

   if (thing == null)
     assert thing != null : ... ;

I honestly don't understand the purpose of that `if` statement.  Why
not just have the `assert` statement there directly?  I removed the
seemingly irrelevant `if` statements in these cases, but if this is
some intentional pattern, please explain it to me.

In a few places where nullness is statically known but non-obvious,
add assert statements to point out what's going on to help future
developers.

Upgrade future such warnings to errors to keep us moving in a cleaner
direction.
2017-08-15 09:11:29 -07:00
..
.launchConfigurations launch configurations for download scripts 2007-02-08 20:35:48 +00:00
.settings Fix Eclipse warnings about redundant null checks and assignments 2017-08-15 09:11:29 -07:00
META-INF version 1.4.4-SNAPSHOT 2017-08-06 07:25:20 -07:00
OSGI-INF/l10n Externalize bundle names and vendors 2017-06-07 17:42:11 +02:00
src/com/ibm/wala/cast/java Fix Eclipse warnings about redundant null checks and assignments 2017-08-15 09:11:29 -07:00
.classpath Use consistent Java versions, usually 1.7 2016-11-29 21:29:30 -06:00
.cvsignore Initial contribution of core script analysis code 2007-02-02 17:20:09 +00:00
.project Initial contribution of core script analysis code 2007-02-02 17:20:09 +00:00
build.properties Externalize bundle names and vendors 2017-06-07 17:42:11 +02:00
mvncentral.xml version 1.4.4-SNAPSHOT 2017-08-06 07:25:20 -07:00
pom.xml version 1.4.4-SNAPSHOT 2017-08-06 07:25:20 -07:00