Skip to content

Commit bf01218

Browse files
committed
use isEmpty() instead of length check
1 parent 0fe4daa commit bf01218

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

opengrok-web/src/main/webapp/list.jsp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,7 @@ document.pageReady.push(function() { pageReadyList();});
146146
if (!projects.contains(projectName)) {
147147
projects.add(projectName);
148148
// update cookie
149-
cookieValue = cookieValue.length() == 0 ? projectName :
150-
projectName + ',' + cookieValue;
149+
cookieValue = cookieValue.isEmpty() ? projectName : projectName + ',' + cookieValue;
151150
Cookie cookie = new Cookie(PageConfig.OPEN_GROK_PROJECT, URLEncoder.encode(cookieValue, StandardCharsets.UTF_8));
152151
// TODO hmmm, projects.jspf doesn't set a path
153152
cookie.setPath(request.getContextPath() + '/');
@@ -210,7 +209,7 @@ document.pageReady.push(function() { pageReadyList();});
210209
}
211210
212211
statistics.report(LOGGER, Level.FINE, "directory listing done", "dir.list.latency");
213-
} else if (rev.length() != 0) {
212+
} else if (!rev.isEmpty()) {
214213
// requesting a revision
215214
File xrefFile;
216215
if (cfg.isLatestRevision(rev) && (xrefFile = cfg.findDataFile()) != null) {

opengrok-web/src/main/webapp/mast.jsp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ information: Portions Copyright [yyyy] [name of copyright owner]
1818
1919
CDDL 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.
2222
Portions Copyright 2011 Jens Elkner.
2323
Portions Copyright (c) 2018, Chris Fraire <[email protected]>.
2424
@@ -45,7 +45,7 @@ org.opengrok.indexer.web.Util"%>
4545
}
4646
4747
String redir = cfg.canProcess();
48-
if (redir == null || redir.length() > 0) {
48+
if (redir == null || !redir.isEmpty()) {
4949
if (redir == null) {
5050
response.sendError(HttpServletResponse.SC_NOT_FOUND);
5151
} else {

0 commit comments

Comments
 (0)