Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Monticello: Repackage classes and methods #14887

Merged
merged 3 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/BaselineOfBasicTools/BaselineOfBasicTools.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ BaselineOfBasicTools >> baseline: spec [
spec package: 'Refactoring-Core'.
spec package: 'Refactoring-UI'.
spec package: 'Refactoring-Environment'.
spec package: 'Monticello-OldDataStreamCompatibility'.
spec package: 'Monticello-BackwardCompatibility'.
spec package: 'MonticelloFileServices'.

self specRefactoring: spec.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ Class {
'packageName',
'tagName'
],
#category : 'Monticello-Modeling',
#package : 'Monticello',
#tag : 'Modeling'
#category : 'Monticello-BackwardCompatibility',
#package : 'Monticello-BackwardCompatibility'
}

{ #category : 'instance creation' }
Expand Down Expand Up @@ -78,6 +77,12 @@ MCClassTraitDefinition >> category: aCategoryString [
self packageName: aCategoryString
]

{ #category : 'accessing' }
MCClassTraitDefinition >> classDefinitionString [

^self definitionString
]

{ #category : 'accessing' }
MCClassTraitDefinition >> className [
^self baseTrait
Expand Down Expand Up @@ -194,3 +199,8 @@ MCClassTraitDefinition >> tagName: anObject [

tagName := anObject
]

{ #category : 'accessing' }
MCClassTraitDefinition >> traitComposition [
^ self classTraitComposition
]
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ MCClassTraitDefinition are not generated anymore by Pharo. This is just here for
Class {
#name : 'MCClassTraitParser',
#superclass : 'MCDoItParser',
#category : 'Monticello-Chunk Format',
#package : 'Monticello',
#tag : 'Chunk Format'
#category : 'Monticello-BackwardCompatibility',
#package : 'Monticello-BackwardCompatibility'
}

{ #category : 'factory identification hook' }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Extension { #name : 'MCDataStream' }

{ #category : '*Monticello-OldDataStreamCompatibility' }
{ #category : '*Monticello-BackwardCompatibility' }
MCDataStream >> readBitmap [
"PRIVATE -- Read the contents of a Bitmap."
^ Bitmap newFromStream: byteStream
"Note that the reader knows that the size is in long words, but the data is in bytes."
]

{ #category : '*Monticello-OldDataStreamCompatibility' }
{ #category : '*Monticello-BackwardCompatibility' }
MCDataStream >> readByteArray [
"PRIVATE -- Read the contents of a ByteArray."

Expand All @@ -17,12 +17,12 @@ MCDataStream >> readByteArray [

]

{ #category : '*Monticello-OldDataStreamCompatibility' }
{ #category : '*Monticello-BackwardCompatibility' }
MCDataStream >> readClass [
^ self error: 'Classes cannot be materialized with DataStream'
]

{ #category : '*Monticello-OldDataStreamCompatibility' }
{ #category : '*Monticello-BackwardCompatibility' }
MCDataStream >> readFloat [
"PRIVATE -- Read the contents of a Float.
This is the fast way to read a Float.
Expand All @@ -35,7 +35,7 @@ MCDataStream >> readFloat [
^ new
]

{ #category : '*Monticello-OldDataStreamCompatibility' }
{ #category : '*Monticello-BackwardCompatibility' }
MCDataStream >> readMethod [
"PRIVATE -- Read the contents of an arbitrary instance.
ASSUMES: readDataFrom:size: sends me beginReference: after it
Expand All @@ -62,7 +62,7 @@ MCDataStream >> readMethod [
^ newMethod
]

{ #category : '*Monticello-OldDataStreamCompatibility' }
{ #category : '*Monticello-BackwardCompatibility' }
MCDataStream >> readRectangle [
"Read a compact Rectangle. Rectangles with values outside +/- 2047 were stored as normal objects (type=9). They will not come here. 17:22 tk"

Expand All @@ -84,7 +84,7 @@ MCDataStream >> readRectangle [

]

{ #category : '*Monticello-OldDataStreamCompatibility' }
{ #category : '*Monticello-BackwardCompatibility' }
MCDataStream >> readReference [
"Read the contents of an object reference. (Cf. outputReference:) File is not now positioned at this object."
| referencePosition |
Expand All @@ -93,7 +93,7 @@ MCDataStream >> readReference [
ifFalse: [self objectAt: referencePosition] "relative pos"
]

{ #category : '*Monticello-OldDataStreamCompatibility' }
{ #category : '*Monticello-BackwardCompatibility' }
MCDataStream >> readShortInst [
"Read the contents of an arbitrary instance that has a short header.
ASSUMES: readDataFrom:size: sends me beginReference: after it
Expand All @@ -116,34 +116,34 @@ MCDataStream >> readShortInst [
^ anObject
]

{ #category : '*Monticello-OldDataStreamCompatibility' }
{ #category : '*Monticello-BackwardCompatibility' }
MCDataStream >> readShortRef [
"Read an object reference from two bytes only. Original object must be in first 65536 bytes of the file. Relative to start of data. vacantRef not a possibility."

^ self objectAt: (byteStream nextNumber: 2)
]

{ #category : '*Monticello-OldDataStreamCompatibility' }
{ #category : '*Monticello-BackwardCompatibility' }
MCDataStream >> readStringOld [

^ byteStream nextStringOld
]

{ #category : '*Monticello-OldDataStreamCompatibility' }
{ #category : '*Monticello-BackwardCompatibility' }
MCDataStream >> readUser [
"Reconstruct both the private class and the instance. Still used??"
^ self readInstance. "Will create new unique class"

]

{ #category : '*Monticello-OldDataStreamCompatibility' }
{ #category : '*Monticello-BackwardCompatibility' }
MCDataStream >> readWordArray [
"PRIVATE -- Read the contents of a WordArray."
^ WordArray newFromStream: byteStream
"Size is number of long words."
]

{ #category : '*Monticello-OldDataStreamCompatibility' }
{ #category : '*Monticello-BackwardCompatibility' }
MCDataStream >> readWordLike [
| refPosn aSymbol newClass anObject |
"Can be used by any class that is bits and not bytes (WordArray, Bitmap, SoundBuffer, etc)."
Expand All @@ -155,15 +155,15 @@ MCDataStream >> readWordLike [
^ anObject
]

{ #category : '*Monticello-OldDataStreamCompatibility' }
{ #category : '*Monticello-BackwardCompatibility' }
MCDataStream >> writeBitmap: aBitmap [
"PRIVATE -- Write the contents of a Bitmap."

aBitmap writeOn: byteStream
"Note that this calls (byteStream nextPutAll: aBitmap) which knows enough to put 4-byte quantities on the stream! Reader must know that size is in long words."
]

{ #category : '*Monticello-OldDataStreamCompatibility' }
{ #category : '*Monticello-BackwardCompatibility' }
MCDataStream >> writeByteArray: aByteArray [
"PRIVATE -- Write the contents of a ByteArray."

Expand All @@ -172,12 +172,12 @@ MCDataStream >> writeByteArray: aByteArray [
byteStream nextPutAll: aByteArray.
]

{ #category : '*Monticello-OldDataStreamCompatibility' }
{ #category : '*Monticello-BackwardCompatibility' }
MCDataStream >> writeClass: aClass [
^ self error: 'Classes cannot be serialized with DataStream'
]

{ #category : '*Monticello-OldDataStreamCompatibility' }
{ #category : '*Monticello-BackwardCompatibility' }
MCDataStream >> writeFloat: aFloat [
"PRIVATE -- Write the contents of a Float.
We support 8-byte Floats here."
Expand All @@ -187,7 +187,7 @@ MCDataStream >> writeFloat: aFloat [

]

{ #category : '*Monticello-OldDataStreamCompatibility' }
{ #category : '*Monticello-BackwardCompatibility' }
MCDataStream >> writeRectangle: anObject [
"Write the contents of a Rectangle. See if it can be a compact Rectangle (type=15). Rectangles with values outside +/- 2047 were stored as normal objects (type=9). 17:22 tk"

Expand All @@ -213,7 +213,7 @@ MCDataStream >> writeRectangle: anObject [
byteStream nextNumber: 3 put: acc.
]

{ #category : '*Monticello-OldDataStreamCompatibility' }
{ #category : '*Monticello-BackwardCompatibility' }
MCDataStream >> writeStringOld: aString [
"PRIVATE -- Write the contents of a String."

Expand All @@ -229,15 +229,15 @@ MCDataStream >> writeStringOld: aString [
ifFalse: [self writeByteArray: aString]. "takes more space"
]

{ #category : '*Monticello-OldDataStreamCompatibility' }
{ #category : '*Monticello-BackwardCompatibility' }
MCDataStream >> writeUser: anObject [
"Write the contents of an arbitrary User instance (and its devoted class)."

"If anObject is an instance of a unique user class, will lie and say it has a generic class"
^ anObject storeDataOn: self
]

{ #category : '*Monticello-OldDataStreamCompatibility' }
{ #category : '*Monticello-BackwardCompatibility' }
MCDataStream >> writeWordLike: aWordArray [
"Note that we put the class name before the size."

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ This package is unloadeable.
Class {
#name : 'MCOldDataStreamExtensions',
#superclass : 'Object',
#category : 'Monticello-OldDataStreamCompatibility-Base',
#package : 'Monticello-OldDataStreamCompatibility',
#tag : 'Base'
#category : 'Monticello-BackwardCompatibility',
#package : 'Monticello-BackwardCompatibility'
}

{ #category : 'class initialization' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ A MCSystemCategoryParser extracts or set a category/protocol to the correspondin
Class {
#name : 'MCSystemCategoryParser',
#superclass : 'MCDoItParser',
#category : 'Monticello-Chunk Format',
#package : 'Monticello',
#tag : 'Chunk Format'
#category : 'Monticello-BackwardCompatibility',
#package : 'Monticello-BackwardCompatibility'
}

{ #category : 'factory identification hook' }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
"
I am a package containing backward compatibility code of Monticello.

I contains things that are not needed anymore in Monticello but that are present to be able to read code exported in the past in newer version of Pharo.
"
Class {
#name : 'ManifestMonticelloBackwardCompatibility',
#superclass : 'PackageManifest',
#category : 'Monticello-BackwardCompatibility-Manifest',
#package : 'Monticello-BackwardCompatibility',
#tag : 'Manifest'
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : 'WordArray' }

{ #category : '*Monticello-OldDataStreamCompatibility' }
{ #category : '*Monticello-BackwardCompatibility' }
WordArray class >> newFromStream: s [
"Only meant for my subclasses that are raw bits and word-like. For quick unpack form the disk."
| len |
Expand Down
1 change: 1 addition & 0 deletions src/Monticello-BackwardCompatibility/package.st
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Package { #name : 'Monticello-BackwardCompatibility' }

This file was deleted.

1 change: 0 additions & 1 deletion src/Monticello-OldDataStreamCompatibility/package.st

This file was deleted.

2 changes: 1 addition & 1 deletion src/Monticello/MCOrganizationParser.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ A MCSystemCategoryParser extracts or set a category/protocol to the correspondin
"
Class {
#name : 'MCOrganizationParser',
#superclass : 'MCSystemCategoryParser',
#superclass : 'MCDoItParser',
#category : 'Monticello-Chunk Format',
#package : 'Monticello',
#tag : 'Chunk Format'
Expand Down

This file was deleted.

21 changes: 0 additions & 21 deletions src/Ring-Monticello/MCClassTraitDefinition.extension.st

This file was deleted.