File tree Expand file tree Collapse file tree 2 files changed +4
-16
lines changed
dddsample/tracking/core/src/main/java/se/citerus/dddsample/tracking/core/domain/model/cargo Expand file tree Collapse file tree 2 files changed +4
-16
lines changed Original file line number Diff line number Diff line change @@ -262,6 +262,10 @@ public Location earliestReroutingLocation() {
262
262
* that describes a continuous route even if the cargo is currently misdirected.
263
263
*/
264
264
public Itinerary itineraryMergedWith (final Itinerary other ) {
265
+ if (this .itinerary == null ) {
266
+ return other ;
267
+ }
268
+
265
269
if (isMisdirected () && transportStatus () == ONBOARD_CARRIER ) {
266
270
final Leg currentLeg = Leg .deriveLeg (
267
271
currentVoyage (), lastKnownLocation (), currentVoyage ().arrivalLocationAfterDepartureFrom (lastKnownLocation ())
Original file line number Diff line number Diff line change @@ -115,22 +115,6 @@ boolean matchesActivity(final HandlingActivity handlingActivity) {
115
115
return false ;
116
116
}
117
117
118
- Leg ifLoadLocationSameAs (final HandlingActivity handlingActivity ) {
119
- if (loadLocation .sameAs (handlingActivity .location ())) {
120
- return this ;
121
- } else {
122
- return null ;
123
- }
124
- }
125
-
126
- Leg ifUnloadLocationSameAs (final HandlingActivity handlingActivity ) {
127
- if (unloadLocation .sameAs (handlingActivity .location ())) {
128
- return this ;
129
- } else {
130
- return null ;
131
- }
132
- }
133
-
134
118
HandlingActivity deriveLoadActivity () {
135
119
return loadOnto (voyage ).in (loadLocation );
136
120
}
You can’t perform that action at this time.
0 commit comments