Faculty of Information Technology
Software Engineering Group

Opened 4 months ago

#282 new defect

Search & Rewrite - MethodRewriter out of bounds

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

Description

I'm trying to refactor my code using Search & Rewrite:

Find:
`@receiver listHolder value

Replace With:
`@receiver list

I'm getting an error:
[SubscriptOutOfBoundsError]: subscript (2619) out of bounds in process MethodRewriter [1191]

The search itself works correctly and gives me the result I want to see.

Here is complete walkback:

[SubscriptOutOfBoundsError]: subscript (2619) out of bounds in process MethodRewriter [1191]

String(Object) >> subscriptBoundsError: 2619 {3461120} [11]
String >> basicAt: 2619 {3465216} [34]
String >> at: 2619 {3469312} [35]
String(UninterpretedBytes) >> slowReplaceBytesFrom:to:with:startingAt: 1 45 'testSavingToTreeFromData
    "Testing #save whe...  "Created: / 12-04-2019 / 08:15:34 / svestkap"
' 2597 {3473408} [13]
String(UninterpretedBytes) >> replaceBytesFrom:to:with:startingAt: 1 45 'testSavingToTreeFromData
    "Testing #save whe...  "Created: / 12-04-2019 / 08:15:34 / svestkap"
' 2597 {3477504} [167]
String(UninterpretedBytes) >> replaceFrom:to:with:startingAt: 1 45 'testSavingToTreeFromData
    "Testing #save whe...  "Created: / 12-04-2019 / 08:15:34 / svestkap"
' 2597 {3481600} [12]
String >> replaceFrom:to:with:startingAt: 1 45 'testSavingToTreeFromData
    "Testing #save whe...  "Created: / 12-04-2019 / 08:15:34 / svestkap"
' 2597 {3485696} [110]
String(SequenceableCollection) >> copyFrom:to: 2597 2641 {3489792} [14]
String >> copyFrom:to: 2597 2641 {3493888} [79]
RBFormatter >> formatMethodComment:for:indentBefore:indentAfter: "Created: / 12-04-2019 / 08:15:34 / svestkap" *Error in argString* false false {3497984} [9]
[] in RBFormatter>>formatMethodCommentsAfter:for: >> value:value: 2 "Created: / 12-04-2019 / 08:15:34 / svestkap" {3502080} [36]
OrderedCollection >> keysAndValuesDo: [] in RBFormatter>>formatMethodCommentsAfter:for: {3506176} [13]
[] in RBFormatter>>formatMethodCommentsAfter:for: >> value {3510272} [35]
RBFormatter >> indent:while: 1 [] in RBFormatter>>formatMethodCommentsAfter:for: {3514368} [3]
RBFormatter >> indentWhile: [] in RBFormatter>>formatMethodCommentsAfter:for: {3518464} [2]
RBFormatter >> formatMethodCommentsAfter:for: OrderedCollection("
     self run:#testSavingToT... " "Created: / 12-04-2019 / 08:15:34 / svestkap") *Error in argString* {3522560} [29]
RBMethodNode >> acceptCommentsAfterVisitor: an RBFormatter {3526656} [2]
RBFormatter >> visitNode: *Error in argString* {3538944} [11]
RBFormatter >> format: *Error in argString* {3543040} [3]
RBMethodNode(RBProgramNode) >> formattedCode {3547136} [2]
RBMethodNode >> newSource  {3551232} [4]
[] in Tools::MethodRewriter>>doRewrite: >> value: a Method(ASMenuEditorTests >> testSavingToTreeFromData) {3555328} [21]
[] in Tools::MethodRewriter>>withMethods:do:finallyDo: >> value:value: 1 a Method(ASMenuEditorTests >> testSavingToTreeFromData) {3559424} [23]
Array >> keysAndValuesDo: [] in Tools::MethodRewriter>>withMethods:do:finallyDo: {3563520} [6]
[] in Tools::MethodRewriter>>withMethods:do:finallyDo: >> value  {3567616} [11]
Block >> ensure: [] in Tools::MethodRewriter>>withMethods:do:finallyDo: {3571712} [12]
Tools::MethodRewriter >> withMethods:do:finallyDo: Set(a Method(ASMenuEditorTests >> testSavingToTr...enuEditorTests >> testNodeMoveDownMultipleNodes)) [] in Tools::MethodRewriter>>doRewrite: [] in Tools::MethodRewriter>>withMethods:do: (optimized) {3575808} [28]
Tools::MethodRewriter >> withMethods:do: Set(a Method(ASMenuEditorTests >> testSavingToTr...enuEditorTests >> testNodeMoveDownMultipleNodes)) [] in Tools::MethodRewriter>>doRewrite: {3579904} [3]
Tools::MethodRewriter >> doRewrite: Set(a Method(ASMenuEditorTests >> testSavingToTr...enuEditorTests >> testNodeMoveDownMultipleNodes)) {3584000} [8]
[] in Tools::MethodRewriter>>doRewriteAction >> value: Set(a Method(ASMenuEditorTests >> testSavingToTr...enuEditorTests >> testNodeMoveDownMultipleNodes)) {3588096} [12]
[] in Tools::MethodRewriter>>doSearchPattern:withResultDo: >> value {3592192} [33]
[] in Tools::MethodRewriter>>withMethods:do:finallyDo: >> value  {3596288} [27]
Block >> ensure: [] in Tools::MethodRewriter>>withMethods:do:finallyDo: {3600384} [12]
Tools::MethodRewriter >> withMethods:do:finallyDo: #(a Method(ASAbstractApplicationModel >> timeSta...salamander_menueditor_tests class >> version_HG)) [] in Tools::MethodRewriter>>doSearchPattern:withResultDo: [] in Tools::MethodRewriter>>doSearchPattern:withResultDo: {3604480} [28]
Tools::MethodRewriter >> withMethodsDo:finallyDo: [] in Tools::MethodRewriter>>doSearchPattern:withResultDo: [] in Tools::MethodRewriter>>doSearchPattern:withResultDo: {3608576} [4]
Tools::MethodRewriter >> doSearchPattern:withResultDo: '`@receiver listHolder value' [] in Tools::MethodRewriter>>doRewriteAction {3612672} [12]
Tools::MethodRewriter >> doRewriteAction  {3616768} [10]
Tools::MethodRewriter(Object) >> perform: #doRewriteAction {3620864} [32]
Tools::MethodRewriter(Object) >> perform:withOptionalArgument: #doRewriteAction true {3624960} [8]
MessageSend >> value: true {3629056} [4]
ButtonController >> performAction  {3633152} [35]
ButtonController >> buttonRelease:x:y: 1 83 12 {3637248} [37]
ButtonController(Object) >> perform:withArguments: #buttonRelease:x:y: #(1 83 12) {3641344} [170]
Button(DisplaySurface) >> dispatchEvent:type:arguments:withFocusOn:delegate: WindowEvent::ButtonReleaseEvent(#buttonRelease:x:y: view: Button args: #(1 83 12)) #buttonRelease:x:y: #(1 83 12) an EditTextView true {3645440} [238]
Button(DisplaySurface) >> dispatchEvent:withFocusOn:delegate: WindowEvent::ButtonReleaseEvent(#buttonRelease:x:y: view: Button args: #(1 83 12)) an EditTextView true {3649536} [5]
[] in WindowGroup>>processEventsWithModalGroup: >> value  {3653632} [221]
Block >> on:do:ensure: LastEventQuery (private in WindowGroup) [] in WindowGroup>>processEventsWithModalGroup: [] in WindowGroup>>processEventsWithModalGroup: {3657728} [15]
WindowGroup >> processEventsWithModalGroup: nil {3661824} [232]
[] in WindowGroup>>eventLoopWhile:onLeave: >> value  {3665920} [152]
SignalSet >> handle:do: [] in WindowGroup>>eventLoopWhile:onLeave: [] in WindowGroup>>eventLoopWhile:onLeave: {3670016} [14]
[] in WindowGroup>>eventLoopWhile:onLeave: >> value  {3674112} [81]
Block >> ensure: [] in WindowGroup>>startupWith: (optimized) {3678208} [12]
[] in WindowGroup>>eventLoopWhile:onLeave: >> value {3682304} [184]
WindowGroup::WindowGroupQuery class(Notification class) >> answer:do: WindowGroup(MethodRewriter) [] in WindowGroup>>eventLoopWhile:onLeave: {3686400} [10]
[] in WindowGroup::WindowGroupQuery class>>answer:do: >> value {3690496} [4]
Block >> ensure: [] in WindowGroup::WindowGroupQuery class>>answer:do: (optimized) {3694592} [12]
WindowGroup::WindowGroupQuery class >> answer:do: WindowGroup(MethodRewriter) [] in WindowGroup>>eventLoopWhile:onLeave: {3698688} [5]
WindowGroup >> eventLoopWhile:onLeave: [] in WindowGroup>>startupWith: (optimized) [] in WindowGroup>>startupWith: (optimized) {3702784} [25]
[] in WindowGroup>>startupWith: >> value {3706880} [26]
Block >> ensure: [] in WindowGroup>>startupWith: {3710976} [12]
[] in WindowGroup>>startupWith: >> value  {3715072} [27]
ExceptionHandlerSet >> handleDo: [] in WindowGroup>>startupWith: {3719168} [14]
[] in Process>>start >> value {3723264} [34]
Block >> on:do:ensure: SignalSet(RestartProcessRequest AbortAllOperationRequest TerminateProcessRequest) [] in Process>>start [] in Process>>start {3727360} [15]
Process >> start  {3731456} [35]
UndefinedObject >> nil  {3735552} [0]

Change History (0)

Note: See TracTickets for help on using tickets.