Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/CrossSectionWaterLineFacet.java @ 4506:719680a282e5
CrossSectionWaterLineFacet: Guard class cast.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Wed, 14 Nov 2012 12:25:13 +0100 |
parents | 6153c50f78cf |
children |
comparison
equal
deleted
inserted
replaced
4505:6d3426aba65d | 4506:719680a282e5 |
---|---|
69 if (prevKm == null) | 69 if (prevKm == null) |
70 prevKm = new Double(-1d); | 70 prevKm = new Double(-1d); |
71 if (nextKm == null) | 71 if (nextKm == null) |
72 nextKm = new Double(-1d); | 72 nextKm = new Double(-1d); |
73 | 73 |
74 if (!(artifact instanceof WaterLineArtifact)) { | |
75 logger.error("CrossSectionWaterLineFacet needs WaterLineArtifact"); | |
76 return new Lines.LineData(new double[][] {}, 0d,0d); | |
77 } | |
74 WaterLineArtifact lineArtifact = (WaterLineArtifact) artifact; | 78 WaterLineArtifact lineArtifact = (WaterLineArtifact) artifact; |
75 | 79 |
76 if (crossSection != null) { | 80 if (crossSection != null) { |
77 return lineArtifact.getWaterLines(this.getIndex(), | 81 return lineArtifact.getWaterLines(this.getIndex(), |
78 (FastCrossSectionLine) crossSection, (Double) nextKm, | 82 (FastCrossSectionLine) crossSection, (Double) nextKm, |