Skip to content

Commit 702a0b0

Browse files
committed
refactor
1 parent e69f56e commit 702a0b0

File tree

2 files changed

+7
-30
lines changed

2 files changed

+7
-30
lines changed

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

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -437,17 +437,14 @@ protected List<String> listEntries(String path) throws SVNException {
437437

438438
Collection<SVNDirEntry> entries = repository.getDir(lastFolder, -1 , null , (Collection<SVNDirEntry>) null);
439439
List<SVNDirEntry> entriesList = new ArrayList<>(entries);
440-
Collections.sort(entriesList, new Comparator<SVNDirEntry>() {
441-
@Override
442-
public int compare(SVNDirEntry o1, SVNDirEntry o2) {
443-
if (o1.getRevision() < o2.getRevision()) {
444-
return -1;
445-
}
446-
if (o1.getRevision() > o2.getRevision()) {
447-
return 1;
448-
}
449-
return 0;
440+
Collections.sort(entriesList, (o1, o2) -> {
441+
if (o1.getRevision() < o2.getRevision()) {
442+
return -1;
443+
}
444+
if (o1.getRevision() > o2.getRevision()) {
445+
return 1;
450446
}
447+
return 0;
451448
});
452449
for (SVNDirEntry entry : entriesList) {
453450
if (entry.getKind() == SVNNodeKind.DIR && entry.getName().startsWith(folderPrefix)) {

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

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -234,22 +234,6 @@ public void testMergeConflictWCCorruption() throws Exception {
234234
} catch (EVCSException e) {
235235
checkEVCSException(e);
236236
}
237-
// try {
238-
239-
// fail();
240-
// } catch (EVCSException e) {
241-
// checkEVCSException(e);
242-
// }
243-
244-
245-
// doThrow(testCommonException).when(svn).getBranchUrl(anyString());
246-
// try {
247-
// vcs.merge(NEW_BRANCH, null, MERGE_COMMIT_MESSAGE);
248-
// fail();
249-
// } catch (RuntimeException e) {
250-
// checkException(e, testCommonException);
251-
// }
252-
253237
}
254238

255239
@Test
@@ -340,10 +324,6 @@ private void checkException(Exception e, Exception expectedCause) {
340324
}
341325
}
342326

343-
private void checkCommonException(Exception e) {
344-
checkException(e, testCommonException);
345-
}
346-
347327
@Test
348328
public void testFileExistsExceptions() throws Exception {
349329
SVNRepository mockedRepo = spy(svn.getSVNRepository());

0 commit comments

Comments
 (0)