* based on other options. If insufficient information is available, an
* exception is thrown to the caller.
*
- * @return a repository matching this configuration.
+ * @return a repository matching this configuration. The caller is
+ * responsible to close the repository instance when it is no longer
+ * needed.
* @throws IllegalArgumentException
* insufficient parameters were set.
* @throws IOException
* the repository could not be accessed to configure the rest of
* the builder's parameters.
*/
- @SuppressWarnings("unchecked")
+ @SuppressWarnings({ "unchecked", "resource" })
public R build() throws IOException {
R repo = (R) new FileRepository(setup());
if (isMustExist() && !repo.getObjectDatabase().exists())
openLocks[i] = new Lock();
}
+ @SuppressWarnings("resource")
private Repository openRepository(final Key location,
final boolean mustExist) throws IOException {
Reference<Repository> ref = cacheMap.get(location);