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

No error dialog if lock command failed

From: Andriy Kulchytskyy <whoops_at_ukrtop.com>
Date: 2005-08-30 16:21:56 CEST

Hello,

There is no error dialog (and no exception thrown) if lock command
failed. Using JavaHL interface.

Probably bug is in JavaHL library.
File: http://svn.collab.net/repos/svn/trunk/subversion/bindings/java/javahl/native/SVNClient.cpp
Method: SVNClient::lock (line 3072)

void SVNClient::lock(Targets &targets, const char *comment,
                        bool force)
{
    Pool requestPool;
    const apr_array_header_t *targetsApr = targets.array(requestPool);
    svn_error_t *Err = targets.error_occured(); // one *Err variable
    if(Err != NULL)
    {
        JNIUtil::handleSVNError(Err);
        return;
    }
    apr_pool_t * apr_pool = requestPool.pool ();
    svn_client_ctx_t *ctx = getContext(NULL);
    svn_error_t *err = svn_client_lock(targetsApr, // !!! another *err variable
        comment, force, ctx, apr_pool);

    if (Err != NULL) // !!! but checked the first one
    {
        JNIUtil::handleSVNError(err);
    }
}

The correct code should be:

void SVNClient::lock(Targets &targets, const char *comment,
                        bool force)
{
    Pool requestPool;
    const apr_array_header_t *targetsApr = targets.array(requestPool);
    svn_error_t *Err = targets.error_occured();
    if(Err != NULL)
    {
        JNIUtil::handleSVNError(Err);
        return;
    }
    apr_pool_t * apr_pool = requestPool.pool ();
    svn_client_ctx_t *ctx = getContext(NULL);
    Err = svn_client_lock(targetsApr,
        comment, force, ctx, apr_pool);

    if (Err != NULL)
    {
        JNIUtil::handleSVNError(err);
    }
}

-- 
Best regards,
 Andriy                          mailto:whoops@ukrtop.com
Received on Wed Aug 31 00:21:56 2005

This is an archived mail posted to the Subclipse Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.