@@ -20,7 +20,7 @@ CDDL HEADER END
20
20
21
21
Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
22
22
Portions Copyright 2011 Jens Elkner.
23
- Portions Copyright (c) 2018, Chris Fraire <[email protected] >.
23
+ Portions Copyright (c) 2018-2019 , Chris Fraire <[email protected] >.
24
24
25
25
--%>
26
26
<%@page contentType =" text/html; charset=UTF-8" pageEncoding =" UTF-8" %>
31
31
java.text.Format,
32
32
java.text.SimpleDateFormat,
33
33
java.util.Date,
34
+ java.util.Objects,
34
35
java.util.Set,
35
36
java.util.regex.Pattern,
36
37
37
38
org.opengrok.indexer.history.History,
38
39
org.opengrok.indexer.history.HistoryEntry,
39
- org.opengrok.indexer.history.HistoryException,
40
40
org.opengrok.indexer.configuration.RuntimeEnvironment"
41
41
%>
42
42
<% /* ---------------------- history.jsp start --------------------- */
@@ -62,7 +62,7 @@ org.opengrok.indexer.configuration.RuntimeEnvironment"
62
62
}
63
63
64
64
if (hist == null ) {
65
- /**
65
+ /*
66
66
* The history is not available even for a renamed file.
67
67
* Send 404 Not Found.
68
68
*/
@@ -80,7 +80,6 @@ include file="httpheader.jspf"
80
80
% >
81
81
<%
82
82
{
83
- PageConfig cfg = PageConfig . get(request);
84
83
if ((request. getAttribute(" history.jsp-hist" )) != null ) {
85
84
% >
86
85
<body >
@@ -111,7 +110,7 @@ include file="pageheader.jspf"
111
110
String context = request. getContextPath();
112
111
String path = cfg. getPath();
113
112
114
- History hist = null ;
113
+ History hist;
115
114
if ((hist = (History ) request. getAttribute(" history.jsp-hist" )) != null ) {
116
115
117
116
int start = cfg. getSearchStart();
@@ -146,7 +145,7 @@ include file="minisearch.jspf"
146
145
PageConfig cfg = PageConfig . get(request);
147
146
String context = request. getContextPath();
148
147
String path = cfg. getPath();
149
- History hist = null ;
148
+ History hist;
150
149
if ((hist = (History ) request. getAttribute(" history.jsp-hist" )) != null ) {
151
150
RuntimeEnvironment env = cfg. getEnv();
152
151
String uriEncodedName = cfg. getUriEncodedPath();
@@ -249,7 +248,6 @@ document.domReady.push(function() {domReadyHistory();});
249
248
<td ><%= rev % > </td ><%
250
249
} else {
251
250
if (entry. isActive()) {
252
- String rp = uriEncodedName;
253
251
StringBuffer urlBuffer = request. getRequestURL();
254
252
if (request. getQueryString() != null ) {
255
253
urlBuffer. append(' ?' ). append(request. getQueryString());
@@ -258,7 +256,7 @@ document.domReady.push(function() {domReadyHistory();});
258
256
% >
259
257
<td ><a href =" <%= urlBuffer % >"
260
258
title =" link to revision line" >#</a >
261
- <a href =" <%= context + Prefix . XREF_P + rp + " ?r=" + Util . URIEncode(rev) % >" ><%=
259
+ <a href =" <%= context + Prefix . XREF_P + uriEncodedName + " ?r=" + Util . URIEncode(rev) % >" ><%=
262
260
rev % > </a ></td >
263
261
<td ><%
264
262
% > <input type =" radio"
@@ -363,7 +361,7 @@ document.domReady.push(function() {domReadyHistory();});
363
361
% > <div class =" filelist-hidden" ><br /><%
364
362
for (String ifile : files) {
365
363
String jfile = Util . stripPathPrefix(path, ifile);
366
- if (rev == " " ) {
364
+ if (Objects . equals( rev, " " ) ) {
367
365
% >
368
366
<a class =" h" href =" <%= context + Prefix . XREF_P + ifile % >" ><%= jfile % > </a ><br /><%
369
367
} else {
@@ -383,7 +381,7 @@ document.domReady.push(function() {domReadyHistory();});
383
381
<tr >
384
382
<td colspan =" 5" >
385
383
<%
386
- String slider = null ;
384
+ String slider;
387
385
if ((slider = (String ) request. getAttribute(" history.jsp-slider" )) != null ) {
388
386
// NOTE: shouldn't happen that it doesn't have this attribute
389
387
% > <p class =" slider" ><%= slider % > </p ><%
0 commit comments