You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by se...@apache.org on 2011/02/10 19:03:43 UTC
svn commit: r1069501 - in /cxf/branches/2.3.x-fixes: ./
rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
Author: sergeyb
Date: Thu Feb 10 18:03:43 2011
New Revision: 1069501
URL: http://svn.apache.org/viewvc?rev=1069501&view=rev
Log:
Merged revisions 1069500 via svnmerge from
https://svn.apache.org/repos/asf/cxf/trunk
........
r1069500 | sergeyb | 2011-02-10 18:00:24 +0000 (Thu, 10 Feb 2011) | 1 line
[CXF-3324] Adding log guards in JAXRSUtils
........
Modified:
cxf/branches/2.3.x-fixes/ (props changed)
cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Feb 10 18:03:43 2011
@@ -1 +1 @@
-/cxf/trunk:1068320,1068337,1068525,1068867,1068877,1069249,1069318,1069492
+/cxf/trunk:1068320,1068337,1068525,1068867,1068877,1069249,1069318,1069492,1069500
Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified: cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java?rev=1069501&r1=1069500&r2=1069501&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java (original)
+++ cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java Thu Feb 10 18:03:43 2011
@@ -222,10 +222,12 @@ public final class JAXRSUtils {
String path,
MultivaluedMap<String, String> values,
Message message) {
-
- LOG.fine(new org.apache.cxf.common.i18n.Message("START_CRI_MATCH",
+ boolean isFineLevelLoggable = LOG.isLoggable(Level.FINE);
+ if (isFineLevelLoggable) {
+ LOG.fine(new org.apache.cxf.common.i18n.Message("START_CRI_MATCH",
BUNDLE,
path).toString());
+ }
if (resources.size() == 1) {
return resources.get(0).getURITemplate().match(path, values)
? resources.get(0) : null;
@@ -239,12 +241,14 @@ public final class JAXRSUtils {
MultivaluedMap<String, String> map = new MetadataMap<String, String>();
if (cri.getURITemplate().match(path, map)) {
candidateList.put(cri, map);
- LOG.fine(new org.apache.cxf.common.i18n.Message("CRI_SELECTED_POSSIBLY",
+ if (isFineLevelLoggable) {
+ LOG.fine(new org.apache.cxf.common.i18n.Message("CRI_SELECTED_POSSIBLY",
BUNDLE,
cri.getServiceClass().getName(),
path,
cri.getURITemplate().getValue()).toString());
- } else {
+ }
+ } else if (isFineLevelLoggable) {
LOG.fine(new org.apache.cxf.common.i18n.Message("CRI_NO_MATCH",
BUNDLE,
path,
@@ -257,10 +261,12 @@ public final class JAXRSUtils {
candidateList.entrySet().iterator().next();
values.putAll(firstEntry.getValue());
ClassResourceInfo cri = firstEntry.getKey();
- LOG.fine(new org.apache.cxf.common.i18n.Message("CRI_SELECTED",
+ if (isFineLevelLoggable) {
+ LOG.fine(new org.apache.cxf.common.i18n.Message("CRI_SELECTED",
BUNDLE,
cri.getServiceClass().getName(),
path, cri.getURITemplate().getValue()).toString());
+ }
return cri;
}
@@ -274,7 +280,8 @@ public final class JAXRSUtils {
String requestContentType,
List<MediaType> acceptContentTypes,
boolean logNow) {
- if (LOG.isLoggable(Level.FINE)) {
+ boolean isFineLevelLoggable = LOG.isLoggable(Level.FINE);
+ if (isFineLevelLoggable) {
org.apache.cxf.common.i18n.Message msg =
new org.apache.cxf.common.i18n.Message("START_OPER_MATCH",
BUNDLE,
@@ -331,7 +338,7 @@ public final class JAXRSUtils {
logNoMatchMessage(ori, path, httpMethod, requestType, acceptContentTypes);
}
}
- if (added && LOG.isLoggable(Level.FINE)) {
+ if (added && isFineLevelLoggable) {
LOG.fine(new org.apache.cxf.common.i18n.Message("OPER_SELECTED_POSSIBLY",
BUNDLE,
ori.getMethodToInvoke().getName()).toString());
@@ -355,9 +362,11 @@ public final class JAXRSUtils {
BUNDLE, resource.getServiceClass().getName(),
ori.getMethodToInvoke().getName()).toString());
}
- LOG.fine(new org.apache.cxf.common.i18n.Message("OPER_SELECTED",
- BUNDLE, ori.getMethodToInvoke().getName(),
- resource.getServiceClass().getName()).toString());
+ if (isFineLevelLoggable) {
+ LOG.fine(new org.apache.cxf.common.i18n.Message("OPER_SELECTED",
+ BUNDLE, ori.getMethodToInvoke().getName(),
+ resource.getServiceClass().getName()).toString());
+ }
return ori;
}