activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgo...@apache.org
Subject svn commit: r708735 - /activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Transport/TransportFactory.cs
Date Wed, 29 Oct 2008 00:07:14 GMT
Author: jgomes
Date: Tue Oct 28 17:07:13 2008
New Revision: 708735

URL: http://svn.apache.org/viewvc?rev=708735&view=rev
Log:
Refactor to use TryGetValue() to avoid throwing exception.

Modified:
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Transport/TransportFactory.cs

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Transport/TransportFactory.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Transport/TransportFactory.cs?rev=708735&r1=708734&r2=708735&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Transport/TransportFactory.cs
(original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Transport/TransportFactory.cs
Tue Oct 28 17:07:13 2008
@@ -104,13 +104,10 @@
 				throw new IOException("Transport not scheme specified: [" + location + "]");
 			}
 
-			scheme = scheme.ToLower();
 			ITransportFactory tf;
-			try
-			{
-			    tf = TransportFactory.factoryCache[scheme];
-			}
-			catch
+
+			scheme = scheme.ToLower();
+			if(!TransportFactory.factoryCache.TryGetValue(scheme, out tf))
 			{
 			    // missing in the cache - go add request it if it exists
 			    tf = TransportFactory.AddTransportFactory(scheme);



Mime
View raw message