Permalink
Browse files

sonar fixes

  • Loading branch information...
perwendel committed Mar 19, 2013
1 parent a1adf96 commit ab957c3d05093597508da2b0bc6fbd2f7d2282ce
@@ -16,14 +16,16 @@
*/
package spark;
-public class Access {
-
- public static String getBody(Response response) {
- return response.body();
- }
-
- public static void runFromServlet() {
- Spark.runFromServlet();
- }
-
+public final class Access {
+
+ private Access() {}
+
+ public static String getBody(Response response) {
+ return response.body();
+ }
+
+ public static void runFromServlet() {
+ Spark.runFromServlet();
+ }
+
}
@@ -16,6 +16,8 @@
*/
package spark;
+import javax.servlet.http.HttpServletResponse;
+
/**
* Exception used for stopping the execution
*
@@ -24,7 +26,7 @@
public class HaltException extends RuntimeException {
private static final long serialVersionUID = 1L;
- private int statusCode = 200;
+ private int statusCode = HttpServletResponse.SC_OK;
private String body = null;
HaltException() {
@@ -25,10 +25,10 @@
*/
public class JettyLogger implements Logger {
- private org.slf4j.Logger LOG = org.slf4j.LoggerFactory.getLogger(getClass());
+ private org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(getClass());
public void debug(String msg, Throwable th) {
- LOG.debug(msg, th);
+ logger.debug(msg, th);
}
public Logger getLogger(String arg) {
@@ -37,29 +37,28 @@ public Logger getLogger(String arg) {
@Override
public boolean isDebugEnabled() {
- return LOG.isDebugEnabled();
+ return logger.isDebugEnabled();
}
@Override
public void warn(String msg, Throwable th) {
- LOG.warn(msg, th);
- th.printStackTrace();
+ logger.warn(msg, th);
}
@Override
public void debug(Throwable thrown) {
- LOG.debug("", thrown);
+ logger.debug("", thrown);
}
@Override
public void debug(String msg, Object... args) {
StringBuffer log = new StringBuffer(msg);
for (Object arg : args) {
- log.append(", " + arg);
-
+ log.append(", ");
+ log.append(arg);
}
- LOG.debug(log.toString());
+ logger.debug(log.toString());
}
@Override
@@ -74,22 +73,22 @@ public void ignore(Throwable ignored) {
@Override
public void info(Throwable thrown) {
- LOG.info("", thrown);
+ logger.info("", thrown);
}
@Override
public void info(String msg, Object... args) {
StringBuffer log = new StringBuffer(msg);
for (Object arg : args) {
- log.append(", " + arg);
-
+ log.append(", ");
+ log.append(arg);
}
- LOG.info(log.toString());
+ logger.info(log.toString());
}
@Override
public void info(String msg, Throwable thrown) {
- LOG.info(msg, thrown);
+ logger.info(msg, thrown);
}
@Override
@@ -99,17 +98,17 @@ public void setDebugEnabled(boolean enabled) {
@Override
public void warn(Throwable thrown) {
- LOG.warn("", thrown);
+ logger.warn("", thrown);
}
@Override
public void warn(String msg, Object... args) {
StringBuffer log = new StringBuffer(msg);
for (Object arg : args) {
- log.append(", " + arg);
-
+ log.append(", ");
+ log.append(arg);
}
- LOG.warn(log.toString());
+ logger.warn(log.toString());
}
}
Oops, something went wrong.

0 comments on commit ab957c3

Please sign in to comment.