From 8e759725a16ed80eccab7a24bef582a63147a741 Mon Sep 17 00:00:00 2001 From: Torsten Bergmann Date: Tue, 5 Dec 2023 23:56:52 +0100 Subject: [PATCH] Cleanup: notNil -> isNotNil and notEmpy -> isNotEmpty in Iceberg-* packages. (second PR) Fix #1762 --- Iceberg-Libgit/IceGitCommit.class.st | 2 +- Iceberg-Libgit/IceRepositoryCreator.class.st | 4 ++-- .../IceGitLocalRepositoryType.class.st | 2 +- Iceberg-Plugin-GitHub/IceGitHubAPI.class.st | 2 +- Iceberg-Plugin-GitHub/IceGitHubTreeCommand.class.st | 2 +- .../IceTipMetacelloInstallBaselineCommand.class.st | 2 +- Iceberg-TipUI/IceTipCommand.class.st | 4 ++-- Iceberg-TipUI/IceTipGitRepositoryPanel.class.st | 2 +- Iceberg-TipUI/IceTipLocalRepositoryPanel.class.st | 2 +- Iceberg-TipUI/IceTipMergePatchMorph.class.st | 2 +- Iceberg-TipUI/IceTipNewRepositoryPanel.class.st | 2 +- Iceberg-TipUI/IceTipPackageCommand.class.st | 2 +- Iceberg-TipUI/IceTipRepositoryGroupPanel.class.st | 2 +- Iceberg-TipUI/IceTipTreeGroup.class.st | 2 +- Iceberg/IceCommit.class.st | 2 +- Iceberg/IceMethodDefinition.class.st | 2 +- Iceberg/IceNode.class.st | 2 +- Iceberg/IceOperationMerge.class.st | 2 +- Iceberg/IceProxyMCVersionInfo.class.st | 4 ++-- Iceberg/LGitCommit.extension.st | 2 +- Iceberg/MCMethodDefinition.extension.st | 1 - 21 files changed, 23 insertions(+), 24 deletions(-) diff --git a/Iceberg-Libgit/IceGitCommit.class.st b/Iceberg-Libgit/IceGitCommit.class.st index 85fc953dac..6526a8ef3c 100644 --- a/Iceberg-Libgit/IceGitCommit.class.st +++ b/Iceberg-Libgit/IceGitCommit.class.st @@ -138,7 +138,7 @@ IceGitCommit >> hasMultipleAncestors [ | ancestors | "using ancestorsIds because ancestors will instantiate parents and is slower" ancestors := self ancestorIds. - ^ ancestors notNil + ^ ancestors isNotNil and: [ ancestors size > 1 ] ] diff --git a/Iceberg-Libgit/IceRepositoryCreator.class.st b/Iceberg-Libgit/IceRepositoryCreator.class.st index 213999bf6d..d64f5ee447 100644 --- a/Iceberg-Libgit/IceRepositoryCreator.class.st +++ b/Iceberg-Libgit/IceRepositoryCreator.class.st @@ -198,7 +198,7 @@ IceRepositoryCreator >> initialize [ { #category : 'private - testing' } IceRepositoryCreator >> isCloning [ - ^ self remoteToUse notNil + ^ self remoteToUse isNotNil ] { #category : 'accessing' } @@ -277,7 +277,7 @@ IceRepositoryCreator >> validateAlreadyPresentAndNotGit [ "Validate if I will add a local repository (url isNil and location isNotNil)... testing the local directory actually exists" (self remoteToUse isNil - and: [ self location notNil + and: [ self location isNotNil and: [ self location exists and: [ (self class isGitRoot: self location) not ] ] ]) ifTrue: [ diff --git a/Iceberg-Metacello-Integration/IceGitLocalRepositoryType.class.st b/Iceberg-Metacello-Integration/IceGitLocalRepositoryType.class.st index bf150ca7e2..69d67f04d7 100644 --- a/Iceberg-Metacello-Integration/IceGitLocalRepositoryType.class.st +++ b/Iceberg-Metacello-Integration/IceGitLocalRepositoryType.class.st @@ -46,7 +46,7 @@ IceGitLocalRepositoryType >> mcRepository [ extractedLocation := tuple first asFileReference asAbsolute. repository := IceRepository registry detect: [ :each | - each location notNil + each location isNotNil and: [ each location resolve asAbsolute = extractedLocation ] ] ifNone: [ (IceRepositoryCreator new diff --git a/Iceberg-Plugin-GitHub/IceGitHubAPI.class.st b/Iceberg-Plugin-GitHub/IceGitHubAPI.class.st index e43b1d23a5..7410398eaf 100644 --- a/Iceberg-Plugin-GitHub/IceGitHubAPI.class.st +++ b/Iceberg-Plugin-GitHub/IceGitHubAPI.class.st @@ -263,7 +263,7 @@ IceGitHubAPI >> newRequestTo: aString [ ^ ZnClient new in: [ :this | - (self credentials notNil and: [ isAnonymous not]) ifTrue: [ + (self credentials isNotNil and: [ isAnonymous not]) ifTrue: [ self credentials applyToRequest: this ] ]; headerAt: 'Accept' put: self acceptMediaType; url: 'https://api.github.com/', (aString first = $/ diff --git a/Iceberg-Plugin-GitHub/IceGitHubTreeCommand.class.st b/Iceberg-Plugin-GitHub/IceGitHubTreeCommand.class.st index ea12946868..9fba4ce958 100644 --- a/Iceberg-Plugin-GitHub/IceGitHubTreeCommand.class.st +++ b/Iceberg-Plugin-GitHub/IceGitHubTreeCommand.class.st @@ -36,7 +36,7 @@ IceGitHubTreeCommand >> actsOnTag: aRemoteModel [ { #category : 'testing' } IceGitHubTreeCommand >> canBeExecuted [ - ^ self item notNil and: [(self item canActivateCommand: self) and: [super canBeExecuted]] + ^ self item isNotNil and: [(self item canActivateCommand: self) and: [super canBeExecuted]] ] { #category : 'accessing' } diff --git a/Iceberg-Plugin-Metacello/IceTipMetacelloInstallBaselineCommand.class.st b/Iceberg-Plugin-Metacello/IceTipMetacelloInstallBaselineCommand.class.st index 20a824174b..4fdfde5c9c 100644 --- a/Iceberg-Plugin-Metacello/IceTipMetacelloInstallBaselineCommand.class.st +++ b/Iceberg-Plugin-Metacello/IceTipMetacelloInstallBaselineCommand.class.st @@ -38,7 +38,7 @@ IceTipMetacelloInstallBaselineCommand >> basicInstallBaseline: icePackage groups { #category : 'testing' } IceTipMetacelloInstallBaselineCommand >> canBeExecuted [ - ^ self packageModel notNil and: [ self package isMetacelloBaseline ] + ^ self packageModel isNotNil and: [ self package isMetacelloBaseline ] ] { #category : 'private' } diff --git a/Iceberg-TipUI/IceTipCommand.class.st b/Iceberg-TipUI/IceTipCommand.class.st index 587b696def..e49f3fe479 100644 --- a/Iceberg-TipUI/IceTipCommand.class.st +++ b/Iceberg-TipUI/IceTipCommand.class.st @@ -57,13 +57,13 @@ IceTipCommand >> badge [ { #category : 'testing' } IceTipCommand >> hasRepository [ - ^ self repositoryModel notNil + ^ self repositoryModel isNotNil ] { #category : 'testing' } IceTipCommand >> hasSelectedItem [ - ^ self context selectedItem notNil + ^ self context selectedItem isNotNil ] { #category : 'testing' } diff --git a/Iceberg-TipUI/IceTipGitRepositoryPanel.class.st b/Iceberg-TipUI/IceTipGitRepositoryPanel.class.st index eb361361b9..9bc444384c 100644 --- a/Iceberg-TipUI/IceTipGitRepositoryPanel.class.st +++ b/Iceberg-TipUI/IceTipGitRepositoryPanel.class.st @@ -92,7 +92,7 @@ IceTipGitRepositoryPanel >> validate [ assert: (IceGitRemote isValidUrl: remoteString) description: 'The url is incorrect.'. self - assert: self projectLocation location notNil + assert: self projectLocation location isNotNil description: 'Project location must be defined (if it does not exists, it will be created).' ] diff --git a/Iceberg-TipUI/IceTipLocalRepositoryPanel.class.st b/Iceberg-TipUI/IceTipLocalRepositoryPanel.class.st index 8e2a42f95e..d9382932e6 100644 --- a/Iceberg-TipUI/IceTipLocalRepositoryPanel.class.st +++ b/Iceberg-TipUI/IceTipLocalRepositoryPanel.class.st @@ -85,7 +85,7 @@ IceTipLocalRepositoryPanel >> titleForWindow [ IceTipLocalRepositoryPanel >> validate [ self - assert: self location notNil + assert: self location isNotNil description: 'Project location must exist!'. self assert: self location exists diff --git a/Iceberg-TipUI/IceTipMergePatchMorph.class.st b/Iceberg-TipUI/IceTipMergePatchMorph.class.st index 6a05a76fb0..4748e2153d 100644 --- a/Iceberg-TipUI/IceTipMergePatchMorph.class.st +++ b/Iceberg-TipUI/IceTipMergePatchMorph.class.st @@ -125,7 +125,7 @@ IceTipMergePatchMorph >> selectionHasActualClass [ ^self selectedChangeWrapper ifNil: [false] - ifNotNil: [:w | w item value contextClass notNil] + ifNotNil: [:w | w item value contextClass isNotNil] ] { #category : 'testing' } diff --git a/Iceberg-TipUI/IceTipNewRepositoryPanel.class.st b/Iceberg-TipUI/IceTipNewRepositoryPanel.class.st index 0b4e333c58..5627423007 100644 --- a/Iceberg-TipUI/IceTipNewRepositoryPanel.class.st +++ b/Iceberg-TipUI/IceTipNewRepositoryPanel.class.st @@ -137,6 +137,6 @@ IceTipNewRepositoryPanel >> validate [ assert: self projectNameInputText text isNotEmpty description: 'You must enter a project name (it will be used also as part of the path).'. self - assert: self projectLocation location notNil + assert: self projectLocation location isNotNil description: 'Project location must be defined (if it does not exists, it will be created).' ] diff --git a/Iceberg-TipUI/IceTipPackageCommand.class.st b/Iceberg-TipUI/IceTipPackageCommand.class.st index 72c5cc9e02..2950c42b68 100644 --- a/Iceberg-TipUI/IceTipPackageCommand.class.st +++ b/Iceberg-TipUI/IceTipPackageCommand.class.st @@ -21,7 +21,7 @@ IceTipPackageCommand class >> isAbstract [ { #category : 'testing' } IceTipPackageCommand >> hasPackageModel [ - ^ self packageModel notNil + ^ self packageModel isNotNil ] { #category : 'testing' } diff --git a/Iceberg-TipUI/IceTipRepositoryGroupPanel.class.st b/Iceberg-TipUI/IceTipRepositoryGroupPanel.class.st index fd61359ed0..93c44c6ac6 100644 --- a/Iceberg-TipUI/IceTipRepositoryGroupPanel.class.st +++ b/Iceberg-TipUI/IceTipRepositoryGroupPanel.class.st @@ -69,7 +69,7 @@ IceTipRepositoryGroupPanel >> filteredItemsFor: pattern [ { #category : 'testing' } IceTipRepositoryGroupPanel >> hasSelectedItem [ - ^ repositoryList selectedItem notNil + ^ repositoryList selectedItem isNotNil ] { #category : 'initialization' } diff --git a/Iceberg-TipUI/IceTipTreeGroup.class.st b/Iceberg-TipUI/IceTipTreeGroup.class.st index 3de0ec917c..ec17a0748b 100644 --- a/Iceberg-TipUI/IceTipTreeGroup.class.st +++ b/Iceberg-TipUI/IceTipTreeGroup.class.st @@ -78,7 +78,7 @@ IceTipTreeGroup >> isGroup [ IceTipTreeGroup >> isSameAs: aNode [ ^ aNode species = self species and: [ self name = aNode name - and: [ aNode name notNil ] ] + and: [ aNode name isNotNil ] ] ] { #category : 'accessing' } diff --git a/Iceberg/IceCommit.class.st b/Iceberg/IceCommit.class.st index a92c564384..c4f79c1488 100644 --- a/Iceberg/IceCommit.class.st +++ b/Iceberg/IceCommit.class.st @@ -179,7 +179,7 @@ IceCommit >> diffToWorkingCopyForPackages: aCollection [ IceCommit >> hasMultipleAncestors [ | ancestors | ancestors := self ancestors. - ^ ancestors notNil + ^ ancestors isNotNil and: [ ancestors size > 1 ] ] diff --git a/Iceberg/IceMethodDefinition.class.st b/Iceberg/IceMethodDefinition.class.st index 8f85c4f61b..616d9754f8 100644 --- a/Iceberg/IceMethodDefinition.class.st +++ b/Iceberg/IceMethodDefinition.class.st @@ -114,7 +114,7 @@ IceMethodDefinition >> install [ { #category : 'morphic - compatibility' } IceMethodDefinition >> isLoadable [ - ^ self contextClass notNil + ^ self contextClass isNotNil ] { #category : 'testing' } diff --git a/Iceberg/IceNode.class.st b/Iceberg/IceNode.class.st index 493f5b415b..3721452fc2 100644 --- a/Iceberg/IceNode.class.st +++ b/Iceberg/IceNode.class.st @@ -242,7 +242,7 @@ IceNode >> hasChanges [ { #category : 'testing' } IceNode >> hasParent [ - ^ self parent notNil + ^ self parent isNotNil ] { #category : 'comparing' } diff --git a/Iceberg/IceOperationMerge.class.st b/Iceberg/IceOperationMerge.class.st index f8ed377709..a694c6151b 100644 --- a/Iceberg/IceOperationMerge.class.st +++ b/Iceberg/IceOperationMerge.class.st @@ -74,7 +74,7 @@ IceOperationMerge >> isLoadable [ { #category : 'testing' } IceOperationMerge >> isResolved [ - ^ chosen notNil + ^ chosen isNotNil ] { #category : 'resolution' } diff --git a/Iceberg/IceProxyMCVersionInfo.class.st b/Iceberg/IceProxyMCVersionInfo.class.st index a06a411b54..3b81cfa892 100644 --- a/Iceberg/IceProxyMCVersionInfo.class.st +++ b/Iceberg/IceProxyMCVersionInfo.class.st @@ -32,7 +32,7 @@ IceProxyMCVersionInfo class >> lastCommitFound: aCommit [ "This is just a cleanup mechanism... in general iceberg will be scanning a full repository and each proxy will be pointing to same commit so no point in keep it waiting" - (LastCommitFound notNil and: [ oldCommit isNil ]) ifTrue: [ + (LastCommitFound isNotNil and: [ oldCommit isNil ]) ifTrue: [ [ (Delay forSeconds: 60) wait. LastCommitFound := nil ] fork ] ] @@ -93,7 +93,7 @@ IceProxyMCVersionInfo >> doesNotUnderstand: aMessage [ IceProxyMCVersionInfo >> findVersionInfo [ | repo remote commit | - (self class lastCommitFound notNil + (self class lastCommitFound isNotNil and: [ self class lastCommitFound id = commitId ]) ifTrue: [ commit := self class lastCommitFound. diff --git a/Iceberg/LGitCommit.extension.st b/Iceberg/LGitCommit.extension.st index bcab6164f7..cbb126c0dc 100644 --- a/Iceberg/LGitCommit.extension.st +++ b/Iceberg/LGitCommit.extension.st @@ -15,6 +15,6 @@ LGitCommit >> changesFileNamed: fileName [ ^ (myVersion ifNil: [ parentVersions includes: nil ] ifNotNil: [ parentVersions anySatisfy: [ :version | - version notNil and: [ version objectId = myVersion objectId ]]]) not + version isNotNil and: [ version objectId = myVersion objectId ]]]) not ] diff --git a/Iceberg/MCMethodDefinition.extension.st b/Iceberg/MCMethodDefinition.extension.st index 2a59ce3e6b..e11406cada 100644 --- a/Iceberg/MCMethodDefinition.extension.st +++ b/Iceberg/MCMethodDefinition.extension.st @@ -1,6 +1,5 @@ Extension { #name : 'MCMethodDefinition' } - { #category : '*Iceberg-Changes' } MCMethodDefinition >> method [ ^ self actualClass >> self selector