Skip to content

Commit 9a7329c

Browse files
authored
Merge pull request #884 from ApptiveGrid/cleanups
removed obsolete methods, added error for non-existing entries
2 parents c4da780 + 5cf4ab8 commit 9a7329c

5 files changed

+25
-39
lines changed

src/Soil-Core/SoilConsistencyInspectorVisitor.class.st

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ SoilConsistencyInspectorVisitor >> addCluster: aSoilPersistentClusterVersion [
2020
]
2121

2222
{ #category : #'as yet unclassified' }
23-
SoilConsistencyInspectorVisitor >> check: anObject using: aBlock proceed: aBoolean [
23+
SoilConsistencyInspectorVisitor >> check: anObject using: aBlock [
2424
aBlock
2525
on: Error
2626
do: [ :error |

src/Soil-Core/SoilConsistencyVisitor.class.st

+16-9
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,34 @@ Class {
1010

1111
{ #category : #checking }
1212
SoilConsistencyVisitor >> check [
13-
self visit: soil
13+
self visitWithTransaction: soil
1414
]
1515

1616
{ #category : #'as yet unclassified' }
17-
SoilConsistencyVisitor >> check: anObject using: aBlock proceed: aBoolean [
17+
SoilConsistencyVisitor >> check: anObject using: aBlock [
1818
aBlock
1919
on: Error
2020
do: [ :error |
2121
errors at: anObject put: error ]
2222
]
2323

2424
{ #category : #'as yet unclassified' }
25-
SoilConsistencyVisitor >> checkCluster: cluster [
26-
self checkObjectId: cluster objectId.
27-
cluster references do: [ :ref |
28-
self checkObjectId: ref ]
25+
SoilConsistencyVisitor >> checkBehaviorDescription: objectId [
26+
| description |
27+
description := transaction objectWithId: objectId.
28+
self check: description using: [
29+
soil behaviorRegistry
30+
nameAt: description behaviorIdentifier
31+
ifAbsent: [ Error signal: 'description for ', description behaviorIdentifier asString , ' cannot not be found in identifier index' ] ]
2932
]
3033

3134
{ #category : #'as yet unclassified' }
32-
SoilConsistencyVisitor >> checkHeaderPage: headerPage [
33-
self shouldBeImplemented.
35+
SoilConsistencyVisitor >> checkCluster: cluster [
36+
self checkObjectId: cluster objectId.
37+
cluster references do: [ :ref |
38+
self checkObjectId: ref ].
39+
cluster behaviorDescriptions do: [ :description |
40+
self checkBehaviorDescription: description ]
3441
]
3542

3643
{ #category : #'as yet unclassified' }
@@ -46,7 +53,7 @@ SoilConsistencyVisitor >> checkPage: aPage [
4653
self
4754
check: aPage
4855
using: [ aPage validate ]
49-
proceed: true
56+
5057
]
5158

5259
{ #category : #'as yet unclassified' }

src/Soil-Core/SoilIndexConsistencyVisitor.class.st

-21
This file was deleted.

src/Soil-Core/SoilObjectSegment.class.st

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ SoilObjectSegment >> asCachedSegment [
4848
SoilObjectSegment >> at: anInteger [
4949
| position |
5050
position := indexFile positionAt: anInteger.
51+
position isZero ifTrue: [ SoilIndexOutOfRange signal: 'no entry for object at ', id asString, ':', anInteger asString ].
5152
^ (objectFile atPosition: position) ifNotNil: [ :record |
5253
record objectId: (SoilObjectId segment: id index: anInteger).
5354
self soil notificationHandler recordRead: record.

src/Soil-Core/SoilTransactionalVisitor.class.st

+7-8
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,6 @@ Class {
77
#category : #'Soil-Core-Visitor'
88
}
99

10-
{ #category : #visiting }
11-
SoilTransactionalVisitor >> scan: aSoil [
12-
soil := aSoil.
13-
transaction := soil newTransaction.
14-
[ self visit: aSoil ]
15-
ensure: [ transaction abort ]
16-
]
17-
1810
{ #category : #accessing }
1911
SoilTransactionalVisitor >> transaction [
2012

@@ -26,3 +18,10 @@ SoilTransactionalVisitor >> transaction: anObject [
2618

2719
transaction := anObject
2820
]
21+
22+
{ #category : #visiting }
23+
SoilTransactionalVisitor >> visitWithTransaction: aSoil [
24+
transaction := aSoil newTransaction.
25+
[ self visit: aSoil ]
26+
ensure: [ transaction abort ]
27+
]

0 commit comments

Comments
 (0)