Source:
private void processNextPeriodicMeterReadsForDaily(final List<PeriodicMeterReadsGas> periodicMeterReads, final List<DataObject> bufferedObjects, final DateTime bufferedDateTime, final Channel channel, final boolean isSelectiveAccessSupported) throws ProtocolAdapterException { final AmrProfileStatusCode amrProfileStatusCode = this.readAmrProfileStatusCode(bufferedObjects .get(BUFFER_INDEX_AMR_STATUS)); DataObject gasValue = null; DataObject gasCaptureTime = null; if (isSelectiveAccessSupported) { gasValue = bufferedObjects.get(INDEX_DAYLY_SELECTIVE_ACCESS_MBUS_VALUE_MAP.get(channel.getChannelNumber())); gasCaptureTime = bufferedObjects.get(INDEX_DAYLY_SELECTIVE_ACCESS_MBUS_VALUE_CAPTURE_TIME_MAP.get(channel .getChannelNumber())); } else { gasValue = bufferedObjects.get(INDEX_DAYLY_MBUS_VALUE_MAP.get(channel.getChannelNumber())); gasCaptureTime = bufferedObjects .get(INDEX_DAYLY_MBUS_VALUE_CAPTURE_TIME_MAP.get(channel.getChannelNumber())); } LOGGER.debug("gasValue: {}", this.dlmsHelperService.getDebugInfo(gasValue)); LOGGER.debug("gasCaptureTime: {}", this.dlmsHelperService.getDebugInfo(gasCaptureTime)); final CosemDateTime cosemDateTime = this.dlmsHelperService.fromDateTimeValue((byte[]) gasCaptureTime.value()); final Date captureTime; if (cosemDateTime.isDateTimeSpecified()) { captureTime = cosemDateTime.asDateTime().toDate(); } else { throw new ProtocolAdapterException("Unexpected null/unspecified value for Gas Capture Time"); } final PeriodicMeterReadsGas nextPeriodicMeterReads = new PeriodicMeterReadsGas(bufferedDateTime.toDate(), (Long) gasValue.value(), captureTime, amrProfileStatusCode); periodicMeterReads.add(nextPeriodicMeterReads); }

Target:
private void processNextPeriodicMeterReadsForDaily(final List<PeriodicMeterReadsGas> periodicMeterReads, final List<DataObject> bufferedObjects, final DateTime bufferedDateTime, final Channel channel, final boolean isSelectiveAccessSupported) throws ProtocolAdapterException { final AmrProfileStatusCode amrProfileStatusCode = this.readAmrProfileStatusCode(bufferedObjects .get(BUFFER_INDEX_AMR_STATUS)); DataObject gasValue = null; DataObject gasCaptureTime = null; if (isSelectiveAccessSupported) { gasValue = bufferedObjects.get(INDEX_DAILY_SELECTIVE_ACCESS_MBUS_VALUE_MAP.get(channel.getChannelNumber())); gasCaptureTime = bufferedObjects.get(INDEX_DAILY_SELECTIVE_ACCESS_MBUS_VALUE_CAPTURE_TIME_MAP.get(channel .getChannelNumber())); } else { gasValue = bufferedObjects.get(INDEX_DAILY_MBUS_VALUE_MAP.get(channel.getChannelNumber())); gasCaptureTime = bufferedObjects .get(INDEX_DAILY_MBUS_VALUE_CAPTURE_TIME_MAP.get(channel.getChannelNumber())); } LOGGER.debug("gasValue: {}", this.dlmsHelperService.getDebugInfo(gasValue)); LOGGER.debug("gasCaptureTime: {}", this.dlmsHelperService.getDebugInfo(gasCaptureTime)); final CosemDateTime cosemDateTime = this.dlmsHelperService.fromDateTimeValue((byte[]) gasCaptureTime.value()); final Date captureTime; if (cosemDateTime.isDateTimeSpecified()) { captureTime = cosemDateTime.asDateTime().toDate(); } else { throw new ProtocolAdapterException("Unexpected null/unspecified value for Gas Capture Time"); } final PeriodicMeterReadsGas nextPeriodicMeterReads = new PeriodicMeterReadsGas(bufferedDateTime.toDate(), (Long) gasValue.value(), captureTime, amrProfileStatusCode); periodicMeterReads.add(nextPeriodicMeterReads); }