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

Re: svn commit: r23937 - in trunk/subversion/bindings/java/javahl: native src/org/tigris/subversion/javahl

From: Daniel Rall <dlr_at_collab.net>
Date: 2007-03-20 19:47:01 CET

Will singleStatus() ever throw ArrayIndexOutOfBoundsException? If so,
it might be more backwards compatible to wrap a try/catch block around
the Java one-liner to re-throw the exception as ClientException.

On Tue, 20 Mar 2007, hwright@tigris.org wrote:
...
> JavaHL: Remove the C++ implementation of singleStatus(), in favor of a one-line
> Java implementation.
>
> [ in subversion/bindings/java/javahl ]
> * src/org/tigris/subversion/javahl/SVNClient.java
> (singleStatus): Reimplement as a thin wrapper around the status() method. The
> defaults used are taken from the SVNClient::singleStatus() function, which
> is being removed.
>
> * native/SVNClient.h,
> native/SVNClient.cpp
> (singleStatus): Remove.
>
> * native/org_tigris_subversion_javahl_SVNClient.cpp
> (Java_org_tigris_subversion_javahl_SVNClient_singleStatus): Remove.
...
> --- trunk/subversion/bindings/java/javahl/native/SVNClient.cpp (original)
> +++ trunk/subversion/bindings/java/javahl/native/SVNClient.cpp Tue Mar 20 07:57:28 2007
> @@ -311,76 +311,6 @@
> }
> }
>
> -jobject SVNClient::singleStatus(const char *path, bool onServer)
> -{
> - status_baton statusBaton;
> - Pool requestPool;
> - svn_revnum_t youngest = SVN_INVALID_REVNUM;
> - svn_opt_revision_t rev;
> -
> - if (path == NULL)
> - {
> - JNIUtil::throwNullPointerException("path");
> - return NULL;
> - }
> -
> - svn_client_ctx_t *ctx = getContext(NULL);
> - if (ctx == NULL)
> - {
> - return NULL;
> - }
> -
> -
> - rev.kind = svn_opt_revision_unspecified;
> - statusBaton.pool = requestPool.pool();
> - Path intPath(path);
> - svn_error_t *Err = intPath.error_occured();
> - if (Err != NULL)
> - {
> - JNIUtil::handleSVNError(Err);
> - return NULL;
> - }
> -
> - Err = svn_client_status2(&youngest, intPath.c_str(), &rev,
> - statusReceiver, &statusBaton,
> - FALSE, // DESCEND
> - TRUE, // get_All
> - onServer ? TRUE : FALSE, //update
> - FALSE, //no_ignore,
> - FALSE, // ignore externals
> - ctx,
> - requestPool.pool());
> - if (Err == NULL)
> - {
> - int size = statusBaton.statusVect.size();
> - if (size == 0)
> - return NULL;
> -
> - // when svn_client_status is used with a directory, the status of the
> - // directory itself and the status of all its direct children are
> - // returned
> - // we just want the status of the directory (ie the status of the
> - // element with the shortest path)
> - int j = 0;
> - for (int i = 0; i < size; i++)
> - {
> - if (strlen(statusBaton.statusVect[i].path) <
> - strlen(statusBaton.statusVect[j].path))
> - j = i;
> - }
> -
> - jobject jStatus = createJavaStatus(statusBaton.statusVect[j].path,
> - statusBaton.statusVect[j].status);
> -
> - return jStatus;
> - }
> - else
> - {
> - JNIUtil::handleSVNError(Err);
> - return NULL;
> - }
> -}
...
> --- trunk/subversion/bindings/java/javahl/src/org/tigris/subversion/javahl/SVNClient.java (original)
> +++ trunk/subversion/bindings/java/javahl/src/org/tigris/subversion/javahl/SVNClient.java Tue Mar 20 07:57:28 2007
> @@ -270,8 +270,11 @@
> * @param onServer Request status information from the server.
> * @return the subversion status of the file.
> */
> - public native Status singleStatus(String path, boolean onServer)
> - throws ClientException;
> + public Status singleStatus(String path, boolean onServer)
> + throws ClientException
> + {
> + return status(path, false, onServer, true, false, false)[0];
> + }
...

  • application/pgp-signature attachment: stored
Received on Tue Mar 20 19:47:24 2007

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