Method.st
changeset 21373 d8c34dd8952f
parent 21372 3b87306d0b09
child 21431 e3a47227faa1
--- a/Method.st	Tue Feb 07 20:14:56 2017 +0100
+++ b/Method.st	Tue Feb 07 20:17:46 2017 +0100
@@ -2053,10 +2053,11 @@
                     ifTrue:[annotationOrArray second]
                     ifFalse:[#()].
         args isArray ifFalse:[args := Array with: args].
-        annotation := Annotation
-                        method:self
-                        key: annotationOrArray first
-                        arguments: args.
+        annotation := Annotation method:self key: annotationOrArray first arguments: args.
+                        
+        "/ unknown annotations are not written back,
+        "/ to give later loaded annotation classes a chance to create
+        "/ a proper instance (otherwise, it would be and remain an unknown annotation)
         annotation isUnknown ifFalse:[
             annotations isImmutable ifTrue:[
                 annotations := annotations asMutableCollection
@@ -2064,17 +2065,12 @@
             annotations at: index put: annotation.
 "/            annotation annotatesMethod: self
         ].
-    ] ifFalse:[
-        "/ retry, in case a new annotation subclass was loaded in the meantime...
-        annotationOrArray isUnknown ifTrue:[
-            Transcript showCR:'should recreate new annotation'
-        ].    
     ].    
     ^annotation
 
     "Created: / 02-07-2010 / 22:30:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 11-07-2010 / 19:39:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 07-02-2017 / 20:14:44 / cg"
+    "Modified (format): / 07-02-2017 / 20:17:30 / cg"
 !
 
 annotationIndexOf: key