# HG changeset patch # User Claus Gittinger # Date 1487177126 -3600 # Node ID 0f7f5f090f81dd329e73974e3f836682fe398b4b # Parent fab3dc7eb9bed5e4072cace38a215a463386eb8d #REFACTORING by cg class: Method added: #isTaggedAs: changed: #isForCompatibility #isObsolete common code in isForCompatibility, isObsolete and isTaggedAs. diff -r fab3dc7eb9be -r 0f7f5f090f81 Method.st --- 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 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