745 in order to make the consumers only depend on one input |
745 in order to make the consumers only depend on one input |
746 (i.e. to pass multiple-class and multiple-protocol info |
746 (i.e. to pass multiple-class and multiple-protocol info |
747 without a need for another classHolder/protocolHolder in the methodList)." |
747 without a need for another classHolder/protocolHolder in the methodList)." |
748 |
748 |
749 ^ Iterator on:[:whatToDo | |
749 ^ Iterator on:[:whatToDo | |
750 |protocols allProtocols noCat static notStatic classSelectorPairsAlreadyDone |
750 |protocols allProtocols noCat static notStatic classSelectorPairsAlreadyDone |
751 packages remainingClasses remainingCategories classesAlreadyDone| |
751 packages remainingClasses remainingCategories classesAlreadyDone noPackage| |
752 |
752 |
753 noCat := (self class nameListEntryForNILCategory). |
753 noPackage := Project noProjectID. |
754 static := (self class nameListEntryForStatic). |
754 noCat := (self class nameListEntryForNILCategory). |
755 notStatic := (self class nameListEntryForNonStatic). |
755 static := (self class nameListEntryForStatic). |
756 |
756 notStatic := (self class nameListEntryForNonStatic). |
757 protocols := self selectedProtocols value ? #(). |
757 |
758 protocols := protocols collect:[:each | (each ifNil:[noCat]) string]. |
758 protocols := self selectedProtocols value ? #(). |
759 lastGeneratedProtocols := protocols. |
759 protocols := protocols collect:[:each | (each ifNil:[noCat]) string]. |
760 protocols := protocols asSet. |
760 lastGeneratedProtocols := protocols. |
761 |
761 protocols := protocols asSet. |
762 (leafClasses size > 0 |
762 |
763 and:[protocols size > 0]) ifTrue:[ |
763 (leafClasses size > 0 |
764 allProtocols := protocols includes:(self class nameListEntryForALL). |
764 and:[protocols size > 0]) ifTrue:[ |
765 |
765 allProtocols := protocols includes:(self class nameListEntryForALL). |
766 packages := packageFilter value value. |
766 |
767 (packages notNil and:[packages includes:(self class nameListEntryForALL)]) ifTrue:[ |
767 packages := packageFilter value value. |
768 packages := nil. |
768 (packages notNil and:[packages includes:(self class nameListEntryForALL)]) ifTrue:[ |
769 ]. |
769 packages := nil. |
770 |
770 ]. |
771 remainingClasses := leafClasses copy asIdentitySet. |
771 |
772 remainingCategories := protocols copy asSet. |
772 remainingClasses := leafClasses copy asIdentitySet. |
773 |
773 remainingCategories := protocols copy asSet. |
774 classesAlreadyDone := IdentitySet new. |
774 |
775 classSelectorPairsAlreadyDone := Set new. |
775 classesAlreadyDone := IdentitySet new. |
776 |
776 classSelectorPairsAlreadyDone := Set new. |
777 leafClasses do:[:aLeafClass | |
777 |
778 (self classesToProcessForClasses:(Array with:aLeafClass)) do:[:aClass | |
778 leafClasses do:[:aLeafClass | |
779 |supportsMethodCategories isJavaClass anyInThisClass| |
779 (self classesToProcessForClasses:(Array with:aLeafClass)) do:[:aClass | |
780 |
780 |supportsMethodCategories isJavaClass anyInThisClass| |
781 (classesAlreadyDone includes:aClass) ifFalse:[ |
781 |
782 classesAlreadyDone add:aClass. |
782 (classesAlreadyDone includes:aClass) ifFalse:[ |
783 |
783 classesAlreadyDone add:aClass. |
784 supportsMethodCategories := aClass supportsMethodCategories. |
784 |
785 isJavaClass := aClass isJavaClass. |
785 supportsMethodCategories := aClass supportsMethodCategories. |
786 anyInThisClass := false. |
786 isJavaClass := aClass isJavaClass. |
787 |
787 anyInThisClass := false. |
788 aClass methodDictionary keysAndValuesDo:[:sel :mthd | |
788 |
789 |cat| |
789 aClass methodDictionary keysAndValuesDo:[:sel :mthd | |
790 |
790 |cat mPkg| |
791 supportsMethodCategories ifTrue:[ |
791 |
792 cat := mthd category. |
792 supportsMethodCategories ifTrue:[ |
793 ] ifFalse:[ |
793 cat := mthd category. |
794 isJavaClass ifTrue:[ |
794 ] ifFalse:[ |
795 cat := mthd isStatic ifTrue:[static] ifFalse:[notStatic] |
795 isJavaClass ifTrue:[ |
796 ] ifFalse:[ |
796 cat := mthd isStatic ifTrue:[static] ifFalse:[notStatic] |
797 cat := noCat. |
797 ] ifFalse:[ |
798 ] |
798 cat := noCat. |
799 ]. |
799 ] |
800 (allProtocols or:[protocols includes:cat]) ifTrue:[ |
800 ]. |
801 (packages isNil or:[packages includes:mthd package]) |
801 (allProtocols or:[protocols includes:cat]) ifTrue:[ |
802 ifTrue:[ |
802 mPkg := mthd package. |
803 |
803 (packages isNil or:[mPkg = noPackage or:[packages includes:mPkg]]) |
804 (methodVisibilityHolder value == #class) ifTrue:[ |
804 ifTrue:[ |
805 whatToDo value:aClass value:cat value:sel value:mthd. |
805 |
806 ] ifFalse:[ |
806 (methodVisibilityHolder value == #class) ifTrue:[ |
807 (classSelectorPairsAlreadyDone includes:(aLeafClass->sel)) ifFalse:[ |
807 whatToDo value:aClass value:cat value:sel value:mthd. |
808 classSelectorPairsAlreadyDone add:(aLeafClass->sel). |
808 ] ifFalse:[ |
809 whatToDo value:aClass value:cat value:sel value:mthd. |
809 (classSelectorPairsAlreadyDone includes:(aLeafClass->sel)) ifFalse:[ |
810 ]. |
810 classSelectorPairsAlreadyDone add:(aLeafClass->sel). |
811 ]. |
811 whatToDo value:aClass value:cat value:sel value:mthd. |
812 |
812 ]. |
813 anyInThisClass := true. |
813 ]. |
814 remainingCategories remove:cat ifAbsent:nil. |
814 |
815 ] |
815 anyInThisClass := true. |
816 ] |
816 remainingCategories remove:cat ifAbsent:nil. |
817 ]. |
817 ] |
818 anyInThisClass ifTrue:[ remainingClasses remove:aClass ifAbsent:nil. ]. |
818 ] |
819 ]. |
819 ]. |
820 ]. |
820 anyInThisClass ifTrue:[ remainingClasses remove:aClass ifAbsent:nil. ]. |
821 ]. |
821 ]. |
822 remainingClasses do:[:aClass | |
822 ]. |
823 whatToDo value:aClass value:nil value:nil value:nil. |
823 ]. |
824 ]. |
824 remainingClasses do:[:aClass | |
825 remainingCategories do:[:cat | |
825 whatToDo value:aClass value:nil value:nil value:nil. |
826 whatToDo value:nil value:cat value:nil value:nil. |
826 ]. |
827 ] |
827 remainingCategories do:[:cat | |
828 ] |
828 whatToDo value:nil value:cat value:nil value:nil. |
829 ] |
829 ] |
830 |
830 ] |
831 "Created: / 5.2.2000 / 13:42:10 / cg" |
831 ] |
832 "Modified: / 25.2.2000 / 22:21:52 / cg" |
832 |
|
833 "Created: / 05-02-2000 / 13:42:10 / cg" |
|
834 "Modified: / 18-09-2006 / 21:41:08 / cg" |
833 ! ! |
835 ! ! |
834 |
836 |
835 !MethodCategoryList methodsFor:'private'! |
837 !MethodCategoryList methodsFor:'private'! |
836 |
838 |
837 class:cls protocol:cat includesMethodsInAnyPackage:packageFilter |
839 class:cls protocol:cat includesMethodsInAnyPackage:packageFilter |