Skip to content

Commit 7073590

Browse files
committed
[ignore] Mark variables as 'final'
1 parent 7a8852d commit 7073590

File tree

2 files changed

+20
-16
lines changed

2 files changed

+20
-16
lines changed

exist-core/src/main/java/org/exist/management/impl/RecentQueryHistory.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@
2929
*/
3030
public class RecentQueryHistory {
3131

32-
private int idx;
33-
private String sourceKey;
34-
private int recentInvocationCount;
35-
private long mostRecentExecutionTime;
36-
private long mostRecentExecutionDuration;
37-
private String requestURI;
32+
private final int idx;
33+
private final String sourceKey;
34+
private final int recentInvocationCount;
35+
private final long mostRecentExecutionTime;
36+
private final long mostRecentExecutionDuration;
37+
private final String requestURI;
3838

39-
public RecentQueryHistory(int idx, ProcessMonitor.QueryHistory queryHistory) {
39+
public RecentQueryHistory(final int idx, final ProcessMonitor.QueryHistory queryHistory) {
4040
this.idx = idx;
4141
this.sourceKey = queryHistory.getSource();
4242
this.recentInvocationCount = queryHistory.getInvocationCount();

exist-core/src/main/java/org/exist/management/impl/RunningQuery.java

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@
2929
*/
3030
public class RunningQuery {
3131

32-
int id;
33-
String sourceType;
34-
String sourceKey;
35-
boolean terminating;
36-
String requestURI;
37-
String thread;
38-
long elapsed;
32+
private final int id;
33+
private final String sourceType;
34+
private final String sourceKey;
35+
private final boolean terminating;
36+
private final String requestURI;
37+
private final String thread;
38+
private final long startTime;
3939

4040
public RunningQuery(final XQueryWatchDog watchdog, final String requestURI) {
4141
this.id = watchdog.getContext().hashCode();
@@ -44,7 +44,7 @@ public RunningQuery(final XQueryWatchDog watchdog, final String requestURI) {
4444
this.terminating = watchdog.isTerminating();
4545
this.requestURI = requestURI;
4646
this.thread = watchdog.getRunningThread();
47-
this.elapsed = System.currentTimeMillis() - watchdog.getStartTime();
47+
this.startTime = watchdog.getStartTime();
4848
}
4949

5050
public int getId() {
@@ -71,7 +71,11 @@ public String getThread() {
7171
return thread;
7272
}
7373

74+
public long getStartTime() {
75+
return startTime;
76+
}
77+
7478
public long getElapsed() {
75-
return elapsed;
79+
return System.currentTimeMillis() - startTime;
7680
}
7781
}

0 commit comments

Comments
 (0)