@@ -18,7 +18,7 @@ information: Portions Copyright [yyyy] [name of copyright owner]
1818
1919CDDL HEADER END
2020
21- Copyright (c) 2005, 2022 , Oracle and/or its affiliates. All rights reserved.
21+ Copyright (c) 2005, 2025 , Oracle and/or its affiliates. All rights reserved.
2222Portions Copyright 2011 Jens Elkner.
2323Portions Copyright (c) 2018-2020, Chris Fraire <[email protected] >. 2424--%>
@@ -59,7 +59,7 @@ org.opengrok.indexer.web.Util"
5959
6060 String path = cfg. getPath();
6161
62- if (path. length() > 0 ) {
62+ if (! path. isEmpty() ) {
6363 String primePath = path;
6464 Project project = cfg. getProject();
6565 if (project != null ) {
@@ -148,7 +148,7 @@ include file="/httpheader.jspf"
148148 request. setAttribute(" history.jsp-slider" , Util . createSlider(startIndex, max, totalHits, request));
149149% >
150150 <div id =" Masthead" >History log of
151- <%= Util . breadcrumbPath(context + Prefix . XREF_P , path,' /' ," " ,true ,cfg. isDir()) % >
151+ <%= Util . breadcrumbPath(context + Prefix . XREF_P , path, ' /' , " " , true , cfg. isDir()) % >
152152 (Results <span class =" bold" > <%= totalHits != 0 ? startIndex + 1 : 0 % > – <%= startIndex + thisPageIndex
153153 % > </span > of <span class =" bold" ><%= totalHits % > </span >)
154154 </div >
@@ -231,11 +231,11 @@ document.domReady.push(function() {domReadyHistory();});
231231 <th ><input type =" submit" value =" Compare " />
232232 <% if (hist. getHistoryEntries(). size() > revision1Index && revision1Index >= 0 ) { % >
233233 <input type =" hidden" id =" input_r1" name =" <%= QueryParameters . REVISION_1_PARAM % >"
234- value =" <%= path + ' @' + hist. getHistoryEntries(). get(revision1Index). getRevision() % >" />
234+ value =" <%= Util . uriEncodePath( path) + ' @' + hist. getHistoryEntries(). get(revision1Index). getRevision() % >" />
235235 <% } % >
236236 <% if (hist. getHistoryEntries(). size() > revision2Index && revision2Index >= 0 ) { % >
237237 <input type =" hidden" id =" input_r2" name =" <%= QueryParameters . REVISION_2_PARAM % >"
238- value =" <%= path + ' @' + hist. getHistoryEntries(). get(revision2Index). getRevision() % >" />
238+ value =" <%= Util . uriEncodePath( path) + ' @' + hist. getHistoryEntries(). get(revision2Index). getRevision() % >" />
239239 <% } % >
240240 </th ><%
241241 }
@@ -259,11 +259,11 @@ document.domReady.push(function() {domReadyHistory();});
259259 int count= 0 ;
260260 for (HistoryEntry entry : hist. getHistoryEntries(maxItems, startIndex)) {
261261 String dispRev = entry. getDisplayRevision();
262- if (dispRev == null || dispRev. length() == 0 ) {
262+ if (dispRev == null || dispRev. isEmpty() ) {
263263 dispRev = " " ;
264264 }
265265 String rev = entry. getRevision();
266- if (rev == null || rev. length() == 0 ) {
266+ if (rev == null || rev. isEmpty() ) {
267267 rev = " " ;
268268 }
269269 String tags = hist. getTags(). get(rev);
@@ -323,7 +323,7 @@ document.domReady.push(function() {domReadyHistory();});
323323 data-revision-1 =" <%= revision1Index % >"
324324 data-revision-2 =" <%= (startIndex + count) % >"
325325 data-diff-revision =" <%= QueryParameters . REVISION_2_PARAM % >"
326- data-revision-path =" <%= path + ' @' + hist. getHistoryEntries(). get(startIndex + count). getRevision() % >"
326+ data-revision-path =" <%= Util . htmlize( path) + ' @' + hist. getHistoryEntries(). get(startIndex + count). getRevision() % >"
327327 <%
328328 if (count + startIndex < revision2Index || (count + startIndex > revision2Index && count + startIndex <= revision1Index - 1)) {
329329 // revision2 enabled
@@ -354,7 +354,7 @@ document.domReady.push(function() {domReadyHistory();});
354354 String author = entry. getAuthor();
355355 if (author == null ) {
356356 % > (no author)<%
357- } else if (userPage != null && userPage. length() > 0 ) {
357+ } else if (userPage != null && ! userPage. isEmpty() ) {
358358 String alink = Util . getEmail(author);
359359 % > <a href =" <%= userPage + Util . htmlize(alink) + userPageSuffix
360360 % >" ><%= Util . htmlize(author) % > </a ><%
@@ -367,10 +367,10 @@ document.domReady.push(function() {domReadyHistory();});
367367 int summaryLength = Math . max(10 , cfg. getRevisionMessageCollapseThreshold());
368368 String cout = Util . htmlize(entry. getMessage());
369369
370- if (bugPage != null && bugPage. length() > 0 && bugPattern != null ) {
370+ if (bugPage != null && ! bugPage. isEmpty() && bugPattern != null ) {
371371 cout = Util . linkifyPattern(cout, bugPattern, " $1" , Util . completeUrl(bugPage + " $1" , request));
372372 }
373- if (reviewPage != null && reviewPage. length() > 0 && reviewPattern != null ) {
373+ if (reviewPage != null && ! reviewPage. isEmpty() && reviewPattern != null ) {
374374 cout = Util . linkifyPattern(cout, reviewPattern, " $1" , Util . completeUrl(reviewPage + " $1" , request));
375375 }
376376
@@ -380,10 +380,10 @@ document.domReady.push(function() {domReadyHistory();});
380380 showSummary = true ;
381381 coutSummary = coutSummary. substring(0 , summaryLength - 1 );
382382 coutSummary = Util . htmlize(coutSummary);
383- if (bugPage != null && bugPage. length() > 0 && bugPattern != null ) {
383+ if (bugPage != null && ! bugPage. isEmpty() && bugPattern != null ) {
384384 coutSummary = Util . linkifyPattern(coutSummary, bugPattern, " $1" , Util . completeUrl(bugPage + " $1" , request));
385385 }
386- if (reviewPage != null && reviewPage. length() > 0 && reviewPattern != null ) {
386+ if (reviewPage != null && ! reviewPage. isEmpty() && reviewPattern != null ) {
387387 coutSummary = Util . linkifyPattern(coutSummary, reviewPattern, " $1" , Util . completeUrl(reviewPage + " $1" , request));
388388 }
389389 }
0 commit comments