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

Re: svn commit: r1157416 - in /subversion/trunk/subversion/bindings/javahl: src/org/apache/subversion/javahl/JNIError.java src/org/tigris/subversion/javahl/JNIError.java tests/org/apache/subversion/javahl/BasicTests.java

From: Hyrum K Wright <hyrum.wright_at_wandisco.com>
Date: Mon, 15 Aug 2011 07:16:29 -0500

The solution we used for SubversExceptions involved catching these in
the tirgis package, and then re-throwing the proper tigris exception.
That should work for this case, as well (but will be a bit of tedious
work).

-Hyrum

On Sat, Aug 13, 2011 at 8:28 PM, Mark Phippard <markphip_at_gmail.com> wrote:
> We could probably leave it behind for compile purposes but the native code would not throw the old class so I assume user would have a runtime error regardless.
>
> Sent from my iPhone
>
> On Aug 13, 2011, at 9:24 PM, Hyrum K Wright <hyrum.wright_at_wandisco.com> wrote:
>
>> Are there backward compat concerns here?
>>
>> IOW, if this is a public class in the tigris package and folks could
>> conceivably be catching it, such catches would now fail, yes?  (I'm
>> not familiar enough with the code or its use cases to know if this is
>> a valid concern or not.)
>>
>> -Hyrum
>>
>> On Sat, Aug 13, 2011 at 3:03 PM,  <markphip_at_apache.org> wrote:
>>> Author: markphip
>>> Date: Sat Aug 13 20:03:25 2011
>>> New Revision: 1157416
>>>
>>> URL: http://svn.apache.org/viewvc?rev=1157416&view=rev
>>> Log:
>>> Move JNIError class from org.tigris to org.apache package. This
>>> resolves NoClassDefFoundException at runtime when native code tries
>>> to throw this error.
>>>
>>> [ subversion/bindings/javahl/ ]
>>> * tests/org/apache/subversion/javahl/BasicTests.java
>>>  (testJNIError): New test to verify this error is thrown.
>>>
>>> * src/org/tigris/subversion/javahl/JNIError.java
>>> * src/org/apache/subversion/javahl/JNIError.java
>>>  Moved class from tigris to apache package.
>>>
>>>
>>> Added:
>>>    subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/JNIError.java
>>>      - copied, changed from r1157410, subversion/trunk/subversion/bindings/javahl/src/org/tigris/subversion/javahl/JNIError.java
>>> Removed:
>>>    subversion/trunk/subversion/bindings/javahl/src/org/tigris/subversion/javahl/JNIError.java
>>> Modified:
>>>    subversion/trunk/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java
>>>
>>> Copied: subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/JNIError.java (from r1157410, subversion/trunk/subversion/bindings/javahl/src/org/tigris/subversion/javahl/JNIError.java)
>>> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/JNIError.java?p2=subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/JNIError.java&p1=subversion/trunk/subversion/bindings/javahl/src/org/tigris/subversion/javahl/JNIError.java&r1=1157410&r2=1157416&rev=1157416&view=diff
>>> ==============================================================================
>>> --- subversion/trunk/subversion/bindings/javahl/src/org/tigris/subversion/javahl/JNIError.java (original)
>>> +++ subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/JNIError.java Sat Aug 13 20:03:25 2011
>>> @@ -21,7 +21,7 @@
>>>  * @endcopyright
>>>  */
>>>
>>> -package org.tigris.subversion.javahl;
>>> +package org.apache.subversion.javahl;
>>>
>>>  /**
>>>  * This error is thrown by error in the native library.
>>>
>>> Modified: subversion/trunk/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java
>>> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java?rev=1157416&r1=1157415&r2=1157416&view=diff
>>> ==============================================================================
>>> --- subversion/trunk/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java (original)
>>> +++ subversion/trunk/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java Sat Aug 13 20:03:25 2011
>>> @@ -130,6 +130,35 @@ public class BasicTests extends SVNTests
>>>     }
>>>
>>>     /**
>>> +     * Test the JNIError class functionality
>>> +     * @throws Throwable
>>> +     */
>>> +    public void testJNIError() throws Throwable
>>> +    {
>>> +        // build the test setup.
>>> +        OneTest thisTest = new OneTest();
>>> +
>>> +        // Create a client, dispose it, then try to use it later
>>> +        ISVNClient tempclient = new SVNClient();
>>> +        tempclient.dispose();
>>> +
>>> +        // create Y and Y/Z directories in the repository
>>> +        addExpectedCommitItem(null, thisTest.getUrl().toString(), "Y", NodeKind.none,
>>> +                              CommitItemStateFlags.Add);
>>> +        Set<String> urls = new HashSet<String>(1);
>>> +        urls.add(thisTest.getUrl() + "/Y");
>>> +        try
>>> +        {
>>> +            tempclient.mkdir(urls, false, null, new ConstMsg("log_msg"), null);
>>> +        }
>>> +        catch(JNIError e)
>>> +        {
>>> +               return; // Test passes!
>>> +        }
>>> +        fail("A JNIError should have been thrown here.");
>>> +    }
>>> +
>>> +    /**
>>>      * Tests Mergeinfo and RevisionRange classes.
>>>      * @since 1.5
>>>      */
>>>
>>>
>>>
>>
>>
>>
>> --
>>
>> uberSVN: Apache Subversion Made Easy
>> http://www.uberSVN.com/
>

-- 
uberSVN: Apache Subversion Made Easy
http://www.uberSVN.com/
Received on 2011-08-15 14:17:08 CEST

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