@@ -20,7 +20,7 @@ CDDL HEADER END
2020
2121Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
2222Portions Copyright 2011 Jens Elkner.
23- Portions Copyright (c) 2018, Chris Fraire <cfraire@me.com>.
23+ Portions Copyright (c) 2018-2019 , Chris Fraire <cfraire@me.com>.
2424
2525--%>
2626<%@page contentType =" text/html; charset=UTF-8" pageEncoding =" UTF-8" %>
@@ -31,12 +31,12 @@ Portions Copyright (c) 2018, Chris Fraire <cfraire@me.com>.
3131java.text.Format,
3232java.text.SimpleDateFormat,
3333java.util.Date,
34+ java.util.Objects,
3435java.util.Set,
3536java.util.regex.Pattern,
3637
3738org.opengrok.indexer.history.History,
3839org.opengrok.indexer.history.HistoryEntry,
39- org.opengrok.indexer.history.HistoryException,
4040org.opengrok.indexer.configuration.RuntimeEnvironment"
4141%>
4242<% /* ---------------------- history.jsp start --------------------- */
@@ -62,7 +62,7 @@ org.opengrok.indexer.configuration.RuntimeEnvironment"
6262 }
6363
6464 if (hist == null ) {
65- /**
65+ /*
6666 * The history is not available even for a renamed file.
6767 * Send 404 Not Found.
6868 */
@@ -80,7 +80,6 @@ include file="httpheader.jspf"
8080% >
8181<%
8282{
83- PageConfig cfg = PageConfig . get(request);
8483 if ((request. getAttribute(" history.jsp-hist" )) != null ) {
8584% >
8685<body >
@@ -111,7 +110,7 @@ include file="pageheader.jspf"
111110 String context = request. getContextPath();
112111 String path = cfg. getPath();
113112
114- History hist = null ;
113+ History hist;
115114 if ((hist = (History ) request. getAttribute(" history.jsp-hist" )) != null ) {
116115
117116 int start = cfg. getSearchStart();
@@ -146,7 +145,7 @@ include file="minisearch.jspf"
146145 PageConfig cfg = PageConfig . get(request);
147146 String context = request. getContextPath();
148147 String path = cfg. getPath();
149- History hist = null ;
148+ History hist;
150149 if ((hist = (History ) request. getAttribute(" history.jsp-hist" )) != null ) {
151150 RuntimeEnvironment env = cfg. getEnv();
152151 String uriEncodedName = cfg. getUriEncodedPath();
@@ -249,7 +248,6 @@ document.domReady.push(function() {domReadyHistory();});
249248 <td ><%= rev % > </td ><%
250249 } else {
251250 if (entry. isActive()) {
252- String rp = uriEncodedName;
253251 StringBuffer urlBuffer = request. getRequestURL();
254252 if (request. getQueryString() != null ) {
255253 urlBuffer. append(' ?' ). append(request. getQueryString());
@@ -258,7 +256,7 @@ document.domReady.push(function() {domReadyHistory();});
258256 % >
259257 <td ><a href =" <%= urlBuffer % >"
260258 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) % >" ><%=
262260 rev % > </a ></td >
263261 <td ><%
264262 % > <input type =" radio"
@@ -363,7 +361,7 @@ document.domReady.push(function() {domReadyHistory();});
363361 % > <div class =" filelist-hidden" ><br /><%
364362 for (String ifile : files) {
365363 String jfile = Util . stripPathPrefix(path, ifile);
366- if (rev == " " ) {
364+ if (Objects . equals( rev, " " ) ) {
367365 % >
368366<a class =" h" href =" <%= context + Prefix . XREF_P + ifile % >" ><%= jfile % > </a ><br /><%
369367 } else {
@@ -383,7 +381,7 @@ document.domReady.push(function() {domReadyHistory();});
383381 <tr >
384382 <td colspan =" 5" >
385383<%
386- String slider = null ;
384+ String slider;
387385 if ((slider = (String ) request. getAttribute(" history.jsp-slider" )) != null ) {
388386 // NOTE: shouldn't happen that it doesn't have this attribute
389387 % > <p class =" slider" ><%= slider % > </p ><%
0 commit comments