[dev] OfficeBean LocalOfficeConnection UNO url bug

2007-02-12 Thread Terry Alexis Lurie
com.sun.star.comp.beans.LocalOfficeConnection has a bug[1].

In the setUnoUrl() function the mPipe variable is not initialized properly.
It is set to null regardless of the value passed in.

This null value causes problems later. In the OfficeService.getIdentifier() 
function, a null mPipe means that getPipeName() is called again to provide a 
value.
So if you would like to set a custom UNO connection you cannot, as getPipeName 
always returns a JVM wide constant.

The bug is that the requested key is pipe, when in fact the key should be 
name.

My suggested fix (r1.10) is to change the line in setUnoUrl():

mPipe = (String) aURL.getConnectionParameters().get( pipe );

to

mPipe = (String) aURL.getConnectionParameters().get( name );

Unfortunately all the member variables are marked private, so you cannot fix 
the binary jar at runtime: by creating a subclass and overriding the setUnoUrl 
method.
Maybe to reduce further unfixable binaries most member variables and methods 
could be changed to protected instead.

At the moment I have altered the binary officebean.jar to remove the 
LocalOfficeConnection class and compiled my own revision based on the source.

Cheers!

Terry.

---
[1] 
http://api.openoffice.org/source/browse/api/bean/com/sun/star/comp/beans/LocalOfficeConnection.java?view=markup



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [dev] OfficeBean LocalOfficeConnection UNO url bug

2007-02-12 Thread Juergen Schmidt

Hi Terry,

Terry Alexis Lurie wrote:

com.sun.star.comp.beans.LocalOfficeConnection has a bug[1].

In the setUnoUrl() function the mPipe variable is not initialized properly.
It is set to null regardless of the value passed in.

This null value causes problems later. In the OfficeService.getIdentifier() 
function, a null mPipe means that getPipeName() is called again to provide a 
value.
So if you would like to set a custom UNO connection you cannot, as getPipeName 
always returns a JVM wide constant.

The bug is that the requested key is pipe, when in fact the key should be 
name.

My suggested fix (r1.10) is to change the line in setUnoUrl():

mPipe = (String) aURL.getConnectionParameters().get( pipe );

to

mPipe = (String) aURL.getConnectionParameters().get( name );

Unfortunately all the member variables are marked private, so you cannot fix 
the binary jar at runtime: by creating a subclass and overriding the setUnoUrl 
method.
Maybe to reduce further unfixable binaries most member variables and methods 
could be changed to protected instead

At the moment I have altered the binary officebean.jar to remove the 
LocalOfficeConnection class and compiled my own revision based on the source.


you should simply submit an issue for this problem

Thanks

Juergen



Cheers!

Terry.

---
[1] 
http://api.openoffice.org/source/browse/api/bean/com/sun/star/comp/beans/LocalOfficeConnection.java?view=markup



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [dev] OfficeBean LocalOfficeConnection UNO url bug

2007-02-12 Thread Stephan Bergmann

Terry Alexis Lurie wrote:

com.sun.star.comp.beans.LocalOfficeConnection has a bug[1].

In the setUnoUrl() function the mPipe variable is not initialized properly.
It is set to null regardless of the value passed in.

This null value causes problems later. In the OfficeService.getIdentifier() 
function, a null mPipe means that getPipeName() is called again to provide a 
value.
So if you would like to set a custom UNO connection you cannot, as getPipeName 
always returns a JVM wide constant.

The bug is that the requested key is pipe, when in fact the key should be 
name.

My suggested fix (r1.10) is to change the line in setUnoUrl():

mPipe = (String) aURL.getConnectionParameters().get( pipe );

to

mPipe = (String) aURL.getConnectionParameters().get( name );


Terry,

Thanks for this analysis.  Did you file an issue (see 
http://qa.openoffice.org/issue_handling/project_issues.html; make jl 
the owner of the issue)?



Unfortunately all the member variables are marked private, so you cannot fix 
the binary jar at runtime: by creating a subclass and overriding the setUnoUrl 
method.
Maybe to reduce further unfixable binaries most member variables and methods 
could be changed to protected instead.


Nah, a class' subclassing API needs to be designed just as carefully as 
its public API.  I would not want to weaken that.  (I also think that 
final should be the default for classes.)



At the moment I have altered the binary officebean.jar to remove the 
LocalOfficeConnection class and compiled my own revision based on the source.


With open source, I think that is the best solution anyway: fix it 
properly, test it, get it upstream.


Thanks again,
-Stephan


Cheers!

Terry.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]