diff --git a/src/Kernel-CodeModel/ClassDescription.class.st b/src/Kernel-CodeModel/ClassDescription.class.st index 14da1f15a5a..944f089aa8d 100644 --- a/src/Kernel-CodeModel/ClassDescription.class.st +++ b/src/Kernel-CodeModel/ClassDescription.class.st @@ -277,7 +277,7 @@ ClassDescription >> classify: selector under: aProtocol [ "If we try to classify the method as an extension of its own package, just unclassify the method to avoid any weird state where the method could be considered as an extension or not depending on the interpretation." (self isProtocolExtensionFromTheSamePackage: aProtocol) ifTrue: [ - ExtensionPointsOwningPackageNotification signalFor: self package name. + ExtensionPointsOwningPackageNotification signalFor: self package name class: self selector: selector. ^ self classify: selector under: Protocol unclassified ]. (newProtocol := self ensureProtocol: aProtocol) = oldProtocol ifTrue: [ ^ self ]. @@ -933,7 +933,7 @@ ClassDescription >> renameProtocol: anOldProtocol as: aNewProtocol [ "We should not be able to have a protocol that is an extension of the same class so let's skip the rename." (self isProtocolExtensionFromTheSamePackage: aNewProtocol) ifTrue: [ - ExtensionPointsOwningPackageNotification signalFor: self package name. + ExtensionPointsOwningPackageNotification signalFor: self package name class: self selector: nil. ^ self ]. oldProtocol := self ensureProtocol: anOldProtocol. diff --git a/src/Kernel/ExtensionPointsOwningPackageNotification.class.st b/src/Kernel/ExtensionPointsOwningPackageNotification.class.st index 3bf34636b53..66df4ab30e5 100644 --- a/src/Kernel/ExtensionPointsOwningPackageNotification.class.st +++ b/src/Kernel/ExtensionPointsOwningPackageNotification.class.st @@ -5,7 +5,9 @@ Class { #name : 'ExtensionPointsOwningPackageNotification', #superclass : 'SystemNotification', #instVars : [ - 'packageName' + 'packageName', + 'concernedClass', + 'selector' ], #category : 'Kernel-Exceptions', #package : 'Kernel', @@ -13,19 +15,33 @@ Class { } { #category : 'signalling' } -ExtensionPointsOwningPackageNotification class >> signalFor: aPackageName [ +ExtensionPointsOwningPackageNotification class >> signalFor: aPackageName class: aClass selector: aSelector [ ^ self new packageName: aPackageName; + concernedClass: aClass; + selector: aSelector; signal ] +{ #category : 'accessing' } +ExtensionPointsOwningPackageNotification >> concernedClass [ + + ^ concernedClass +] + +{ #category : 'accessing' } +ExtensionPointsOwningPackageNotification >> concernedClass: anObject [ + + concernedClass := anObject +] + { #category : 'accessing' } ExtensionPointsOwningPackageNotification >> messageText [ ^ messageText ifNil: [ - 'An extension protocol points the package "' , packageName - , '" while the class containing the method is already in this package. The creation of this protocol will be aborted.' ] + 'An extension protocol points the package "' , packageName , '" while ' , self concernedClass , ' containing ' , (self selector ifNil: [ 'the method' ]) + , ' is already in this package. The creation of this protocol will be aborted.' ] ] { #category : 'accessing' } @@ -39,3 +55,15 @@ ExtensionPointsOwningPackageNotification >> packageName: anObject [ packageName := anObject ] + +{ #category : 'accessing' } +ExtensionPointsOwningPackageNotification >> selector [ + + ^ selector +] + +{ #category : 'accessing' } +ExtensionPointsOwningPackageNotification >> selector: anObject [ + + selector := anObject +]