7cca9819606e7f65e3b18d0aae74f4662674daf9
java/com.sap.sailing.domain/src/com/sap/sailing/domain/maneuverhash/impl/ManeuverRaceFingerprintImpl.java
| ... | ... | @@ -55,25 +55,25 @@ public class ManeuverRaceFingerprintImpl extends MarkPassingRaceFingerprintImpl |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | private int calculateWindHash(TrackedRace trackedRace) { |
| 58 | - Set<WindSource> windSoures = trackedRace.getWindSources(); |
|
| 58 | + final Set<WindSource> windSoures = trackedRace.getWindSources(); |
|
| 59 | 59 | int res = 0; |
| 60 | - Set<WindSource> windSouresToExclude = trackedRace.getWindSourcesToExclude(); |
|
| 61 | - for(WindSource w : windSoures) { |
|
| 62 | - if(w.getType().isObserved() && !windSouresToExclude.contains(w)) { |
|
| 60 | + final Set<WindSource> windSouresToExclude = trackedRace.getWindSourcesToExclude(); |
|
| 61 | + for (WindSource w : windSoures) { |
|
| 62 | + if (w.getType().isObserved() && !windSouresToExclude.contains(w)) { |
|
| 63 | 63 | WindTrack windTrack = trackedRace.getOrCreateWindTrack(w); |
| 64 | 64 | windTrack.lockForRead(); |
| 65 | 65 | try { |
| 66 | - int k = w.getId().hashCode(); |
|
| 66 | + int k = w.getId() == null ? 0 : w.getId().hashCode(); |
|
| 67 | 67 | int v = 0; |
| 68 | - for(Wind wf : trackedRace.getOrCreateWindTrack(w).getFixes()) { |
|
| 69 | - v = v + (int) ( wf.getPosition().getLatDeg() + wf.getPosition().getLngDeg() + wf.getKilometersPerHour()); |
|
| 68 | + for (Wind wf : trackedRace.getOrCreateWindTrack(w).getFixes()) { |
|
| 69 | + v = v + (int) (wf.getPosition().getLatDeg() + wf.getPosition().getLngDeg() |
|
| 70 | + + wf.getKilometersPerHour()); |
|
| 70 | 71 | } |
| 71 | 72 | res = res ^ k; |
| 72 | - res = res ^ v; |
|
| 73 | + res = res ^ v; |
|
| 73 | 74 | } finally { |
| 74 | 75 | windTrack.unlockAfterRead(); |
| 75 | 76 | } |
| 76 | - |
|
| 77 | 77 | } |
| 78 | 78 | } |
| 79 | 79 | return res; |