Skip to content

Commit

Permalink
change 01 to fix issue #103
Browse files Browse the repository at this point in the history
  • Loading branch information
brunobuzzi committed Aug 13, 2018
1 parent 1977392 commit 7291160
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 6 deletions.
18 changes: 15 additions & 3 deletions sources/uml/UMLExecutionSnapshot.cls
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,10 @@ initialize
executedImplementations := Set new.
hasInfiniteLoop := false!

isAttachedToStack

^parentStack notNil!

isCurtailed
^isCurtailed!

Expand Down Expand Up @@ -304,8 +308,15 @@ nodesNotExecuted: anObject
parentSnapshot
^parentSnapshot!

parentSnapshot: anObject
parentSnapshot := anObject!
parentSnapshot: anUMLExecutionSnapshot

parentSnapshot := anUMLExecutionSnapshot.

anUMLExecutionSnapshot
ifNil: [parentStack := UMLExecutionStack newStartWith: self]
ifNotNil: [parentStack := anUMLExecutionSnapshot parentStack].

parentStack registerStackItem: self.!

parentStack
^parentStack!
Expand Down Expand Up @@ -574,6 +585,7 @@ virtualMachine: anObject
!UMLExecutionSnapshot categoriesFor: #hasSequence!public! !
!UMLExecutionSnapshot categoriesFor: #includesObjectNamed:!public! !
!UMLExecutionSnapshot categoriesFor: #initialize!public! !
!UMLExecutionSnapshot categoriesFor: #isAttachedToStack!public! !
!UMLExecutionSnapshot categoriesFor: #isCurtailed!accessing!private! !
!UMLExecutionSnapshot categoriesFor: #isCurtailed:!accessing!private! !
!UMLExecutionSnapshot categoriesFor: #isDebugging!accessing!private! !
Expand All @@ -592,7 +604,7 @@ virtualMachine: anObject
!UMLExecutionSnapshot categoriesFor: #nodesNotExecuted!accessing!private! !
!UMLExecutionSnapshot categoriesFor: #nodesNotExecuted:!accessing!private! !
!UMLExecutionSnapshot categoriesFor: #parentSnapshot!accessing!private! !
!UMLExecutionSnapshot categoriesFor: #parentSnapshot:!accessing!private! !
!UMLExecutionSnapshot categoriesFor: #parentSnapshot:!accessing!public!vm stack! !
!UMLExecutionSnapshot categoriesFor: #parentStack!accessing!private! !
!UMLExecutionSnapshot categoriesFor: #parentStack:!accessing!private! !
!UMLExecutionSnapshot categoriesFor: #parsedCode!public! !
Expand Down
27 changes: 24 additions & 3 deletions sources/uml/UMLExecutionStack.cls
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ UMLExecutionStack comment: ''!
creatorSnapshot
^creatorSnapshot!

creatorSnapshot: anObject
creatorSnapshot := anObject!
creatorSnapshot: anUMLExecutionSnapshot

creatorSnapshot := anUMLExecutionSnapshot.

anUMLExecutionSnapshot parentStack: self.!

currentSnapshots
^currentSnapshots!
Expand Down Expand Up @@ -50,19 +53,35 @@ infiniteLoopSnapshot
infiniteLoopSnapshot: anObject
infiniteLoopSnapshot := anObject!

initialize

super initialize.

currentSnapshots := OrderedCollection new.
executedSnapshots := OrderedCollection new.!

onErrorDoSnapshot
^onErrorDoSnapshot!

onErrorDoSnapshot: anObject
onErrorDoSnapshot := anObject!

registerStackItem: anUMLExecutionSnapshot
"The receiver register <anUMLExecutionSnapshot> to the current stack"

currentSnapshots add: anUMLExecutionSnapshot.

anUMLExecutionSnapshot parentStack: self.

^anUMLExecutionSnapshot!

virtualMachine
^virtualMachine!

virtualMachine: anObject
virtualMachine := anObject! !
!UMLExecutionStack categoriesFor: #creatorSnapshot!accessing!private! !
!UMLExecutionStack categoriesFor: #creatorSnapshot:!accessing!private! !
!UMLExecutionStack categoriesFor: #creatorSnapshot:!accessing!public! !
!UMLExecutionStack categoriesFor: #currentSnapshots!accessing!private! !
!UMLExecutionStack categoriesFor: #currentSnapshots:!accessing!private! !
!UMLExecutionStack categoriesFor: #dnuSnapshot!accessing!private! !
Expand All @@ -73,8 +92,10 @@ virtualMachine: anObject
!UMLExecutionStack categoriesFor: #hasInfiniteLoop!public! !
!UMLExecutionStack categoriesFor: #infiniteLoopSnapshot!accessing!private! !
!UMLExecutionStack categoriesFor: #infiniteLoopSnapshot:!accessing!private! !
!UMLExecutionStack categoriesFor: #initialize!public! !
!UMLExecutionStack categoriesFor: #onErrorDoSnapshot!accessing!private! !
!UMLExecutionStack categoriesFor: #onErrorDoSnapshot:!accessing!private! !
!UMLExecutionStack categoriesFor: #registerStackItem:!public! !
!UMLExecutionStack categoriesFor: #virtualMachine!accessing!private! !
!UMLExecutionStack categoriesFor: #virtualMachine:!accessing!private! !

Expand Down

0 comments on commit 7291160

Please sign in to comment.