Mercurial > dive4elements > river
comparison flys-backend/src/main/java/de/intevation/flys/importer/parsers/W80Parser.java @ 4777:34398f424cfd
W80Parser: Return null if no year set to behave like other parsers and avoid
building a (wrong) TimeSpan object.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Mon, 07 Jan 2013 11:55:46 +0100 |
parents | 92a08725bc63 |
children | 7dd5baca4f53 |
comparison
equal
deleted
inserted
replaced
4776:20b6ebf23916 | 4777:34398f424cfd |
---|---|
81 | 81 |
82 /** Get the year of this cross sections measurement. */ | 82 /** Get the year of this cross sections measurement. */ |
83 @Override | 83 @Override |
84 public Integer getYear() { | 84 public Integer getYear() { |
85 if (anchorDate == null) { | 85 if (anchorDate == null) { |
86 return Integer.valueOf(0); | 86 return null; |
87 } | 87 } |
88 Calendar dateCalendar = Calendar.getInstance(); | 88 Calendar dateCalendar = Calendar.getInstance(); |
89 dateCalendar.setTime(anchorDate); | 89 dateCalendar.setTime(anchorDate); |
90 return dateCalendar.get(Calendar.YEAR); | 90 return dateCalendar.get(Calendar.YEAR); |
91 } | 91 } |