Merge "Buck: Don't package gson library in shaded plugin jar"
diff --git a/pom.xml b/pom.xml
index 44198d1..67db036 100644
--- a/pom.xml
+++ b/pom.xml
@@ -20,13 +20,13 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>branch-network</artifactId>
<groupId>com.googlesource.gerrit.plugins.branchnetwork</groupId>
- <version>1.0-SNAPSHOT</version>
+ <version>2.12-rc0</version>
<name>Gerrit - Branch network display plugin</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<Gerrit-ApiType>plugin</Gerrit-ApiType>
- <Gerrit-ApiVersion>2.9-SNAPSHOT</Gerrit-ApiVersion>
+ <Gerrit-ApiVersion>${project.version}</Gerrit-ApiVersion>
<Gerrit-ReloadMode>reload</Gerrit-ReloadMode>
<Gerrit-Module>com.googlesource.gerrit.plugins.branchnetwork.GitCommitCacheModule</Gerrit-Module>
<Gerrit-HttpModule>com.googlesource.gerrit.plugins.branchnetwork.NetworkGraphModule</Gerrit-HttpModule>
@@ -52,8 +52,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
- <source>1.6</source>
- <target>1.6</target>
+ <source>1.7</source>
+ <target>1.7</target>
</configuration>
</plugin>
<plugin>
diff --git a/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/data/JGitFacade.java b/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/data/JGitFacade.java
index f0f0ab8..f0395b3 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/data/JGitFacade.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/data/JGitFacade.java
@@ -166,11 +166,8 @@
}
public int getBranchesPlotLanesCount(String repoName) throws IOException {
- final Repository repo =
- repoManager.openRepository(NameKey.parse(repoName));
- final PlotWalk walk = new PlotWalk(repo);
-
- try {
+ try (Repository repo = repoManager.openRepository(NameKey.parse(repoName));
+ PlotWalk walk = new PlotWalk(repo);) {
ObjectId headId = repo.resolve(Constants.HEAD);
if (headId == null) return 0;
@@ -188,9 +185,6 @@
}
return maxLane;
- } finally {
- walk.dispose();
- repo.close();
}
}
}