--- a/JavaMethodref.st Wed May 01 16:22:02 1996 +0000
+++ b/JavaMethodref.st Wed May 01 16:22:55 1996 +0000
@@ -1,5 +1,5 @@
JavaRef subclass:#JavaMethodref
- instanceVariableNames:'method'
+ instanceVariableNames:'method sel'
classVariableNames:''
poolDictionaries:''
category:'Java-Reader-Support'
@@ -20,18 +20,59 @@
self halt.
].
- nm := nameandType name asSymbol.
- sig := nameandType signature.
+ sel isNil ifTrue:[
+ nm := nameandType name asSymbol.
+ sig := nameandType signature.
+ sel := (nm , sig) asSymbol.
+ ].
- class selectorArray keysAndValuesDo:[:idx :sel |
+"/ 'search in: ' print. class fullName print. ' for ' print. nm print. ' sig: ' print. sig printNL.
+ class selectorArray keysAndValuesDo:[:idx :mSel |
"/ idx print. ' 'print. sel printNL.
- sel == nm ifTrue:[
- mthd := class methodArray at:idx.
- mthd signature = sig ifTrue:[
- method := mthd.
- ^ mthd
+ sel == mSel ifTrue:[
+ ^ class methodArray at:idx.
+"/ mthd := class methodArray at:idx.
+"/ 'try: ' print. mthd signatureName printNL.
+"/ mthd signature = sig ifTrue:[
+"/ method := mthd.
+"/ ^ mthd
+"/ ]
+ ]
+ ].
+ self halt.
+!
+
+methodFor:aClass
+ |nm sig mthd cls|
+
+ cls := aClass.
+
+ (cls isMemberOf:JavaUnresolvedClassConstant) ifTrue:[
+ class := class resolve
+ ].
+ (cls isMemberOf:JavaUnresolvedClassConstant) ifTrue:[
+ self halt.
+ ].
+
+ sel isNil ifTrue:[
+ nm := nameandType name asSymbol.
+ sig := nameandType signature.
+ sel := (nm , sig) asSymbol.
+ ].
+
+ [cls notNil] whileTrue:[
+ cls selectorArray keysAndValuesDo:[:idx :mSel |
+"/ idx print. ' 'print. sel printNL.
+ sel == mSel ifTrue:[
+ ^ class methodArray at:idx.
+"/ mthd := class methodArray at:idx.
+"/ mthd signature = sig ifTrue:[
+"/ method := mthd.
+"/ ^ mthd
+"/ ]
]
- ]
+ ].
+ cls := cls superclass
].
self halt.
! !
@@ -39,5 +80,5 @@
!JavaMethodref class methodsFor:'documentation'!
version
- ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaMethodref.st,v 1.5 1996/04/30 23:24:15 cg Exp $'
+ ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaMethodref.st,v 1.6 1996/05/01 16:22:32 cg Exp $'
! !