diff -r cec245f60b30 -r 0f7f5f5c67c7 JavaMethod.st --- a/JavaMethod.st Mon Sep 02 09:59:56 2013 +0100 +++ b/JavaMethod.st Mon Sep 02 10:08:10 2013 +0100 @@ -2027,10 +2027,16 @@ "/ ^ (LabelAndIcon '!! ' , self signatureName "/ ]. + self name = #'' ifTrue:[ + ^ 'static {}' + ]. + self name = #'' ifTrue:[ ^ self class specTextFromSignature:descriptor in:javaClass package withName:(javaClass lastName). ]. ^ self class specTextFromSignature:descriptor in:javaClass package withName:(self name) + + "Modified: / 31-08-2013 / 23:28:41 / Jan Vrany " ! shortDisplayString @@ -2381,37 +2387,9 @@ messagesSent "return a collection of messages sent by this method" - - |walker selectors| - - "/ sigh - must extract all accessed literals ... - "/ must deparse the byteCode in order to do this. - - selectors := IdentitySet new. - walker := JavaByteCodeEnumerator new. - walker - literalAction: - [:pc :slotIndex :const | - |mSel| - - (const isNumber - or:[const isString - or:[const isNil]]) ifFalse:[ - const isJavaMethod ifTrue:[ - mSel := const selector. - ] ifFalse:[ - const isJavaMethodRef ifTrue:[ - mSel := const selector "/ signature. - ] - ]. - ]. - mSel notNil ifTrue:[ - "/ Transcript showCR:mSel. - selectors add:mSel - ]. - ]. - walker decompile:self to:nil. - ^ selectors + ^ self analyzer messagesSent + + "Modified: / 31-08-2013 / 10:43:53 / Jan Vrany " ! overrides: anotherMethod @@ -2541,58 +2519,11 @@ "return true, if this method contains a message-send with aSelectorSymbol as selector." - |walker any| - - "/ quick check, if constantPool includes a methodRef for this - "/ selector. - - any := false. - self javaClass constantPool do:[:const | - (const isNumber - or:[const isString - or:[const isNil]]) ifFalse:[ - const isJavaMethod ifTrue:[ - any := any or:[const selector = aSelectorSymbol]. - ] ifFalse:[ - const isJavaMethodRef ifTrue:[ - any := any or:[const signature = aSelectorSymbol]. - ] - ]. - ]. - ]. - any ifFalse:[^ false]. - - "/ sigh - must extract all accessed literals ... - "/ must deparse the byteCode in order to do this. - - walker := JavaByteCodeEnumerator new. - walker - literalAction: - [:pc :slotIndex :const | - |mSel| - - (const isNumber - or:[const isString - or:[const isNil]]) ifFalse:[ - const isJavaMethod ifTrue:[ - mSel := const selector. - ] ifFalse:[ - const isJavaMethodRef ifTrue:[ - mSel := const signature. - ] - ]. - ]. - mSel notNil ifTrue:[ - "/ Transcript showCR:mSel. - mSel = aSelectorSymbol ifTrue:[ - ^ true - ] - ]. - ]. - walker decompile:self to:nil. - - "Created: / 9.11.1999 / 15:38:14 / cg" - "Modified: / 9.11.1999 / 17:06:03 / cg" + ^ self analyzer sends: aSelectorSymbol + + "Created: / 09-11-1999 / 15:38:14 / cg" + "Modified: / 09-11-1999 / 17:06:03 / cg" + "Modified: / 31-08-2013 / 11:37:42 / Jan Vrany " ! shouldBeSkippedInDebuggersWalkBack @@ -2625,6 +2556,12 @@ "Modified: / 30-08-2013 / 17:07:20 / Jan Vrany " ! +messagesSentToSelf + ^ self analyzer messagesSentToSelf + + "Created: / 31-08-2013 / 09:32:16 / Jan Vrany " +! + messagesSentToSuper ^ self analyzer messagesSentToSuper