Commit 4e27ee6
Prevent creating objects with duplicated GUIDs (#367)
* Check before creating an object; if an object with the same GUID exists, throw
* Add tests
* Fix exception message (the rule is global across all types)
Fixes #365.
This should not affect FW, since the FooFactory.Create(guid) method is not used in FieldWorks. FW Lite uses it, so that FW Lite can create LCM objects with GUIDs that match the GUIDs of objects that are being synchronized from other projects. And FW Lite will be changed to expect an InvalidOperationError to be thrown in case of a duplicated GUID being created, and handle the resulting merge conflict accordingly.
---------
Co-authored-by: Tim Haasdyk <tim_haasdyk@sil.org>1 parent 44fc874 commit 4e27ee6
2 files changed
Lines changed: 38 additions & 2 deletions
File tree
- src/SIL.LCModel/LcmGenerate
- tests/SIL.LCModel.Tests/DomainImpl
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
68 | 80 | | |
69 | 81 | | |
70 | 82 | | |
| |||
Lines changed: 25 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
132 | 133 | | |
133 | 134 | | |
134 | 135 | | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
135 | 159 | | |
136 | 160 | | |
0 commit comments