Conor, thanks for the note. I've committed a fix in r15552, and
nominated the fix for backport to the 1.2.x line in r15553.
I actually took a slightly different approach, since the JLS doesn't
allow return statements in static initializer blocks, adding a
loadNativeLibrary() method and calling that from the static initializer.
- Dan
On Wed, 2005-08-03 at 00:44 +1000, Conor MacNeill wrote:
> The static initializer in SvnClient.java has a problem. If the load of
> the specifiedLibraryName succeeds, the code will still attempt to load
> from the standard locations. The exception thrown by the final attempt
> is not caught and initialization fails, even though the specified
> library may have been loaded successfully. Inserting a return after a
> successful load in the first try block would fix this.
>
> I've annotated the current code below with "// ++++++++".
>
> Conor
>
> static
> {
> /*
> * see if the user has specified the fully qualified path to the
> * native library
> */
> try
> {
> String specifiedLibraryName =
> System.getProperty("subversion.native.library");
> if(specifiedLibraryName != null)
> System.load(specifiedLibraryName);
> // ++++++++ insert return here
> }
> catch(UnsatisfiedLinkError ex)
> {
> // ignore that error to try again
> }
> /*
> * first try to load the library by the new name.
> * if that fails, try to load the library by the old name.
> */
> try
> {
> System.loadLibrary("svnjavahl-1");
> }
> catch(UnsatisfiedLinkError ex)
> {
> try
> {
> System.loadLibrary("libsvnjavahl-1");
> }
> catch (UnsatisfiedLinkError e)
> {
> System.loadLibrary("svnjavahl");
> // ++++++++ exception thrown from here.
> }
> }
> }
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Aug 2 22:20:02 2005