1431 classProvidingComment := firstImplementingClass. |
1431 classProvidingComment := firstImplementingClass. |
1432 ] ifFalse:[ |
1432 ] ifFalse:[ |
1433 commonSuperClass isNil ifTrue:[ |
1433 commonSuperClass isNil ifTrue:[ |
1434 commonSuperClass := Behavior commonSuperclassOf:listOfImplementingClasses. |
1434 commonSuperClass := Behavior commonSuperclassOf:listOfImplementingClasses. |
1435 ] . |
1435 ] . |
1436 (listOfImplementingClasses includes:commonSuperClass) ifTrue:[ |
1436 |
1437 (commonSuperClass implements:selector) ifTrue:[ |
1437 ((listOfImplementingClasses includes:commonSuperClass) |
1438 classProvidingComment := commonSuperClass |
1438 and:[ (commonSuperClass implements:selector) ] |
1439 ] ifFalse:[ |
1439 ) ifTrue:[ |
|
1440 classProvidingComment := commonSuperClass |
|
1441 ] ifFalse:[ |
|
1442 "/ avoid some obvious misleading pathes... |
|
1443 classProvidingComment := { Number . Collection . Stream . View } |
|
1444 detect:[:cls | (listOfImplementingClasses includes:cls) |
|
1445 or:[cls canUnderstand:selector] ] |
|
1446 ifNone:nil. |
|
1447 classProvidingComment notNil ifTrue:[ |
|
1448 classProvidingComment := classProvidingComment whichClassImplements:selector. |
|
1449 ] ifFalse:[ |
1440 classProvidingComment := firstImplementingClass. |
1450 classProvidingComment := firstImplementingClass. |
|
1451 [ |
|
1452 classProvidingComment superclass notNil |
|
1453 and:[ classProvidingComment superclass implements:selector ] |
|
1454 ] whileTrue:[ |
|
1455 classProvidingComment := classProvidingComment superclass |
|
1456 ]. |
1441 ]. |
1457 ]. |
1442 ]. |
1458 ]. |
1443 ]. |
1459 ]. |
1444 classProvidingComment notNil ifTrue:[ |
1460 classProvidingComment notNil ifTrue:[ |
1445 cm := self fetchDescriptionOfMethod:"fetchCommentOfMethod:"(classProvidingComment compiledMethodAt:selector). |
1461 cm := self fetchDescriptionOfMethod:"fetchCommentOfMethod:"(classProvidingComment compiledMethodAt:selector). |
1463 cm isNil ifTrue:[ |
1479 cm isNil ifTrue:[ |
1464 classProvidingComment notNil ifTrue:[ |
1480 classProvidingComment notNil ifTrue:[ |
1465 cm := self fetchDescriptionOfMethod:(classProvidingComment compiledMethodAt:selector). |
1481 cm := self fetchDescriptionOfMethod:(classProvidingComment compiledMethodAt:selector). |
1466 ] |
1482 ] |
1467 ]. |
1483 ]. |
1468 cm notNil ifTrue:[ |
|
1469 cm := (' %1 says:\' withCRs bindWith:(self asClassLink:classProvidingComment name)),cm |
|
1470 ]. |
|
1471 ]. |
1484 ]. |
1472 cm notNil ifTrue:[ |
1485 cm notNil ifTrue:[ |
|
1486 cm := (' %1 says:\' withCRs bindWith:(self asClassLink:classProvidingComment name)),cm. |
|
1487 |
1473 "/ msg := msg,(msg last isSeparator ifTrue:[''] ifFalse:[' ']),cm |
1488 "/ msg := msg,(msg last isSeparator ifTrue:[''] ifFalse:[' ']),cm |
1474 msg := msg,(Character cr),cm |
1489 msg := msg,(Character cr),cm |
1475 ]. |
1490 ]. |
1476 ^ msg |
1491 ^ msg |
1477 ]. |
1492 ]. |