Index: subversion/bindings/javahl/tests/org/tigris/subversion/javahl/SVNAdminTests.java
===================================================================
--- subversion/bindings/javahl/tests/org/tigris/subversion/javahl/SVNAdminTests.java	(revision 38560)
+++ subversion/bindings/javahl/tests/org/tigris/subversion/javahl/SVNAdminTests.java	(working copy)
@@ -22,7 +22,9 @@
  */
 package org.tigris.subversion.javahl;
 
+import java.io.File;
 import java.io.IOException;
+import java.io.OutputStream;
 
 import org.tigris.subversion.javahl.Revision;
 import org.tigris.subversion.javahl.SubversionException;
@@ -55,11 +57,67 @@
     }
 
     public void testSetRevProp()
-        throws SubversionException, IOException
+    throws SubversionException, IOException
     {
         OneTest thisTest = new OneTest(false);
+        final String MSG = "Initial repository creation";
         admin.setRevProp(thisTest.getRepositoryPath(), Revision.getInstance(0),
-                         "svn:log", "Initial repository creation", false,
+                         "svn:log", MSG, false,
                          false);
+        PropertyData[] pdata = client.revProperties(
+                makeReposUrl(thisTest.getRepository()), Revision.getInstance(0)
+                );
+        assertNotNull("expect non null rev props");
+        String logMessage = null;
+        for (int i = 0; i < pdata.length; i++) {
+            if ("svn:log".equals(pdata[i].getName())) {
+                logMessage = pdata[i].getValue();
+                break;
+            }
+        }
+        assertEquals("expect rev prop change to take effect", MSG, logMessage);
     }
+    
+    public void testLoadRepo() 
+    throws SubversionException, IOException
+    {
+        /* Make sure SVNAdmin.load() works, with a repo dump file known
+         * to provoke bug 2979
+         */
+        // makes repos with nothing in it
+        OneTest thisTest = new OneTest(false,false);
+        // verify zero revisions in new repos
+        String repoUrl = makeReposUrl(thisTest.getRepository());
+        final Info2[] infoHolder = new Info2[1];
+        InfoCallback mycallback = new InfoCallback() {
+            public void singleInfo(Info2 info) {
+                infoHolder[0] = info;
+            }
+        };
+        client.info2(repoUrl, Revision.HEAD, Revision.HEAD,
+                Depth.immediates, null, mycallback);
+        assertNotNull("expect info callback", infoHolder[0]);
+        assertEquals("expect zero revisions in new repository",
+                0L, infoHolder[0].getLastChangedRev());
+        
+        // locate dump file in test environment
+        String testRoot = System.getProperty("test.rootdir",
+                "subversion/bindings/javahl/test-work");
+        File javahlRoot = new File(testRoot).getParentFile();
+        File dump = new File(javahlRoot, "tests/data/issue2979.dump");
+        InputInterface input = new FileInputer(dump);
+        OutputInterface loadLog = new IgnoreOutputer();
+        admin.load(thisTest.getRepositoryPath(),
+                input, loadLog, true, true, null);
+        // should have two revs after the load
+        infoHolder[0] = null;
+        client.info2(repoUrl, Revision.HEAD, Revision.HEAD,
+                Depth.immediates, null, mycallback);
+        assertEquals("expect two revisions after load()",
+                2L, infoHolder[0].getLastChangedRev());
+        // verify that the repos is faithful rep. of the dump file, 
+        // e.g., correct author
+        assertEquals("expect 'svn4ant' as author of r2",
+                "svn4ant", infoHolder[0].getLastChangedAuthor());
+    }
 }
Index: subversion/bindings/javahl/tests/org/tigris/subversion/javahl/SVNTests.java
===================================================================
--- subversion/bindings/javahl/tests/org/tigris/subversion/javahl/SVNTests.java	(revision 38560)
+++ subversion/bindings/javahl/tests/org/tigris/subversion/javahl/SVNTests.java	(working copy)
@@ -569,17 +569,19 @@
          *
          * @param createWC Whether to create the working copy on disk,
          * and initialize the expected working copy layout.
+         * @param loadRepos Whether to load the sample repository, or
+         * leave it with no initial revisions
          * @throws SubversionException If there is a problem
          * creating or loading the repository.
          * @throws IOException If there is a problem finding the
          * dump file.
          */
-        protected OneTest(boolean createWC)
+        protected OneTest(boolean createWC, boolean loadRepos)
             throws SubversionException, IOException
         {
             this.testName = testBaseName + ++testCounter;
             this.wc = greekWC.copy();
-            this.repository = createInitialRepository();
+            this.repository = createInitialRepository(loadRepos);
             this.url = makeReposUrl(repository);
 
             if (createWC)
@@ -593,8 +595,23 @@
          * corresponding working copy and expected working copy
          * layout.
          *
+         * @param createWC Whether to create the working copy on disk,
+         * and initialize the expected working copy layout.
+         * 
          * @see #OneTest
          */
+        protected OneTest(boolean createWC)
+            throws SubversionException, IOException
+        {
+            this(createWC,true);
+        }
+        /**
+         * Build a new test setup with a new repository.  Create a
+         * corresponding working copy and expected working copy
+         * layout.
+         *
+         * @see #OneTest
+         */
         protected OneTest()
             throws SubversionException, IOException
         {
@@ -695,7 +712,7 @@
          * @throws IOException If there is a problem finding the
          * dump file.
          */
-        protected File createInitialRepository()
+        protected File createInitialRepository(boolean loadGreek)
             throws SubversionException, IOException
         {
             // build a clean repository directory
@@ -704,8 +721,10 @@
             // create and load the repository from the default repository dump
             admin.create(repos.getAbsolutePath(), true, false,
                          conf.getAbsolutePath(), fsType);
-            admin.load(repos.getAbsolutePath(), new FileInputer(greekDump),
-                       new IgnoreOutputer(), false, false, null);
+            if (loadGreek) {
+                admin.load(repos.getAbsolutePath(), new FileInputer(greekDump),
+                        new IgnoreOutputer(), false, false, null);
+            }
             return repos;
         }
 
Index: subversion/bindings/javahl/tests/data/issue2979.dump
===================================================================
--- subversion/bindings/javahl/tests/data/issue2979.dump	(revision 0)
+++ subversion/bindings/javahl/tests/data/issue2979.dump	(revision 0)
@@ -0,0 +1,114 @@
+SVN-fs-dump-format-version: 2
+
+UUID: 712a93d4-7deb-6645-8811-f770f3dbb12c
+
+Revision-number: 0
+Prop-content-length: 56
+Content-length: 56
+
+K 8
+svn:date
+V 27
+2007-10-21T02:14:52.574819Z
+PROPS-END
+
+Revision-number: 1
+Prop-content-length: 101
+Content-length: 101
+
+K 7
+svn:log
+V 0
+
+K 10
+svn:author
+V 7
+svn4ant
+K 8
+svn:date
+V 27
+2007-10-21T02:14:52.895280Z
+PROPS-END
+
+Node-path: 20-Oct-2007_10-14-52614PM
+Node-kind: dir
+Node-action: add
+Prop-content-length: 10
+Content-length: 10
+
+PROPS-END
+
+
+Revision-number: 2
+Prop-content-length: 104
+Content-length: 104
+
+K 7
+svn:log
+V 3
+FOO
+K 10
+svn:author
+V 7
+svn4ant
+K 8
+svn:date
+V 27
+2007-10-21T02:14:55.989729Z
+PROPS-END
+
+Node-path: 20-Oct-2007_10-14-52614PM/a
+Node-kind: dir
+Node-action: add
+Prop-content-length: 10
+Content-length: 10
+
+PROPS-END
+
+
+Node-path: 20-Oct-2007_10-14-52614PM/a/world.txt
+Node-kind: file
+Node-action: add
+Prop-content-length: 100
+Text-content-length: 5
+Text-content-md5: f5a7924e621e84c9280a9a27e1bcb7f6
+Content-length: 105
+
+K 13
+svn:mime-type
+V 10
+text/plain
+K 12
+svn:keywords
+V 2
+Id
+K 13
+svn:eol-style
+V 6
+native
+PROPS-END
+World
+
+Node-path: 20-Oct-2007_10-14-52614PM/hello.txt
+Node-kind: file
+Node-action: add
+Prop-content-length: 100
+Text-content-length: 5
+Text-content-md5: 8b1a9953c4611296a827abf8c47804d7
+Content-length: 105
+
+K 13
+svn:mime-type
+V 10
+text/plain
+K 12
+svn:keywords
+V 2
+Id
+K 13
+svn:eol-style
+V 6
+native
+PROPS-END
+Hello
+
Index: subversion/bindings/javahl/native/JNIUtil.cpp
===================================================================
--- subversion/bindings/javahl/native/JNIUtil.cpp	(revision 38560)
+++ subversion/bindings/javahl/native/JNIUtil.cpp	(working copy)
@@ -677,16 +677,20 @@
  */
 jbyteArray JNIUtil::makeJByteArray(const signed char *data, int length)
 {
-  if (data == NULL || length == 0)
-    // a NULL or empty will create no Java array
+  if (data == NULL) {
+    // a NULL will create no Java array
     return NULL;
+  }
 
   JNIEnv *env = getEnv();
 
   // Allocate the Java array.
   jbyteArray ret = env->NewByteArray(length);
-  if (isJavaExceptionThrown())
+  if (isJavaExceptionThrown()) {
     return NULL;
+  } else if (ret == NULL) {
+    return NULL;
+  }
 
   // Access the bytes.
   jbyte *retdata = env->GetByteArrayElements(ret, NULL);

