Merge branch 'stable-2.13'

* stable-2.13:
  ProjectQoSFilter: Remove unnecessarily nested else-block
  Revert "Resolve username lazily in git over http tasks"

Change-Id: Ie55393880b41e151847489bd1f4959702695b5fb
This commit is contained in:
David Pursehouse
2017-02-08 16:35:41 +09:00

View File

@@ -154,7 +154,6 @@ public class ProjectQoSFilter implements Filter {
private final Object lock = new Object();
private boolean done;
private Thread worker;
private String fullName;
TaskThunk(
final WorkQueue.Executor executor, final Continuation cont, final HttpServletRequest req) {
@@ -212,33 +211,29 @@ public class ProjectQoSFilter implements Filter {
@Override
public String toString() {
if (fullName != null) {
return fullName;
}
CurrentUser who = user.get();
if (who.isIdentifiedUser()) {
String username = who.asIdentifiedUser().getUserName();
if (username != null && !username.isEmpty()) {
fullName = name + " (" + username + ")";
return fullName;
}
}
return name;
}
private String generateName(HttpServletRequest req) {
String userName = "";
CurrentUser who = user.get();
if (who.isIdentifiedUser()) {
String name = who.asIdentifiedUser().getUserName();
if (name != null && !name.isEmpty()) {
userName = " (" + name + ")";
}
}
String uri = req.getServletPath();
Matcher m = URI_PATTERN.matcher(uri);
if (m.matches()) {
String path = m.group(1);
String cmd = m.group(2);
return cmd + " " + path;
return cmd + " " + path + userName;
}
return req.getMethod() + " " + uri;
return req.getMethod() + " " + uri + userName;
}
}
}