Bug in Behavior>>specialSelectorIndexFor:

VA Smalltalk is a "100% VisualAge compatible" IDE that includes the original VisualAge technology and the popular VA Assist and WidgetKit add-ons.

Moderators: Eric Clayberg, wembley, tc, Diane Engles, solveig

Bug in Behavior>>specialSelectorIndexFor:

Postby Prophet1024 » Wed Mar 28, 2007 11:06 am

.
Last edited by Prophet1024 on Mon Apr 04, 2011 1:20 pm, edited 3 times in total.
Prophet1024
 
Posts: 4
Joined: Mon Jan 29, 2007 12:36 pm

Re: Bug in Behavior>>specialSelectorIndexFor:

Postby Eric Clayberg » Wed Mar 28, 2007 12:36 pm

Prophet1024 wrote:This method should always return an integer, not the selector.

No. That is a private method whose result is only used as an argument to the CompiledMethod>>#sendsSpecialSelector: method which expects a method selector (a Symbol).

At some point in the distant past, the CompiledMethod>>#sendsSpecialSelector: method lilely expected an integer to be passed in, but was then changed to expect a selector. The implementation of its precursor method, Behavior>>specialSelectorIndexFor:, was then changed to reflect those new requirements without changing its name. At this point, it can't be changed as its current implementation has been in place and expected for more than ten years.

In any case, it is a private method that should not be used for anything other than its intended (and very narrow) purpose.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Postby Prophet1024 » Wed Mar 28, 2007 2:43 pm

.
Last edited by Prophet1024 on Mon Apr 04, 2011 1:20 pm, edited 3 times in total.
Prophet1024
 
Posts: 4
Joined: Mon Jan 29, 2007 12:36 pm

Postby Eric Clayberg » Wed Mar 28, 2007 3:22 pm

Prophet1024 wrote:We must be looking at two different things because I only see two senders of Behavior>>specialSelectorIndexFor: and they're both in Behavior (not CompiledMethod>>#sendsSpecialSelector:).

Look at both senders, and you will see calls to CompiledMethod>>#sendsSpecialSelector: as I indicated.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Postby wembley » Thu Mar 29, 2007 6:52 am

OK, so you are both correct (in a way). The 2 senders of Behavior>>specialSelectorIndexFor: use a returned value of 0 to indicate that the selector is not a special selector. But they both call CompiledMethod>>#sendsSpecialSelector: passing the returned value if the returned value is not 0.

I agree with Eric that at some distant time in pre-history (before 6/6/1996) the method in question probably did always return an integer rather than a selector. Whoever made this change in behavior neglected to change both the method signature (to maintain its intent-revealing nature) and the comments in several methods.

I could open a defect for this problem, but it would simply join the huge pile of similar "untidyness" defects that I brought with me from IBM -- they just never make it even close to the top of the list to work on.

Now you might say that this would only take 5 minutes to fix, so why not just do it? The answer is that in addition to the 5 minutes, there is the time to do the record keeping on the defect, create the testcase to ensure we didn't break anything in the course of making the change, and running the testcase on all platforms. It just isn't the best use of our time (in my opinion) even though I really hate it when I, like you, trip over these untidy things. I hope this helps you understand why it is very unlikely that we will correct this problem.
John O'Keefe [|], Principal Smalltalk Architect, Instantiations Inc.
wembley
Moderator
 
Posts: 405
Joined: Mon Oct 16, 2006 3:01 am
Location: Durham, NC

Postby Eric Clayberg » Thu Mar 29, 2007 8:08 am

How about we change the method comment to reflect reality? ;-)
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Postby wembley » Fri Mar 30, 2007 5:07 am

Defect 28026 opened -- I've changed the comments in several methods associated with this item for V7.5.1.
John O'Keefe [|], Principal Smalltalk Architect, Instantiations Inc.
wembley
Moderator
 
Posts: 405
Joined: Mon Oct 16, 2006 3:01 am
Location: Durham, NC


Return to VA Smalltalk 7.0, 7.5 & 8.0

Who is online

Users browsing this forum: No registered users and 1 guest