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:
@@ -154,7 +154,6 @@ public class ProjectQoSFilter implements Filter {
|
|||||||
private final Object lock = new Object();
|
private final Object lock = new Object();
|
||||||
private boolean done;
|
private boolean done;
|
||||||
private Thread worker;
|
private Thread worker;
|
||||||
private String fullName;
|
|
||||||
|
|
||||||
TaskThunk(
|
TaskThunk(
|
||||||
final WorkQueue.Executor executor, final Continuation cont, final HttpServletRequest req) {
|
final WorkQueue.Executor executor, final Continuation cont, final HttpServletRequest req) {
|
||||||
@@ -212,33 +211,29 @@ public class ProjectQoSFilter implements Filter {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
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;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String generateName(HttpServletRequest req) {
|
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();
|
String uri = req.getServletPath();
|
||||||
Matcher m = URI_PATTERN.matcher(uri);
|
Matcher m = URI_PATTERN.matcher(uri);
|
||||||
if (m.matches()) {
|
if (m.matches()) {
|
||||||
String path = m.group(1);
|
String path = m.group(1);
|
||||||
String cmd = m.group(2);
|
String cmd = m.group(2);
|
||||||
return cmd + " " + path;
|
return cmd + " " + path + userName;
|
||||||
}
|
}
|
||||||
return req.getMethod() + " " + uri;
|
|
||||||
|
return req.getMethod() + " " + uri + userName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user