File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 11"
2- Bulk editor on a Java file : comment out a collection of methods
2+ Bulk editor on Java files : comment out or remove a collection of methods
33Can be applied for example on dead methods:
44- compute all dead methods in a file -> `deadMethodCollection`
55- call: `MiBulkEditor new runOn: deadMethodCollection.`
6- - Output the resulting lines in a file
6+
7+ The following will comment out or remove a list of methods from their respective source files
78```
89bulkEditor := MiBulkEditor new.
9- bulkEditor runOn: deadMethods.
10- file := 'SomeFile.java' asFileReference.
11- file ifExists: [ file delete ].
12- file writeStreamDo: [ :st | bulkEditor lines do: [ :line | st << line ; cr ] ].
10+ bulkEditor runOn: <deadMethodCollection>.
1311```
12+
13+ The default is to comment out the methods: `bulkEditor commentLines`
14+ The editor can be instructed to remove the methods from their files: `bulkEditor removeLines`
1415"
1516Class {
1617 #name : ' MiBulkEditor' ,
You can’t perform that action at this time.
0 commit comments