Skip to content

Commit 5efc4d2

Browse files
sonar
1 parent 481ab12 commit 5efc4d2

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/main/java/edu/ie3/datamodel/io/processor/timeseries/TimeSeriesProcessor.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -286,18 +286,16 @@ private Map<String, String> handleEntry(T timeSeries, E entry) throws EntityProc
286286

287287
Map<String, GetterMethod> groundTempOneFieldToMethod =
288288
extractFieldToMethod(GROUND_TEMPERATURE_ONE);
289-
if (weatherValue.getGroundTemperatureValueOne().isPresent()) {
290-
valueResult.putAll(
291-
processObject(
292-
weatherValue.getGroundTemperatureValueOne().get(), groundTempOneFieldToMethod));
289+
Optional<GroundTemperatureValue> gtOneOpt = weatherValue.getGroundTemperatureValueOne();
290+
if (gtOneOpt.isPresent()) {
291+
valueResult.putAll(processObject(gtOneOpt.get(), groundTempOneFieldToMethod));
293292
}
294293

295294
Map<String, GetterMethod> groundTempTwoFieldToMethod =
296295
extractFieldToMethod(GROUND_TEMPERATURE_TWO);
297-
if (weatherValue.getGroundTemperatureValueTwo().isPresent()) {
298-
valueResult.putAll(
299-
processObject(
300-
weatherValue.getGroundTemperatureValueTwo().get(), groundTempTwoFieldToMethod));
296+
Optional<GroundTemperatureValue> gtTwoOpt = weatherValue.getGroundTemperatureValueTwo();
297+
if (gtTwoOpt.isPresent()) {
298+
valueResult.putAll(processObject(gtTwoOpt.get(), groundTempTwoFieldToMethod));
301299
}
302300
}
303301

0 commit comments

Comments
 (0)