openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mik...@apache.org
Subject svn commit: r797626 - in /openjpa/trunk: openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerFactoryImpl.java
Date Fri, 24 Jul 2009 19:29:51 GMT
Author: mikedd
Date: Fri Jul 24 19:29:51 2009
New Revision: 797626

URL: http://svn.apache.org/viewvc?rev=797626&view=rev
Log:
Add braces for a few one line if statements. 

Modified:
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java
    openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerFactoryImpl.java

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java?rev=797626&r1=797625&r2=797626&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java
(original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java
Fri Jul 24 19:29:51 2009
@@ -417,12 +417,11 @@
      * Fire the given lifecycle event to all listeners.
      */
     private boolean fireLifecycleEvent(int type) {
-        if (type == LifecycleEvent.AFTER_PERSIST 
-        && _broker.getConfiguration().getCallbackOptionsInstance()
-                  .getPostPersistCallbackImmediate())
+        if (type == LifecycleEvent.AFTER_PERSIST
+                && _broker.getConfiguration().getCallbackOptionsInstance().getPostPersistCallbackImmediate())
{
             fetchObjectId();
-        return _broker.fireLifecycleEvent(getManagedInstance(), null,
-            _meta, type);
+        }
+        return _broker.fireLifecycleEvent(getManagedInstance(), null, _meta, type);
     }
 
     public void load(FetchConfiguration fetch) {

Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerFactoryImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerFactoryImpl.java?rev=797626&r1=797625&r2=797626&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerFactoryImpl.java
(original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerFactoryImpl.java
Fri Jul 24 19:29:51 2009
@@ -412,16 +412,19 @@
     }
 
     public boolean isLoaded(Object entity, String attribute) {
-        if (entity == null)
+        if (entity == null) {
             return false;
+        }
                
         if (entity instanceof PersistenceCapable) {
             PersistenceCapable pc = (PersistenceCapable)entity;
-            if (!isManagedBy(pc))
+            if (!isManagedBy(pc)) {
                 return false;
+            }
             StateManager sm = pc.pcGetStateManager();
-            if (sm != null && sm instanceof OpenJPAStateManager)
-                return isLoaded((OpenJPAStateManager)sm, attribute);
+            if (sm != null && sm instanceof OpenJPAStateManager) {
+                return isLoaded((OpenJPAStateManager)sm, attribute); 
+            }
         }        
         return false;
     }
@@ -434,22 +437,26 @@
      * this persistence unit.
      */
     private boolean isManagedBy(PersistenceCapable entity) {
-        if (!isOpen())
-            return false;
+        if (!isOpen()) {
+            return false; 
+        }
         Object abfobj = JPAFacadeHelper.toBrokerFactory(this);
-        if (abfobj == null)
+        if (abfobj == null) {
             return false;
+        }
         if (abfobj instanceof AbstractBrokerFactory) {
             AbstractBrokerFactory abf = (AbstractBrokerFactory)abfobj;
             Collection<?> brokers = abf.getOpenBrokers();
-            if (brokers == null || brokers.size() == 0)
+            if (brokers == null || brokers.size() == 0) { 
                 return false;
+            }
             // Cycle through all brokers managed by this factory.  
             Broker[] brokerArr = brokers.toArray(new Broker[brokers.size()]);
             for (Broker broker : brokerArr) {
                 if (broker != null && !broker.isClosed() && 
-                    broker.isPersistent(entity))
+                    broker.isPersistent(entity)) {
                     return true;
+                }
             }
         }
         return false;
@@ -467,11 +474,13 @@
         if (attr != null) {
             FieldMetaData fmd = sm.getMetaData().getField(attr);
             // Could not find field metadata for the specified attribute.
-            if (fmd == null)
+            if (fmd == null) {
                 return false;
+            }
             // If the attribute is not loaded, return false.
-            if (!loadSet.get(fmd.getIndex()))
+            if (!loadSet.get(fmd.getIndex())) {
                 return false;
+            }
         }
         // Check load state of all persistent eager fetch attributes. Per
         // contract, if any of them are not loaded, return false.



Mime
View raw message