]> source.dussan.org Git - gitblit.git/commitdiff
Bump to JGit 4.0.0 272/head 57/257/1
authorLuca Milanesio <luca.milanesio@gmail.com>
Fri, 12 Jun 2015 16:59:37 +0000 (17:59 +0100)
committerLuca Milanesio <luca.milanesio@gmail.com>
Fri, 12 Jun 2015 16:59:47 +0000 (17:59 +0100)
JGit 4.0.0 fixes a memory leak but introduces a non-compatible change
for closing the RevWalk: before it was release() but now is close()

13 files changed:
.classpath
build.moxie
gitblit.iml
src/main/bugtraq/com/syntevo/bugtraq/BugtraqConfig.java
src/main/java/com/gitblit/git/PatchsetReceivePack.java
src/main/java/com/gitblit/service/LuceneService.java
src/main/java/com/gitblit/servlet/RawServlet.java
src/main/java/com/gitblit/tickets/BranchTicketService.java
src/main/java/com/gitblit/utils/CompressionUtils.java
src/main/java/com/gitblit/utils/JGitUtils.java
src/main/java/com/gitblit/utils/RefLogUtils.java
src/main/java/com/gitblit/wicket/pages/NewRepositoryPage.java
src/main/java/com/gitblit/wicket/panels/HistoryPanel.java

index fb8181c0b23a047b56bf745df7bb971edc4fda48..84ff69886a3ea8a69829409db07107d3b32f5dca 100644 (file)
        <classpathentry kind="lib" path="ext/tracwiki-core-1.4.jar" sourcepath="ext/src/tracwiki-core-1.4.jar" />
        <classpathentry kind="lib" path="ext/mediawiki-core-1.4.jar" sourcepath="ext/src/mediawiki-core-1.4.jar" />
        <classpathentry kind="lib" path="ext/confluence-core-1.4.jar" sourcepath="ext/src/confluence-core-1.4.jar" />
-       <classpathentry kind="lib" path="ext/org.eclipse.jgit-3.7.0.201502260915-r.jar" sourcepath="ext/src/org.eclipse.jgit-3.7.0.201502260915-r.jar" />
-       <classpathentry kind="lib" path="ext/jsch-0.1.50.jar" sourcepath="ext/src/jsch-0.1.50.jar" />
+       <classpathentry kind="lib" path="ext/org.eclipse.jgit-4.0.0.201506090130-r.jar" sourcepath="ext/src/org.eclipse.jgit-4.0.0.201506090130-r.jar" />
+       <classpathentry kind="lib" path="ext/jsch-0.1.51.jar" sourcepath="ext/src/jsch-0.1.51.jar" />
        <classpathentry kind="lib" path="ext/JavaEWAH-0.7.9.jar" sourcepath="ext/src/JavaEWAH-0.7.9.jar" />
        <classpathentry kind="lib" path="ext/httpclient-4.1.3.jar" sourcepath="ext/src/httpclient-4.1.3.jar" />
        <classpathentry kind="lib" path="ext/httpcore-4.1.4.jar" sourcepath="ext/src/httpcore-4.1.4.jar" />
        <classpathentry kind="lib" path="ext/commons-logging-1.1.1.jar" sourcepath="ext/src/commons-logging-1.1.1.jar" />
        <classpathentry kind="lib" path="ext/commons-codec-1.7.jar" sourcepath="ext/src/commons-codec-1.7.jar" />
-       <classpathentry kind="lib" path="ext/org.eclipse.jgit.http.server-3.7.0.201502260915-r.jar" sourcepath="ext/src/org.eclipse.jgit.http.server-3.7.0.201502260915-r.jar" />
+       <classpathentry kind="lib" path="ext/org.eclipse.jgit.http.server-4.0.0.201506090130-r.jar" sourcepath="ext/src/org.eclipse.jgit.http.server-4.0.0.201506090130-r.jar" />
        <classpathentry kind="lib" path="ext/bcprov-jdk15on-1.51.jar" sourcepath="ext/src/bcprov-jdk15on-1.51.jar" />
        <classpathentry kind="lib" path="ext/bcmail-jdk15on-1.51.jar" sourcepath="ext/src/bcmail-jdk15on-1.51.jar" />
        <classpathentry kind="lib" path="ext/bcpkix-jdk15on-1.51.jar" sourcepath="ext/src/bcpkix-jdk15on-1.51.jar" />
@@ -89,6 +89,8 @@
        <classpathentry kind="lib" path="ext/selenium-api-2.28.0.jar" sourcepath="ext/src/selenium-api-2.28.0.jar" />
        <classpathentry kind="lib" path="ext/commons-exec-1.1.jar" sourcepath="ext/src/commons-exec-1.1.jar" />
        <classpathentry kind="lib" path="ext/platform-3.4.0.jar" sourcepath="ext/src/platform-3.4.0.jar" />
+       <classpathentry kind="lib" path="ext/mockito-core-1.10.19.jar" sourcepath="ext/src/mockito-core-1.10.19.jar" />
+       <classpathentry kind="lib" path="ext/objenesis-2.1.jar" sourcepath="ext/src/objenesis-2.1.jar" />
        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER" />
        <classpathentry kind="src" path="src/main/dagger">
                <attributes>
index 6863968c5ee9cec5327eecc50434a3a12ed3900c..19730c5725bcb1ff3f8a8aa9d70639c210fca734 100644 (file)
@@ -106,7 +106,7 @@ properties: {
   slf4j.version  : 1.7.10
   wicket.version : 1.4.21
   lucene.version : 4.10.0
-  jgit.version   : 3.7.0.201502260915-r
+  jgit.version   : 4.0.0.201506090130-r
   groovy.version : 2.4.1
   bouncycastle.version : 1.51
   selenium.version : 2.28.0
index d35be382f366a397c75f82b70b26bf8d05e8ff01..de234358705fd2e57f7ff6e529d8a95a4de8c337 100644 (file)
       </library>
     </orderEntry>
     <orderEntry type="module-library">
-      <library name="org.eclipse.jgit-3.7.0.201502260915-r.jar">
+      <library name="org.eclipse.jgit-4.0.0.201506090130-r.jar">
         <CLASSES>
-          <root url="jar://$MODULE_DIR$/ext/org.eclipse.jgit-3.7.0.201502260915-r.jar!/" />
+          <root url="jar://$MODULE_DIR$/ext/org.eclipse.jgit-4.0.0.201506090130-r.jar!/" />
         </CLASSES>
         <JAVADOC />
         <SOURCES>
-          <root url="jar://$MODULE_DIR$/ext/src/org.eclipse.jgit-3.7.0.201502260915-r.jar!/" />
+          <root url="jar://$MODULE_DIR$/ext/src/org.eclipse.jgit-4.0.0.201506090130-r.jar!/" />
         </SOURCES>
       </library>
     </orderEntry>
     <orderEntry type="module-library">
-      <library name="jsch-0.1.50.jar">
+      <library name="jsch-0.1.51.jar">
         <CLASSES>
-          <root url="jar://$MODULE_DIR$/ext/jsch-0.1.50.jar!/" />
+          <root url="jar://$MODULE_DIR$/ext/jsch-0.1.51.jar!/" />
         </CLASSES>
         <JAVADOC />
         <SOURCES>
-          <root url="jar://$MODULE_DIR$/ext/src/jsch-0.1.50.jar!/" />
+          <root url="jar://$MODULE_DIR$/ext/src/jsch-0.1.51.jar!/" />
         </SOURCES>
       </library>
     </orderEntry>
       </library>
     </orderEntry>
     <orderEntry type="module-library">
-      <library name="org.eclipse.jgit.http.server-3.7.0.201502260915-r.jar">
+      <library name="org.eclipse.jgit.http.server-4.0.0.201506090130-r.jar">
         <CLASSES>
-          <root url="jar://$MODULE_DIR$/ext/org.eclipse.jgit.http.server-3.7.0.201502260915-r.jar!/" />
+          <root url="jar://$MODULE_DIR$/ext/org.eclipse.jgit.http.server-4.0.0.201506090130-r.jar!/" />
         </CLASSES>
         <JAVADOC />
         <SOURCES>
-          <root url="jar://$MODULE_DIR$/ext/src/org.eclipse.jgit.http.server-3.7.0.201502260915-r.jar!/" />
+          <root url="jar://$MODULE_DIR$/ext/src/org.eclipse.jgit.http.server-4.0.0.201506090130-r.jar!/" />
         </SOURCES>
       </library>
     </orderEntry>
         </SOURCES>
       </library>
     </orderEntry>
+    <orderEntry type="module-library" scope="TEST">
+      <library name="mockito-core-1.10.19.jar">
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/ext/mockito-core-1.10.19.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES>
+          <root url="jar://$MODULE_DIR$/ext/src/mockito-core-1.10.19.jar!/" />
+        </SOURCES>
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library" scope="TEST">
+      <library name="objenesis-2.1.jar">
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/ext/objenesis-2.1.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES>
+          <root url="jar://$MODULE_DIR$/ext/src/objenesis-2.1.jar!/" />
+        </SOURCES>
+      </library>
+    </orderEntry>
     <orderEntry type="inheritedJdk" />
   </component>
 </module>
index 7776e6fe46e57131bff349dd37f5b04e732f27e5..60b4ecc09d9d123d3f4d5403c6bede0280b50e4a 100644 (file)
@@ -214,7 +214,7 @@ public final class BugtraqConfig {
                        }
                        finally {
                                rw.dispose();
-                               tw.release();
+                               tw.close();
                        }
 
                        if (content == null) {
index 54ffb7baffe5b21cffd8eee39f705ed2143b125f..ef0b409b66760ffd4082907af07ba8df032057ea 100644 (file)
@@ -667,7 +667,7 @@ public class PatchsetReceivePack extends GitblitReceivePack {
                                        // identified the missing object earlier before we got control.\r
                                        LOGGER.error("failed to get commit count", e);\r
                                } finally {\r
-                                       walk.release();\r
+                                       walk.close();\r
                                }\r
 \r
                                sendError("");\r
@@ -1078,7 +1078,7 @@ public class PatchsetReceivePack extends GitblitReceivePack {
                        LOGGER.error("failed to get commit count", e);\r
                        return 0;\r
                } finally {\r
-                       walk.release();\r
+                       walk.close();\r
                }\r
                return count;\r
        }\r
index 798edb0a13091438fea5c60c570197fefee760a1..285ea8d70737d6eb962dcd7b3177a241c616a1b1 100644 (file)
@@ -615,7 +615,7 @@ public class LuceneService implements Runnable {
                        }\r
 \r
                        // finished\r
-                       reader.release();\r
+                       reader.close();\r
 \r
                        // commit all changes and reset the searcher\r
                        config.setInt(CONF_INDEX, null, CONF_VERSION, INDEX_VERSION);\r
index 09f9f8a3c5af652e0ad746486dd364fe035ff49d..1d2724bca7054a6b26fd5948f63f9d6cf598bc61 100644 (file)
@@ -468,7 +468,7 @@ public class RawServlet extends HttpServlet {
                                served = true;
                        }
                } finally {
-                       tw.release();
+                       tw.close();
                        rw.dispose();
                }
 
index 42189bfdf096ab33355826327a76ce9d8a749bb2..839669399f2d82d209fd2a3c387f5ef76c2c2f23 100644 (file)
@@ -297,7 +297,7 @@ public class BranchTicketService extends ITicketService implements RefsChangedLi
                        log.error("failed to read " + file, e);
                } finally {
                        if (rw != null) {
-                               rw.release();
+                               rw.close();
                        }
                }
                return null;
@@ -353,7 +353,7 @@ public class BranchTicketService extends ITicketService implements RefsChangedLi
                } catch (IOException e) {
                        log.error("", e);
                } finally {
-                       inserter.release();
+                       inserter.close();
                }
        }
 
@@ -712,7 +712,7 @@ public class BranchTicketService extends ITicketService implements RefsChangedLi
                        } finally {
                                // release the treewalk
                                if (treeWalk != null) {
-                                       treeWalk.release();
+                                       treeWalk.close();
                                }
                        }
                } finally {
@@ -811,7 +811,7 @@ public class BranchTicketService extends ITicketService implements RefsChangedLi
                        // finish the index
                        builder.finish();
                } finally {
-                       inserter.release();
+                       inserter.close();
                }
                return newIndex;
        }
@@ -855,7 +855,7 @@ public class BranchTicketService extends ITicketService implements RefsChangedLi
                        }
                } finally {
                        if (tw != null) {
-                               tw.release();
+                               tw.close();
                        }
                }
                return list;
@@ -913,10 +913,10 @@ public class BranchTicketService extends ITicketService implements RefsChangedLi
                                                        rc));
                                }
                        } finally {
-                               revWalk.release();
+                               revWalk.close();
                        }
                } finally {
-                       odi.release();
+                       odi.close();
                }
                return success;
        }
index d4bfbb34c5dbf129ec3818db08523e229093a750..b06edd22e79c75f2089de46bb45a06e9861e1d31 100644 (file)
@@ -132,7 +132,7 @@ public class CompressionUtils {
                } catch (IOException e) {\r
                        error(e, repository, "{0} failed to zip files from commit {1}", commit.getName());\r
                } finally {\r
-                       tw.release();\r
+                       tw.close();\r
                        rw.dispose();\r
                }\r
                return success;\r
@@ -291,7 +291,7 @@ public class CompressionUtils {
                } catch (IOException e) {\r
                        error(e, repository, "{0} failed to {1} stream files from commit {2}", algorithm, commit.getName());\r
                } finally {\r
-                       tw.release();\r
+                       tw.close();\r
                        rw.dispose();\r
                }\r
                return success;\r
index 69084ca1a2d3d8acd005099e7523c0479fdcce6b..356a796c71c74d94ad5558fa3136c908762cccc7 100644 (file)
@@ -774,7 +774,7 @@ public class JGitUtils {
                        }\r
                } finally {\r
                        rw.dispose();\r
-                       tw.release();\r
+                       tw.close();\r
                }\r
                return content;\r
        }\r
@@ -885,7 +885,7 @@ public class JGitUtils {
                } catch (IOException e) {\r
                        error(e, repository, "{0} failed to get files for commit {1}", commit.getName());\r
                } finally {\r
-                       tw.release();\r
+                       tw.close();\r
                }\r
                Collections.sort(list);\r
                return list;\r
@@ -942,7 +942,7 @@ public class JGitUtils {
                } catch (IOException e) {\r
                        error(e, repository, "{0} failed to get files for commit {1}", commit.getName());\r
                } finally {\r
-                       tw.release();\r
+                       tw.close();\r
                }\r
                Collections.sort(list);\r
                return list;\r
@@ -994,7 +994,7 @@ public class JGitUtils {
                                                        .getRawMode(0), tw.getObjectId(0).getName(), commit.getId().getName(),\r
                                                        ChangeType.ADD));\r
                                }\r
-                               tw.release();\r
+                               tw.close();\r
                        } else {\r
                                RevCommit parent = rw.parseCommit(commit.getParent(0).getId());\r
                                DiffStatFormatter df = new DiffStatFormatter(commit.getName());\r
@@ -1049,7 +1049,7 @@ public class JGitUtils {
                        RevCommit start = rw.parseCommit(startRange);\r
                        RevCommit end = rw.parseCommit(endRange);\r
                        list.addAll(getFilesInRange(repository, start, end));\r
-                       rw.release();\r
+                       rw.close();\r
                } catch (Throwable t) {\r
                        error(t, repository, "{0} failed to determine files in range {1}..{2}!", startCommit, endCommit);\r
                }\r
@@ -1147,7 +1147,7 @@ public class JGitUtils {
                } catch (IOException e) {\r
                        error(e, repository, "{0} failed to get documents for commit {1}", commit.getName());\r
                } finally {\r
-                       tw.release();\r
+                       tw.close();\r
                }\r
                Collections.sort(list);\r
                return list;\r
@@ -2044,7 +2044,7 @@ public class JGitUtils {
                        error(t, repository, "{0} can't find {1} in commit {2}", path, commit.name());\r
                } finally {\r
                        rw.dispose();\r
-                       tw.release();\r
+                       tw.close();\r
                }\r
                return commitId;\r
        }\r
@@ -2218,10 +2218,10 @@ public class JGitUtils {
                                                success = false;\r
                                        }\r
                                } finally {\r
-                                       revWalk.release();\r
+                                       revWalk.close();\r
                                }\r
                        } finally {\r
-                               odi.release();\r
+                               odi.close();\r
                        }\r
                } catch (Throwable t) {\r
                        error(t, repository, "Failed to create orphan branch {1} in repository {0}", branchName);\r
@@ -2412,7 +2412,7 @@ public class JGitUtils {
                        LOGGER.error("Failed to determine canMerge", e);\r
                } finally {\r
                        if (revWalk != null) {\r
-                               revWalk.release();\r
+                               revWalk.close();\r
                        }\r
                }\r
                return MergeStatus.NOT_MERGEABLE;\r
@@ -2498,14 +2498,14 @@ public class JGitUtils {
                                        // return the merge commit id\r
                                        return new MergeResult(MergeStatus.MERGED, mergeCommitId.getName());\r
                                } finally {\r
-                                       odi.release();\r
+                                       odi.close();\r
                                }\r
                        }\r
                } catch (IOException e) {\r
                        LOGGER.error("Failed to merge", e);\r
                } finally {\r
                        if (revWalk != null) {\r
-                               revWalk.release();\r
+                               revWalk.close();\r
                        }\r
                }\r
                return new MergeResult(MergeStatus.FAILED, null);\r
index f08c99e7d3715e4f604263432de3261cc5f53ae9..355c1208d23a8f3a3ed49876fab9a42ca2adc251 100644 (file)
@@ -294,10 +294,10 @@ public class RefLogUtils {
                                                                rc));
                                        }
                                } finally {
-                                       revWalk.release();
+                                       revWalk.close();
                                }
                        } finally {
-                               odi.release();
+                               odi.close();
                        }
                } catch (Throwable t) {
                        error(t, repository, "Failed to commit reflog entry to {0}");
@@ -395,12 +395,12 @@ public class RefLogUtils {
                        }
 
                        // release the treewalk
-                       treeWalk.release();
+                       treeWalk.close();
 
                        // finish temporary in-core index used for this commit
                        dcBuilder.finish();
                } finally {
-                       inserter.release();
+                       inserter.close();
                }
                return inCoreIndex;
        }
index b6c2359133c65eb8226efc11e58496d07c33051c..d2589e6faa8599a92ad8ff6953da4e32b2c18d44 100644 (file)
@@ -359,14 +359,14 @@ public class NewRepositoryPage extends RootSubPage {
                                        }\r
                                }\r
                        } finally {\r
-                               revWalk.release();\r
+                               revWalk.close();\r
                        }\r
                } catch (UnsupportedEncodingException e) {\r
                        logger().error(null, e);\r
                } catch (IOException e) {\r
                        logger().error(null, e);\r
                } finally {\r
-                       odi.release();\r
+                       odi.close();\r
                        db.close();\r
                }\r
                return success;\r
index e1706a09d3db834ba91b4b9d531a44bfef8e3e99..5233f7c9360a406f24c759fbd21dd3172529317a 100644 (file)
@@ -116,7 +116,7 @@ public class HistoryPanel extends BasePanel {
                                        }\r
                                } catch (Exception e) {\r
                                } finally {\r
-                                       tw.release();\r
+                                       tw.close();\r
                                }\r
                        }\r
                }\r