svn commit: r1214731 - in /ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr: access/jackrabbit/ api/jackrabbit/

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1214731 - in /ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr: access/jackrabbit/ api/jackrabbit/

sascharodekamp
Author: sascharodekamp
Date: Thu Dec 15 12:40:45 2011
New Revision: 1214731

URL: http://svn.apache.org/viewvc?rev=1214731&view=rev
Log:
Change some variable declaration to restrict the scope.

Modified:
    ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/access/jackrabbit/ContentReaderJackrabbit.java
    ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/access/jackrabbit/ContentWriterJackrabbit.java
    ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/access/jackrabbit/JackrabbitRepositoryAccessor.java
    ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/access/jackrabbit/VersioningManagerJackrabbit.java
    ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/jackrabbit/JackrabbitAbstractHelper.java
    ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/jackrabbit/JackrabbitArticleHelper.java

Modified: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/access/jackrabbit/ContentReaderJackrabbit.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/access/jackrabbit/ContentReaderJackrabbit.java?rev=1214731&r1=1214730&r2=1214731&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/access/jackrabbit/ContentReaderJackrabbit.java (original)
+++ ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/access/jackrabbit/ContentReaderJackrabbit.java Thu Dec 15 12:40:45 2011
@@ -21,9 +21,9 @@ import org.ofbiz.jcr.util.jackrabbit.Jcr
 
 public class ContentReaderJackrabbit implements ContentReader {
 
-    private static String module = ContentReaderJackrabbit.class.getName();
+    private final static String module = ContentReaderJackrabbit.class.getName();
 
-    private ObjectContentManager ocm = null;
+    private final ObjectContentManager ocm;
 
     public ContentReaderJackrabbit(ObjectContentManager ocm) {
         this.ocm = ocm;

Modified: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/access/jackrabbit/ContentWriterJackrabbit.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/access/jackrabbit/ContentWriterJackrabbit.java?rev=1214731&r1=1214730&r2=1214731&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/access/jackrabbit/ContentWriterJackrabbit.java (original)
+++ ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/access/jackrabbit/ContentWriterJackrabbit.java Thu Dec 15 12:40:45 2011
@@ -20,10 +20,10 @@ import org.ofbiz.jcr.util.jackrabbit.Jcr
 
 public class ContentWriterJackrabbit implements ContentWriter {
 
-    private static String module = ContentWriterJackrabbit.class.getName();
+    private final static String module = ContentWriterJackrabbit.class.getName();
 
-    private ObjectContentManager ocm = null;
-    VersioningManager versioningManager = null;
+    private final ObjectContentManager ocm;
+    private final VersioningManager versioningManager;
 
     /**
      *

Modified: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/access/jackrabbit/JackrabbitRepositoryAccessor.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/access/jackrabbit/JackrabbitRepositoryAccessor.java?rev=1214731&r1=1214730&r2=1214731&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/access/jackrabbit/JackrabbitRepositoryAccessor.java (original)
+++ ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/access/jackrabbit/JackrabbitRepositoryAccessor.java Thu Dec 15 12:40:45 2011
@@ -24,10 +24,10 @@ import org.ofbiz.jcr.orm.OfbizRepository
 
 public class JackrabbitRepositoryAccessor implements JcrRepositoryAccessor {
 
-    private static String module = JackrabbitRepositoryAccessor.class.getName();
+    private final static String module = JackrabbitRepositoryAccessor.class.getName();
 
-    Session session = null;
-    ObjectContentManagerImpl ocm = null;
+    private final Session session;
+    private final ObjectContentManagerImpl ocm;
 
     /**
      * Create a repository Access object based on the userLogin.
@@ -45,13 +45,7 @@ public class JackrabbitRepositoryAccesso
      * @param userLogin
      */
     public JackrabbitRepositoryAccessor(Session session) {
-        if (session == null) {
-            Debug.logWarning("A repository session is needed to create an OfbizContentMapping Object.", module);
-            return;
-        }
-
         this.session = session;
-
         this.ocm = new ObjectContentManagerImpl(session, JCRFactoryImpl.getMapper());
 
         return;
@@ -76,7 +70,6 @@ public class JackrabbitRepositoryAccesso
         if (this.ocm != null && this.ocm.getSession().isLive()) {
             this.ocm.logout();
         }
-        this.ocm = null;
     }
 
     /*

Modified: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/access/jackrabbit/VersioningManagerJackrabbit.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/access/jackrabbit/VersioningManagerJackrabbit.java?rev=1214731&r1=1214730&r2=1214731&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/access/jackrabbit/VersioningManagerJackrabbit.java (original)
+++ ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/access/jackrabbit/VersioningManagerJackrabbit.java Thu Dec 15 12:40:45 2011
@@ -20,12 +20,12 @@ import org.ofbiz.jcr.access.VersioningMa
 
 public class VersioningManagerJackrabbit implements VersioningManager {
 
-    private static String module = VersioningManagerJackrabbit.class.getName();
+    private final static String module = VersioningManagerJackrabbit.class.getName();
 
-    ObjectContentManager ocm = null;
+    private final ObjectContentManager ocm;
 
-    private Set<String> checkedOutNodeStore = Collections.synchronizedSet(new HashSet<String>());
-    private static String NOVERSION = "-0.0";
+    private final Set<String> checkedOutNodeStore = Collections.synchronizedSet(new HashSet<String>());
+    private final static String NOVERSION = "-0.0";
 
     VersioningManagerJackrabbit(ObjectContentManager ocm) {
         this.ocm = ocm;

Modified: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/jackrabbit/JackrabbitAbstractHelper.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/jackrabbit/JackrabbitAbstractHelper.java?rev=1214731&r1=1214730&r2=1214731&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/jackrabbit/JackrabbitAbstractHelper.java (original)
+++ ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/jackrabbit/JackrabbitAbstractHelper.java Thu Dec 15 12:40:45 2011
@@ -19,7 +19,7 @@ public abstract class JackrabbitAbstract
 
     private static String module = JackrabbitAbstractHelper.class.getName();
 
-    protected JcrRepositoryAccessor access = null;
+    protected final JcrRepositoryAccessor access;
 
     public JackrabbitAbstractHelper(JcrRepositoryAccessor accessor) {
         this.access = accessor;
@@ -31,7 +31,6 @@ public abstract class JackrabbitAbstract
     @Override
     public void closeContentSession() {
         access.closeAccess();
-        access = null;
     }
 
     /* (non-Javadoc)

Modified: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/jackrabbit/JackrabbitArticleHelper.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/jackrabbit/JackrabbitArticleHelper.java?rev=1214731&r1=1214730&r2=1214731&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/jackrabbit/JackrabbitArticleHelper.java (original)
+++ ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/jackrabbit/JackrabbitArticleHelper.java Thu Dec 15 12:40:45 2011
@@ -40,8 +40,7 @@ public class JackrabbitArticleHelper ext
 
     private final static String module = JackrabbitArticleHelper.class.getName();
 
-    private static JackrabbitArticle article = null;
-
+    private JackrabbitArticle article = null;
     private static List<String> possibleLocales = null;
 
     static {