[jboss-svn-commits] JBL Code SVN: r31365 - in labs/jbosstm/branches/JBOSSTS_4_2_3_SP5_CP08_JBTM-377: ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/resources/jts/orbspecific and 1 other directory.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Tue Feb 2 13:59:49 EST 2010


Author: jbertram at redhat.com
Date: 2010-02-02 13:59:48 -0500 (Tue, 02 Feb 2010)
New Revision: 31365

Modified:
   labs/jbosstm/branches/JBOSSTS_4_2_3_SP5_CP08_JBTM-377/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/resources/arjunacore/XAResourceRecord.java
   labs/jbosstm/branches/JBOSSTS_4_2_3_SP5_CP08_JBTM-377/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/resources/jts/orbspecific/XAResourceRecord.java
Log:
JBPAPP-3619

Modified: labs/jbosstm/branches/JBOSSTS_4_2_3_SP5_CP08_JBTM-377/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/resources/arjunacore/XAResourceRecord.java
===================================================================
--- labs/jbosstm/branches/JBOSSTS_4_2_3_SP5_CP08_JBTM-377/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/resources/arjunacore/XAResourceRecord.java	2010-02-02 17:05:50 UTC (rev 31364)
+++ labs/jbosstm/branches/JBOSSTS_4_2_3_SP5_CP08_JBTM-377/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/resources/arjunacore/XAResourceRecord.java	2010-02-02 18:59:48 UTC (rev 31365)
@@ -874,45 +874,37 @@
 			{
 				os.packInt(RecoverableXAConnection.OBJECT_RECOVERY);
 
-				boolean shouldSerialize = false;
-
-				try
-				{
-					if (_theXAResource instanceof Serializable)
-						shouldSerialize = true;
-
-					ByteArrayOutputStream s = new ByteArrayOutputStream();
-					ObjectOutputStream o = new ObjectOutputStream(s);
-
-					// don't allow the packing of a null resource
-
-					if (_theXAResource == null)
-						throw new NotSerializableException();
-
-					o.writeObject(_theXAResource);
-					o.close();
-
-					os.packBoolean(true);
-
-					os.packBytes(s.toByteArray());
-				}
-				catch (NotSerializableException ex)
-				{
-					if (!shouldSerialize)
-					{
-						// have to rely upon XAResource.recover!
-
-						os.packBoolean(false);
-					}
-					else
-					{
-						if (jtaLogger.loggerI18N.isWarnEnabled())
-						{
-							jtaLogger.loggerI18N
-									.warn("com.arjuna.ats.internal.jta.resources.arjunacore.savestate");
-						}
-					}
-				}
+                                if (_theXAResource instanceof Serializable)
+                                {
+        				try
+        				{
+        					ByteArrayOutputStream s = new ByteArrayOutputStream();
+        					ObjectOutputStream o = new ObjectOutputStream(s);
+        
+        					o.writeObject(_theXAResource);
+        					o.close();
+        
+        					os.packBoolean(true);
+        
+        					os.packBytes(s.toByteArray());
+        				}
+        				catch (NotSerializableException ex)
+        				{
+        				    if (jtaLogger.loggerI18N.isWarnEnabled())
+        				    {
+        				        jtaLogger.loggerI18N
+        				            .warn("com.arjuna.ats.internal.jta.resources.arjunacore.savestate");
+        				    }
+                                            
+                                            return false;
+        				}
+                                }
+                                else
+                                {
+                                    // have to rely upon XAResource.recover!
+                                    
+                                    os.packBoolean(false);
+                                }
 			}
 			else
 			{
@@ -932,7 +924,7 @@
 		}
 
 		if (res)
-			res = res && super.save_state(os, t);
+			res = super.save_state(os, t);
 
 		return res;
 	}
@@ -1022,9 +1014,7 @@
 						 * try to get a new XAResource later for this instance.
 						 */
 						
-						return true;
-
-						//return false;
+						res = true;
 					}
 				}
 			}
@@ -1059,7 +1049,7 @@
 		}
 
 		if (res)
-			res = res && super.restore_state(os, t);
+			res = super.restore_state(os, t);
 
 		return res;
 	}

Modified: labs/jbosstm/branches/JBOSSTS_4_2_3_SP5_CP08_JBTM-377/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/resources/jts/orbspecific/XAResourceRecord.java
===================================================================
--- labs/jbosstm/branches/JBOSSTS_4_2_3_SP5_CP08_JBTM-377/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/resources/jts/orbspecific/XAResourceRecord.java	2010-02-02 17:05:50 UTC (rev 31364)
+++ labs/jbosstm/branches/JBOSSTS_4_2_3_SP5_CP08_JBTM-377/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/resources/jts/orbspecific/XAResourceRecord.java	2010-02-02 18:59:48 UTC (rev 31365)
@@ -881,42 +881,37 @@
 			if (_recoveryObject == null)
 			{
 				os.packInt(RecoverableXAConnection.OBJECT_RECOVERY);
-
-				boolean shouldSerialize = false;
 				
-				try
-				{
-					if (_theXAResource instanceof Serializable)
-						shouldSerialize = true;
-					
-					ByteArrayOutputStream s = new ByteArrayOutputStream();
-					ObjectOutputStream o = new ObjectOutputStream(s);
+                                if (_theXAResource instanceof Serializable)
+                                {
+        				try
+        				{
+        					ByteArrayOutputStream s = new ByteArrayOutputStream();
+        					ObjectOutputStream o = new ObjectOutputStream(s);
+        
+        					o.writeObject(_theXAResource);
+        					o.close();
+        
+        					os.packBoolean(true);
+        
+        					os.packBytes(s.toByteArray());
+        				}
+        				catch (NotSerializableException ex)
+        				{
+        				    if (jtaLogger.loggerI18N.isWarnEnabled())
+        				    {
+        				        jtaLogger.loggerI18N.warn("com.arjuna.ats.internal.jta.resources.jts.orbspecific.saveState");
+        				    }
 
-					o.writeObject(_theXAResource);
-					o.close();
-
-					os.packBoolean(true);
-
-					os.packBytes(s.toByteArray());
-				}
-				catch (NotSerializableException ex)
-				{
-					if (!shouldSerialize)
-					{
-						// have to rely upon XAResource.recover!
-	
-						os.packBoolean(false);		
-					}			
-					else
-					{
-						if (jtaLogger.loggerI18N.isWarnEnabled())
-						{
-							jtaLogger.loggerI18N.warn("com.arjuna.ats.internal.jta.resources.jts.orbspecific.saveState");
-						}
-						
-						return false;
-					}
-				}
+        				    return false;
+        				}
+                                }
+                                else
+                                {
+                                    // have to rely upon XAResource.recover!
+                                
+                                    os.packBoolean(false);
+                                }
 			}
 			else
 			{



More information about the jboss-svn-commits mailing list