ARTEMIS-4695 BAD_COPY_PASTE in ActiveMQScheduledLeaseLock.java
In the detectAndReportRenewSlowness() method, the logger.error() and logger.warn() methods are called 3 times. In two of the three calls, the method arguments correspond to parameters that are tested in the if() conditional construct. Also, the arguments of the logger.error() and logger.warn() methods are identical in lines 139 and 141, respectively, which may indicate that they were copied incorrectly.
This commit is contained in:
parent
fc13a39c6f
commit
bc86a0a481
|
@ -136,7 +136,7 @@ final class ActiveMQScheduledLeaseLock extends ActiveMQScheduledComponent implem
|
||||||
final long measuredRenewPeriodNanos = renewStart - lastRenewStart;
|
final long measuredRenewPeriodNanos = renewStart - lastRenewStart;
|
||||||
final long measuredRenewPeriodMillis = TimeUnit.NANOSECONDS.toMillis(measuredRenewPeriodNanos);
|
final long measuredRenewPeriodMillis = TimeUnit.NANOSECONDS.toMillis(measuredRenewPeriodNanos);
|
||||||
if (measuredRenewPeriodMillis - expirationMillis > 100) {
|
if (measuredRenewPeriodMillis - expirationMillis > 100) {
|
||||||
logger.error("{} lock {} renew period lasted {} ms instead of {} ms", lockName, lostLock ? "failed" : "successful", measuredRenewPeriodMillis, expectedRenewPeriodMillis);
|
logger.error("{} lock {} renew period lasted {} ms instead of {} ms", lockName, lostLock ? "failed" : "successful", measuredRenewPeriodMillis, expirationMillis);
|
||||||
} else if (measuredRenewPeriodMillis - expectedRenewPeriodMillis > 100) {
|
} else if (measuredRenewPeriodMillis - expectedRenewPeriodMillis > 100) {
|
||||||
logger.warn("{} lock {} renew period lasted {} ms instead of {} ms", lockName, lostLock ? "failed" : "successful", measuredRenewPeriodMillis, expectedRenewPeriodMillis);
|
logger.warn("{} lock {} renew period lasted {} ms instead of {} ms", lockName, lostLock ? "failed" : "successful", measuredRenewPeriodMillis, expectedRenewPeriodMillis);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue