Source:
public List<Sample> getLastDayDeviceName( @Scope({OAuthScope.SENSORS_BASIC}) final AccessToken accessToken, @PathParam("sensor") String sensor, @PathParam("device_name") String deviceName, @QueryParam("from") Long queryEndTimestampInUTC) { if (hiddenSensors.contains(sensor)) { throw new WebApplicationException(Response.status(Response.Status.NOT_FOUND).build()); } final int slotDurationInMinutes = 5; final long queryStartTimeInUTC = new DateTime(queryEndTimestampInUTC, DateTimeZone.UTC).minusDays(1).getMillis(); validateQueryRange(queryEndTimestampInUTC, DateTime.now(), accessToken.accountId, allowedRangeInSeconds); final Optional<DeviceAccountPair> deviceIdPair = deviceDAO.getMostRecentSensePairByAccountId(accessToken.accountId); if (!deviceIdPair.isPresent()) { throw new WebApplicationException(Response.status(Response.Status.NOT_FOUND).build()); } Optional<Device.Color> color = Optional.absent(); if (this.hasColorCompensationEnabled(accessToken.accountId)) { color = senseColorDAO.getColorForSense(deviceName); } final Optional<Calibration> calibrationOptional = getCalibrationStrict(deviceName); List<Sample> timeSeries; if (hasDeviceDataDynamoDBEnabled(accessToken.accountId)) { timeSeries = deviceDataDAODynamoDB.generateTimeSeriesByUTCTime(queryStartTimeInUTC, queryEndTimestampInUTC, accessToken.accountId, deviceIdPair.get().externalDeviceId, slotDurationInMinutes, sensor, missingDataDefaultValue(accessToken.accountId), color, calibrationOptional); } else { timeSeries = deviceDataDAO.generateTimeSeriesByUTCTime(queryStartTimeInUTC, queryEndTimestampInUTC, accessToken.accountId, deviceIdPair.get().internalDeviceId, slotDurationInMinutes, sensor, missingDataDefaultValue(accessToken.accountId), color, calibrationOptional); } return adjustTimeSeries(timeSeries, sensor, deviceName); }

Target:
public List<Sample> getLastDayDeviceName( @Scope({OAuthScope.SENSORS_BASIC}) final AccessToken accessToken, @PathParam("sensor") String sensor, @PathParam("device_name") String deviceName, @QueryParam("from") Long queryEndTimestampInUTC) { if (hiddenSensors.contains(sensor)) { throw new WebApplicationException(Response.status(Response.Status.NOT_FOUND).build()); } final int slotDurationInMinutes = 5; final long queryStartTimeInUTC = new DateTime(queryEndTimestampInUTC, DateTimeZone.UTC).minusDays(1).getMillis(); validateQueryRange(queryEndTimestampInUTC, DateTime.now(), accessToken.accountId, allowedRangeInSeconds); final Optional<DeviceAccountPair> deviceIdPair = deviceDAO.getMostRecentSensePairByAccountId(accessToken.accountId); if (!deviceIdPair.isPresent()) { throw new WebApplicationException(Response.status(Response.Status.NOT_FOUND).build()); } Optional<Device.Color> color = Optional.absent(); if (this.hasColorCompensationEnabled(accessToken.accountId)) { color = senseColorDAO.getColorForSense(deviceName); } final Optional<Calibration> calibrationOptional = getCalibrationStrict(deviceName); final List<Sample> timeSeries; if (hasDeviceDataDynamoDBEnabled(accessToken.accountId)) { timeSeries = deviceDataDAODynamoDB.generateTimeSeriesByUTCTime(queryStartTimeInUTC, queryEndTimestampInUTC, accessToken.accountId, deviceIdPair.get().externalDeviceId, slotDurationInMinutes, sensor, missingDataDefaultValue(accessToken.accountId), color, calibrationOptional); } else { timeSeries = deviceDataDAO.generateTimeSeriesByUTCTime(queryStartTimeInUTC, queryEndTimestampInUTC, accessToken.accountId, deviceIdPair.get().internalDeviceId, slotDurationInMinutes, sensor, missingDataDefaultValue(accessToken.accountId), color, calibrationOptional); } return adjustTimeSeries(timeSeries, sensor, deviceName); }