fixed sonar bugs

This commit is contained in:
jomu
2015-02-21 15:49:40 +00:00
parent b20d4ffd7a
commit 6a8de77311
2 changed files with 4 additions and 6 deletions

View File

@ -42,7 +42,7 @@ public class AuthenticationFilter implements Filter {
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
if ((loginPage == null) || (errorPage == null)) {
returnError(request, response, "AuthenticationFilter not properly configured! Contact Administrator.");
returnError(response, "AuthenticationFilter not properly configured! Contact Administrator.");
}
User currentUser = null;
@ -74,10 +74,8 @@ public class AuthenticationFilter implements Filter {
this.filterConfig = null;
}
private void returnError(ServletRequest request, ServletResponse response, String errorMsg) {
private void returnError(ServletResponse response, String errorMsg) {
response.setContentType("text/html");
try (
ServletOutputStream servletOutputStream = response.getOutputStream();
PrintStream ps = new PrintStream(servletOutputStream);

View File

@ -145,7 +145,7 @@ public abstract class FileUtil {
try {
md = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException ex) {
throw new IOException("Cannot get MD5 MessageDigest instance");
throw new IOException("Cannot get MD5 MessageDigest instance. Reason: "+ex.toString(), ex);
}
try (InputStream is = Files.newInputStream(Paths.get(fileName));