Refactoring Browser Fixes and Enhancements
To install any of the fixes files, simply retrieve them from archive
and file them into your image. You will need to install them in
order of their dates since some newer files might depend on older
ones.
These are the current released fixes files. You can click on a
file to see its description below. We try to release a set of
enhancements/fixes monthly so if you have a bug or enhancement
that you'll like to see included in the next fixes file, please
mail us
with your suggestion.
- Added tranformation rule to convert super sends to self sends if they
refer to the same method, rule to move assignments to same variable outside
ifTrue:ifFalse: blocks, rule to rewrite "(a < b) and: [a > c]" to use
between:and:, and rule for rewriting code such as "a < b ifTrue: [a]
ifFalse: [b]" to be "a min: b".
- Changed the ClassSelectionDialog to handle selectors instead of just
classes. This shouldn't affect the browser itself, but should affect some
of the other programs that use parts of the browser (e.g., the interaction diagram).
- Refactored the RefactoringBrowser and RefactoringManager classes by moving
some of its code into more appropriate classes (e.g., Navigator).
- Fixed bug with renaming temporary refactoring. If the
variable selected was only one character long, it wouldn't rename the variable.
- Added the rename class refactoring to the ENVY versions.
- Fixed the RewriteRuleEditor so that you could just send the open message.
Before you could only send the rewrite: message to open a rewrite rule.
- Refactored the BrowserTextTool so that it no-longer uses the
"continuousAccept: true" on its text editor. Whenever continuous accept mode
was true, the shortcut keys didn't always work as expected.
- Changed the out-of-date method to display in red text instead of a red
background (VisualWorks).
- Added the children to sibling refactoring. Use this
refactoring whenever you have a non-abstract superclass that has several
subclasses, and you want to convert it to have an abstract class. For example,
it will convert
to have the new abstract superclass, A':
Whenever this is run, it will push up the inherited methods and variables, and
write subclassResponsibility methods for those methods defined in all
subclasses.
- Removed the "self/super send not implemented" rule in Smalllint. This
has been incorporated with the "Sent not implemented" rule.
- Fixed bug in spawn hierarchy that was introduced in the previous changes.
One method was missing a return, which caused the spawn hierarchy to have
a doesNotUnderstand: error.
- Fix bug in parsing IBM numbers. If the end of a method had a number
such as "3r1" or "3e1" where there was only one digit after the "r" or "e", then
it would treat the number as "3 r1" (i.e., the rX or eX were treated as message
sends).
- Changed the spawn menu selections to spawn the selected items. For
example, spawn class will now spawn every selected class in one browser,
instead of spawning the primary selection.
- Made several performance improvements to Smalllint. These are mainly
noticiable when running IBM Smalltalk.
- Fixed bug in parser for IBM so that both ##(...) and the Pool::varname
syntax is handled correctly.
- Fixed inserting errors with the formatter. If the error occurred at the
end of the input, the error message would be inserted in the wrong position.
- Made some speed improvements with the IBM version. Smalllint should
run much faster on larger images since we are no longer using the default
sets provided by IBM. These sets would degenerate to linear behavior whenever
~30000 elements were added.
- Text widgets in IBM use the tab width defined by the other browsers.
- Fixed bug in remove class (ENVY). If you tried to remove a class with subclasses
it would warn you multiple times and won't remove the class. Now it will
warn you once for each class that has multiple subclasses and will remove
the class and its subclasses.
- Changed the SmalllintResultEditor interface so that instead of displaying
each result in the same window, you can open them in their own windows.
- Added class comments to several classes
- Fixed bug in Navigator when a selector was removed, you could get a notifier saying that the selector wasn’t found (ENVY/VW & VA).
- Performed some refactorings (mostly renaming items).
- Changed formatter so that three part selectors are printed on new lines.
- Fixed method node matching. When matching a method node, it didn’t look at the selector name.
- Optimized the parse tree matching some. Smalllint should run faster.
- Added context sensitive menus to the code tools (e.g., selecting a message send will allow you to browse senders/implementors).
- Added remove parameter refactoring. If you select an argument to a method, then you can remove it as a parameter if all implementors of that selector do not use that argument.
- Changed references to #subclassResponsibility to be "‘subclassResponsibility’ asSymbol". Tools in VisualWorks will not falsely conclude that these are abstract classes. However, VisualAge automatically compiles it as the symbol anyway.
- Added add parameter refactoring. You can add a parameter to all implementors of the selector. Whenever you add the parameter, it will ask for the new selector name as well as a default argument to pass. This refactoring will only preserve behavior as long as the default argument has no side-effects.
- Added refactoring to move a method to a component (i.e., an instance variable or argument to the method). This refactoring will abstract all variable references so the method can be moved. If the method refers to self, it will pass "self" as an argument. It also will prompt for the class to move the method to (it performs some type analysis to try to guess the class, but it will still prompt you for the correct class).
- Fixed bug in browsing class variable references. If you tried to browse class variable references to a variable defined in a superclass, then a notifier would appear.
- Changed the rename method refactoring so that you can also permute the arguments while performing the rename. If your arguments also have side effects, then this might not be behavior preserving.
- Fixed warning messages for the refactorings. Before it would always ask "Do you want to proceed?", even if the message already asked a question.
- Fixed drag and drop in VW so that you can no longer drop whenever you are viewing the class hierarchy. Before, it would allow you to drop, but it would be dropping on the wrong lists, since VW would allow drops on invisible lists.
- Fixed adding/removing variables in VisualWorks. These changes are now logged in the .cha file.
- Fixed children to sibling refactoring in VisualWorks/ENVY. The protocols weren’t updated properly, since it used the #removeSelector: method instead of the #removeSelector:ifAbsent: method.
- Changed the extract method refactoring to allow you to overwrite a selector if you want to. Before, it wouldn’t allow you to overwrite the selector since it might change behavior.
- Changed the pull up, push down, and rename variable refactoring so that the values of the live objects are maintained. Before, these values would have been nilled out.
- Changed the Smalllint results window to display the number of problems found for each rule.
- Fixed bug in Smalllint for VisualWorks. Messages to self could be ignored when inside of block closures.
- Changed the menus in VisualAge so that they aren't computed before the browser is opened, thus making the browser open faster.
- Refactored search and replace expressions into rule objects.
This resulted in most of the changes for this version.
Originally, the search/replace expressions were represented by associations which could hold
a variety of combinations. These association varieties have been factored into their own rule
objects. This shouldn't affect normal users of the
browser, but might affect people who have built their own search/replace
expressions. The old protocols are still supported, but will be removed
in some future release.
- Added ability to search for a particular message inside of a cascaded
message. When entering a search/replace expression you can use the ; modifier
character to specify that this node should match any number of messages
in a cascade node. For example, "``@rcv `;msgs; yourself" would match any
cascaded expression with the last message is #yourself.
- Changed the parser to accept multiple primitive/pragma tags at the
begining of a method. The upcoming release of VisualWorks 3.0 uses multiple
tags when adding things to the launcher.
- Add Smalllint rules for doesn't use the result of a collect:, select:, or
reject: and one for doesn't use the result of a =, ==, <, etc message. For the
collect:/select: case, you can either use a do: message or you have missed assigning/returning
the result of the collect:/select:. For the comparision cases, you may have missed a
":" on an assignment resulting in "myVariable = self doSomething", or may have missed
assigning/returning the result.
- Fixed bug that didn't log class hierarchy changes in VisualWorks. While the
changes were included in the change set, they were not written to the .cha file. As a
result, if your image crashed, you would lose these changes.
- Fixed bug in the inline method refactoring. If you tried to inline a method that
had a block as an argument, the variables in the block could be renamed improperly. Also
the returns in the block were removed.
- Fixed bug in the replacing of VisualAge's ##() expressions. If you tried to replace
a ##() expression in the rewrite tool, you would receive a debugger.
- Fixed bug that wouldn't allow you to add "self" as a parameter on the add
parameter refactoring.
- Added the inline temporary refactoring. You can select a temporary variable assignment in the
code view, and have all references to the variable replace by the expression that was assigned. For
example, if you inline "myPrintString := self printString" in
someMethod
| myPrintString |
myPrintString := self printString.
^myPrintString , ' = ', myPrintString
you will get
someMethod
^self printString , ' = ', self printString
- Changed the create accessors and abstract variable menu choices from the navigator to
accept multiple variables.
- Fixed extract to temporary. When extracting a temporary that is the last statement in a block node,
the variable reference was place before the temporary assignment.
- Fixed the menu to allow for extraction of blocks and literals to temporaries.
- Refactored the BasicLintRule into ParseTreeLintRule
and BlockLintRule. All parse tree lint rules should highlight
the offending code correctly. BlockLintRule should work as the
BasicLintRule previously did.
- Changed the formatter so that the carriage returns are
kept before the start of a comment. For example, if you format:
methodName
self performOperation1.
"some comment"
self performOperation2
the blank line before "some comment" will be kept after formatting.
- Fixed bug in the parse tree replacing stuff. If you were
trying to replace only the inner most expression, it wouldn't replace
anything.
- Changed the remove class refactoring so that it will remove
all selected classes. Before it would only remove the first selected
class.
- Fixed the rename method refactoring. You can now use the rename
method refactoring to permute the arguments without renaming the
selector.
- Added an inline all self sends refactoring and a protect instance
variable refactoring (i.e., unabstract inst var). Both of these
refactorings use the inline method refactoring.
- Added the ability to parse VW3.0's namespace constructs (i.e.,
"Smalltalk.Object" and "#{Smalltalk.Object}").
- Fixed a bug in the parser where "variable 0" was parsed as
"variable - 0".
- Fixed a bug in the parser where "self foo; ; bar" would
cause an exception instead of reporting the parser error.
- Changed the senders, implementors, and messages menus to be
just senders and implementors. The messages sent by the method
are listed under these menus (similar to the VW3.0 menus).
- Fixed inline method refactoring. Under certain conditions
single statement blocks that were arguments to the inlined method
could cause an exception.
- Extended the inline method refactoring so that even if the
receiver isn't self, you can still perform the inline (you may
be required to select the implementor class).
- Changed "browse globals" so that you can also enter pool
variables as well as globals.
- Changed the text tools in VisualWorks so that keyboard
shortcuts should work.
- Added browse inst var refs context sensitive menus to the
class tool.
- Changed text handling for VisualAge. Under OS/2 the linefeeds
would be removed after text was inserted into the text widget. This
would cause all refactorings that used the selection to fail.
Hopefully, this change will fix this problem (however, I don't have
OS/2 to fully test this change).
- Changed the code tool in VisualWorks so that it will not
flash when selecting methods. This will fix most problems with
the display flashing in VisualWorks 3.0. However, if you want a
complete fix to the problem, load this
parcel. It modifies the WindowSensor>>privateAddDamage: method.
- Added the ability to generate a default class comment even
if the class is already commented.
- Fixed parser bug that would parse "#(foo:bar)" as "#(#foo #bar)"
instead of "#(#foo: #bar)".
- Fixed method and message matching expressions. If you tried an
matching expression such as "``@object `msg: ``@arg1 put: ``@arg2"
it would match both "self at: 1 put: 2" and "self at: 1 at: 2" when
it should only match the former.
- Fixed meta variable matching. The matching expression
"[``@object]" now only matches a one statement block with no
arguments or temporaries. Before it would match any block with
no arguments or temporaries.
- Fixed add parameter refactoring. Instead of using the new selector,
it would use the original selector, and add the last keyword to the
original selector.
Comments or suggestions can be sent to brant@cs.uiuc.edu
and droberts@cs.uiuc.edu.
Last updated on 2-Mar-98.