提交 2bc541a0 authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Fix long lines and whitespace

上级 905e5fb6
...@@ -1525,27 +1525,30 @@ public class Function extends Expression implements FunctionCall { ...@@ -1525,27 +1525,30 @@ public class Function extends Expression implements FunctionCall {
} else if (v1 instanceof ValueDate) { } else if (v1 instanceof ValueDate) {
// Case where the value is of type date '2000:01:01', we have to retrieve the total // Case where the value is of type date '2000:01:01', we have to retrieve the
// number of days and multiply it by the number of seconds in a day. // total number of days and multiply it by the number of seconds in a day.
result = ValueDecimal.get(numberOfDays.multiply(secondsPerDay)); result = ValueDecimal.get(numberOfDays.multiply(secondsPerDay));
} else if (v1 instanceof ValueTimestampTimeZone) { } else if (v1 instanceof ValueTimestampTimeZone) {
// Case where the value is a of type ValueTimestampTimeZone ('2000:01:01 10:00:00+05). // Case where the value is a of type ValueTimestampTimeZone
// We retrieve the time zone offset in minute // ('2000:01:01 10:00:00+05').
// We retrieve the time zone offset in minutes
ValueTimestampTimeZone v = (ValueTimestampTimeZone) v1; ValueTimestampTimeZone v = (ValueTimestampTimeZone) v1;
BigDecimal timeZoneOffsetSeconds = new BigDecimal(v.getTimeZoneOffsetMins() * 60); BigDecimal timeZoneOffsetSeconds = new BigDecimal(v.getTimeZoneOffsetMins() * 60);
// Sum the time in nanoseconds and the total number of days in seconds // Sum the time in nanoseconds and the total number of days in seconds
// and adding the timeZone offset in seconds. // and adding the timeZone offset in seconds.
result = ValueDecimal.get(timeNanosBigDecimal.divide(nanosSeconds) result = ValueDecimal.get(timeNanosBigDecimal.divide(nanosSeconds)
.add(numberOfDays.multiply(secondsPerDay)) .add(numberOfDays.multiply(secondsPerDay)).subtract(timeZoneOffsetSeconds));
.subtract(timeZoneOffsetSeconds));
} else { } else {
// By default, we have the date and the time ('2000:01:01 10:00:00) if no type is given. // By default, we have the date and the time ('2000:01:01 10:00:00') if no type
// We just have to sum the time in nanoseconds and the total number of days in seconds. // is given.
result = ValueDecimal.get(timeNanosBigDecimal.divide(nanosSeconds).add(numberOfDays.multiply(secondsPerDay))); // We just have to sum the time in nanoseconds and the total number of days in
// seconds.
result = ValueDecimal
.get(timeNanosBigDecimal.divide(nanosSeconds).add(numberOfDays.multiply(secondsPerDay)));
} }
} }
break; break;
......
...@@ -224,7 +224,8 @@ public class ChangeFileEncryption extends Tool { ...@@ -224,7 +224,8 @@ public class ChangeFileEncryption extends Tool {
try (FileChannel fileIn = getFileChannel(fileName, "r", decryptKey)){ try (FileChannel fileIn = getFileChannel(fileName, "r", decryptKey)){
try(InputStream inStream = new FileChannelInputStream(fileIn, true)) { try(InputStream inStream = new FileChannelInputStream(fileIn, true)) {
FileUtils.delete(temp); FileUtils.delete(temp);
try (OutputStream outStream = new FileChannelOutputStream(getFileChannel(temp, "rw", encryptKey), true)) { try (OutputStream outStream = new FileChannelOutputStream(getFileChannel(temp, "rw", encryptKey),
true)) {
byte[] buffer = new byte[4 * 1024]; byte[] buffer = new byte[4 * 1024];
long remaining = fileIn.size(); long remaining = fileIn.size();
long total = remaining; long total = remaining;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论