Skip to content

Commit

Permalink
Cleanup: deprecate #notEmpty and use #isNotEmpty
Browse files Browse the repository at this point in the history
Fix #14
  • Loading branch information
astares committed Oct 26, 2023
1 parent 8e6c146 commit 3d0f7bd
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/XML-Writer-Core/XMLAttributeDeclarationWriter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ XMLAttributeDeclarationWriter >> defaultPragma [
XMLAttributeDeclarationWriter >> defaultPragma: aDefaultPragma [

defaultPragma := (aDefaultPragma isNotNil and: [
aDefaultPragma notEmpty and: [
aDefaultPragma isNotEmpty and: [
aDefaultPragma first == $# ] ])
ifTrue: [ aDefaultPragma allButFirst ]
ifFalse: [ aDefaultPragma ]
Expand Down Expand Up @@ -105,7 +105,7 @@ XMLAttributeDeclarationWriter >> writeBody [
{ #category : #writing }
XMLAttributeDeclarationWriter >> writeDefaultPragma [

self defaultPragma notEmpty ifTrue: [
self defaultPragma isNotEmpty ifTrue: [
self writer
space;
nextPut: $#;
Expand Down
2 changes: 1 addition & 1 deletion src/XML-Writer-Core/XMLEntityDeclarationWriter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ XMLEntityDeclarationWriter >> isParameter: aBoolean [
{ #category : #testing }
XMLEntityDeclarationWriter >> isUnparsed [

^ self ndata notEmpty
^ self ndata isNotEmpty
]

{ #category : #accessing }
Expand Down
4 changes: 2 additions & 2 deletions src/XML-Writer-Core/XMLExternalIDWriter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ Class {
{ #category : #testing }
XMLExternalIDWriter >> hasPublicID [

^ self publicID notEmpty
^ self publicID isNotEmpty
]

{ #category : #testing }
XMLExternalIDWriter >> hasSystemID [

^ self systemID notEmpty
^ self systemID isNotEmpty
]

{ #category : #testing }
Expand Down
2 changes: 1 addition & 1 deletion src/XML-Writer-Core/XMLPIWriter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ XMLPIWriter >> data: aString [
{ #category : #testing }
XMLPIWriter >> hasData [

^ self data notEmpty
^ self data isNotEmpty
]

{ #category : #testing }
Expand Down
4 changes: 2 additions & 2 deletions src/XML-Writer-Core/XMLTagWriter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ XMLTagWriter >> attributes: anAssociationCollection [
{ #category : #testing }
XMLTagWriter >> hasAttributes [

^ attributes isNotNil and: [ attributes notEmpty ]
^ attributes isNotNil and: [ attributes isNotEmpty ]
]

{ #category : #testing }
XMLTagWriter >> hasXMLNSDeclarations [

^ xmlnsDeclarations isNotNil and: [ xmlnsDeclarations notEmpty ]
^ xmlnsDeclarations isNotNil and: [ xmlnsDeclarations isNotEmpty ]
]

{ #category : #testing }
Expand Down
4 changes: 2 additions & 2 deletions src/XML-Writer-Core/XMLUnsafeStartTagWriter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ XMLUnsafeStartTagWriter >> attributes: anAssociationCollection [
{ #category : #testing }
XMLUnsafeStartTagWriter >> hasAttributes [

^ attributes isNotNil and: [ attributes notEmpty ]
^ attributes isNotNil and: [ attributes isNotEmpty ]
]

{ #category : #testing }
XMLUnsafeStartTagWriter >> hasXMLNSDeclarations [

^ xmlnsDeclarations isNotNil and: [ xmlnsDeclarations notEmpty ]
^ xmlnsDeclarations isNotNil and: [ xmlnsDeclarations isNotEmpty ]
]

{ #category : #testing }
Expand Down
2 changes: 1 addition & 1 deletion src/XML-Writer-Core/XMLXMLDeclarationWriter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ XMLXMLDeclarationWriter >> encoding: anEncoding [
{ #category : #testing }
XMLXMLDeclarationWriter >> hasEncoding [

^ self encoding notEmpty
^ self encoding isNotEmpty
]

{ #category : #testing }
Expand Down
22 changes: 22 additions & 0 deletions src/XML-Writer-Tests/ManifestXMLWriterTests.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
"
Please describe the package using the class comment of the included manifest class. The manifest class also includes other additional metadata for the package. These meta data are used by other tools such as the SmalllintManifestChecker and the critics Browser
"
Class {
#name : #ManifestXMLWriterTests,
#superclass : #PackageManifest,
#category : #'XML-Writer-Tests-Manifest'
}

{ #category : #'code-critics' }
ManifestXMLWriterTests class >> ruleDetectContainsRuleV1FalsePositive [

<ignoreForCoverage>
^ #(#(#(#RGMethodDefinition #(#XMLWriterRecordingFormatterProxy #receivedNextAll:with: #false)) #'2023-10-26T02:25:37.729304+02:00') )
]

{ #category : #'code-critics' }
ManifestXMLWriterTests class >> ruleLiteralArrayContainsSuspiciousTrueFalseOrNilRuleV1FalsePositive [

<ignoreForCoverage>
^ #(#(#(#RGMetaclassDefinition #(#'ManifestXMLWriterTests class' #ManifestXMLWriterTests)) #'2023-10-26T02:26:03.499966+02:00') )
]
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ XMLWriterRecordingFormatterProxy >> receivedNextAll: aNameCollection with: anArg

aNameCollection do: [ :each |
| message |
(messageQueue notEmpty and: [
(messageQueue isNotEmpty and: [
(message := messageQueue first) selector == each asSymbol and: [
message arguments asArray = (Array with: anArgument) ] ])
ifFalse: [ ^ false ].
Expand Down

0 comments on commit 3d0f7bd

Please sign in to comment.