<commit_before>Class {
	#name : #TraitedClass,
	#superclass : #Object,
	#classInstVars : [
		'users'
	],
	#category : #TraitsV2
}

{ #category : #'accessing method dictionary' }
TraitedClass class >> addAndClassifySelector: selector withMethod: compiledMethod inProtocol: aCategory notifying: requestor [

	| r |
	r := super
		addAndClassifySelector: selector
		withMethod: compiledMethod
		inProtocol: aCategory
		notifying: requestor.

	self propagateChangeOf: selector.

	^ r
	
]

{ #category : #'accessing method dictionary' }
TraitedClass class >> addSelector: selector withMethod: compiledMethod notifying: requestor [
	| r |
	r := super addSelector: selector withMethod: compiledMethod notifying: requestor.
	self propagateChangeOf: selector.
	
	^ r
]

{ #category : #users }
TraitedClass class >> addUser: aClass [

	self basicUsers add: aClass.
]

{ #category : #users }
TraitedClass class >> basicUsers [
	^ users ifNil: [ users := WeakSet new ]
]

{ #category : #accessing }
TraitedClass class >> isTrait [
	^ true
]

{ #category : #changes }
TraitedClass class >> propagateChangeOf: aSelector [
	| change |

	change := TraitChange new
		updatedSelectors: {aSelector};
		yourself.
		
	self basicUsers do: [ :e | change applyOn: e ]
]

{ #category : #users }
TraitedClass class >> removeUser: aClass [

	self basicUsers remove: aClass ifAbsent: [ ].
]

{ #category : #accessing }
TraitedClass class >> traitComposition [
	
	^ TaEmptyComposition new<commit_msg>Fixing classTrait in TraitedClass.<commit_after>Class {
	#name : #TraitedClass,
	#superclass : #Object,
	#classInstVars : [
		'users'
	],
	#category : #TraitsV2
}

{ #category : #'accessing method dictionary' }
TraitedClass class >> addAndClassifySelector: selector withMethod: compiledMethod inProtocol: aCategory notifying: requestor [

	| r |
	r := super
		addAndClassifySelector: selector
		withMethod: compiledMethod
		inProtocol: aCategory
		notifying: requestor.

	self propagateChangeOf: selector.

	^ r
	
]

{ #category : #'accessing method dictionary' }
TraitedClass class >> addSelector: selector withMethod: compiledMethod notifying: requestor [
	| r |
	r := super addSelector: selector withMethod: compiledMethod notifying: requestor.
	self propagateChangeOf: selector.
	
	^ r
]

{ #category : #users }
TraitedClass class >> addUser: aClass [

	self basicUsers add: aClass.
]

{ #category : #users }
TraitedClass class >> basicUsers [
	^ users ifNil: [ users := WeakSet new ]
]

{ #category : #accessing }
TraitedClass class >> classTrait [
	^ self class
]

{ #category : #accessing }
TraitedClass class >> isTrait [
	^ true
]

{ #category : #changes }
TraitedClass class >> propagateChangeOf: aSelector [
	| change |

	change := TraitChange new
		updatedSelectors: {aSelector};
		yourself.
		
	self basicUsers do: [ :e | change applyOn: e ]
]

{ #category : #users }
TraitedClass class >> removeUser: aClass [

	self basicUsers remove: aClass ifAbsent: [ ].
]

{ #category : #accessing }
TraitedClass class >> traitComposition [
	
	^ TaEmptyComposition new
{'fraction_non_alphanumeric': 0.10953947368421052, 'fraction_numerical': 0.0006578947368421052, 'mean_word_length': 4.459605026929982, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5917891', 'n_tokens_mistral': 1008, 'n_tokens_neox': 961, 'n_words': 263}