[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Empty auth folder created in cwd during initialization of JavaHL svn 1.4.x.

From: Lieven Govaerts <svnlgo_at_mobsol.be>
Date: 2006-11-07 10:08:24 CET

I've upgraded some Java scripts to support Subversion 1.4.2 (coming from 1.2.3).
While executing the script, I find in the current working directory a new empty
folder structure:
auth\
  svn.simple\
  svn.ssl.usr\
  svn.username\

Stepping through the Java code, I found that these folders are created from the
constructor of org.tigris.subversion.javahl.SVNClient:

    /**
     * Standard empty contructor, builds just the native peer.
     */
    public SVNClient()
    {
        cppAddr = ctNative();

        // Ensure that Subversion's config file area and templates exist.
        try
        {
            // Passing an empty string instead of null (which would be
            // more appropriate) prevents earlier versions of the
            // native library (mismatched from the Java bytecode
            // version) from crashing.
            setConfigDirectory("");
        }
        catch (ClientException suppressed)
        {
            // Not an exception-worthy problem, continue on.
        }
    }

I see two problems with the code:
1. These folders are supposed to be created in the users home directory, not in
the current working folder.
2. Doing some non-trivial initialization in a constructor is against best
practice (in Java).

Looking at the JavaHL code r20726 (which adds the setConfigDirectory call) is
most likely the reason of this behavior. If anyone can easily see the cause of
the problem and solve it that would be nice, otherwise I'll have a go later
this week.

Lieven

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Nov 7 10:08:43 2006

This is an archived mail posted to the Subversion Dev mailing list.