3 ms·
One could make the "Aren't these just libraries?" argument for the collections stuff introduced in 1.2, but this standardization served a legitimate purpose by
by ShabbyDoo 17y ago
One could make the "Aren't these just libraries?" argument for the collections stuff introduced in 1.2, but this standardization served a legitimate purpose by facilitating rich inter-component/framework interoperability. While I don't dispute the benefits of using this new Objects class, provides methods used in implementations, not common API representations. So, I'd argue that the Java ecosystem isn't much better off for it. This isn't to say that I'm not happy that it's there, but I don't think it's nearly as noteworthy as new language features, underlying JVM performance improvements, etc.
As an aside, I was surprised that the article did not take advantage of static imports to rid the code of the "Objects" references. One could just say:
if (notNull(foo).equals("bar")){...}
- jimbokun 17y ago"As an aside, I was surprised that the article did not take advantage of static imports..." I also much prefer the readability of static imports, but it won't work for the "equals," "toString" and "hashCode" methods, obviously.