Null pointer check elimination
Per Bothner
per@bothner.com
Sat Nov 12 17:05:00 GMT 2005
A "function-never-returns-null" attribute doesn't seem like
the right mechanism. Instead, there should be a "never-null"
attribute on pointer types. A "function-never-returns-null" is
just a function whose return-type has the "never-null" attribute.
A type attribute is much more useful. For example it allows:
String x = shared ? "x" : new String("x");
// The type of x [in a single-assignment-world] is non-null.
[If we already have such a mechanism, I apologize.]
--
--Per Bothner
per@bothner.com http://per.bothner.com/
More information about the Java
mailing list