Skip to content

Commit

Permalink
Cleanup: use #isNotNil instead of #notNil
Browse files Browse the repository at this point in the history
Fix #27
  • Loading branch information
astares committed Oct 25, 2023
1 parent 2f63cbb commit 39dcb4e
Show file tree
Hide file tree
Showing 35 changed files with 81 additions and 81 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ XMLConformanceTest >> ignorableParserExceptions [
{ #category : #testing }
XMLConformanceTest >> isIgnorableParserException: anError [
^ self ignorableParserExceptions notNil
^ self ignorableParserExceptions isNotNil
and: [self ignorableParserExceptions handles: anError]
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ XMLConformanceVirtualFileExternalEntityResolver >> resolveExternalEntityURI: anX
withSelector: sourceSelector].

contents := self virtualFileClass perform: sourceSelector.
(aMaxSize notNil
(aMaxSize isNotNil
and: [contents size > aMaxSize])
ifTrue: [
self
Expand Down
2 changes: 1 addition & 1 deletion src/XML-Parser-Tests/XMLDFALimitsTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ XMLDFALimitsTest >> testDFAStateCacheLimit [
visitedStates add: currentState.
previousState := currentState.
currentState := currentState nextDFAStateMatching: name.
self assert: currentState notNil.
self assert: currentState isNotNil.
i = names size
ifTrue: [
visitedStates do: [:each |
Expand Down
4 changes: 2 additions & 2 deletions src/XML-Parser-Tests/XMLDOMParserTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ XMLDOMParserTest >> testAttributeNamespaces [
assert:
(each attributeNames allSatisfy: [:name |
(each attributeNodeAt: name namespaceURI: 'defaultNS') isNil]);
assert: (each attributeNodeAt: 'ps:family-name' namespaceURI: 'personNS') notNil;
assert: (each attributeNodeAt: 'ps:first-name' namespaceURI: 'personNS') notNil]
assert: (each attributeNodeAt: 'ps:family-name' namespaceURI: 'personNS') isNotNil;
assert: (each attributeNodeAt: 'ps:first-name' namespaceURI: 'personNS') isNotNil]
]

{ #category : #tests }
Expand Down
12 changes: 6 additions & 6 deletions src/XML-Parser-Tests/XMLExceptionTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ XMLExceptionTest >> testFormatSignalWith [
on: Error
do: [ :exception | raisedException := exception ].
self
assert: raisedException notNil;
assert: raisedException isNotNil;
assert: raisedException class identicalTo: self exceptionClass;
assert: raisedException messageText equals: '1' ]
]
Expand All @@ -140,7 +140,7 @@ XMLExceptionTest >> testFormatSignalWithArguments [
on: Error
do: [ :exception | raisedException := exception ].
self
assert: raisedException notNil;
assert: raisedException isNotNil;
assert: raisedException class identicalTo: self exceptionClass;
assert: raisedException messageText equals: '1 two 3 four' ]
]
Expand All @@ -154,7 +154,7 @@ XMLExceptionTest >> testFormatSignalWithWith [
on: Error
do: [ :exception | raisedException := exception ].
self
assert: raisedException notNil;
assert: raisedException isNotNil;
assert: raisedException class identicalTo: self exceptionClass;
assert: raisedException messageText equals: '1 two' ]
]
Expand All @@ -173,7 +173,7 @@ XMLExceptionTest >> testFormatSignalWithWithWith [
on: Error
do: [ :exception | raisedException := exception ].
self
assert: raisedException notNil;
assert: raisedException isNotNil;
assert: raisedException class identicalTo: self exceptionClass;
assert: raisedException messageText equals: '1 two 3' ]
]
Expand All @@ -193,7 +193,7 @@ XMLExceptionTest >> testFormatSignalWithWithWithWith [
on: Error
do: [ :exception | raisedException := exception ].
self
assert: raisedException notNil;
assert: raisedException isNotNil;
assert: raisedException class identicalTo: self exceptionClass;
assert: raisedException messageText equals: '1 two 3 four' ]
]
Expand Down Expand Up @@ -224,7 +224,7 @@ XMLExceptionTest >> testSignalMessageFrom [
on: Error
do: [ :exception | raisedException := exception ].
self
assert: raisedException notNil;
assert: raisedException isNotNil;
assert: raisedException class identicalTo: self exceptionClass;
assert: raisedException messageText equals: ('({1}) {2}' format:
(Array
Expand Down
2 changes: 1 addition & 1 deletion src/XML-Parser-Tests/XMLHTTPRequestTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ XMLHTTPRequestTest >> testEnableCompression [
request acceptEncoding do: [ :each |
self assert:
(XMLHTTPDecompressingReadStreamAdapterFactory classForCompression:
each) notNil ]
each) isNotNil ]
]

{ #category : #tests }
Expand Down
2 changes: 1 addition & 1 deletion src/XML-Parser-Tests/XMLIntegerReaderTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ XMLIntegerReaderTest >> testNonDigit [
uppercaseLetterInterval includes: each ] ])
ifTrue: [
self
assert: (reader nextIntegerWithBase: base) notNil;
assert: (reader nextIntegerWithBase: base) isNotNil;
assert: reader atEnd ]
ifFalse: [
self
Expand Down
6 changes: 3 additions & 3 deletions src/XML-Parser-Tests/XMLNodeWithChildrenTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ XMLNodeWithChildrenTest >> testAllNodesDetect [
allNodes := nodeWithNodes allNodes.
detectedNode := nodeWithNodes allNodesDetect: [ :each | each isPI ].
self
assert: detectedNode notNil;
assert: detectedNode isNotNil;
assert: detectedNode isPI;
assert: detectedNode
equals: (allNodes detect: [ :each | each isPI ]);
Expand Down Expand Up @@ -460,7 +460,7 @@ XMLNodeWithChildrenTest >> testDescendantNodesDetect [
detectedNode := nodeWithNodes descendantNodesDetect: [ :each |
each isPI ].
self
assert: detectedNode notNil;
assert: detectedNode isNotNil;
assert: detectedNode isPI;
assert: detectedNode
equals: (descendantNodes detect: [ :each | each isPI ]);
Expand Down Expand Up @@ -728,7 +728,7 @@ XMLNodeWithChildrenTest >> testNodesDetect [
node := self newNodeWithNodes.
detectedNode := node nodesDetect: [ :each | each isComment ].
self
assert: detectedNode notNil;
assert: detectedNode isNotNil;
assert: detectedNode
equals: (node nodes detect: [ :each | each isComment ]);
assert:
Expand Down
20 changes: 10 additions & 10 deletions src/XML-Parser-Tests/XMLNodeWithElementsTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ XMLNodeWithElementsTest >> testAllElementsDetect [
detectedElement := nodeWithElements allElementsDetect: [ :each |
each isNamed: 'prefix:four' ].
self
assert: detectedElement notNil;
assert: detectedElement isNotNil;
assert: (detectedElement isNamed: 'prefix:four');
assert: detectedElement
equals:
Expand Down Expand Up @@ -827,7 +827,7 @@ XMLNodeWithElementsTest >> testDescendantElementsDetect [
detectedElement := nodeWithElements descendantElementsDetect: [ :each |
each isNamed: 'prefix:four' ].
self
assert: detectedElement notNil;
assert: detectedElement isNotNil;
assert: (detectedElement isNamed: 'prefix:four');
assert: detectedElement
equals:
Expand Down Expand Up @@ -1152,8 +1152,8 @@ XMLNodeWithElementsTest >> testElementRenamingToNext [
usesNamespaces: false;
allElementsDo: [ :each |
| parent oldName oldLocalName nextElement |
((parent := each parent) notNil and: [
(nextElement := each nextElement) notNil ]) ifTrue: [
((parent := each parent) isNotNil and: [
(nextElement := each nextElement) isNotNil ]) ifTrue: [
oldName := each name.
oldLocalName := each localName.

Expand All @@ -1180,8 +1180,8 @@ XMLNodeWithElementsTest >> testElementRenamingToPrevious [
usesNamespaces: false;
allElementsDo: [ :each |
| parent oldName oldLocalName previousElement |
((parent := each parent) notNil and: [
(previousElement := each previousElement) notNil ]) ifTrue: [
((parent := each parent) isNotNil and: [
(previousElement := each previousElement) isNotNil ]) ifTrue: [
oldName := each name.
oldLocalName := each localName.

Expand Down Expand Up @@ -1453,7 +1453,7 @@ XMLNodeWithElementsTest >> testFindElementNamed [
allElements := nodeWithElements allElements.
foundElement := nodeWithElements findElementNamed: 'four'.
self
assert: foundElement notNil;
assert: foundElement isNotNil;
assert: (foundElement isNamed: 'four');
assert: foundElement
identicalTo: (allElements detect: [ :each | each isNamed: 'four' ]);
Expand All @@ -1472,7 +1472,7 @@ XMLNodeWithElementsTest >> testFindElementNamedNamespaceURI [
findElementNamed: 'four'
namespaceURI: 'testNS'.
self
assert: foundElement notNil;
assert: foundElement isNotNil;
assert: (foundElement isNamed: 'four').
self
assert: foundElement
Expand All @@ -1498,7 +1498,7 @@ XMLNodeWithElementsTest >> testFindElementNamedNamespaceURIWith [
namespaceURI: 'testNS'
with: [ :each | each hasChildren ].
self
assert: foundElement notNil;
assert: foundElement isNotNil;
assert: (foundElement isNamed: 'prefix:four').
self
assert: foundElement
Expand Down Expand Up @@ -1527,7 +1527,7 @@ XMLNodeWithElementsTest >> testFindElementNamedWith [
findElementNamed: 'four'
with: [ :each | each hasChildren ].
self
assert: foundElement notNil;
assert: foundElement isNotNil;
assert: (foundElement isNamed: 'four').
self
assert: foundElement
Expand Down
4 changes: 2 additions & 2 deletions src/XML-Parser-Tests/XMLObservableListTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ XMLObservableListTest >> assertList: aList receivedNotificationOfReplacing: anOl
XMLObservableListTest >> assertNotification: aNotification for: anObject withList: aList hasType: aSelectorCollection [

self
assert: aNotification notNil;
assert: aNotification isNotNil;
assert: (aSelectorCollection includes: aNotification selector).
self
assert: aNotification arguments
Expand All @@ -91,7 +91,7 @@ XMLObservableListTest >> assertNotification: aNotification for: anObject withLis
{ #category : #assertions }
XMLObservableListTest >> denyList: aFirstList sharesObserverWith: aSecondList [
self deny:
(aFirstList observer notNil
(aFirstList observer isNotNil
and: [aFirstList observer == aSecondList observer])
]

Expand Down
14 changes: 7 additions & 7 deletions src/XML-Parser/DTDDoctypeDefinition.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -335,15 +335,15 @@ DTDDoctypeDefinition >> hasAttributeValidators [
DTDDoctypeDefinition >> hasElementIDReferences [
"direct access to avoid lazy initialization"

^ elementIDValidator notNil
^ elementIDValidator isNotNil
and: [elementIDValidator hasIDReferences]
]

{ #category : #testing }
DTDDoctypeDefinition >> hasElementIDs [
"direct access to avoid lazy initialization"

^ elementIDValidator notNil
^ elementIDValidator isNotNil
and: [elementIDValidator hasIDs]
]

Expand All @@ -368,7 +368,7 @@ DTDDoctypeDefinition >> hasEntities [
DTDDoctypeDefinition >> hasGeneralEntities [
"direct access to avoid lazy initialization"

^ generalEntities notNil
^ generalEntities isNotNil
and: [generalEntities isNotEmpty]
]

Expand All @@ -383,27 +383,27 @@ DTDDoctypeDefinition >> hasNotationAttributeValidators [
DTDDoctypeDefinition >> hasNotations [
"direct access to avoid lazy initialization"

^ notations notNil and: [ notations isNotEmpty ]
^ notations isNotNil and: [ notations isNotEmpty ]
]

{ #category : #testing }
DTDDoctypeDefinition >> hasParameterEntities [
"direct access to avoid lazy initialization"

^ parameterEntities notNil and: [ parameterEntities isNotEmpty ]
^ parameterEntities isNotNil and: [ parameterEntities isNotEmpty ]
]

{ #category : #testing }
DTDDoctypeDefinition >> hasRoot [

^ root notNil and: [ root isNotEmpty ]
^ root isNotNil and: [ root isNotEmpty ]
]

{ #category : #testing }
DTDDoctypeDefinition >> hasUnparsedEntities [
"direct access to avoid lazy initialization"

^ unparsedEntities notNil and: [ unparsedEntities isNotEmpty ]
^ unparsedEntities isNotNil and: [ unparsedEntities isNotEmpty ]
]

{ #category : #'instance creation' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ DTDExternalEntityResolverLimitingDecorator >> checkExternalEntityLimit [

| maxExternalEntities |

((maxExternalEntities := self externalEntityResolver maxExternalEntities) notNil
((maxExternalEntities := self externalEntityResolver maxExternalEntities) isNotNil
and: [self totalResolvedExternalEntities >= maxExternalEntities])
ifTrue: [self errorExternalEntityLimitExceeded]
]
Expand Down
2 changes: 1 addition & 1 deletion src/XML-Parser/DTDExternalParsedEntity.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ DTDExternalParsedEntity >> hasReplacement [
{ #category : #testing }
DTDExternalParsedEntity >> hasUnresolvedReplacement [

^ self unresolvedReplacement notNil
^ self unresolvedReplacement isNotNil
]

{ #category : #testing }
Expand Down
2 changes: 1 addition & 1 deletion src/XML-Parser/DTDStaticExternalEntityResolver.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ DTDStaticExternalEntityResolver >> resolveExternalEntityURI: anXMLURIOrURIString
ifAbsent: [
self errorUnresolvableExternalEntityURI: anXMLURIOrURIString].

(aMaxSize notNil
(aMaxSize isNotNil
and: [replacement size > aMaxSize])
ifTrue: [
self
Expand Down
2 changes: 1 addition & 1 deletion src/XML-Parser/DTDSubsetParserDriver.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ DTDSubsetParserDriver >> handleAttributeDeclaration: anElement name: anAttribute
defaultValue: aDefaultValue].

(self isValidating
and: [newAttributeValidator notNil])
and: [newAttributeValidator isNotNil])
ifTrue: [newAttributeValidator validateAttributeDeclaration].
]

Expand Down
4 changes: 2 additions & 2 deletions src/XML-Parser/XMLAbstractFactory.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ XMLAbstractFactory class >> findSupportedImplementation [
self isSupportedImplementation
ifTrue: [^ self].

(self preferredImplementation notNil
(self preferredImplementation isNotNil
and: [self preferredImplementation isSupportedImplementation])
ifTrue: [^ self preferredImplementation].
self allSubclassesDo: [:each |
Expand All @@ -45,7 +45,7 @@ XMLAbstractFactory class >> findSupportedImplementation [

{ #category : #testing }
XMLAbstractFactory class >> hasSupportedImplementation [
^ self findSupportedImplementation notNil
^ self findSupportedImplementation isNotNil
]

{ #category : #accessing }
Expand Down
2 changes: 1 addition & 1 deletion src/XML-Parser/XMLCachingNodeList.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ XMLCachingNodeList >> firstElement [

{ #category : #testing }
XMLCachingNodeList >> hasElements [
^ cachedElements notNil and: [cachedElements isNotEmpty]
^ cachedElements isNotNil and: [cachedElements isNotEmpty]
]

{ #category : #testing }
Expand Down
6 changes: 3 additions & 3 deletions src/XML-Parser/XMLDocument.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,12 @@ XMLDocument >> errorCannotHaveNonElementRoot [

{ #category : #testing }
XMLDocument >> hasDoctypeDeclaration [
^ self doctypeDeclaration notNil
^ self doctypeDeclaration isNotNil
]

{ #category : #testing }
XMLDocument >> hasDoctypeDefinition [
^ self doctypeDefinition notNil
^ self doctypeDefinition isNotNil
]

{ #category : #testing }
Expand All @@ -98,7 +98,7 @@ XMLDocument >> hasEncoding [

{ #category : #testing }
XMLDocument >> hasRoot [
^ self root notNil
^ self root isNotNil
]

{ #category : #private }
Expand Down
Loading

0 comments on commit 39dcb4e

Please sign in to comment.