Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/HYKFacet.java @ 3602:e1fd2dfdcb80
Issue #806 and NullPointerExceptions in CrossSectionGenerator fixed
flys-artifacts/trunk@5228 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Christian Lins <christian.lins@intevation.de> |
---|---|
date | Wed, 22 Aug 2012 10:18:00 +0000 |
parents | cd5eb8f5f6f1 |
children |
comparison
equal
deleted
inserted
replaced
3601:6c94153cc4a4 | 3602:e1fd2dfdcb80 |
---|---|
1 package de.intevation.flys.artifacts.model; | 1 package de.intevation.flys.artifacts.model; |
2 | |
3 import de.intevation.artifactdatabase.state.Facet; | |
4 import de.intevation.artifacts.Artifact; | |
5 import de.intevation.artifacts.CallContext; | |
6 import de.intevation.artifacts.DataProvider; | |
7 import de.intevation.flys.artifacts.HYKArtifact; | |
8 import de.intevation.flys.artifacts.states.DefaultState.ComputeType; | |
9 import de.intevation.flys.model.FastCrossSectionLine; | |
2 | 10 |
3 import java.util.List; | 11 import java.util.List; |
4 | 12 |
5 import org.apache.log4j.Logger; | 13 import org.apache.log4j.Logger; |
6 | |
7 import de.intevation.artifacts.Artifact; | |
8 import de.intevation.artifacts.CallContext; | |
9 import de.intevation.artifacts.DataProvider; | |
10 | |
11 import de.intevation.artifactdatabase.state.Facet; | |
12 | |
13 import de.intevation.flys.artifacts.HYKArtifact; | |
14 | |
15 import de.intevation.flys.artifacts.states.DefaultState.ComputeType; | |
16 import de.intevation.flys.model.FastCrossSectionLine; | |
17 | 14 |
18 | 15 |
19 /** | 16 /** |
20 * Trival Facet for HYKs | 17 * Trival Facet for HYKs |
21 */ | 18 */ |
37 * computation. | 34 * computation. |
38 * | 35 * |
39 * @param art artifact to get data from. | 36 * @param art artifact to get data from. |
40 * @param context ignored | 37 * @param context ignored |
41 */ | 38 */ |
42 public Object getData(Artifact art, CallContext context) { | 39 @Override |
40 public Object getData(Artifact art, CallContext context) { | |
43 logger.debug("HYKFacet.getData"); | 41 logger.debug("HYKFacet.getData"); |
44 | 42 |
45 String dataKey = CrossSectionFacet.BLACKBOARD_CS_MASTER_DATA; | 43 String dataKey = CrossSectionFacet.BLACKBOARD_CS_MASTER_DATA; |
46 | 44 |
47 List<DataProvider> providers = context.getDataProvider(dataKey); | 45 List<DataProvider> providers = context.getDataProvider(dataKey); |
50 return null; | 48 return null; |
51 } | 49 } |
52 | 50 |
53 FastCrossSectionLine crossSection = (FastCrossSectionLine) providers.get(0) | 51 FastCrossSectionLine crossSection = (FastCrossSectionLine) providers.get(0) |
54 .provideData(dataKey, null, context); | 52 .provideData(dataKey, null, context); |
53 | |
54 if(crossSection == null) { | |
55 logger.debug("getData: crossSection is null"); | |
56 return null; | |
57 } | |
55 | 58 |
56 double km = crossSection.getKm(); | 59 double km = crossSection.getKm(); |
57 logger.debug("HYKFacet.getData: Master Cross Section is at km: " + km); | 60 logger.debug("HYKFacet.getData: Master Cross Section is at km: " + km); |
58 | 61 |
59 // Set this km at hyk artifact to be evaluated. | 62 // Set this km at hyk artifact to be evaluated. |