[exo-jcr-commits] exo-jcr SVN: r5631 - in ws/branches/2.3.x: exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/groovy and 1 other directory.
do-not-reply at jboss.org
do-not-reply at jboss.org
Tue Feb 14 09:20:27 EST 2012
Author: andrew.plotnikov
Date: 2012-02-14 09:20:26 -0500 (Tue, 14 Feb 2012)
New Revision: 5631
Modified:
ws/branches/2.3.x/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/ContentEncodingModule.java
ws/branches/2.3.x/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/ContentMD5Module.java
ws/branches/2.3.x/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/Cookie.java
ws/branches/2.3.x/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/Cookie2.java
ws/branches/2.3.x/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/HttpOutputStream.java
ws/branches/2.3.x/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/RetryModule.java
ws/branches/2.3.x/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/TransferEncodingModule.java
ws/branches/2.3.x/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/groovy/GroovyJaxrsPublisher.java
Log:
EXOJCR-1760: Fixed the Blocker/Critical violations and the easiest Major ones raised by eXo Quality Level 1.2
Modified: ws/branches/2.3.x/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/ContentEncodingModule.java
===================================================================
--- ws/branches/2.3.x/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/ContentEncodingModule.java 2012-02-14 14:19:34 UTC (rev 5630)
+++ ws/branches/2.3.x/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/ContentEncodingModule.java 2012-02-14 14:20:26 UTC (rev 5631)
@@ -49,7 +49,7 @@
class ContentEncodingModule implements HTTPClientModule
{
- private static final Log log = ExoLogger.getLogger("exo.ws.commons.ContentEncodingModule");
+ private static final Log LOG = ExoLogger.getLogger("exo.ws.commons.ContentEncodingModule");
// Methods
@@ -170,8 +170,8 @@
String encoding = ((HttpHeaderElement)pce.firstElement()).getName();
if (encoding.equalsIgnoreCase("gzip") || encoding.equalsIgnoreCase("x-gzip"))
{
- if (log.isDebugEnabled())
- log.debug("Pushing gzip-input-stream");
+ if (LOG.isDebugEnabled())
+ LOG.debug("Pushing gzip-input-stream");
resp.inp_stream = new GZIPInputStream(resp.inp_stream);
pce.removeElementAt(pce.size() - 1);
@@ -179,8 +179,8 @@
}
else if (encoding.equalsIgnoreCase("deflate"))
{
- if (log.isDebugEnabled())
- log.debug("Pushing inflater-input-stream");
+ if (LOG.isDebugEnabled())
+ LOG.debug("Pushing inflater-input-stream");
resp.inp_stream = new InflaterInputStream(resp.inp_stream);
pce.removeElementAt(pce.size() - 1);
@@ -188,8 +188,8 @@
}
else if (encoding.equalsIgnoreCase("compress") || encoding.equalsIgnoreCase("x-compress"))
{
- if (log.isDebugEnabled())
- log.debug("Pushing uncompress-input-stream");
+ if (LOG.isDebugEnabled())
+ LOG.debug("Pushing uncompress-input-stream");
resp.inp_stream = new UncompressInputStream(resp.inp_stream);
pce.removeElementAt(pce.size() - 1);
@@ -197,15 +197,15 @@
}
else if (encoding.equalsIgnoreCase("identity"))
{
- if (log.isDebugEnabled())
- log.debug("Ignoring 'identity' token");
+ if (LOG.isDebugEnabled())
+ LOG.debug("Ignoring 'identity' token");
pce.removeElementAt(pce.size() - 1);
}
else
{
- if (log.isDebugEnabled())
- log.debug("Unknown content encoding '" + encoding + "'");
+ if (LOG.isDebugEnabled())
+ LOG.debug("Unknown content encoding '" + encoding + "'");
}
Modified: ws/branches/2.3.x/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/ContentMD5Module.java
===================================================================
--- ws/branches/2.3.x/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/ContentMD5Module.java 2012-02-14 14:19:34 UTC (rev 5630)
+++ ws/branches/2.3.x/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/ContentMD5Module.java 2012-02-14 14:20:26 UTC (rev 5631)
@@ -50,7 +50,7 @@
class ContentMD5Module implements HTTPClientModule
{
- private static final Log log = ExoLogger.getLogger("exo.ws.commons.ContentMD5Module");
+ private static final Log LOG = ExoLogger.getLogger("exo.ws.commons.ContentMD5Module");
// Constructors
@@ -107,12 +107,12 @@
if ((md5_digest == null && !md5_tok) || resp.getHeader("Transfer-Encoding") != null)
return;
- if (log.isDebugEnabled())
+ if (LOG.isDebugEnabled())
{
if (md5_digest != null)
- log.debug("Received digest: " + md5_digest + " - pushing md5-check-stream");
+ LOG.debug("Received digest: " + md5_digest + " - pushing md5-check-stream");
else
- log.debug("Expecting digest in trailer " + " - pushing md5-check-stream");
+ LOG.debug("Expecting digest in trailer " + " - pushing md5-check-stream");
}
resp.inp_stream = new MD5InputStream(resp.inp_stream, new VerifyMD5(resp));
}
Modified: ws/branches/2.3.x/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/Cookie.java
===================================================================
--- ws/branches/2.3.x/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/Cookie.java 2012-02-14 14:19:34 UTC (rev 5630)
+++ ws/branches/2.3.x/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/Cookie.java 2012-02-14 14:20:26 UTC (rev 5631)
@@ -70,7 +70,7 @@
/** Make this compatible with V0.3-2 */
private static final long serialVersionUID = 8599975325569296615L;
- private static final Log log = ExoLogger.getLogger("exo.ws.commons.Cookie");
+ private static final Log LOG = ExoLogger.getLogger("exo.ws.commons.Cookie");
protected String name;
@@ -304,8 +304,8 @@
cookie_arr = Util.resizeArray(cookie_arr, cookie_arr.length + 1);
cookie_arr[cookie_arr.length - 1] = curr;
}
- else if (log.isDebugEnabled())
- log.debug("Ignoring cookie: " + curr);
+ else if (LOG.isDebugEnabled())
+ LOG.debug("Ignoring cookie: " + curr);
}
return cookie_arr;
@@ -339,7 +339,7 @@
* throw new ProtocolException("Bad Set-Cookie header: " + set_cookie +
* "\nInvalid date found at " + "position " + beg);
*/
- log.warn("Bad Set-Cookie header: " + set_cookie + ". Invalid date '" + value + "'");
+ LOG.warn("Bad Set-Cookie header: " + set_cookie + ". Invalid date '" + value + "'");
}
}
else if (name.equals("max-age")) // from rfc-2109
@@ -365,7 +365,7 @@
// you get everything these days...
if (value.length() == 0)
{
- log.warn("Bad Set-Cookie header: " + set_cookie + ". Domain is empty - ignoring domain");
+ LOG.warn("Bad Set-Cookie header: " + set_cookie + ". Domain is empty - ignoring domain");
return true;
}
@@ -379,7 +379,7 @@
// must be the same domain as in the url
if (!cookie.domain.endsWith(value))
{
- log.warn("Bad Set-Cookie header: " + set_cookie + ". Current domain " + cookie.domain
+ LOG.warn("Bad Set-Cookie header: " + set_cookie + ". Current domain " + cookie.domain
+ " does not match given parsed " + value);
return false;
}
@@ -398,7 +398,7 @@
// two dots
if (!value.equals(".local") && value.indexOf('.', 1) == -1)
{
- log.warn("Bad Set-Cookie header: " + set_cookie + ". Domain attribute " + value
+ LOG.warn("Bad Set-Cookie header: " + set_cookie + ". Domain attribute " + value
+ "isn't .local and doesn't have at " + "least 2 dots");
return false;
}
@@ -416,7 +416,7 @@
int dl = cookie.domain.length(), vl = value.length();
if (dl > vl && cookie.domain.substring(0, dl - vl).indexOf('.') != -1)
{
- log.warn("Bad Set-Cookie header: " + set_cookie + ". Domain attribute " + value
+ LOG.warn("Bad Set-Cookie header: " + set_cookie + ". Domain attribute " + value
+ "is more than one level below " + "current domain " + cookie.domain);
return false;
}
Modified: ws/branches/2.3.x/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/Cookie2.java
===================================================================
--- ws/branches/2.3.x/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/Cookie2.java 2012-02-14 14:19:34 UTC (rev 5630)
+++ ws/branches/2.3.x/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/Cookie2.java 2012-02-14 14:20:26 UTC (rev 5631)
@@ -54,7 +54,7 @@
/** Make this compatible with V0.3-2 */
private static final long serialVersionUID = 2208203902820875917L;
- private static final Log log = ExoLogger.getLogger("exo.ws.commons.Cookie2");
+ private static final Log LOG = ExoLogger.getLogger("exo.ws.commons.Cookie2");
protected int version;
@@ -341,7 +341,7 @@
// path attribute must be a prefix of the request-URI
if (!Util.getPath(req.getRequestURI()).startsWith(curr.path))
{
- log.warn("Bad Set-Cookie2 header: " + set_cookie + ", path '" + curr.path + "' is not a prefix of the "
+ LOG.warn("Bad Set-Cookie2 header: " + set_cookie + ", path '" + curr.path + "' is not a prefix of the "
+ "request uri '" + req.getRequestURI() + "'");
continue;
}
@@ -356,7 +356,7 @@
// domain must be either .local or must contain at least two dots
if (!curr.domain.equals(".local") && curr.domain.indexOf('.', 1) == -1)
{
- log.warn("Bad Set-Cookie2 header: " + set_cookie + ", domain '" + curr.domain + "' is not '.local' and "
+ LOG.warn("Bad Set-Cookie2 header: " + set_cookie + ", domain '" + curr.domain + "' is not '.local' and "
+ "doesn't contain two '.'s");
continue;
}
@@ -364,7 +364,7 @@
// domain must domain match host
if (!eff_host.endsWith(curr.domain))
{
- log.warn("Bad Set-Cookie2 header: " + set_cookie + ", domain '" + curr.domain + "' does not match current"
+ LOG.warn("Bad Set-Cookie2 header: " + set_cookie + ", domain '" + curr.domain + "' does not match current"
+ "host '" + eff_host + "'");
continue;
}
@@ -372,7 +372,7 @@
// host minus domain may not contain any dots
if (eff_host.substring(0, eff_host.length() - curr.domain.length()).indexOf('.') != -1)
{
- log.warn("Bad Set-Cookie2 header: " + set_cookie + ", domain '" + curr.domain + "' is more than one '.'"
+ LOG.warn("Bad Set-Cookie2 header: " + set_cookie + ", domain '" + curr.domain + "' is more than one '.'"
+ "away from host '" + eff_host + "'");
continue;
}
@@ -386,7 +386,7 @@
break;
if (idx2 == curr.port_list.length)
{
- log.warn("Bad Set-Cookie2 header: " + set_cookie + ", port list " + "does include current port "
+ LOG.warn("Bad Set-Cookie2 header: " + set_cookie + ", port list " + "does include current port "
+ req.getConnection().getPort());
continue;
}
Modified: ws/branches/2.3.x/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/HttpOutputStream.java
===================================================================
--- ws/branches/2.3.x/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/HttpOutputStream.java 2012-02-14 14:19:34 UTC (rev 5630)
+++ ws/branches/2.3.x/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/HttpOutputStream.java 2012-02-14 14:20:26 UTC (rev 5631)
@@ -125,7 +125,7 @@
/** just ignore all the data if told to do so */
private boolean ignore = false;
- private static final Log log = ExoLogger.getLogger("exo.ws.commons.HttpOutputStream");
+ private static final Log LOG = ExoLogger.getLogger("exo.ws.commons.HttpOutputStream");
// Constructors
@@ -172,11 +172,11 @@
if (os == null)
bos = new ByteArrayOutputStream();
- if (log.isDebugEnabled())
+ if (LOG.isDebugEnabled())
{
- log.debug("Stream ready for writing");
+ LOG.debug("Stream ready for writing");
if (bos != null)
- log.debug("Buffering all data before sending request");
+ LOG.debug("Buffering all data before sending request");
}
}
@@ -375,8 +375,8 @@
req.setHeaders(hdrs);
}
- if (log.isDebugEnabled())
- log.debug("Sending request");
+ if (LOG.isDebugEnabled())
+ LOG.debug("Sending request");
try
{
@@ -405,11 +405,11 @@
if (length == -1)
{
- if (log.isDebugEnabled() && trailers.length > 0)
+ if (LOG.isDebugEnabled() && trailers.length > 0)
{
- log.debug("Sending trailers:");
+ LOG.debug("Sending trailers:");
for (int idx = 0; idx < trailers.length; idx++)
- log.debug("\t" + trailers[idx].getName() + ": " + trailers[idx].getValue());
+ LOG.debug("\t" + trailers[idx].getName() + ": " + trailers[idx].getValue());
}
os.write(Codecs.chunkedEncode(null, 0, 0, trailers, true));
@@ -417,8 +417,8 @@
os.flush();
- if (log.isDebugEnabled())
- log.debug("All data sent");
+ if (LOG.isDebugEnabled())
+ LOG.debug("All data sent");
}
catch (IOException ioe)
Modified: ws/branches/2.3.x/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/RetryModule.java
===================================================================
--- ws/branches/2.3.x/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/RetryModule.java 2012-02-14 14:19:34 UTC (rev 5630)
+++ ws/branches/2.3.x/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/RetryModule.java 2012-02-14 14:20:26 UTC (rev 5631)
@@ -54,7 +54,7 @@
class RetryModule implements HTTPClientModule, GlobalConstants
{
- private static final Log log = ExoLogger.getLogger("exo.ws.commons.RetryModule");
+ private static final Log LOG = ExoLogger.getLogger("exo.ws.commons.RetryModule");
// Constructors
@@ -85,7 +85,7 @@
}
catch (RetryException re)
{
- log.error("Caught RetryException");
+ LOG.error("Caught RetryException");
boolean got_lock = false;
@@ -102,7 +102,7 @@
for (RetryException e = re.first; e != null; e = e.next)
{
- log.error("Handling exception ", e);
+ LOG.error("Handling exception ", e);
Request req = e.request;
HTTPConnection con = req.getConnection();
@@ -181,7 +181,7 @@
// now resend the request
- log.info("Retrying request '" + req.getMethod() + " " + req.getRequestURI() + "'");
+ LOG.info("Retrying request '" + req.getMethod() + " " + req.getRequestURI() + "'");
if (e.conn_reset)
req.num_retries++;
Modified: ws/branches/2.3.x/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/TransferEncodingModule.java
===================================================================
--- ws/branches/2.3.x/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/TransferEncodingModule.java 2012-02-14 14:19:34 UTC (rev 5630)
+++ ws/branches/2.3.x/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/TransferEncodingModule.java 2012-02-14 14:20:26 UTC (rev 5631)
@@ -49,7 +49,7 @@
class TransferEncodingModule implements HTTPClientModule
{
- private static final Log log = ExoLogger.getLogger("exo.ws.commons.TransferEncodingModule");
+ private static final Log LOG = ExoLogger.getLogger("exo.ws.commons.TransferEncodingModule");
// Methods
@@ -165,41 +165,41 @@
String encoding = ((HttpHeaderElement)pte.lastElement()).getName();
if (encoding.equalsIgnoreCase("gzip"))
{
- if (log.isDebugEnabled())
- log.debug("Pushing gzip-input-stream");
+ if (LOG.isDebugEnabled())
+ LOG.debug("Pushing gzip-input-stream");
resp.inp_stream = new GZIPInputStream(resp.inp_stream);
}
else if (encoding.equalsIgnoreCase("deflate"))
{
- if (log.isDebugEnabled())
- log.debug("Pushing inflater-input-stream");
+ if (LOG.isDebugEnabled())
+ LOG.debug("Pushing inflater-input-stream");
resp.inp_stream = new InflaterInputStream(resp.inp_stream);
}
else if (encoding.equalsIgnoreCase("compress"))
{
- if (log.isDebugEnabled())
- log.debug("Pushing uncompress-input-stream");
+ if (LOG.isDebugEnabled())
+ LOG.debug("Pushing uncompress-input-stream");
resp.inp_stream = new UncompressInputStream(resp.inp_stream);
}
else if (encoding.equalsIgnoreCase("chunked"))
{
- if (log.isDebugEnabled())
- log.debug("Pushing chunked-input-stream");
+ if (LOG.isDebugEnabled())
+ LOG.debug("Pushing chunked-input-stream");
resp.inp_stream = new ChunkedInputStream(resp.inp_stream);
}
else if (encoding.equalsIgnoreCase("identity"))
{
- if (log.isDebugEnabled())
- log.debug("Ignoring 'identity' token");
+ if (LOG.isDebugEnabled())
+ LOG.debug("Ignoring 'identity' token");
}
else
{
- if (log.isDebugEnabled())
- log.debug("Unknown transfer encoding '" + encoding + "'");
+ if (LOG.isDebugEnabled())
+ LOG.debug("Unknown transfer encoding '" + encoding + "'");
break;
}
Modified: ws/branches/2.3.x/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/groovy/GroovyJaxrsPublisher.java
===================================================================
--- ws/branches/2.3.x/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/groovy/GroovyJaxrsPublisher.java 2012-02-14 14:19:34 UTC (rev 5630)
+++ ws/branches/2.3.x/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/groovy/GroovyJaxrsPublisher.java 2012-02-14 14:20:26 UTC (rev 5631)
@@ -64,7 +64,7 @@
*/
public class GroovyJaxrsPublisher
{
- private static final Log log = ExoLogger.getExoLogger(GroovyJaxrsPublisher.class);
+ private static final Log LOG = ExoLogger.getExoLogger(GroovyJaxrsPublisher.class);
@SuppressWarnings("rawtypes")
private static final Comparator<Constructor> constructorComparator = new Comparator<Constructor>() {
@@ -134,7 +134,7 @@
@Deprecated
public void setGroovyClassLoader(GroovyClassLoader gcl)
{
- log.warn("Method setGroovyClassLoader is deprecated.");
+ LOG.warn("Method setGroovyClassLoader is deprecated.");
}
/**
More information about the exo-jcr-commits
mailing list