You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by David Jencks <da...@yahoo.com> on 2006/03/24 23:04:57 UTC

question about the c++ code

I know virtually nothing about C++ but noticed this when scanning  
through the C++ port of the jms framework, and it looked odd to me:

In ActiveMQConnectionFactory.cpp I see this constructor:

ActiveMQConnectionFactory::ActiveMQConnectionFactory( const char*  
userName,
	const char* password,
	const char* brokerUrl ) throw( CMSException )
{
	this->userName = userName;
	this->password = password;

     brokerUrl = brokerUrl;

     transportFactory = new  
activemq::transport::stomp::StompTransportFactory();
}


I'd expect the 3rd assignment to be

this->broketUrl = brokerUrl;

If the code as written is correct, could someone explain to me how  
UserName and password are different from brokerUrl?

thanks
david jencks


Re: question about the c++ code

Posted by Nathan Mittler <na...@gmail.com>.
Definitely a bug - good find :-)

James, it's just a one-liner change in
cms/activemqcms/src/activemq/ActiveMQConnectionFactory.cpp ... how should I
proceed for submittal?  Do you want to capture the issue in Jira?

Regards,
Nate

On 3/24/06, Christopher G. Stach II <cg...@ldsys.net> wrote:
>
> David Jencks wrote:
> > I know virtually nothing about C++ but noticed this when scanning
> > through the C++ port of the jms framework, and it looked odd to me:
> >
> > In ActiveMQConnectionFactory.cpp I see this constructor:
> >
> > ActiveMQConnectionFactory::ActiveMQConnectionFactory( const char*
> userName,
> >     const char* password,
> >     const char* brokerUrl ) throw( CMSException )
> > {
> >     this->userName = userName;
> >     this->password = password;
> >
> >     brokerUrl = brokerUrl;
> >
> >     transportFactory = new
> > activemq::transport::stomp::StompTransportFactory();
> > }
> >
> >
> > I'd expect the 3rd assignment to be
> >
> > this->broketUrl = brokerUrl;
> >
> > If the code as written is correct, could someone explain to me how
> > UserName and password are different from brokerUrl?
> >
> > thanks
> > david jencks
> >
>
> The local variable is preferred in scope, so this->brokerUrl would never
> be set.
>
> --
> Christopher G. Stach II
> 708-721-5114
>

Re: question about the c++ code

Posted by "Christopher G. Stach II" <cg...@ldsys.net>.
David Jencks wrote:
> I know virtually nothing about C++ but noticed this when scanning
> through the C++ port of the jms framework, and it looked odd to me:
> 
> In ActiveMQConnectionFactory.cpp I see this constructor:
> 
> ActiveMQConnectionFactory::ActiveMQConnectionFactory( const char* userName,
>     const char* password,
>     const char* brokerUrl ) throw( CMSException )
> {
>     this->userName = userName;
>     this->password = password;
> 
>     brokerUrl = brokerUrl;
> 
>     transportFactory = new
> activemq::transport::stomp::StompTransportFactory();
> }
> 
> 
> I'd expect the 3rd assignment to be
> 
> this->broketUrl = brokerUrl;
> 
> If the code as written is correct, could someone explain to me how
> UserName and password are different from brokerUrl?
> 
> thanks
> david jencks
> 

The local variable is preferred in scope, so this->brokerUrl would never
be set.

-- 
Christopher G. Stach II
708-721-5114