Author: sshyrkov
Date: Mon Jun 18 10:24:18 2007
New Revision: 17615

URL: https://svndev.jahia.net/websvn/listing.php?sc=3D1&rev=3D17615&repname=
=3Djahia
Log:
Check for logger.isDebugEnabled() before performing logger.debug

Modified:
    trunk/core/src/java/org/jahia/engines/shared/BigText_Field.java

Modified: trunk/core/src/java/org/jahia/engines/shared/BigText_Field.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/core/src/java/o=
rg/jahia/engines/shared/BigText_Field.java&rev=3D17615&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/core/src/java/org/jahia/engines/shared/BigText_Field.java (origin=
al)
+++ trunk/core/src/java/org/jahia/engines/shared/BigText_Field.java Mon Jun=
 18 10:24:18 2007
@@ -109,7 +109,8 @@
         value =3D JahiaBigTextField.rewriteURLs(value, jParams);
         theField.setValue(value);
 =

-        logger.debug("handling mode : " + mode + " for field " +
+        if (logger.isDebugEnabled())
+            logger.debug("handling mode : " + mode + " for field " +
                 theField.getID() + " value=3D" + theField.getValue());
 =

         // Set Session attribute for AJAX sitemap
@@ -146,13 +147,15 @@
         }
 =

         ignoreAllWarnings =3D jParams.getParameter("ignoreAllWarnings") !=
=3D null;
-        logger.debug("ignoreAllWarnings: " + ignoreAllWarnings);
+        if (logger.isDebugEnabled())
+            logger.debug("ignoreAllWarnings: " + ignoreAllWarnings);
         ((ParamBean) jParams).getRequest().setAttribute("ignoreAllWarnings=
",
                 Boolean.valueOf(ignoreAllWarnings));
 =

         boolean out =3D true;
         String fieldValue =3D jParams.getParameter("_" + theField.getID());
-        logger.debug("GetFormData: theField.getValue(): " + theField.getVa=
lue() +
+        if (logger.isDebugEnabled())
+            logger.debug("GetFormData: theField.getValue(): " + theField.g=
etValue() +
                 ", fieldValue: " + fieldValue);
 =

         final JahiaSite site =3D ServicesRegistry.getInstance().
@@ -205,7 +208,8 @@
             fieldValue =3D fieldValue.replaceAll("(?i)\\</html>", "");
         }
 =

-        logger.debug("fieldValue: " + fieldValue);
+        if (logger.isDebugEnabled())
+            logger.debug("fieldValue: " + fieldValue);
 =

         fieldValue =3D StringUtils.replace(fieldValue, "\"" + jParams.getC=
ontextPath() + JahiaBigTextField.SERVLET_PATH, "\"" + JahiaBigTextField.URL=
_MARKER);
         fieldValue =3D StringUtils.replace(fieldValue, "'" + jParams.getCo=
ntextPath() + JahiaBigTextField.SERVLET_PATH, "'" + JahiaBigTextField.URL_M=
ARKER);
@@ -223,7 +227,8 @@
 =

         final Set pageXRefs =3D ((JahiaBigTextField) theField).getInternal=
Links();
         engineMap.put("pageXRefs", pageXRefs);
-        logger.debug("pageXRefs: " + pageXRefs);
+        if (logger.isDebugEnabled())
+            logger.debug("pageXRefs: " + pageXRefs);
 =

         if (! ignoreAllWarnings) {
             // Display or ignore URL integrity checks (warnings)
@@ -233,7 +238,8 @@
 =

                 if (! warningMessages.isEmpty()) {
                     warningMessages.saveMessages(theField.getID() + ".warn=
ing.", ((ParamBean) jParams).getRequest());
-                    logger.debug("There are some Integrity warning message=
s !");
+                    if (logger.isDebugEnabled())
+                        logger.debug("There are some Integrity warning mes=
sages !");
 =

                     out =3D false;
                 }
@@ -252,7 +258,8 @@
 =

                 if (! warningMessages.isEmpty()) {
                     warningMessages.saveMessages(theField.getID() + ".WAIw=
arning.", ((ParamBean) jParams).getRequest());
-                    logger.debug("There are some WAI warning messages !");
+                    if (logger.isDebugEnabled())
+                        logger.debug("There are some WAI warning messages =
!");
 =

                     return false;
                 }
@@ -434,7 +441,8 @@
             final Iterator pageXRefIter =3D pageXRefs.iterator();
             while (pageXRefIter.hasNext()) {
                 final Integer curPageIDInt =3D (Integer) pageXRefIter.next=
();
-                logger.debug("Found reference to page " + curPageIDInt + "=
 in this bigtext");
+                if (logger.isDebugEnabled())
+                    logger.debug("Found reference to page " + curPageIDInt=
 + " in this bigtext");
                 ObjectLink.createLink(fieldKey,
                         new ContentPageKey(curPageIDInt.intValue()), "hard=
codedLink", 1,
                         new Date(),
@@ -593,7 +601,8 @@
      */
     public Collection getFieldGroupsNotHavingAccessOnPage(int pageID,
                                                           JahiaField field=
, ProcessingContext jParams, Map engineMap) throws JahiaException {
-        logger.debug("Comparing ACLs of field " + field.getID() + " and pa=
ge " +
+        if (logger.isDebugEnabled())
+            logger.debug("Comparing ACLs of field " + field.getID() + " an=
d page " +
                 pageID);
         final ContentPage page =3D ContentPage.getPage(pageID);
         final JahiaBaseACL aclObject =3D getFieldACLObject(field, engineMa=
p);
@@ -604,7 +613,8 @@
 =

         // Get all the groups which can see the field
         final Vector fieldACLGroups =3D aclObject.getGroupnameListNoAdmin(=
aclEntry);
-        logger.debug("fieldACLGroups: " + fieldACLGroups);
+        if (logger.isDebugEnabled())
+            logger.debug("fieldACLGroups: " + fieldACLGroups);
 =

         if (page =3D=3D null) {
             return fieldACLGroups;
@@ -612,7 +622,8 @@
 =

         // Get all the groups which can see the target page
         final Vector pageACLGroups =3D page.getACL().getGroupnameListNoAdm=
in(aclEntry);
-        logger.debug("pageACLGroups: " + pageACLGroups);
+        if (logger.isDebugEnabled())
+            logger.debug("pageACLGroups: " + pageACLGroups);
 =

         final Vector result =3D new Vector(fieldACLGroups.size());
 =

@@ -627,7 +638,8 @@
                 // only add the group name once
                 if (! result.contains(groupID)) {
                     result.addElement(groupID);
-                    logger.debug("Adding group " + groupID + " to result");
+                    if (logger.isDebugEnabled())
+                        logger.debug("Adding group " + groupID + " to resu=
lt");
                 }
             }
         }
@@ -675,19 +687,22 @@
         if (field.getID() <=3D 0) {  // this means the field has not yet b=
een saved
             // fetch the parent container ACL entry instead...
             final JahiaContainer container =3D (JahiaContainer) engineMap.=
get("theContainer");
-            logger.debug("Trying to use parent Container ACL instead: ID =
=3D " +
+            if (logger.isDebugEnabled())
+                logger.debug("Trying to use parent Container ACL instead: =
ID =3D " +
                     container.getID());
 =

             if (container.getID() <=3D 0) { // this means the container ha=
s not yet been saved
                 // fetch the parent container list ACL entry instead...
                 final int ctnListID =3D container.getListID();
-                logger.debug("Trying to use parent ContainerList ACL inste=
ad: ID =3D " +
+                if (logger.isDebugEnabled())
+                    logger.debug("Trying to use parent ContainerList ACL i=
nstead: ID =3D " +
                         ctnListID);
 =

                 if (ctnListID <=3D 0) { // this means the containerList is=
 empty
                     // fetch the page ACL entry instead
                     final ContentPage fieldPage =3D ContentPage.getPage(fi=
eld.getPageID());
-                    logger.debug("Trying to use parent ContentPage ACL ins=
tead: ID =3D " +
+                    if (logger.isDebugEnabled())
+                        logger.debug("Trying to use parent ContentPage ACL=
 instead: ID =3D " +
                             field.getPageID());
 =

                     if (fieldPage =3D=3D null) {
@@ -782,14 +797,16 @@
                                                     final JahiaField theFi=
eld, final boolean allLangs) throws JahiaException {
 =

         final String value =3D theField.getValue();
-        logger.debug("composeWarningMessages... " + value);
+        if (logger.isDebugEnabled())
+            logger.debug("composeWarningMessages... " + value);
 =

         final Set pids =3D ((JahiaBigTextField) theField).getInternalLinks=
();
         final Set wrongKeys =3D ((JahiaBigTextField) theField).getWrongURL=
Keys();
         final EngineMessages result =3D new EngineMessages();
 =

         if (pids.size() > 0) {
-            logger.debug("PIDs are: " + pids);
+            if (logger.isDebugEnabled())
+                logger.debug("PIDs are: " + pids);
 =

             final Iterator ite =3D pids.iterator();
             final Vector langs;
@@ -903,7 +920,8 @@
                 result.add("BigText.wrongURLKeys", msg);
             }
         }
-        logger.debug("Returning " + result.getSize() + " warning message(s=
): " + result);
+        if (logger.isDebugEnabled())
+            logger.debug("Returning " + result.getSize() + " warning messa=
ge(s): " + result);
         return result;
     }
 }

_______________________________________________
cvs_list mailing list
[email protected]
http://lists.jahia.org/cgi-bin/mailman/listinfo/cvs_list

Reply via email to