Author: cziegeler
Date: Mon Aug 23 15:50:51 2010
New Revision: 988161

URL: http://svn.apache.org/viewvc?rev=988161&view=rev
Log:
Use static loggers for data objects

Modified:
    
sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResource.java
    
sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrPropertyResource.java

Modified: 
sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResource.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResource.java?rev=988161&r1=988160&r2=988161&view=diff
==============================================================================
--- 
sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResource.java
 (original)
+++ 
sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResource.java
 Mon Aug 23 15:50:51 2010
@@ -57,7 +57,7 @@ class JcrNodeResource extends JcrItemRes
     private static final String UNSET_RESOURCE_SUPER_TYPE = "<unset>";
 
     /** default log */
-    private final Logger log = LoggerFactory.getLogger(getClass());
+    private static final Logger LOGGER = 
LoggerFactory.getLogger(JcrNodeResource.class);
 
     private final Node node;
 
@@ -126,12 +126,12 @@ class JcrNodeResource extends JcrItemRes
                 return (Type) new JcrModifiablePropertyMap(getNode(), 
this.dynamicClassLoader);
             } catch (AccessControlException ace) {
                 // the user has no write permission, cannot adapt
-                log.debug(
+                LOGGER.debug(
                     "adaptTo(PersistableValueMap): Cannot set properties on 
{}",
                     this);
             } catch (RepositoryException e) {
                 // some other problem, cannot adapt
-                log.debug(
+                LOGGER.debug(
                     "adaptTo(PersistableValueMap): Unexpected problem for {}",
                     this);
             }
@@ -187,7 +187,7 @@ class JcrNodeResource extends JcrItemRes
                         data = ((Property) item);
                     } catch (ItemNotFoundException infe) {
                         // we don't actually care, but log for completeness
-                        log.debug("getInputStream: No primary items for "
+                        LOGGER.debug("getInputStream: No primary items for "
                             + toString(), infe);
                         data = null;
                     }
@@ -206,7 +206,7 @@ class JcrNodeResource extends JcrItemRes
                 }
 
             } catch (RepositoryException re) {
-                log.error("getInputStream: Cannot get InputStream for " + this,
+                LOGGER.error("getInputStream: Cannot get InputStream for " + 
this,
                     re);
             }
         }
@@ -219,7 +219,7 @@ class JcrNodeResource extends JcrItemRes
         try {
             return URLFactory.createURL(node.getSession(), node.getPath());
         } catch (Exception ex) {
-            log.error("getURL: Cannot create URL for " + this, ex);
+            LOGGER.error("getURL: Cannot create URL for " + this, ex);
         }
 
         return null;
@@ -235,7 +235,7 @@ class JcrNodeResource extends JcrItemRes
                     getNode().getNodes(), this.dynamicClassLoader);
             }
         } catch (RepositoryException re) {
-            log.error("listChildren: Cannot get children of " + this, re);
+            LOGGER.error("listChildren: Cannot get children of " + this, re);
         }
 
         return Collections.<Resource> emptyList().iterator();
@@ -268,12 +268,12 @@ class JcrNodeResource extends JcrItemRes
                 try {
                     metadata.setModificationTime(prop.getLong());
                 } catch(ValueFormatException vfe) {
-                    log.debug("Property {} cannot be converted to a long, 
ignored ({})",
+                    LOGGER.debug("Property {} cannot be converted to a long, 
ignored ({})",
                             prop.getPath(), vfe);
                 }
             }
         } catch (RepositoryException re) {
-            log.info(
+            LOGGER.info(
                 "setMetaData: Problem extracting metadata information for "
                     + getPath(), re);
         }

Modified: 
sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrPropertyResource.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrPropertyResource.java?rev=988161&r1=988160&r2=988161&view=diff
==============================================================================
--- 
sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrPropertyResource.java
 (original)
+++ 
sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrPropertyResource.java
 Mon Aug 23 15:50:51 2010
@@ -38,7 +38,7 @@ import org.slf4j.LoggerFactory;
 class JcrPropertyResource extends JcrItemResource {
 
     /** default log */
-    private final Logger log = LoggerFactory.getLogger(getClass());
+    private static final Logger LOGGER = 
LoggerFactory.getLogger(JcrPropertyResource.class);
 
     private final Property property;
 
@@ -161,12 +161,12 @@ class JcrPropertyResource extends JcrIte
             }
 
         } catch (ValueFormatException vfe) {
-            log.debug("adaptTo: Problem accessing the property value of {}: 
{}",
+            LOGGER.debug("adaptTo: Problem accessing the property value of {}: 
{}",
                 getPath(), vfe.getMessage());
-            log.debug("adaptTo: Cause", vfe);
+            LOGGER.debug("adaptTo: Cause", vfe);
 
         } catch (RepositoryException re) {
-            log.debug("adaptTo: Problem accessing the property " + getPath(), 
re);
+            LOGGER.debug("adaptTo: Problem accessing the property " + 
getPath(), re);
         }
 
         // try to use adapter factories
@@ -196,7 +196,7 @@ class JcrPropertyResource extends JcrIte
             getResourceMetadata().setContentLength(length);
             return stream;
         } catch (RepositoryException re) {
-            log.error("getInputStream: Problem accessing the property "
+            LOGGER.error("getInputStream: Problem accessing the property "
                 + getPath() + " stream", re);
         }
 


Reply via email to