Fix for static methods
authorJan Vrany <jan.vrany@fit.cvut.cz>
Tue, 10 Sep 2013 12:46:19 +0200
changeset 13541 f5f6d24d493f
parent 13540 2204d5170d0b
child 13542 f250e6fa0190
Fix for static methods
Tools_ClassList.st
--- a/Tools_ClassList.st	Tue Sep 10 10:50:19 2013 +0200
+++ b/Tools_ClassList.st	Tue Sep 10 12:46:19 2013 +0200
@@ -1110,9 +1110,33 @@
                         ] ifFalse:[
                             cat := self class nameListEntryForNonStatic.
                         ].
-                        cls methodDictionary keysAndValuesDo:[:sel :mthd |
-                            whatToDo value:cls value:cat value:sel value:mthd.
-                        ].                            
+
+                        "Java classes have static methods in it's instance method dictionary..."
+                        cls theNonMetaclass isJavaClass ifTrue:[
+                            cls isMeta ifTrue:[
+                                "/ Iterate static method...
+                                cls theNonMetaclass methodDictionary keysAndValuesDo:[:sel :mthd |
+                                    (mthd isJavaMethod and:[mthd isStatic]) ifTrue:[
+                                        whatToDo value:cls value:cat value:sel value:mthd.
+                                    ]
+                                ].
+                                "/ ...and possible class extensions/synthetic proxies...
+                                cls methodDictionary keysAndValuesDo:[:sel :mthd |
+                                    whatToDo value:cls value:cat value:sel value:mthd.
+                                ].                            
+                            ] ifFalse:[
+                                cls methodDictionary keysAndValuesDo:[:sel :mthd |
+                                    "/ filter out static method
+                                    (mthd isJavaMethod not or:[mthd isStatic not]) ifTrue:[
+                                        whatToDo value:cls value:cat value:sel value:mthd.
+                                    ].
+                                ].                            
+                            ]
+                        ] ifFalse:[
+                            cls methodDictionary keysAndValuesDo:[:sel :mthd |
+                                whatToDo value:cls value:cat value:sel value:mthd.
+                            ].                            
+                        ]
 
                     ].
                 ].
@@ -2077,10 +2101,10 @@
 !ClassList class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/Tools_ClassList.st,v 1.77 2013-09-06 18:39:07 vrany Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Tools_ClassList.st,v 1.78 2013-09-10 10:46:19 vrany Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libtool/Tools_ClassList.st,v 1.77 2013-09-06 18:39:07 vrany Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Tools_ClassList.st,v 1.78 2013-09-10 10:46:19 vrany Exp $'
 ! !