mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-03-06 12:20:56 +01:00
fix pmd reported violations
This commit is contained in:
@@ -7,6 +7,11 @@
|
||||
|
||||
package sonia.scm.agent;
|
||||
|
||||
//~--- non-JDK imports --------------------------------------------------------
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
//~--- JDK imports ------------------------------------------------------------
|
||||
|
||||
import com.sun.grizzly.http.SelectorThread;
|
||||
@@ -32,6 +37,9 @@ public class Main
|
||||
/** Field description */
|
||||
private static final String DEFAULT_URI = "http://localhost:{0}/";
|
||||
|
||||
/** Field description */
|
||||
private static Logger logger = LoggerFactory.getLogger(Main.class);
|
||||
|
||||
//~--- methods --------------------------------------------------------------
|
||||
|
||||
/**
|
||||
@@ -95,7 +103,10 @@ public class Main
|
||||
{
|
||||
return Integer.parseInt(port);
|
||||
}
|
||||
catch (NumberFormatException e) {}
|
||||
catch (NumberFormatException ex)
|
||||
{
|
||||
logger.debug(ex.getMessage(), ex);
|
||||
}
|
||||
}
|
||||
|
||||
return defaultPort;
|
||||
|
||||
@@ -22,7 +22,6 @@ import java.util.List;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ public class EhCacheManager implements CacheManager
|
||||
public <K, V> ExtendedCache<K, V> getExtendedCache(Class<K> key,
|
||||
Class<V> value, String name)
|
||||
{
|
||||
return getCache(key, value, name);
|
||||
return getCache(name);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -71,23 +71,20 @@ public class EhCacheManager implements CacheManager
|
||||
public <K, V> SimpleCache<K, V> getSimpleCache(Class<K> key, Class<V> value,
|
||||
String name)
|
||||
{
|
||||
return getCache(key, value, name);
|
||||
return getCache(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param key
|
||||
* @param value
|
||||
* @param name
|
||||
* @param <K>
|
||||
* @param <V>
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private <K, V> EhCache<K, V> getCache(Class<K> key, Class<V> value,
|
||||
String name)
|
||||
private <K, V> EhCache<K, V> getCache(String name)
|
||||
{
|
||||
return new EhCache<K, V>(cacheManager.getCache(name));
|
||||
}
|
||||
|
||||
@@ -7,6 +7,11 @@
|
||||
|
||||
package sonia.scm.filter;
|
||||
|
||||
//~--- non-JDK imports --------------------------------------------------------
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
//~--- JDK imports ------------------------------------------------------------
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -24,6 +29,12 @@ import javax.servlet.http.HttpServletResponseWrapper;
|
||||
public class GZipResponseWrapper extends HttpServletResponseWrapper
|
||||
{
|
||||
|
||||
/** Field description */
|
||||
private static final Logger logger =
|
||||
LoggerFactory.getLogger(GZipResponseWrapper.class);
|
||||
|
||||
//~--- constructors ---------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Constructs ...
|
||||
*
|
||||
@@ -71,7 +82,10 @@ public class GZipResponseWrapper extends HttpServletResponseWrapper
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (IOException e) {}
|
||||
catch (IOException ex)
|
||||
{
|
||||
logger.error(ex.getMessage(), ex);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -102,7 +102,7 @@ public abstract class AbstractResourceServlet extends HttpServlet
|
||||
protected void doGet(HttpServletRequest request, HttpServletResponse response)
|
||||
throws ServletException, IOException
|
||||
{
|
||||
processRequest(request, response);
|
||||
processRequest(response);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -120,7 +120,7 @@ public abstract class AbstractResourceServlet extends HttpServlet
|
||||
HttpServletResponse response)
|
||||
throws ServletException, IOException
|
||||
{
|
||||
processRequest(request, response);
|
||||
processRequest(response);
|
||||
}
|
||||
|
||||
//~--- get methods ----------------------------------------------------------
|
||||
@@ -142,14 +142,12 @@ public abstract class AbstractResourceServlet extends HttpServlet
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
*
|
||||
* @throws IOException
|
||||
* @throws ServletException
|
||||
*/
|
||||
private void processRequest(HttpServletRequest request,
|
||||
HttpServletResponse response)
|
||||
private void processRequest(HttpServletResponse response)
|
||||
throws ServletException, IOException
|
||||
{
|
||||
response.setCharacterEncoding(getCharacterEncoding());
|
||||
|
||||
Reference in New Issue
Block a user