#REFACTORING by cg
class: Method
added: #isTaggedAs:
changed:
#isForCompatibility
#isObsolete
common code in isForCompatibility, isObsolete
and isTaggedAs.
--- a/Method.st Wed Feb 15 16:56:24 2017 +0100
+++ b/Method.st Wed Feb 15 17:45:26 2017 +0100
@@ -2708,10 +2708,9 @@
"returns true, if this method only used for compatibility
and should use only when porting foreign code but not otherwise"
- |res|
-
- ^ self package == #'stx:libcompat'
- or:[(res := self resources) notNil and:[res includesKey:#compatibility]]
+ ^ (self package == #'stx:libcompat') or:[self isTaggedAs:#compatibility]
+
+ "Modified: / 15-02-2017 / 17:16:10 / cg"
!
isInvalid
@@ -2774,9 +2773,9 @@
isObsolete
"returns true, if this method is obsolete and should not be used any longer"
- |res|
-
- ^ (res := self resources) notNil and:[res includesKey:#obsolete]
+ ^ self isTaggedAs:#obsolete
+
+ "Modified: / 15-02-2017 / 17:15:25 / cg"
!
isShadowingExtension
@@ -2797,6 +2796,16 @@
"Modified (comment): / 01-02-2017 / 16:58:39 / stefan"
!
+isTaggedAs:tag
+ "returns true, if this method has a <resource: tag> annotation"
+
+ |res|
+
+ ^ (res := self resources) notNil and:[res includesKey:tag]
+
+ "Created: / 15-02-2017 / 17:15:15 / cg"
+!
+
isVersionMethod
"Return true, if this is a CVS, SVN or other version method.
Stupid: need to know all of them here; better add a pragma or