28 Object subclass:#CachedMethodInfo |
28 Object subclass:#CachedMethodInfo |
29 instanceVariableNames:'flags' |
29 instanceVariableNames:'flags' |
30 classVariableNames:'FlagObsolete FlagSendsSuper FlagIsUncommented |
30 classVariableNames:'FlagObsolete FlagSendsSuper FlagIsUncommented |
31 FlagIsDocumentationMethod FlagIsLongMethod FlagIsExtension |
31 FlagIsDocumentationMethod FlagIsLongMethod FlagIsExtension |
32 FlagIsRedefine FlagIsOverride FlagIsSubclassResponsibility |
32 FlagIsRedefine FlagIsOverride FlagIsSubclassResponsibility |
33 FlagIsTest' |
33 FlagIsTest FlagIsAnnotated' |
34 poolDictionaries:'' |
34 poolDictionaries:'' |
35 privateIn:MethodCategoryList |
35 privateIn:MethodCategoryList |
36 ! |
36 ! |
37 |
37 |
38 Method variableSubclass:#MissingMethod |
38 Method variableSubclass:#MissingMethod |
591 ]. |
591 ]. |
592 |
592 |
593 changedObject == selectedProtocolsHolder ifTrue:[ |
593 changedObject == selectedProtocolsHolder ifTrue:[ |
594 rawProtocolList := rawProtocolListHolder value. |
594 rawProtocolList := rawProtocolListHolder value. |
595 rawProtocolList size == 0 ifTrue:[ |
595 rawProtocolList size == 0 ifTrue:[ |
|
596 lastGeneratedProtocols := nil. |
596 self updateList. |
597 self updateList. |
597 rawProtocolList := rawProtocolListHolder value. |
598 rawProtocolList := rawProtocolListHolder value. |
598 ]. |
599 ]. |
599 rawProtocolList notNil ifTrue:[ |
600 rawProtocolList notNil ifTrue:[ |
600 selectedCategories := selectedProtocolsHolder value ? #(). |
601 selectedCategories := selectedProtocolsHolder value ? #(). |
605 newIndices ~= self selectedProtocolIndices value ifTrue:[ |
606 newIndices ~= self selectedProtocolIndices value ifTrue:[ |
606 self selectedProtocolIndices |
607 self selectedProtocolIndices |
607 setValue:nil; "/ to force update |
608 setValue:nil; "/ to force update |
608 value:newIndices. |
609 value:newIndices. |
609 ]. |
610 ]. |
610 (lastGeneratedProtocols notNil |
611 "/ cg: does not work (selecting all with testcase classes) |
611 and:[(lastGeneratedProtocols includes:self class nameListEntryForALL) |
612 "/ don't see why, at the moment, but.... |
612 and:[(selectedCategories ? #()) includes:self class nameListEntryForALL]]) |
613 "/ (lastGeneratedProtocols notNil |
613 ifTrue:[ |
614 "/ and:[(lastGeneratedProtocols includes:self class nameListEntryForALL) |
614 "/ no need to update generator |
615 "/ and:[(selectedCategories ? #()) includes:self class nameListEntryForALL]]) |
615 ] ifFalse:[ |
616 "/ ifTrue:[ |
|
617 "/ "/ no need to update generator |
|
618 "/ ] ifFalse:[ |
616 self updateOutputGenerator. |
619 self updateOutputGenerator. |
617 ] |
620 "/ ] |
618 ]. |
621 ]. |
619 ^ self |
622 ^ self |
620 ]. |
623 ]. |
621 |
624 |
622 (changedObject == variableFilter |
625 (changedObject == variableFilter |
839 on:[:whatToDo | |
842 on:[:whatToDo | |
840 |protocols |
843 |protocols |
841 allProtocols superSendProtocols uncommentedProtocols obsoleteProtocols |
844 allProtocols superSendProtocols uncommentedProtocols obsoleteProtocols |
842 documentationProtocols longProtocols extensionProtocols redefinedProtocols overrideProtocols |
845 documentationProtocols longProtocols extensionProtocols redefinedProtocols overrideProtocols |
843 missingRequiredProtocols subclassResponsibilities |
846 missingRequiredProtocols subclassResponsibilities |
844 notInstrumented fullyCovered partiallyCovered uncovered |
847 notInstrumentedProtocols annotatedProtocols fullyCoveredProtocols |
|
848 partiallyCoveredProtocols uncoveredProtocols |
845 noCat static notStatic classSelectorPairsAlreadyDone |
849 noCat static notStatic classSelectorPairsAlreadyDone |
846 packages remainingClasses remainingCategories classesAlreadyDone noPackage| |
850 packages remainingClasses remainingCategories classesAlreadyDone noPackage |
|
851 catListed| |
847 |
852 |
848 noPackage := PackageId noProjectID. |
853 noPackage := PackageId noProjectID. |
849 noCat := (self class nameListEntryForNILCategory). |
854 noCat := (self class nameListEntryForNILCategory). |
850 static := (self class nameListEntryForStatic). |
855 static := (self class nameListEntryForStatic). |
851 notStatic := (self class nameListEntryForNonStatic). |
856 notStatic := (self class nameListEntryForNonStatic). |
865 extensionProtocols := protocols includes:(self class nameListEntryForExtensions). |
870 extensionProtocols := protocols includes:(self class nameListEntryForExtensions). |
866 redefinedProtocols := protocols includes:(self class nameListEntryForRedefined). |
871 redefinedProtocols := protocols includes:(self class nameListEntryForRedefined). |
867 overrideProtocols := protocols includes:(self class nameListEntryForOverride). |
872 overrideProtocols := protocols includes:(self class nameListEntryForOverride). |
868 missingRequiredProtocols := protocols includes:(self class nameListEntryForRequired). |
873 missingRequiredProtocols := protocols includes:(self class nameListEntryForRequired). |
869 subclassResponsibilities := protocols includes:(self class nameListEntryForMustBeRedefinedInSubclass). |
874 subclassResponsibilities := protocols includes:(self class nameListEntryForMustBeRedefinedInSubclass). |
870 fullyCovered := protocols includes:(self class nameListEntryForFullyCovered). |
875 annotatedProtocols := protocols includes:(self class nameListEntryForAnnotated). |
871 partiallyCovered := protocols includes:(self class nameListEntryForPartiallyCovered). |
876 |
872 uncovered := protocols includes:(self class nameListEntryForUncovered). |
877 fullyCoveredProtocols := protocols includes:(self class nameListEntryForFullyCovered). |
873 notInstrumented := protocols includes:(self class nameListEntryForNotInstrumented). |
878 partiallyCoveredProtocols := protocols includes:(self class nameListEntryForPartiallyCovered). |
|
879 uncoveredProtocols := protocols includes:(self class nameListEntryForUncovered). |
|
880 notInstrumentedProtocols := protocols includes:(self class nameListEntryForNotInstrumented). |
874 |
881 |
875 "/ packages := packageFilter value value. |
882 packages := packageFilter value value. |
876 "/ (packages notNil and:[packages includes:(self class nameListEntryForALL)]) ifTrue:[ |
883 (packages notNil and:[packages includes:(self class nameListEntryForALL)]) ifTrue:[ |
877 "/ packages := nil. |
884 packages := nil. |
878 "/ ]. |
885 ]. |
879 |
886 |
880 remainingClasses := leafClasses copy asIdentitySet. |
887 remainingClasses := leafClasses copy asIdentitySet. |
881 remainingCategories := protocols copy asSet. |
888 remainingCategories := protocols copy asSet. |
882 |
889 |
883 classesAlreadyDone := IdentitySet new. |
890 classesAlreadyDone := IdentitySet new. |
895 anyInThisClass := false. |
902 anyInThisClass := false. |
896 |
903 |
897 aClass methodDictionary keysAndValuesDo:[:sel :mthd | |
904 aClass methodDictionary keysAndValuesDo:[:sel :mthd | |
898 |cat mPkg includeIt info| |
905 |cat mPkg includeIt info| |
899 |
906 |
|
907 "/ sel == #metacelloCleanup ifTrue:[self halt]. |
900 supportsMethodCategories ifTrue:[ |
908 supportsMethodCategories ifTrue:[ |
901 cat := mthd category. |
909 cat := mthd category. |
902 ] ifFalse:[ |
910 ] ifFalse:[ |
903 isJavaClass ifTrue:[ |
911 isJavaClass ifTrue:[ |
904 cat := mthd isStatic ifTrue:[static] ifFalse:[notStatic] |
912 cat := mthd isStatic ifTrue:[static] ifFalse:[notStatic] |
905 ] ifFalse:[ |
913 ] ifFalse:[ |
906 cat := noCat. |
914 cat := noCat. |
907 ] |
915 ] |
908 ]. |
916 ]. |
|
917 catListed := cat. |
|
918 |
909 mPkg := mthd package. |
919 mPkg := mthd package. |
910 (packages isNil or:[mPkg = noPackage or:[packages includes:mPkg]]) |
920 (packages isNil |
911 ifTrue:[ |
921 or:[ mPkg = noPackage |
|
922 or:[ (packages includes:mPkg) |
|
923 or:[ (extensionProtocols and:[ mthd isExtension ]) |
|
924 ]]] |
|
925 ) ifTrue:[ |
912 "/ used to be a more readable or, but to reuse info, I've splitted it. |
926 "/ used to be a more readable or, but to reuse info, I've splitted it. |
913 "/ because we should use the parser only once, we reuse the same methodInfo. |
927 "/ because we should use the parser only once, we reuse the same methodInfo. |
914 "/ otherwise, the list update becomes too slow for long classes (NewSystemBrowser) |
928 "/ otherwise, the list update becomes too slow for long classes (NewSystemBrowser) |
915 includeIt := allProtocols. |
929 includeIt := allProtocols. |
916 includeIt ifFalse:[ includeIt := protocols includes:cat ]. |
930 includeIt ifFalse:[ includeIt := protocols includes:cat ]. |
919 info isNil ifTrue:[ info := self methodInfoFor:mthd in:aClass selector:sel ]. |
933 info isNil ifTrue:[ info := self methodInfoFor:mthd in:aClass selector:sel ]. |
920 includeIt := info sendsSuper ]]. |
934 includeIt := info sendsSuper ]]. |
921 includeIt ifFalse:[ |
935 includeIt ifFalse:[ |
922 uncommentedProtocols ifTrue:[ |
936 uncommentedProtocols ifTrue:[ |
923 info isNil ifTrue:[ info := self methodInfoFor:mthd in:aClass selector:sel ]. |
937 info isNil ifTrue:[ info := self methodInfoFor:mthd in:aClass selector:sel ]. |
924 includeIt := info isUncommented ]]. |
938 includeIt := info isUncommented. |
|
939 catListed := self class nameListEntryForUncommented ]]. |
925 includeIt ifFalse:[ |
940 includeIt ifFalse:[ |
926 obsoleteProtocols ifTrue:[ |
941 obsoleteProtocols ifTrue:[ |
927 info isNil ifTrue:[ info := self methodInfoFor:mthd in:aClass selector:sel ]. |
942 info isNil ifTrue:[ info := self methodInfoFor:mthd in:aClass selector:sel ]. |
928 includeIt := info isObsolete ]]. |
943 includeIt := info isObsolete ]]. |
929 includeIt ifFalse:[ |
944 includeIt ifFalse:[ |
935 info isNil ifTrue:[ info := self methodInfoFor:mthd in:aClass selector:sel ]. |
950 info isNil ifTrue:[ info := self methodInfoFor:mthd in:aClass selector:sel ]. |
936 includeIt := info isLongMethod ]]. |
951 includeIt := info isLongMethod ]]. |
937 includeIt ifFalse:[ |
952 includeIt ifFalse:[ |
938 extensionProtocols ifTrue:[ |
953 extensionProtocols ifTrue:[ |
939 info isNil ifTrue:[ info := self methodInfoFor:mthd in:aClass selector:sel ]. |
954 info isNil ifTrue:[ info := self methodInfoFor:mthd in:aClass selector:sel ]. |
940 includeIt := info isExtensionMethod ]]. |
955 includeIt := info isExtensionMethod. |
|
956 catListed := self class nameListEntryForExtensions ]]. |
941 includeIt ifFalse:[ |
957 includeIt ifFalse:[ |
942 overrideProtocols ifTrue:[ |
958 overrideProtocols ifTrue:[ |
943 info isNil ifTrue:[ info := self methodInfoFor:mthd in:aClass selector:sel ]. |
959 info isNil ifTrue:[ info := self methodInfoFor:mthd in:aClass selector:sel ]. |
944 includeIt := info isOverride ]]. |
960 includeIt := info isOverride ]]. |
945 includeIt ifFalse:[ |
961 includeIt ifFalse:[ |
948 includeIt := info isRedefine ]]. |
964 includeIt := info isRedefine ]]. |
949 includeIt ifFalse:[ |
965 includeIt ifFalse:[ |
950 subclassResponsibilities ifTrue:[ |
966 subclassResponsibilities ifTrue:[ |
951 info isNil ifTrue:[ info := self methodInfoFor:mthd in:aClass selector:sel ]. |
967 info isNil ifTrue:[ info := self methodInfoFor:mthd in:aClass selector:sel ]. |
952 includeIt := info isSubclassResponsibility ]]. |
968 includeIt := info isSubclassResponsibility ]]. |
|
969 includeIt ifFalse:[ |
|
970 annotatedProtocols ifTrue:[ |
|
971 info isNil ifTrue:[ info := self methodInfoFor:mthd in:aClass selector:sel ]. |
|
972 includeIt := info isAnnotated ]]. |
953 |
973 |
954 includeIt ifFalse:[ |
974 includeIt ifFalse:[ |
955 mthd isInstrumented ifTrue:[ |
975 mthd isInstrumented ifTrue:[ |
956 mthd hasBeenCalled ifTrue:[ |
976 mthd hasBeenCalled ifTrue:[ |
957 mthd haveAllBlocksBeenExecuted ifTrue:[ |
977 mthd haveAllBlocksBeenExecuted ifTrue:[ |
958 includeIt := fullyCovered. |
978 includeIt := fullyCoveredProtocols. |
959 ] ifFalse:[ |
979 ] ifFalse:[ |
960 includeIt := partiallyCovered |
980 includeIt := partiallyCoveredProtocols |
961 ] |
981 ] |
962 ] ifFalse:[ |
982 ] ifFalse:[ |
963 includeIt := uncovered |
983 includeIt := uncoveredProtocols |
964 ]. |
984 ]. |
965 ] ifFalse:[ |
985 ] ifFalse:[ |
966 includeIt := notInstrumented |
986 includeIt := notInstrumentedProtocols |
967 ]. |
987 ]. |
968 ]. |
988 ]. |
969 |
989 |
970 includeIt ifTrue:[ |
990 includeIt ifTrue:[ |
971 (methodVisibilityHolder value == #class) ifTrue:[ |
991 (methodVisibilityHolder value == #class) ifTrue:[ |
972 whatToDo value:aClass value:cat value:sel value:mthd. |
992 whatToDo value:aClass value:catListed value:sel value:mthd. |
973 ] ifFalse:[ |
993 ] ifFalse:[ |
974 (classSelectorPairsAlreadyDone includes:(aLeafClass->sel)) ifFalse:[ |
994 (classSelectorPairsAlreadyDone includes:(aLeafClass->sel)) ifFalse:[ |
975 classSelectorPairsAlreadyDone add:(aLeafClass->sel). |
995 classSelectorPairsAlreadyDone add:(aLeafClass->sel). |
976 whatToDo value:aClass value:cat value:sel value:mthd. |
996 whatToDo value:aClass value:catListed value:sel value:mthd. |
977 ]. |
997 ]. |
978 ]. |
998 ]. |
979 anyInThisClass := true. |
999 anyInThisClass := true. |
980 remainingCategories remove:cat ifAbsent:nil. |
1000 remainingCategories remove:catListed ifAbsent:nil. |
981 ]. |
1001 ]. |
982 ] |
1002 ] |
983 ]. |
1003 ]. |
984 |
1004 |
985 missingRequiredProtocols ifTrue:[ |
1005 missingRequiredProtocols ifTrue:[ |
1127 itemsWithInstrumentedMethods itemsWithCalledMethods itemsWithUncalledMethods |
1147 itemsWithInstrumentedMethods itemsWithCalledMethods itemsWithUncalledMethods |
1128 itemsWithPartiallyCoveredMethods itemsWithFullyCoveredMethods |
1148 itemsWithPartiallyCoveredMethods itemsWithFullyCoveredMethods |
1129 packageFilterOnInput packageFilter nameListEntryForALL changeSet |
1149 packageFilterOnInput packageFilter nameListEntryForALL changeSet |
1130 emphasizedPlus emphasisForRef emphasisForMod |
1150 emphasizedPlus emphasisForRef emphasisForMod |
1131 numAll numObsolete numSuper numUncommented numDocumentation numLong numOverride |
1151 numAll numObsolete numSuper numUncommented numDocumentation numLong numOverride |
1132 numRedefine numExtension numMissingRequired numSubclassResponsibility |
1152 numRedefine numExtension numMissingRequired numSubclassResponsibility |
1133 numFullyCovered numPartiallyCovered numUncovered numNotInstrumented |
1153 numAnnotated numFullyCovered numPartiallyCovered numUncovered numNotInstrumented |
1134 showPseudoProtocols showCoverageInformation |
1154 showPseudoProtocols showCoverageInformation |
1135 addPseudoEntry addPseudoEntryWithColor countAll pseudoEntryColor userPreferences |
1155 addPseudoEntry addPseudoEntryWithColor countAll pseudoEntryColor userPreferences |
1136 startTime lazyPseudoProtocols| |
1156 startTime lazyPseudoProtocols| |
1137 |
1157 |
1138 userPreferences := UserPreferences current. |
1158 userPreferences := UserPreferences current. |
1178 variablesToHighlight := variableFilter value. |
1198 variablesToHighlight := variableFilter value. |
1179 classVarsToHighLight := filterClassVars value. |
1199 classVarsToHighLight := filterClassVars value. |
1180 numObsolete := numSuper := numUncommented := numDocumentation := numLong := 0. |
1200 numObsolete := numSuper := numUncommented := numDocumentation := numLong := 0. |
1181 numRedefine := numOverride := numExtension := numMissingRequired := numSubclassResponsibility := 0. |
1201 numRedefine := numOverride := numExtension := numMissingRequired := numSubclassResponsibility := 0. |
1182 numNotInstrumented := numFullyCovered := numPartiallyCovered := numUncovered := 0. |
1202 numNotInstrumented := numFullyCovered := numPartiallyCovered := numUncovered := 0. |
|
1203 numAnnotated := 0. |
1183 |
1204 |
1184 generator do:[:clsIn :catIn | |
1205 generator do:[:clsIn :catIn | |
1185 |emptyProtocols clsName doHighLight doHighLightRed suppress| |
1206 |emptyProtocols clsName doHighLight doHighLightRed suppress| |
1186 |
1207 |
1187 leafClassesProcessed add:clsIn. |
1208 leafClassesProcessed add:clsIn. |
1237 info isLongMethod ifTrue:[ numLong := numLong + 1 ]. |
1258 info isLongMethod ifTrue:[ numLong := numLong + 1 ]. |
1238 info isExtensionMethod ifTrue:[ numExtension := numExtension + 1 ]. |
1259 info isExtensionMethod ifTrue:[ numExtension := numExtension + 1 ]. |
1239 info isOverride ifTrue:[ numOverride := numOverride + 1 ]. |
1260 info isOverride ifTrue:[ numOverride := numOverride + 1 ]. |
1240 info isRedefine ifTrue:[ numRedefine := numRedefine + 1 ]. |
1261 info isRedefine ifTrue:[ numRedefine := numRedefine + 1 ]. |
1241 info isSubclassResponsibility ifTrue:[ numSubclassResponsibility := numSubclassResponsibility + 1]. |
1262 info isSubclassResponsibility ifTrue:[ numSubclassResponsibility := numSubclassResponsibility + 1]. |
|
1263 info isAnnotated ifTrue:[ numAnnotated := numAnnotated + 1]. |
1242 ] |
1264 ] |
1243 ]. |
1265 ]. |
1244 (Timestamp now deltaFrom:startTime) > 10 seconds ifTrue:[ |
1266 (Timestamp now deltaFrom:startTime) > 5 seconds ifTrue:[ |
1245 lazyPseudoProtocols := true. |
1267 lazyPseudoProtocols := true. |
1246 "/ because we already computed for 10seconds, more and more will be found in |
1268 "/ because we already computed for 10seconds, more and more will be found in |
1247 "/ the cache, and eventually, pseudo protocols will be shown anyway |
1269 "/ the cache, and eventually, pseudo protocols will be shown anyway |
1248 masterApplication showInfo:'suppress pseudo protocols - parsing took too long'. |
1270 masterApplication showInfo:'suppress pseudo protocols - parsing took too long'. |
1249 ]. |
1271 ]. |
1287 mPackage ~~ classPackage ifTrue:[ |
1309 mPackage ~~ classPackage ifTrue:[ |
1288 mthd setPackage:(mPackage := mPackage string asSymbol). |
1310 mthd setPackage:(mPackage := mPackage string asSymbol). |
1289 ] |
1311 ] |
1290 ]. |
1312 ]. |
1291 mPackage ~~ classPackage ifTrue:[ |
1313 mPackage ~~ classPackage ifTrue:[ |
1292 mPackage ~= PackageId noProjectID ifTrue:[ |
1314 (mCategory notNil and:[mPackage ~= PackageId noProjectID]) ifTrue:[ |
1293 itemsWithExtensions add:mCategory. |
1315 itemsWithExtensions add:mCategory. |
1294 |
1316 |
1295 (packageFilter notNil |
1317 (packageFilter notNil |
1296 and:[ (packageFilter includes:mPackage) not]) |
1318 and:[ (packageFilter includes:mPackage) not]) |
1297 ifTrue:[ |
1319 ifTrue:[ |
1472 addPseudoEntry value:self class nameListEntryForLong value:numLong. |
1494 addPseudoEntry value:self class nameListEntryForLong value:numLong. |
1473 addPseudoEntry value:self class nameListEntryForObsolete value:numObsolete. |
1495 addPseudoEntry value:self class nameListEntryForObsolete value:numObsolete. |
1474 addPseudoEntry value:self class nameListEntryForExtensions value:numExtension. |
1496 addPseudoEntry value:self class nameListEntryForExtensions value:numExtension. |
1475 addPseudoEntry value:self class nameListEntryForOverride value:numOverride. |
1497 addPseudoEntry value:self class nameListEntryForOverride value:numOverride. |
1476 addPseudoEntry value:self class nameListEntryForMustBeRedefinedInSubclass value:numSubclassResponsibility. |
1498 addPseudoEntry value:self class nameListEntryForMustBeRedefinedInSubclass value:numSubclassResponsibility. |
|
1499 addPseudoEntry value:self class nameListEntryForAnnotated value:numAnnotated. |
1477 showCoverageInformation ifTrue:[ |
1500 showCoverageInformation ifTrue:[ |
1478 addPseudoEntryWithColor value:self class nameListEntryForPartiallyCovered value:numPartiallyCovered value:userPreferences colorForInstrumentedPartiallyCoveredCode. |
1501 addPseudoEntryWithColor value:self class nameListEntryForPartiallyCovered value:numPartiallyCovered value:userPreferences colorForInstrumentedPartiallyCoveredCode. |
1479 addPseudoEntryWithColor value:self class nameListEntryForUncovered value:numUncovered value:userPreferences colorForInstrumentedNeverCalledCode. |
1502 addPseudoEntryWithColor value:self class nameListEntryForUncovered value:numUncovered value:userPreferences colorForInstrumentedNeverCalledCode. |
1480 addPseudoEntryWithColor value:self class nameListEntryForFullyCovered value:numFullyCovered value:userPreferences colorForInstrumentedFullyCoveredCode. |
1503 addPseudoEntryWithColor value:self class nameListEntryForFullyCovered value:numFullyCovered value:userPreferences colorForInstrumentedFullyCoveredCode. |
1481 addPseudoEntry value:self class nameListEntryForNotInstrumented value:numNotInstrumented. |
1504 addPseudoEntry value:self class nameListEntryForNotInstrumented value:numNotInstrumented. |
1582 |
1606 |
1583 "Modified: / 08-08-2011 / 18:21:03 / cg" |
1607 "Modified: / 08-08-2011 / 18:21:03 / cg" |
1584 ! |
1608 ! |
1585 |
1609 |
1586 methodInfoFor:aMethod in:mclass selector:selector lazy:lazy |
1610 methodInfoFor:aMethod in:mclass selector:selector lazy:lazy |
1587 |info isDocumentationMethod isVersionMethod def| |
1611 |info isDocumentationMethod isVersionMethod def methodsPackage| |
1588 |
1612 |
1589 "/ the first at:ifAbsent: is aktually not needed - it is here to |
1613 "/ the first at:ifAbsent: is aktually not needed - it is here to |
1590 "/ reduce the average blocking time, and to allow for debugging the info generating |
1614 "/ reduce the average blocking time, and to allow for debugging the info generating |
1591 "/ code without deadlock |
1615 "/ code without deadlock |
1592 MethodInfoCacheAccessLock critical:[ |
1616 MethodInfoCacheAccessLock critical:[ |
1596 lazy ifTrue:[ |
1620 lazy ifTrue:[ |
1597 "/ TODO: start a background thread to compute the stuff below, |
1621 "/ TODO: start a background thread to compute the stuff below, |
1598 "/ notify me to update the list, when all the lazy info is avail... |
1622 "/ notify me to update the list, when all the lazy info is avail... |
1599 ] ifFalse:[ |
1623 ] ifFalse:[ |
1600 true "aMethod mclass language isSmalltalk" ifTrue:[ |
1624 true "aMethod mclass language isSmalltalk" ifTrue:[ |
1601 info := CachedMethodInfo new. |
1625 methodsPackage := aMethod package. |
1602 info isObsolete:(aMethod isObsolete). |
1626 |
1603 info sendsSuper:(aMethod superMessages notEmptyOrNil). |
|
1604 info isUncommented:(self methodIsMarkedAsUncommented:aMethod). |
|
1605 isVersionMethod := aMethod isVersionMethod. |
1627 isVersionMethod := aMethod isVersionMethod. |
1606 isDocumentationMethod := isVersionMethod not and:[aMethod isDocumentationMethod]. |
1628 isDocumentationMethod := isVersionMethod not and:[aMethod isDocumentationMethod]. |
|
1629 |
|
1630 info := CachedMethodInfo new. |
|
1631 info isObsolete:(aMethod isObsolete). "/ (aMethod isObsolete). |
|
1632 info sendsSuper:(aMethod superMessages notEmptyOrNil). "/ (aMethod superMessages notEmptyOrNil). |
|
1633 info isUncommented:(self methodIsMarkedAsUncommented:aMethod). "/ (self methodIsMarkedAsUncommented:aMethod). |
1607 info isDocumentationMethod:isDocumentationMethod. |
1634 info isDocumentationMethod:isDocumentationMethod. |
1608 info isLongMethod:( self methodIsMarkedAsLong:aMethod ). |
1635 info isLongMethod:(self methodIsMarkedAsLong:aMethod). "/ (self methodIsMarkedAsLong:aMethod). |
1609 |
1636 |
1610 aMethod package ~= mclass package ifTrue:[ |
1637 methodsPackage ~= mclass package ifTrue:[ |
1611 aMethod package ~= #'__NoProject__' ifTrue:[ |
1638 methodsPackage ~= #'__NoProject__' ifTrue:[ |
1612 info isExtensionMethod:true. |
1639 info isExtensionMethod:true. |
1613 info isOverride:( (def := aMethod package asPackageId projectDefinitionClass) notNil |
1640 info isOverride:( |
1614 and:[ (def methodOverwrittenBy:aMethod ) notNil ]) |
1641 ((def := methodsPackage asPackageId projectDefinitionClass) notNil |
|
1642 and:[ (def methodOverwrittenBy:aMethod ) notNil ]) |
|
1643 ) |
1615 ] |
1644 ] |
1616 ] ifFalse:[ |
1645 ] ifFalse:[ |
1617 info isExtensionMethod:false. |
1646 info isExtensionMethod:false. |
1618 info isOverride:false. |
1647 info isOverride:false. |
1619 ]. |
1648 ]. |
1620 info isRedefine:( isVersionMethod not |
1649 info isRedefine:( |
1621 and:[ isDocumentationMethod not |
1650 ( isVersionMethod not |
1622 and:[ mclass superclass notNil |
1651 and:[ isDocumentationMethod not |
1623 and:[ (mclass superclass whichClassIncludesSelector:selector ) notNil ]]]). |
1652 and:[ mclass superclass notNil |
|
1653 and:[ (mclass superclass whichClassIncludesSelector:selector ) notNil ]]]) |
|
1654 ). |
1624 |
1655 |
1625 info isSubclassResponsibility:( aMethod sends:#subclassResponsibility or:#subclassResponsibility: ). |
1656 info isSubclassResponsibility:( aMethod sends:#subclassResponsibility or:#subclassResponsibility: ). |
|
1657 info isAnnotated:(aMethod hasAnnotation). |
1626 |
1658 |
1627 MethodInfoCacheAccessLock critical:[ |
1659 MethodInfoCacheAccessLock critical:[ |
1628 MethodInfoCache at:(mclass name,'>>',selector) put:info |
1660 MethodInfoCache at:(mclass name,'>>',selector) put:info |
1629 ]. |
1661 ]. |
1630 ]. |
1662 ]. |
1771 FlagIsExtension := 32. |
1803 FlagIsExtension := 32. |
1772 FlagIsOverride := 64. |
1804 FlagIsOverride := 64. |
1773 FlagIsRedefine := 128. |
1805 FlagIsRedefine := 128. |
1774 FlagIsSubclassResponsibility := 128. |
1806 FlagIsSubclassResponsibility := 128. |
1775 FlagIsTest := 256. |
1807 FlagIsTest := 256. |
|
1808 FlagIsAnnotated := 512. |
1776 |
1809 |
1777 "Modified: / 08-03-2010 / 18:33:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1810 "Modified: / 08-03-2010 / 18:33:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1811 "Modified: / 07-09-2011 / 10:04:30 / cg" |
1778 ! ! |
1812 ! ! |
1779 |
1813 |
1780 !MethodCategoryList::CachedMethodInfo class methodsFor:'instance creation'! |
1814 !MethodCategoryList::CachedMethodInfo class methodsFor:'instance creation'! |
1781 |
1815 |
1782 new |
1816 new |
1929 ! ! |
1977 ! ! |
1930 |
1978 |
1931 !MethodCategoryList class methodsFor:'documentation'! |
1979 !MethodCategoryList class methodsFor:'documentation'! |
1932 |
1980 |
1933 version |
1981 version |
1934 ^ '$Id: Tools__MethodCategoryList.st 7819 2011-08-19 08:54:18Z vranyj1 $' |
1982 ^ '$Header: /cvs/stx/stx/libtool/Tools_MethodCategoryList.st,v 1.77 2011/09/23 18:56:37 cg Exp $' |
1935 ! |
1983 ! |
1936 |
1984 |
1937 version_CVS |
1985 version_CVS |
1938 ^ '§Header: /cvs/stx/stx/libtool/Tools_MethodCategoryList.st,v 1.71 2011/08/18 08:05:43 cg Exp §' |
1986 ^ '§Header: /cvs/stx/stx/libtool/Tools_MethodCategoryList.st,v 1.77 2011/09/23 18:56:37 cg Exp §' |
1939 ! ! |
1987 ! ! |
1940 |
1988 |
1941 MethodCategoryList initialize! |
1989 MethodCategoryList initialize! |
1942 MethodCategoryList::CachedMethodInfo initialize! |
1990 MethodCategoryList::CachedMethodInfo initialize! |