--- a/Method.st Wed May 27 06:37:28 2015 +0200
+++ b/Method.st Thu May 28 06:50:45 2015 +0200
@@ -947,9 +947,12 @@
!
annotations
+ "return (a copy) of the annotations array"
+
| retval |
annotations isNil ifTrue:[^ #()].
+
retval := Array new: annotations size.
1 to: annotations size do: [:i|
retval at: i put: (self annotationAtIndex: i).
@@ -1994,11 +1997,14 @@
annotationAtIndex: index
"return the annotation at given index.
- any raw annotation array is lazily initialized"
+ any raw annotation array (as generated by the compiler)
+ is lazily initialized from the 2-element format to real annotation instances here.
+ This is done to avoid the need for knowledge about annotation instances in the stc compiler."
| annotationOrArray annotation args |
annotations isNil ifTrue:[^nil].
+
annotationOrArray := annotation := annotations at: index.
annotationOrArray isArray ifTrue:[
args := annotationOrArray size == 2
@@ -3904,11 +3910,11 @@
!Method class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/Method.st,v 1.460 2015-05-18 15:19:10 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Method.st,v 1.461 2015-05-27 14:28:15 cg Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libbasic/Method.st,v 1.460 2015-05-18 15:19:10 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Method.st,v 1.461 2015-05-27 14:28:15 cg Exp $'
!
version_SVN