Faculty of Information Technology
Software Engineering Group

Opened 6 weeks ago

Last modified 6 weeks ago

#286 new defect

Search & rewrite tool - subscript out of bounds error

Reported by: Patrik Svestka Owned by:
Priority: major Milestone:
Component: default Keywords:
Cc: Also affects CVS HEAD (eXept version): no

Description

When I tried to do
In search
``@receiver doButtonAction: ASMenuEditor applyButtonName

In Replace:
``@receiver doButtonAction: #appyButtonName.

I got an error:

[SubscriptOutOfBoundsError]: subscript (3811) out of bounds in process MethodRewriter [35244]

The whole walkbacktext:

[SubscriptOutOfBoundsError]: subscript (3811) out of bounds in process MethodRewriter [35244]

String(Object) >> subscriptBoundsError: 3811 {7688192} [11]
String >> basicAt: 3811 {7692288} [34]
String >> at: 3811 {7696384} [35]
String(UninterpretedBytes) >> slowReplaceBytesFrom:to:with:startingAt: 1 46 'testSavingCommandEditFieldEmpty
    "Leaving co... "Modified: / 09-08-2019 / 09:37:10 / svestkap"
' 3776 {7700480} [13]
String(UninterpretedBytes) >> replaceBytesFrom:to:with:startingAt: 1 46 'testSavingCommandEditFieldEmpty
    "Leaving co... "Modified: / 09-08-2019 / 09:37:10 / svestkap"
' 3776 {7704576} [167]
String(UninterpretedBytes) >> replaceFrom:to:with:startingAt: 1 46 'testSavingCommandEditFieldEmpty
    "Leaving co... "Modified: / 09-08-2019 / 09:37:10 / svestkap"
' 3776 {7708672} [12]
String >> replaceFrom:to:with:startingAt: 1 46 'testSavingCommandEditFieldEmpty
    "Leaving co... "Modified: / 09-08-2019 / 09:37:10 / svestkap"
' 3776 {7712768} [110]
String(SequenceableCollection) >> copyFrom:to: 3776 3821 {7716864} [14]
String >> copyFrom:to: 3776 3821 {7720960} [79]
RBFormatter >> formatMethodComment:for:indentBefore:indentAfter: "Modified: / 09-08-2019 / 09:37:10 / svestkap" *Error in argString* false false {7725056} [9]
[] in RBFormatter>>formatMethodCommentsAfter:for: >> value:value: 3 "Modified: / 09-08-2019 / 09:37:10 / svestkap" {7729152} [36]
OrderedCollection >> keysAndValuesDo: [] in RBFormatter>>formatMethodCommentsAfter:for: {7733248} [13]
[] in RBFormatter>>formatMethodCommentsAfter:for: >> value {7737344} [35]
RBFormatter >> indent:while: 1 [] in RBFormatter>>formatMethodCommentsAfter:for: {7741440} [3]
RBFormatter >> indentWhile: [] in RBFormatter>>formatMethodCommentsAfter:for: {7745536} [2]
RBFormatter >> formatMethodCommentsAfter:for: OrderedCollection("
     self run:#testSavingCom..." "Modified: / 09-08-2019 / 09:37:10 / svestkap") *Error in argString* {7749632} [29]
RBMethodNode >> acceptCommentsAfterVisitor: an RBFormatter {7753728} [2]
RBFormatter >> visitNode: *Error in argString* {7757824} [11]
RBFormatter >> format: *Error in argString* {7761920} [3]
RBMethodNode(RBProgramNode) >> formattedCode {7766016} [2]
RBMethodNode >> newSource  {7770112} [4]
[] in Tools::MethodRewriter>>doRewrite: >> value: a Method(ASMenuEditorTests >> testSavingCommandEditFieldEmpty) {7774208} [21]
[] in Tools::MethodRewriter>>withMethods:do:finallyDo: >> value:value: 1 a Method(ASMenuEditorTests >> testSavingCommandEditFieldEmpty) {7778304} [23]
Array >> keysAndValuesDo: [] in Tools::MethodRewriter>>withMethods:do:finallyDo: {7782400} [6]
[] in Tools::MethodRewriter>>withMethods:do:finallyDo: >> value  {7786496} [11]
Block >> ensure: [] in Tools::MethodRewriter>>withMethods:do:finallyDo: {7790592} [12]
Tools::MethodRewriter >> withMethods:do:finallyDo: Set(a Method(ASMenuEditorTests >> testSavingComm...itorTests >> testSavingNewNodeAndMoveItAround_2)) [] in Tools::MethodRewriter>>doRewrite: [] in Tools::MethodRewriter>>withMethods:do: (optimized) {7794688} [28]
Tools::MethodRewriter >> withMethods:do: Set(a Method(ASMenuEditorTests >> testSavingComm...itorTests >> testSavingNewNodeAndMoveItAround_2)) [] in Tools::MethodRewriter>>doRewrite: {7798784} [3]
Tools::MethodRewriter >> doRewrite: Set(a Method(ASMenuEditorTests >> testSavingComm...itorTests >> testSavingNewNodeAndMoveItAround_2)) {7802880} [8]
[] in Tools::MethodRewriter>>doRewriteAction >> value: Set(a Method(ASMenuEditorTests >> testSavingComm...itorTests >> testSavingNewNodeAndMoveItAround_2)) {7806976} [12]
[] in Tools::MethodRewriter>>doSearchPattern:withResultDo: >> value {7811072} [33]
[] in Tools::MethodRewriter>>withMethods:do:finallyDo: >> value  {7815168} [27]
Block >> ensure: [] in Tools::MethodRewriter>>withMethods:do:finallyDo: {7819264} [12]
Tools::MethodRewriter >> withMethods:do:finallyDo: #(a Method(ASDamagedRegistryAbstractTests >> men...d(ASWindowsInformationTests class >> version_HG)) [] in Tools::MethodRewriter>>doSearchPattern:withResultDo: [] in Tools::MethodRewriter>>doSearchPattern:withResultDo: {7823360} [28]
Tools::MethodRewriter >> withMethodsDo:finallyDo: [] in Tools::MethodRewriter>>doSearchPattern:withResultDo: [] in Tools::MethodRewriter>>doSearchPattern:withResultDo: {7827456} [4]
Tools::MethodRewriter >> doSearchPattern:withResultDo: '``@receiver doButtonAction: ASMenuEditor applyButtonName' [] in Tools::MethodRewriter>>doRewriteAction {7831552} [12]
Tools::MethodRewriter >> doRewriteAction  {7835648} [10]
Tools::MethodRewriter(Object) >> perform: #doRewriteAction {7839744} [32]
Tools::MethodRewriter(Object) >> perform:withOptionalArgument: #doRewriteAction true {7843840} [8]
MessageSend >> value: true {7847936} [4]
ButtonController >> performAction  {7852032} [35]
ButtonController >> buttonRelease:x:y: 1 46 4 {7856128} [37]
ButtonController(Object) >> perform:withArguments: #buttonRelease:x:y: #(1 46 4) {7860224} [169]
Button(DisplaySurface) >> dispatchEvent:type:arguments:withFocusOn:delegate: WindowEvent::ButtonReleaseEvent(#buttonRelease:x:y: view: Button args: #(1 46 4)) #buttonRelease:x:y: #(1 46 4) an EditTextView true {7864320} [238]
Button(DisplaySurface) >> dispatchEvent:withFocusOn:delegate: WindowEvent::ButtonReleaseEvent(#buttonRelease:x:y: view: Button args: #(1 46 4)) an EditTextView true {7868416} [5]
[] in WindowGroup>>processEventsWithModalGroup: >> value  {7872512} [221]
Block >> on:do:ensure: LastEventQuery (private in WindowGroup) [] in WindowGroup>>processEventsWithModalGroup: [] in WindowGroup>>processEventsWithModalGroup: {7876608} [15]
WindowGroup >> processEventsWithModalGroup: nil {7880704} [232]
[] in WindowGroup>>eventLoopWhile:onLeave: >> value  {7884800} [152]
SignalSet >> handle:do: [] in WindowGroup>>eventLoopWhile:onLeave: [] in WindowGroup>>eventLoopWhile:onLeave: {7888896} [14]
[] in WindowGroup>>eventLoopWhile:onLeave: >> value  {7892992} [81]
Block >> ensure: [] in WindowGroup>>startupWith: (optimized) {7897088} [12]
[] in WindowGroup>>eventLoopWhile:onLeave: >> value {7901184} [184]
WindowGroup::WindowGroupQuery class(Notification class) >> answer:do: WindowGroup(MethodRewriter) [] in WindowGroup>>eventLoopWhile:onLeave: {7905280} [10]
[] in WindowGroup::WindowGroupQuery class>>answer:do: >> value {7909376} [4]
Block >> ensure: [] in WindowGroup::WindowGroupQuery class>>answer:do: (optimized) {7913472} [12]
WindowGroup::WindowGroupQuery class >> answer:do: WindowGroup(MethodRewriter) [] in WindowGroup>>eventLoopWhile:onLeave: {7917568} [5]
WindowGroup >> eventLoopWhile:onLeave: [] in WindowGroup>>startupWith: (optimized) [] in WindowGroup>>startupWith: (optimized) {7921664} [25]
[] in WindowGroup>>startupWith: >> value {7925760} [26]
Block >> ensure: [] in WindowGroup>>startupWith: {7929856} [12]
[] in WindowGroup>>startupWith: >> value  {7933952} [27]
ExceptionHandlerSet >> handleDo: [] in WindowGroup>>startupWith: {7938048} [14]
[] in Process>>start >> value {7942144} [34]
Block >> on:do:ensure: SignalSet(RestartProcessRequest AbortAllOperationRequest TerminateProcessRequest) [] in Process>>start [] in Process>>start {7946240} [15]
Process >> start  {7950336} [35]
UndefinedObject >> nil  {7954432} [0]

Attachments (1)

issue286-workaround.st (2.7 KB) - added by Jan Vrany 6 weeks ago.
Possible workaround

Download all attachments as: .zip

Change History (2)

Changed 6 weeks ago by Jan Vrany

Attachment: issue286-workaround.st added

Possible workaround

comment:1 Changed 6 weeks ago by Jan Vrany

Can you try this issue286-workaround.st? and see if it helps?

Note: See TracTickets for help on using tickets.