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()tags/v1.7.0
<classpathentry kind="lib" path="ext/tracwiki-core-1.4.jar" sourcepath="ext/src/tracwiki-core-1.4.jar" /> | <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/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/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/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/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/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-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/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/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/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" /> | <classpathentry kind="lib" path="ext/bcpkix-jdk15on-1.51.jar" sourcepath="ext/src/bcpkix-jdk15on-1.51.jar" /> | ||||
<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/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/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/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="con" path="org.eclipse.jdt.launching.JRE_CONTAINER" /> | ||||
<classpathentry kind="src" path="src/main/dagger"> | <classpathentry kind="src" path="src/main/dagger"> | ||||
<attributes> | <attributes> |
slf4j.version : 1.7.10 | slf4j.version : 1.7.10 | ||||
wicket.version : 1.4.21 | wicket.version : 1.4.21 | ||||
lucene.version : 4.10.0 | lucene.version : 4.10.0 | ||||
jgit.version : 3.7.0.201502260915-r | |||||
jgit.version : 4.0.0.201506090130-r | |||||
groovy.version : 2.4.1 | groovy.version : 2.4.1 | ||||
bouncycastle.version : 1.51 | bouncycastle.version : 1.51 | ||||
selenium.version : 2.28.0 | selenium.version : 2.28.0 |
</library> | </library> | ||||
</orderEntry> | </orderEntry> | ||||
<orderEntry type="module-library"> | <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> | <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> | </CLASSES> | ||||
<JAVADOC /> | <JAVADOC /> | ||||
<SOURCES> | <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> | </SOURCES> | ||||
</library> | </library> | ||||
</orderEntry> | </orderEntry> | ||||
<orderEntry type="module-library"> | <orderEntry type="module-library"> | ||||
<library name="jsch-0.1.50.jar"> | |||||
<library name="jsch-0.1.51.jar"> | |||||
<CLASSES> | <CLASSES> | ||||
<root url="jar://$MODULE_DIR$/ext/jsch-0.1.50.jar!/" /> | |||||
<root url="jar://$MODULE_DIR$/ext/jsch-0.1.51.jar!/" /> | |||||
</CLASSES> | </CLASSES> | ||||
<JAVADOC /> | <JAVADOC /> | ||||
<SOURCES> | <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> | </SOURCES> | ||||
</library> | </library> | ||||
</orderEntry> | </orderEntry> | ||||
</library> | </library> | ||||
</orderEntry> | </orderEntry> | ||||
<orderEntry type="module-library"> | <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> | <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> | </CLASSES> | ||||
<JAVADOC /> | <JAVADOC /> | ||||
<SOURCES> | <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> | </SOURCES> | ||||
</library> | </library> | ||||
</orderEntry> | </orderEntry> | ||||
</SOURCES> | </SOURCES> | ||||
</library> | </library> | ||||
</orderEntry> | </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" /> | <orderEntry type="inheritedJdk" /> | ||||
</component> | </component> | ||||
</module> | </module> |
} | } | ||||
finally { | finally { | ||||
rw.dispose(); | rw.dispose(); | ||||
tw.release(); | |||||
tw.close(); | |||||
} | } | ||||
if (content == null) { | if (content == null) { |
// identified the missing object earlier before we got control. | // identified the missing object earlier before we got control. | ||||
LOGGER.error("failed to get commit count", e); | LOGGER.error("failed to get commit count", e); | ||||
} finally { | } finally { | ||||
walk.release(); | |||||
walk.close(); | |||||
} | } | ||||
sendError(""); | sendError(""); | ||||
LOGGER.error("failed to get commit count", e); | LOGGER.error("failed to get commit count", e); | ||||
return 0; | return 0; | ||||
} finally { | } finally { | ||||
walk.release(); | |||||
walk.close(); | |||||
} | } | ||||
return count; | return count; | ||||
} | } |
} | } | ||||
// finished | // finished | ||||
reader.release(); | |||||
reader.close(); | |||||
// commit all changes and reset the searcher | // commit all changes and reset the searcher | ||||
config.setInt(CONF_INDEX, null, CONF_VERSION, INDEX_VERSION); | config.setInt(CONF_INDEX, null, CONF_VERSION, INDEX_VERSION); |
served = true; | served = true; | ||||
} | } | ||||
} finally { | } finally { | ||||
tw.release(); | |||||
tw.close(); | |||||
rw.dispose(); | rw.dispose(); | ||||
} | } | ||||
log.error("failed to read " + file, e); | log.error("failed to read " + file, e); | ||||
} finally { | } finally { | ||||
if (rw != null) { | if (rw != null) { | ||||
rw.release(); | |||||
rw.close(); | |||||
} | } | ||||
} | } | ||||
return null; | return null; | ||||
} catch (IOException e) { | } catch (IOException e) { | ||||
log.error("", e); | log.error("", e); | ||||
} finally { | } finally { | ||||
inserter.release(); | |||||
inserter.close(); | |||||
} | } | ||||
} | } | ||||
} finally { | } finally { | ||||
// release the treewalk | // release the treewalk | ||||
if (treeWalk != null) { | if (treeWalk != null) { | ||||
treeWalk.release(); | |||||
treeWalk.close(); | |||||
} | } | ||||
} | } | ||||
} finally { | } finally { | ||||
// finish the index | // finish the index | ||||
builder.finish(); | builder.finish(); | ||||
} finally { | } finally { | ||||
inserter.release(); | |||||
inserter.close(); | |||||
} | } | ||||
return newIndex; | return newIndex; | ||||
} | } | ||||
} | } | ||||
} finally { | } finally { | ||||
if (tw != null) { | if (tw != null) { | ||||
tw.release(); | |||||
tw.close(); | |||||
} | } | ||||
} | } | ||||
return list; | return list; | ||||
rc)); | rc)); | ||||
} | } | ||||
} finally { | } finally { | ||||
revWalk.release(); | |||||
revWalk.close(); | |||||
} | } | ||||
} finally { | } finally { | ||||
odi.release(); | |||||
odi.close(); | |||||
} | } | ||||
return success; | return success; | ||||
} | } |
} catch (IOException e) { | } catch (IOException e) { | ||||
error(e, repository, "{0} failed to zip files from commit {1}", commit.getName()); | error(e, repository, "{0} failed to zip files from commit {1}", commit.getName()); | ||||
} finally { | } finally { | ||||
tw.release(); | |||||
tw.close(); | |||||
rw.dispose(); | rw.dispose(); | ||||
} | } | ||||
return success; | return success; | ||||
} catch (IOException e) { | } catch (IOException e) { | ||||
error(e, repository, "{0} failed to {1} stream files from commit {2}", algorithm, commit.getName()); | error(e, repository, "{0} failed to {1} stream files from commit {2}", algorithm, commit.getName()); | ||||
} finally { | } finally { | ||||
tw.release(); | |||||
tw.close(); | |||||
rw.dispose(); | rw.dispose(); | ||||
} | } | ||||
return success; | return success; |
} | } | ||||
} finally { | } finally { | ||||
rw.dispose(); | rw.dispose(); | ||||
tw.release(); | |||||
tw.close(); | |||||
} | } | ||||
return content; | return content; | ||||
} | } | ||||
} catch (IOException e) { | } catch (IOException e) { | ||||
error(e, repository, "{0} failed to get files for commit {1}", commit.getName()); | error(e, repository, "{0} failed to get files for commit {1}", commit.getName()); | ||||
} finally { | } finally { | ||||
tw.release(); | |||||
tw.close(); | |||||
} | } | ||||
Collections.sort(list); | Collections.sort(list); | ||||
return list; | return list; | ||||
} catch (IOException e) { | } catch (IOException e) { | ||||
error(e, repository, "{0} failed to get files for commit {1}", commit.getName()); | error(e, repository, "{0} failed to get files for commit {1}", commit.getName()); | ||||
} finally { | } finally { | ||||
tw.release(); | |||||
tw.close(); | |||||
} | } | ||||
Collections.sort(list); | Collections.sort(list); | ||||
return list; | return list; | ||||
.getRawMode(0), tw.getObjectId(0).getName(), commit.getId().getName(), | .getRawMode(0), tw.getObjectId(0).getName(), commit.getId().getName(), | ||||
ChangeType.ADD)); | ChangeType.ADD)); | ||||
} | } | ||||
tw.release(); | |||||
tw.close(); | |||||
} else { | } else { | ||||
RevCommit parent = rw.parseCommit(commit.getParent(0).getId()); | RevCommit parent = rw.parseCommit(commit.getParent(0).getId()); | ||||
DiffStatFormatter df = new DiffStatFormatter(commit.getName()); | DiffStatFormatter df = new DiffStatFormatter(commit.getName()); | ||||
RevCommit start = rw.parseCommit(startRange); | RevCommit start = rw.parseCommit(startRange); | ||||
RevCommit end = rw.parseCommit(endRange); | RevCommit end = rw.parseCommit(endRange); | ||||
list.addAll(getFilesInRange(repository, start, end)); | list.addAll(getFilesInRange(repository, start, end)); | ||||
rw.release(); | |||||
rw.close(); | |||||
} catch (Throwable t) { | } catch (Throwable t) { | ||||
error(t, repository, "{0} failed to determine files in range {1}..{2}!", startCommit, endCommit); | error(t, repository, "{0} failed to determine files in range {1}..{2}!", startCommit, endCommit); | ||||
} | } | ||||
} catch (IOException e) { | } catch (IOException e) { | ||||
error(e, repository, "{0} failed to get documents for commit {1}", commit.getName()); | error(e, repository, "{0} failed to get documents for commit {1}", commit.getName()); | ||||
} finally { | } finally { | ||||
tw.release(); | |||||
tw.close(); | |||||
} | } | ||||
Collections.sort(list); | Collections.sort(list); | ||||
return list; | return list; | ||||
error(t, repository, "{0} can't find {1} in commit {2}", path, commit.name()); | error(t, repository, "{0} can't find {1} in commit {2}", path, commit.name()); | ||||
} finally { | } finally { | ||||
rw.dispose(); | rw.dispose(); | ||||
tw.release(); | |||||
tw.close(); | |||||
} | } | ||||
return commitId; | return commitId; | ||||
} | } | ||||
success = false; | success = false; | ||||
} | } | ||||
} finally { | } finally { | ||||
revWalk.release(); | |||||
revWalk.close(); | |||||
} | } | ||||
} finally { | } finally { | ||||
odi.release(); | |||||
odi.close(); | |||||
} | } | ||||
} catch (Throwable t) { | } catch (Throwable t) { | ||||
error(t, repository, "Failed to create orphan branch {1} in repository {0}", branchName); | error(t, repository, "Failed to create orphan branch {1} in repository {0}", branchName); | ||||
LOGGER.error("Failed to determine canMerge", e); | LOGGER.error("Failed to determine canMerge", e); | ||||
} finally { | } finally { | ||||
if (revWalk != null) { | if (revWalk != null) { | ||||
revWalk.release(); | |||||
revWalk.close(); | |||||
} | } | ||||
} | } | ||||
return MergeStatus.NOT_MERGEABLE; | return MergeStatus.NOT_MERGEABLE; | ||||
// return the merge commit id | // return the merge commit id | ||||
return new MergeResult(MergeStatus.MERGED, mergeCommitId.getName()); | return new MergeResult(MergeStatus.MERGED, mergeCommitId.getName()); | ||||
} finally { | } finally { | ||||
odi.release(); | |||||
odi.close(); | |||||
} | } | ||||
} | } | ||||
} catch (IOException e) { | } catch (IOException e) { | ||||
LOGGER.error("Failed to merge", e); | LOGGER.error("Failed to merge", e); | ||||
} finally { | } finally { | ||||
if (revWalk != null) { | if (revWalk != null) { | ||||
revWalk.release(); | |||||
revWalk.close(); | |||||
} | } | ||||
} | } | ||||
return new MergeResult(MergeStatus.FAILED, null); | return new MergeResult(MergeStatus.FAILED, null); |
rc)); | rc)); | ||||
} | } | ||||
} finally { | } finally { | ||||
revWalk.release(); | |||||
revWalk.close(); | |||||
} | } | ||||
} finally { | } finally { | ||||
odi.release(); | |||||
odi.close(); | |||||
} | } | ||||
} catch (Throwable t) { | } catch (Throwable t) { | ||||
error(t, repository, "Failed to commit reflog entry to {0}"); | error(t, repository, "Failed to commit reflog entry to {0}"); | ||||
} | } | ||||
// release the treewalk | // release the treewalk | ||||
treeWalk.release(); | |||||
treeWalk.close(); | |||||
// finish temporary in-core index used for this commit | // finish temporary in-core index used for this commit | ||||
dcBuilder.finish(); | dcBuilder.finish(); | ||||
} finally { | } finally { | ||||
inserter.release(); | |||||
inserter.close(); | |||||
} | } | ||||
return inCoreIndex; | return inCoreIndex; | ||||
} | } |
} | } | ||||
} | } | ||||
} finally { | } finally { | ||||
revWalk.release(); | |||||
revWalk.close(); | |||||
} | } | ||||
} catch (UnsupportedEncodingException e) { | } catch (UnsupportedEncodingException e) { | ||||
logger().error(null, e); | logger().error(null, e); | ||||
} catch (IOException e) { | } catch (IOException e) { | ||||
logger().error(null, e); | logger().error(null, e); | ||||
} finally { | } finally { | ||||
odi.release(); | |||||
odi.close(); | |||||
db.close(); | db.close(); | ||||
} | } | ||||
return success; | return success; |
} | } | ||||
} catch (Exception e) { | } catch (Exception e) { | ||||
} finally { | } finally { | ||||
tw.release(); | |||||
tw.close(); | |||||
} | } | ||||
} | } | ||||
} | } |