Skip to content

Commit 788b234

Browse files
committed
use isEmpty() instead of length check
1 parent c15d8b3 commit 788b234

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
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) {

0 commit comments

Comments
 (0)