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

RE: [PATCH] Fix Win32 JavaHL Failures

From: Paul Burba <pburba_at_collab.net>
Date: 2007-04-12 08:03:41 CEST

> -----Original Message-----
> From: Hyrum K. Wright [mailto:hyrum_wright@mail.utexas.edu]
> Sent: Wednesday, April 11, 2007 11:40 PM
> To: Paul Burba
> Cc: Subversion Development; Mark Phippard; Daniel Rall
> Subject: Re: [PATCH] Fix Win32 JavaHL Failures
>
> Paul Burba wrote:
> > Of the two JavaHL errors I've been seeing the last few days on
> > Windows, testCopy and testMergeInfoRetrieval...
> >
>
> Paul,
> Good catch! Review below.
>
> > [[[
> > Fix JavaHL testCopy() failure on Win32.
> >
> > * subversion/bindings/javahl/native/CopySources.cpp
> > (CopySources): Initialize m_error_occured.
> > (array): Use JNIUtil::preprocessPath on copy sources to ensure
> > paths are canonical before they get into libsvn_client code.
> > (error_occured): New method definition.
> >
> > * subversion/bindings/javahl/native/CopySources.h
> > (error_occured): New public method declaration.
> > (m_error_occured): New private member.
> > ]]]
> >
> >
> >
> ----------------------------------------------------------------------
> > --
> >
> > Index: subversion/bindings/javahl/native/CopySources.cpp
> > ===================================================================
> > --- subversion/bindings/javahl/native/CopySources.cpp
> (revision 24543)
> > +++ subversion/bindings/javahl/native/CopySources.cpp
> (working copy)
> > @@ -27,10 +27,12 @@
> > #include "JNIStringHolder.h"
> > #include "Revision.h"
> > #include "CopySources.h"
> > -
> > +#include <iostream>
> > +using namespace std;
>
> I don't think we use the 'using' statement elsewhere; I'd
> leave it our here.

Oops, that and the include were from some cout << debugging, gone.
 
> > CopySources::CopySources(jobjectArray jcopySources) {
> > m_copySources = jcopySources;
> > + m_error_occured = NULL;
> > }
> >
> > CopySources::~CopySources()
> > @@ -111,7 +113,14 @@
> > JNIStringHolder path(jpath);
> > if (JNIUtil::isJavaExceptionThrown())
> > return NULL;
> > +
> > src->path = apr_pstrdup(pool, (const char *) path);
> > + svn_error_t *err =
> JNIUtil::preprocessPath(src->path, pool);
> > + if (err)
> > + {
> > + m_error_occured = err;
> > + break;
> > + }
>
> You should just be able to wrap the call to
> JNIUtil::preprocessPath in the SVN_JNI_ERR() macro. That
> should be all the error handling you need.

Ok, that's easier :-) Returning NULL on an error with the macro.

> > env->DeleteLocalRef(jpath);
> >
> > // Extract source revision from the copy source.
> > @@ -159,3 +168,8 @@
> >
> > return copySources;
> > }
> > +
> > +svn_error_t *CopySources::error_occured() {
> > + return m_error_occured;
> > +}
> > Index: subversion/bindings/javahl/native/CopySources.h
> > ===================================================================
> > --- subversion/bindings/javahl/native/CopySources.h (revision 24543)
> > +++ subversion/bindings/javahl/native/CopySources.h (working copy)
> > @@ -60,11 +60,15 @@
> > static jobject makeJCopySource(const char *path,
> svn_revnum_t rev,
> > Pool &pool);
> >
> > + svn_error_t *error_occured();
> > +
> > private:
> > /**
> > * A local reference to the Java CopySources peer.
> > */
> > jobjectArray m_copySources;
> > +
> > + svn_error_t *m_error_occured;
> > };
> >
> > #endif /* COPY_SOURCES_H */
>
> -Hyrum

Thanks again Hyrum. The problem with testMergeInfoRetrieval() turned
out to be quite similar. Fixed both in r24548.

Mark - Built you the latest MSVC6.0 binaries. They are at the usual
place.

Paul B.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Apr 12 08:04:33 2007

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

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