Author: tabish
Date: Tue Mar 17 22:26:16 2009
New Revision: 755430

URL: http://svn.apache.org/viewvc?rev=755430&view=rev
Log:
Check destination names on creation to make sure they aren't empty strings, 
throw an exception is they are. 

Modified:
    activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQSession.cpp

Modified: activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQSession.cpp
URL: 
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQSession.cpp?rev=755430&r1=755429&r2=755430&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQSession.cpp 
(original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQSession.cpp Tue 
Mar 17 22:26:16 2009
@@ -391,6 +391,12 @@
     try{
 
         this->checkClosed();
+
+        if( queueName == "" ) {
+            throw IllegalArgumentException(
+                __FILE__, __LINE__, "Destination Name cannot be the Empty 
String." );
+        }
+
         return new commands::ActiveMQQueue( queueName );
     }
     AMQ_CATCH_RETHROW( ActiveMQException )
@@ -405,6 +411,12 @@
     try{
 
         this->checkClosed();
+
+        if( topicName == "" ) {
+            throw IllegalArgumentException(
+                __FILE__, __LINE__, "Destination Name cannot be the Empty 
String." );
+        }
+
         return new commands::ActiveMQTopic( topicName );
     }
     AMQ_CATCH_RETHROW( ActiveMQException )


Reply via email to