Skip to content

Commit 7772757

Browse files
committed
refactor
1 parent 1c4f211 commit 7772757

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ hs_err_pid*
1414
/gradle
1515
build
1616
bin
17+
*.iml

src/main/java/org/scm4j/vcs/svn/SVNVCS.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public class SVNVCS implements IVCS {
7373
private SVNClientManager clientManager;
7474
private SVNURL trunkSVNUrl;
7575
private SVNAuthentication userPassAuth;
76-
private IVCSRepositoryWorkspace repo;
76+
private final IVCSRepositoryWorkspace repo;
7777
private String repoUrl;
7878

7979
public static final String MASTER_PATH= "trunk/";
@@ -335,8 +335,8 @@ public String getRepoUrl() {
335335
return repo.getRepoUrl();
336336
}
337337

338-
private void fillUnifiedDiffs(final String srcBranchName, final String dstBranchName, List<VCSDiffEntry> entries,
339-
IVCSLockedWorkingCopy wc) throws SVNException {
338+
private void fillUnifiedDiffs(final String srcBranchName, final String dstBranchName, List<VCSDiffEntry> entries)
339+
throws SVNException {
340340
for (VCSDiffEntry entry : entries) {
341341
ByteArrayOutputStream baos = new ByteArrayOutputStream();
342342

@@ -382,8 +382,8 @@ public void handleLogEntry(SVNLogEntry logEntry) throws SVNException {
382382
}
383383

384384

385-
private List<VCSDiffEntry> getDiffEntries(final String srcBranchName, final String dstBranchName,
386-
final IVCSLockedWorkingCopy wc) throws SVNException {
385+
private List<VCSDiffEntry> getDiffEntries(final String srcBranchName, final String dstBranchName)
386+
throws SVNException {
387387
final SvnOperationFactory svnOperationFactory = new SvnOperationFactory();
388388
final SvnDiffSummarize summarizeDiff = svnOperationFactory.createDiffSummarize();
389389
final List<VCSDiffEntry> res = new ArrayList<>();
@@ -424,8 +424,8 @@ public List<VCSDiffEntry> getBranchesDiff(final String srcBranchName, final Stri
424424
try {
425425
try (IVCSLockedWorkingCopy wc = repo.getVCSLockedWorkingCopy()) {
426426
checkout(getBranchUrl(dstBranchName), wc.getFolder());
427-
List<VCSDiffEntry> entries = getDiffEntries(srcBranchName, dstBranchName, wc);
428-
fillUnifiedDiffs(srcBranchName, dstBranchName, entries, wc);
427+
List<VCSDiffEntry> entries = getDiffEntries(srcBranchName, dstBranchName);
428+
fillUnifiedDiffs(srcBranchName, dstBranchName, entries);
429429
return entries;
430430
}
431431
} catch (SVNException e) {

src/test/java/org/scm4j/vcs/svn/SVNVCSTest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,14 @@ public class SVNVCSTest extends VCSAbstractTest {
2525
private static final String TRUNK_CREATED_COMMIT_MESSAGE = "trunk/ created";
2626
private static final String BRANCHES_CREATED_COMMIT_MESSAGE = "branches/ created";
2727
private SVNVCS svn;
28-
private SVNURL localRepoUrl;
2928
private SVNRepository svnRepo;
3029
private SVNWCClient mockedSVNRevertClient;
31-
private RuntimeException testSvnRevertException = new RuntimeException("test exeption on svn revert");
30+
private final RuntimeException testSvnRevertException = new RuntimeException("test exeption on svn revert");
3231

3332
@Override
3433
public void setUp() throws Exception {
3534
super.setUp();
36-
localRepoUrl = SVNRepositoryFactory.createLocalRepository(new File(repoUrl.replace("file://", "")), true, true);
35+
SVNURL localRepoUrl = SVNRepositoryFactory.createLocalRepository(new File(repoUrl.replace("file://", "")), true, true);
3736

3837
svnRepo = SVNRepositoryFactory.create(localRepoUrl);
3938

0 commit comments

Comments
 (0)