Welcome, Unregistered.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Reply
Old 28-Jan-2007, 11:46   #1
K.I.L.E.R
Retarded moron
 
Join Date: Jun 2002
Location: Australia, Melbourne
Posts: 2,949
Send a message via ICQ to K.I.L.E.R Send a message via AIM to K.I.L.E.R Send a message via MSN to K.I.L.E.R
Default Sun Microsystems have made a whopper

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.

What a dumbfounding situation. The Javadoc mentions to use "contains" and not "inside".
__________________
I eat coffee.
K.I.L.E.R is offline   Reply With Quote
Old 28-Jan-2007, 15:55   #2
Xmas
Off-season
 
Join Date: Feb 2002
Location: On the pursuit of happiness
Posts: 3,019
Default

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.
Xmas is offline   Reply With Quote
Old 28-Jan-2007, 22:22   #3
Colourless
Monochrome wench
 
Join Date: Feb 2002
Location: Somewhere in outback South Australia
Posts: 1,257
Send a message via ICQ to Colourless Send a message via MSN to Colourless
Default

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.
__________________
-Colourless

D3D FSAA Viewer 5.4
Words by Cat - Truely Intelligent Viewing

Last edited by Colourless; 28-Jan-2007 at 22:29.
Colourless is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:04.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.