Skip to content

Commit c5c76db

Browse files
dpursehouselucamilanesio
authored andcommitted
OAuthWebFilter: Fix 'parameter should not be assigned' warning
Don't assign a new value to the parameter that was passed into the method. Use the locally created copy. Change-Id: I3a4c8ff3da6f3d0adf45cf77794459dd67595525
1 parent 60525c1 commit c5c76db

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/OAuthWebFilter.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ public void doFilter(ServletRequest request, ServletResponse response,
8989
login(request, httpRequest, httpResponse, ghLogin);
9090
} else {
9191
if (OAuthProtocol.isOAuthLogout(httpRequest)) {
92-
response = logout(request, response, chain, httpRequest);
92+
httpResponse =
93+
(HttpServletResponse) logout(request, httpResponse, chain, httpRequest);
9394
}
9495

9596
if (ghLogin != null && ghLogin.isLoggedIn()) {
@@ -99,7 +100,7 @@ public void doFilter(ServletRequest request, ServletResponse response,
99100
GITHUB_EXT_ID + ghLogin.getToken().accessToken);
100101
}
101102

102-
chain.doFilter(httpRequest, response);
103+
chain.doFilter(httpRequest, httpResponse);
103104
}
104105
} finally {
105106
HttpSession httpSession = httpRequest.getSession();

0 commit comments

Comments
 (0)