@@ -18,7 +18,7 @@ information: Portions Copyright [yyyy] [name of copyright owner]
18
18
19
19
CDDL HEADER END
20
20
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.
22
22
Portions Copyright 2011 Jens Elkner.
23
23
Portions Copyright (c) 2018-2020, Chris Fraire <[email protected] >.
24
24
--%>
@@ -59,7 +59,7 @@ org.opengrok.indexer.web.Util"
59
59
60
60
String path = cfg. getPath();
61
61
62
- if (path. length() > 0 ) {
62
+ if (! path. isEmpty() ) {
63
63
String primePath = path;
64
64
Project project = cfg. getProject();
65
65
if (project != null ) {
@@ -148,7 +148,7 @@ include file="/httpheader.jspf"
148
148
request. setAttribute(" history.jsp-slider" , Util . createSlider(startIndex, max, totalHits, request));
149
149
% >
150
150
<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()) % >
152
152
(Results <span class =" bold" > <%= totalHits != 0 ? startIndex + 1 : 0 % > – <%= startIndex + thisPageIndex
153
153
% > </span > of <span class =" bold" ><%= totalHits % > </span >)
154
154
</div >
@@ -231,11 +231,11 @@ document.domReady.push(function() {domReadyHistory();});
231
231
<th ><input type =" submit" value =" Compare " />
232
232
<% if (hist. getHistoryEntries(). size() > revision1Index && revision1Index >= 0 ) { % >
233
233
<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() % >" />
235
235
<% } % >
236
236
<% if (hist. getHistoryEntries(). size() > revision2Index && revision2Index >= 0 ) { % >
237
237
<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() % >" />
239
239
<% } % >
240
240
</th ><%
241
241
}
@@ -259,11 +259,11 @@ document.domReady.push(function() {domReadyHistory();});
259
259
int count= 0 ;
260
260
for (HistoryEntry entry : hist. getHistoryEntries(maxItems, startIndex)) {
261
261
String dispRev = entry. getDisplayRevision();
262
- if (dispRev == null || dispRev. length() == 0 ) {
262
+ if (dispRev == null || dispRev. isEmpty() ) {
263
263
dispRev = " " ;
264
264
}
265
265
String rev = entry. getRevision();
266
- if (rev == null || rev. length() == 0 ) {
266
+ if (rev == null || rev. isEmpty() ) {
267
267
rev = " " ;
268
268
}
269
269
String tags = hist. getTags(). get(rev);
@@ -323,7 +323,7 @@ document.domReady.push(function() {domReadyHistory();});
323
323
data-revision-1 =" <%= revision1Index % >"
324
324
data-revision-2 =" <%= (startIndex + count) % >"
325
325
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() % >"
327
327
<%
328
328
if (count + startIndex < revision2Index || (count + startIndex > revision2Index && count + startIndex <= revision1Index - 1)) {
329
329
// revision2 enabled
@@ -354,7 +354,7 @@ document.domReady.push(function() {domReadyHistory();});
354
354
String author = entry. getAuthor();
355
355
if (author == null ) {
356
356
% > (no author)<%
357
- } else if (userPage != null && userPage. length() > 0 ) {
357
+ } else if (userPage != null && ! userPage. isEmpty() ) {
358
358
String alink = Util . getEmail(author);
359
359
% > <a href =" <%= userPage + Util . htmlize(alink) + userPageSuffix
360
360
% >" ><%= Util . htmlize(author) % > </a ><%
@@ -367,10 +367,10 @@ document.domReady.push(function() {domReadyHistory();});
367
367
int summaryLength = Math . max(10 , cfg. getRevisionMessageCollapseThreshold());
368
368
String cout = Util . htmlize(entry. getMessage());
369
369
370
- if (bugPage != null && bugPage. length() > 0 && bugPattern != null ) {
370
+ if (bugPage != null && ! bugPage. isEmpty() && bugPattern != null ) {
371
371
cout = Util . linkifyPattern(cout, bugPattern, " $1" , Util . completeUrl(bugPage + " $1" , request));
372
372
}
373
- if (reviewPage != null && reviewPage. length() > 0 && reviewPattern != null ) {
373
+ if (reviewPage != null && ! reviewPage. isEmpty() && reviewPattern != null ) {
374
374
cout = Util . linkifyPattern(cout, reviewPattern, " $1" , Util . completeUrl(reviewPage + " $1" , request));
375
375
}
376
376
@@ -380,10 +380,10 @@ document.domReady.push(function() {domReadyHistory();});
380
380
showSummary = true ;
381
381
coutSummary = coutSummary. substring(0 , summaryLength - 1 );
382
382
coutSummary = Util . htmlize(coutSummary);
383
- if (bugPage != null && bugPage. length() > 0 && bugPattern != null ) {
383
+ if (bugPage != null && ! bugPage. isEmpty() && bugPattern != null ) {
384
384
coutSummary = Util . linkifyPattern(coutSummary, bugPattern, " $1" , Util . completeUrl(bugPage + " $1" , request));
385
385
}
386
- if (reviewPage != null && reviewPage. length() > 0 && reviewPattern != null ) {
386
+ if (reviewPage != null && ! reviewPage. isEmpty() && reviewPattern != null ) {
387
387
coutSummary = Util . linkifyPattern(coutSummary, reviewPattern, " $1" , Util . completeUrl(reviewPage + " $1" , request));
388
388
}
389
389
}
0 commit comments