[VAST 8.0.0] little fix for RB Extensions

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

[VAST 8.0.0] little fix for RB Extensions

Postby jtuchel » Fri Oct 30, 2009 5:06 am

Hi there,

I just fixed EtAbstractMethodsBrowser>>#createInstVarAccessors to:

Code: Select all
createInstVarAccessors
   | instVars |
   self changeRequest ifFalse: [^self].
   instVars := self selectInstanceVariables ifNil: [^self].  "I just added the ifNil: check in this line"
   instVars isEmpty ifTrue: [^self].
   instVars do: [:each |
      self handleError: [
         (CreateAccessorsForVariableRefactoring
            variable: each
            class: self actualClass
            classVariable: false) execute]].
   self changedClass


Reason: if you choose to create instvar accessors and press "cancel" you should not get a debugger.
I havent't checked if this is fixed in B128 or B130 of 8.0.1.

cu

Joachim
jtuchel
[|]
 
Posts: 245
Joined: Fri Oct 05, 2007 1:05 am
Location: Ludwigsburg, Germany

Re: [VAST 8.0.0] little fix for RB Extensions

Postby wembley » Fri Oct 30, 2009 6:18 am

You are correct. And EtAbstractMethodsBrowser>>#createClassVarAccessors has the same problem. Case 43892 fixed in V8.0.1 (post B130).
John O'Keefe [|], Principal Smalltalk Architect, Instantiations Inc.
wembley
Moderator
 
Posts: 405
Joined: Mon Oct 16, 2006 3:01 am
Location: Durham, NC

Re: [VAST 8.0.0] little fix for RB Extensions

Postby jtuchel » Fri Oct 30, 2009 7:18 am

Thanks John.

I just saw that you have fixed another thing that I found disturbing and just wanted to take a look at: you can now create Instvar Accessors when the class/instance toggle is on the class side and vice versa. Great! Why haven't I seen that earlier...?

cu

Joachim
jtuchel
[|]
 
Posts: 245
Joined: Fri Oct 05, 2007 1:05 am
Location: Ludwigsburg, Germany

Re: [VAST 8.0.0] little fix for RB Extensions

Postby jtuchel » Fri Oct 30, 2009 7:28 am

While we're at it:

I've never used protect or abstract for variables, but it looks as if the methods

EtAbstractMethodsBrowser>>#protectInstVar
EtAbstractMethodsBrowser>>#abstractInstVar
EtAbstractMethodsBrowser>>#abstractClassVar

have the same problem. So a better fix might be to make selectInstanceVariables return an empty collection instead of adding notNil checks to their senders...
In that case the isEmpty checks after sends of selectInstanceVariables can be deleted (risking a few additional cycles for iterating over empty lists).

cu

Joachim
jtuchel
[|]
 
Posts: 245
Joined: Fri Oct 05, 2007 1:05 am
Location: Ludwigsburg, Germany

Re: [VAST 8.0.0] little fix for RB Extensions

Postby wembley » Fri Oct 30, 2009 7:43 am

Joachim -

You are right, and this change would better match the implementation of the RB (BrowserNavigator>>#selectInstanceVariables and #selectClassVariables returns an empty collection of the Chooser dialog is canceled).
John O'Keefe [|], Principal Smalltalk Architect, Instantiations Inc.
wembley
Moderator
 
Posts: 405
Joined: Mon Oct 16, 2006 3:01 am
Location: Durham, NC

Re: [VAST 8.0.0] little fix for RB Extensions

Postby wembley » Fri Oct 30, 2009 11:30 am

jtuchel wrote:In that case the isEmpty checks after sends of selectInstanceVariables can be deleted (risking a few additional cycles for iterating over empty lists).

Just one small change -- the isEmpty check can't be removed. If it is, both zero class/inst variables and a canceled selection dialog drops through to the self changedClass line.
John O'Keefe [|], Principal Smalltalk Architect, Instantiations Inc.
wembley
Moderator
 
Posts: 405
Joined: Mon Oct 16, 2006 3:01 am
Location: Durham, NC

Re: [VAST 8.0.0] little fix for RB Extensions

Postby jtuchel » Fri Oct 30, 2009 8:56 pm

yes, you're right ;-)
jtuchel
[|]
 
Posts: 245
Joined: Fri Oct 05, 2007 1:05 am
Location: Ludwigsburg, Germany


Return to VA Smalltalk 7.0, 7.5 & 8.0

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest