From 568df19845bdb736642e723444362028523afab8 Mon Sep 17 00:00:00 2001 From: Roberto Tyley Date: Sun, 25 May 2014 19:34:24 +0100 Subject: [PATCH] Remove a bit of repetition and casting in PackFileTest PackFileTest lives in o.e.j.internal.storage.file, so I think it's OK for it to acknowledge the existence of FileRepository in order to avoid some unnecessary casting, and probably nicer to avoid the repetition too. Change-Id: I0de592a32f6178e6d6bf114848101e185b3111a1 Signed-off-by: Roberto Tyley --- .../jgit/internal/storage/file/PackFileTest.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackFileTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackFileTest.java index a19fcd9d50..3324627e7f 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackFileTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackFileTest.java @@ -95,7 +95,7 @@ public class PackFileTest extends LocalDiskRepositoryTestCase { private TestRng rng; - private Repository repo; + private FileRepository repo; private TestRepository tr; @@ -274,12 +274,9 @@ public class PackFileTest extends LocalDiskRepositoryTestCase { deflate(pack, delta); byte[] footer = digest(pack); - File packName = new File(new File( - ((FileObjectDatabase) repo.getObjectDatabase()).getDirectory(), - "pack"), idA.name() + ".pack"); - File idxName = new File(new File( - ((FileObjectDatabase) repo.getObjectDatabase()).getDirectory(), - "pack"), idA.name() + ".idx"); + File dir = new File(repo.getObjectDatabase().getDirectory(), "pack"); + File packName = new File(dir, idA.name() + ".pack"); + File idxName = new File(dir, idA.name() + ".idx"); FileOutputStream f = new FileOutputStream(packName); try { -- 2.39.5