Sun Microsystems have made a whopper

K.I.L.E.R

Retarded moron
Veteran
Just take a look at their "Rectangle" class implementation of "contains":

Code:
 /**
     * Checks whether or not this <code>Rectangle</code> contains the 
     * point at the specified location {@code (x,y)}.
     *
     * @param  x the specified X coordinate
     * @param  y the specified Y coordinate
     * @return    <code>true</code> if the point 
     *            {@code (x,y)} is inside this 
     *          <code>Rectangle</code>; 
     *            <code>false</code> otherwise.
     * @since     1.1
     */
    public boolean contains(int x, int y) {
    return inside(x, y);
    }

Guess what type of method "inside" is?
A deprecated one. :LOL:

What a dumbfounding situation. The Javadoc mentions to use "contains" and not "inside". :LOL:
 
Deprecated does not mean it's gone, and it doesn't really make a difference whether you implement inside as contains or vice-versa.
"inside" is only deprecated because it's not a verb, so it doesn't fit the style recommendations.
 
It would only be a problem if the inside() method was removed. And in that case they would just change the contains() implementation to contain the code that inside() used to have.

Deprecated functions in APIs of course can last around for years, if not forever, but just lacking documentation. You just need to look at Win32 and how many deprecated but still working functions there are still around from the Win16 days.
 
Last edited by a moderator:
Back
Top