From 86d58c6da3bc8da200752b1c33b2706a62ab94b0 Mon Sep 17 00:00:00 2001 From: Marcel Steinbeck Date: Sun, 17 Dec 2023 12:25:13 +0100 Subject: [PATCH] Deprecate getRevision and getPredecessorRevision --- README.md | 4 +- .../informatik/st/libvcs4j/RevisionRange.java | 77 +++++++---- .../st/libvcs4j/VCSModelFactory.java | 35 +++-- .../st/libvcs4j/RevisionRangeTest.java | 20 +-- .../st/libvcs4j/mapping/Mapping.java | 16 +-- .../st/libvcs4j/spoon/Environment.java | 8 +- .../st/libvcs4j/spoon/EnvironmentBuilder.java | 2 +- .../st/libvcs4j/mapping/MappingTest.java | 6 +- .../st/libvcs4j/mapping/TrackerGSONTest.java | 16 +-- .../spoon/EnvironmentBuilderGSONTest.java | 12 +- .../bloater/GodClassDetectorTest.java | 2 +- .../bloater/LongMethodDetectorTest.java | 2 +- .../LongParameterListDetectorTest.java | 2 +- .../codesmell/coupler/CycleDetectorTest.java | 2 +- .../coupler/MethodChainDetectorTest.java | 2 +- .../dispensable/CommentsDetectorTest.java | 4 +- .../dispensable/DataClassDetectorTest.java | 2 +- .../dispensable/UnusedCodeDetectorTest.java | 2 +- .../missingJavadoc/JavadocDetectorTest.java | 126 +++++++++--------- .../SwitchStatementDetectorTest.java | 2 +- .../ooabusers/TemporaryFieldDetectorTest.java | 2 +- .../st/libvcs4j/engine/AbstractVSCEngine.java | 2 +- .../informatik/st/libvcs4j/VCSBaseTest.java | 28 ++-- .../st/libvcs4j/engine/IntegrationTest.java | 4 +- .../st/libvcs4j/engine/JsonSurferTest.java | 2 +- .../st/libvcs4j/git/JavaCPPTest.java | 26 ++-- .../informatik/st/libvcs4j/hg/JavaHGTest.java | 8 +- 27 files changed, 218 insertions(+), 196 deletions(-) diff --git a/README.md b/README.md index 692d15bf..ace21350 100644 --- a/README.md +++ b/README.md @@ -62,10 +62,10 @@ VCSEngine vcs = ... for (RevisionRange range : vcs) { // Path to the root of the currently checked out revivion. - range.getRevision().getOutput(); + range.getCurrent().getOutput(); // Returns the files of the currenlty checked out revision as list. - range.getRevision().getFiles(); + range.getCurrent().getFiles(); } ``` diff --git a/libvcs4j-api/src/main/java/de/unibremen/informatik/st/libvcs4j/RevisionRange.java b/libvcs4j-api/src/main/java/de/unibremen/informatik/st/libvcs4j/RevisionRange.java index 14fa72a6..c032605e 100644 --- a/libvcs4j-api/src/main/java/de/unibremen/informatik/st/libvcs4j/RevisionRange.java +++ b/libvcs4j-api/src/main/java/de/unibremen/informatik/st/libvcs4j/RevisionRange.java @@ -17,9 +17,9 @@ /** * This class represents the state transition between two revisions. The "from" - * revision (if any) is available with {@link #getPredecessorRevision()}. The - * "to" revision is available with {@link #getRevision()}. - * + * revision (if any) is available with {@link #getPrevious()}. The "to" + * revision is available with {@link #getCurrent()}. + *

* A single range may subsume several commits to merge commits on, for * instance, a monthly basis. */ @@ -37,11 +37,38 @@ public interface RevisionRange extends VCSModelElement { /** * Returns the "to" revision the file changes of this range belong to. + * @deprecated + * Use {@link #getCurrent()} instead. * * @return * The "to" revision the file changes of this range belong to. */ - Revision getRevision(); + @Deprecated + default Revision getRevision() { + return getCurrent(); + } + + /** + * Returns the "to" revision the file changes of this range belong to. + * + * @return + * The "to" revision the file changes of this range belong to. + */ + Revision getCurrent(); + + /** + * Returns the "from" revision the file changes of this range belong to. + * @deprecated + * Use {@link #getPrevious()} instead. + * + * @return + * The "from" revision the file changes of this range belong to or an + * empty {@link Optional} if this is the first range. + */ + @Deprecated + default Optional getPredecessorRevision() { + return getPrevious(); + } /** * Returns the "from" revision the file changes of this range belong to. @@ -50,13 +77,12 @@ public interface RevisionRange extends VCSModelElement { * The "from" revision the file changes of this range belong to or an * empty {@link Optional} if this is the first range. */ - Optional getPredecessorRevision(); + Optional getPrevious(); /** - * Returns the commits that have been applied to - * {@link #getPredecessorRevision()} so that {@link #getRevision()} results - * from it. The order of the returned list is from oldest to latest. - * Contains at least one commit. + * Returns the commits that have been applied to {@link #getPrevious()} so + * that {@link #getCurrent()} results from it. The order of the returned + * list is from oldest to latest. Contains at least one commit. * * @return * The list of commits. @@ -77,10 +103,9 @@ default Commit getLatestCommit() { } /** - * Returns all files that have changed between - * {@link #getPredecessorRevision()} and {@link #getRevision()}. The - * default implementation, if necessary, merges the file changes of all - * commits listed in {@link #getCommits()}. + * Returns all files that have changed between {@link #getPrevious()} and + * {@link #getCurrent()}. The default implementation, if necessary, merges + * the file changes of all commits listed in {@link #getCommits()}. * * @return * The list of file changes. @@ -178,8 +203,8 @@ default List getFileChanges() { // Postprocessing: Replace accumulated file changes such that the // revisions of the referenced files match with the predecessor and // successor revision of this range. - final Revision predRev = getPredecessorRevision().orElse(null); - final Revision rev = getRevision(); + final Revision predRev = getPrevious().orElse(null); + final Revision rev = getCurrent(); final VCSEngine engine = getVCSEngine(); final VCSModelFactory factory = engine.getModelFactory(); final ListIterator it = accum.listIterator(); @@ -301,7 +326,7 @@ default List getFileChangesBySuffix(final String suffix) { * {@code prefix}. * * You may use this method to analyze file changes affecting a certain - * directory (and its sub-directories) only. For instance, call + * directory (and its subdirectories) only. For instance, call * {@code getFileChangesByPrefix("src/main/java")} to get only the file * changes affecting files located in "src/main/java". * @@ -378,7 +403,7 @@ default List getIssues() { * Returns whether this range is the first one. That is, there is no * predecessor revision and, consequently, all changes returned by * {@link #getFileChanges()} are additions. The default implementation - * simply checks whether {@link #getPredecessorRevision()} returns an empty + * simply checks whether {@link #getPrevious()} returns an empty * {@link Optional}. * * @return @@ -386,7 +411,7 @@ default List getIssues() { * otherwise. */ default boolean isFirst() { - return getPredecessorRevision().isEmpty(); + return getPrevious().isEmpty(); } /** @@ -416,17 +441,16 @@ default void ifNotFirst(final Consumer action) { /** * Merges this range into {@code predecessor} and returns a new instance * that represents the state transition from - * {@code predecessor.getPredecessorRevision()} to - * {@code this.getRevision()}. The commits of {@code predecessor} and - * {@code this} are combined such that the commits of {@code this} are - * applied onto the commits of {@code predecessor}. + * {@code predecessor.getPrevious()} to {@code this.getCurrent()}. The + * commits of {@code predecessor} and {@code this} are combined such that + * the commits of {@code this} are applied onto the commits of + * {@code predecessor}. * * @param predecessor * The predecessor range to merge this range into. * @return * A new revision range representing the state transition from - * {@code predecessor.getPredecessorRevision()} to - * {@code this.getRevision()}. + * {@code predecessor.getPrevious()} to {@code this.getCurrent()}. * @throws NullPointerException * If {@code predecessor} is {@code null}. */ @@ -437,8 +461,7 @@ default RevisionRange merge(final RevisionRange predecessor) final List commits = predecessor.getCommits(); commits.addAll(getCommits()); return engine.getModelFactory().createRevisionRange(getOrdinal(), - getRevision(), - predecessor.getPredecessorRevision().orElse(null), commits, - getVCSEngine()); + getCurrent(), predecessor.getPrevious().orElse(null), + commits, getVCSEngine()); } } diff --git a/libvcs4j-api/src/main/java/de/unibremen/informatik/st/libvcs4j/VCSModelFactory.java b/libvcs4j-api/src/main/java/de/unibremen/informatik/st/libvcs4j/VCSModelFactory.java index 7f2af643..1d9c7e9d 100644 --- a/libvcs4j-api/src/main/java/de/unibremen/informatik/st/libvcs4j/VCSModelFactory.java +++ b/libvcs4j-api/src/main/java/de/unibremen/informatik/st/libvcs4j/VCSModelFactory.java @@ -392,28 +392,28 @@ public String toString() { * fallback. {@code null} values are filtered out. * * @param ordinal - * The ordinal of the revision range to create. - * @param revision - * The revision of the revision range to create. - * @param predecessorRevision - * The predecessor revision of the revision range to create. + * The ordinal of the range to create. + * @param current + * The current revision of the range to create. + * @param previous + * The previous revision of the range to create. * @param commits - * The commits of the revision range to create. + * The commits of the range to create. * @param engine - * The engine of the revision range to create. + * The engine of the range to create. * @return * The created {@link RevisionRange} instance. * @throws NullPointerException - * If {@code revision} or {@code engine} is {@code null}. + * If {@code current} or {@code engine} is {@code null}. * @throws IllegalArgumentException * If {@code ordinal < 1} or if {@code commits} is empty. */ default RevisionRange createRevisionRange(final int ordinal, - final Revision revision, final Revision predecessorRevision, + final Revision current, final Revision previous, final List commits, final VCSEngine engine) throws NullPointerException, IllegalArgumentException { Validate.isPositive(ordinal, "Ordinal (%d) < 1"); - Validate.notNull(revision); + Validate.notNull(current); Validate.notNull(engine); final List _commits = createCopy(commits); Validate.notEmpty(_commits, "There must be at least one commit"); @@ -424,13 +424,13 @@ public int getOrdinal() { } @Override - public Revision getRevision() { - return revision; + public Revision getCurrent() { + return current; } @Override - public Optional getPredecessorRevision() { - return Optional.ofNullable(predecessorRevision); + public Optional getPrevious() { + return Optional.ofNullable(previous); } @Override @@ -446,10 +446,9 @@ public VCSEngine getVCSEngine() { @Override public String toString() { return String.format("RevisionRange(ordinal=%d, " + - "revision=%s, predecessorRevision=%s, commits=%d, " + - "first=%b)", getOrdinal(), getRevision().getId(), - getPredecessorRevision().map(Revision::getId) - .orElse(null), + "current=%s, previous=%s, commits=%d, " + + "first=%b)", getOrdinal(), getCurrent().getId(), + getPrevious().map(Revision::getId).orElse(null), getCommits().size(), isFirst()); } }; diff --git a/libvcs4j-api/src/test/java/de/unibremen/informatik/st/libvcs4j/RevisionRangeTest.java b/libvcs4j-api/src/test/java/de/unibremen/informatik/st/libvcs4j/RevisionRangeTest.java index 4f7a6cc6..679c38ea 100644 --- a/libvcs4j-api/src/test/java/de/unibremen/informatik/st/libvcs4j/RevisionRangeTest.java +++ b/libvcs4j-api/src/test/java/de/unibremen/informatik/st/libvcs4j/RevisionRangeTest.java @@ -105,7 +105,7 @@ public void testMergeAddRelocateRemove() { RevisionRange range1 = spy(RevisionRange.class); when(range1.getCommits()).thenReturn(Arrays.asList(c1, c2)); when(range1.getVCSEngine()).thenReturn(engine); - when(range1.getRevision()).thenReturn(rev3); + when(range1.getCurrent()).thenReturn(rev3); assertThat(range1.getFileChanges()) .hasSize(1) .first() @@ -185,8 +185,8 @@ public void testRelocateRelocateRelocate() { RevisionRange range1 = spy(RevisionRange.class); when(range1.getCommits()).thenReturn(Arrays.asList(c2, c3)); when(range1.getVCSEngine()).thenReturn(vcs); - when(range1.getPredecessorRevision()).thenReturn(Optional.of(rev1)); - when(range1.getRevision()).thenReturn(rev3); + when(range1.getPrevious()).thenReturn(Optional.of(rev1)); + when(range1.getCurrent()).thenReturn(rev3); assertThat(range1.getFileChanges()) .hasSize(1) .first() @@ -204,8 +204,8 @@ public void testRelocateRelocateRelocate() { RevisionRange range2 = spy(RevisionRange.class); when(range2.getCommits()).thenReturn(Arrays.asList(c2, c3, c4)); when(range2.getVCSEngine()).thenReturn(vcs); - when(range2.getPredecessorRevision()).thenReturn(Optional.of(rev1)); - when(range2.getRevision()).thenReturn(rev4); + when(range2.getPrevious()).thenReturn(Optional.of(rev1)); + when(range2.getCurrent()).thenReturn(rev4); assertThat(range2.getFileChanges()) .hasSize(1) .first() @@ -260,8 +260,8 @@ public void testAddAdd() { RevisionRange range = spy(RevisionRange.class); when(range.getCommits()).thenReturn(Arrays.asList(c1, c2)); when(range.getVCSEngine()).thenReturn(vcs); - when(range.getPredecessorRevision()).thenReturn(Optional.empty()); - when(range.getRevision()).thenReturn(rev2); + when(range.getPrevious()).thenReturn(Optional.empty()); + when(range.getCurrent()).thenReturn(rev2); assertThat(range.getFileChanges()).hasSize(2); assertThat(range.getFileChanges().get(0).getType()) @@ -334,7 +334,7 @@ public void testUnrelated() { RevisionRange range = spy(RevisionRange.class); when(range.getCommits()).thenReturn(Arrays.asList(c1, c2, c3)); when(range.getVCSEngine()).thenReturn(engine); - when(range.getRevision()).thenReturn(rev3); + when(range.getCurrent()).thenReturn(rev3); assertThat(range.getFileChanges().get(0).getType()) .isEqualTo(r1.getType()); assertThat(range.getFileChanges().get(1).getType()) @@ -388,7 +388,7 @@ public void isFirstWithPredecessor() { Revision rev = mock(Revision.class); RevisionRange range = mock(RevisionRange.class); - when(range.getPredecessorRevision()).thenReturn(Optional.of(rev)); + when(range.getPrevious()).thenReturn(Optional.of(rev)); when(range.isFirst()).thenCallRealMethod(); assertThat(range.isFirst()).isFalse(); } @@ -396,7 +396,7 @@ public void isFirstWithPredecessor() { @Test public void isFirstWithoutPredecessor() { RevisionRange range = mock(RevisionRange.class); - when(range.getPredecessorRevision()).thenReturn(Optional.empty()); + when(range.getPrevious()).thenReturn(Optional.empty()); when(range.isFirst()).thenCallRealMethod(); assertThat(range.isFirst()).isTrue(); } diff --git a/libvcs4j-tools/src/main/java/de/unibremen/informatik/st/libvcs4j/mapping/Mapping.java b/libvcs4j-tools/src/main/java/de/unibremen/informatik/st/libvcs4j/mapping/Mapping.java index 34934289..2e9fb865 100644 --- a/libvcs4j-tools/src/main/java/de/unibremen/informatik/st/libvcs4j/mapping/Mapping.java +++ b/libvcs4j-tools/src/main/java/de/unibremen/informatik/st/libvcs4j/mapping/Mapping.java @@ -275,7 +275,7 @@ public Result map( log.info("Mapping {}/{} elements", previous.size(), mappables.size()); final List> current = filterOutNull(mappables); validateSameRevisions(current); - validateHaveRevision(current, range.getRevision()); + validateHaveRevision(current, range.getCurrent()); final IdentityHashMap, Mappable> bySignature = mapBySignature(previous, current); @@ -320,10 +320,10 @@ public Result map( * @throws NullPointerException * If any of the given arguments is {@code null}. * @throws IllegalArgumentException - * If {@code range} has no predecessor (see - * {@link RevisionRange#getPredecessorRevision()}), if {@code from} or - * {@code to} contain a mappable without a range, or if {@code from} - * or {@code to} contain a mappable that does not correspond to + * If {@code range} has no predecessor revision (see + * {@link RevisionRange#getPrevious()}), if {@code from} or + * {@code to} contains a mappable without a range, or if {@code from} + * or {@code to} contains a mappable that does not correspond to * {@code range}. * @throws IOException * If an error occurred while applying changes (see @@ -335,7 +335,7 @@ public Result map( @NonNull final RevisionRange range) throws IOException { final List> backup = new ArrayList<>(previous); try { - final Revision preRev = range.getPredecessorRevision() + final Revision preRev = range.getPrevious() .orElseThrow(() -> new IllegalArgumentException( "Revision range without predecessor")); final List> prev = filterOutNull(from); @@ -451,7 +451,7 @@ private static boolean haveRevision( final IdentityHashMap, Mappable> fromToUpdated = new IdentityHashMap<>(); from.forEach(f -> fromToUpdated.put(f, f)); - final Optional preRev = range.getPredecessorRevision(); + final Optional preRev = range.getPrevious(); final boolean applyChanges = preRev.isPresent() && haveRevision(from, preRev.get()); if (applyChanges) { @@ -482,7 +482,7 @@ private static boolean haveRevision( private static Optional> applyChanges( @NonNull final Mappable mappable, @NonNull final RevisionRange revRange) throws IOException { - final Revision revision = revRange.getRevision(); + final Revision revision = revRange.getCurrent(); final List ranges = new ArrayList<>(); for (final VCSFile.Range range : mappable.getRanges()) { // Never returns an addition. diff --git a/libvcs4j-tools/src/main/java/de/unibremen/informatik/st/libvcs4j/spoon/Environment.java b/libvcs4j-tools/src/main/java/de/unibremen/informatik/st/libvcs4j/spoon/Environment.java index ad544796..9f41c326 100644 --- a/libvcs4j-tools/src/main/java/de/unibremen/informatik/st/libvcs4j/spoon/Environment.java +++ b/libvcs4j-tools/src/main/java/de/unibremen/informatik/st/libvcs4j/spoon/Environment.java @@ -39,13 +39,13 @@ public class Environment { private final RevisionRange revisionRange; /** - * Shortcut for {@code getRevisionRange().getRevision()}. + * Shortcut for {@code getRevisionRange().getCurrent()}. * * @return - * The revision returned by {@code getRevisionRange().getRevision()}. + * The revision returned by {@code getRevisionRange().getCurrent()}. */ public Revision getRevision() { - return revisionRange.getRevision(); + return revisionRange.getCurrent(); } /** @@ -79,7 +79,7 @@ public List findReferencedFiles(@NonNull final VCSFile file) { // Make VCS file paths canonical. final Map fileToCPath = new IdentityHashMap<>(); try { - final Revision revision = revisionRange.getRevision(); + final Revision revision = revisionRange.getCurrent(); for (final VCSFile vFile : revision.getFiles()) { final Path cPath = vFile.toFile().getCanonicalFile().toPath(); fileToCPath.put(vFile, cPath); diff --git a/libvcs4j-tools/src/main/java/de/unibremen/informatik/st/libvcs4j/spoon/EnvironmentBuilder.java b/libvcs4j-tools/src/main/java/de/unibremen/informatik/st/libvcs4j/spoon/EnvironmentBuilder.java index 0641ed55..4fd29e6a 100644 --- a/libvcs4j-tools/src/main/java/de/unibremen/informatik/st/libvcs4j/spoon/EnvironmentBuilder.java +++ b/libvcs4j-tools/src/main/java/de/unibremen/informatik/st/libvcs4j/spoon/EnvironmentBuilder.java @@ -70,7 +70,7 @@ public Optional getEnvironment() { */ public Environment update(@NonNull final RevisionRange range) throws BuildException { - final Revision revision = range.getRevision(); + final Revision revision = range.getCurrent(); log.info("Building Spoon model for revision {}", revision.getId()); log.info("Enable auto imports: {}", autoImports); log.info("Enable comments: {}", comments); diff --git a/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/mapping/MappingTest.java b/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/mapping/MappingTest.java index bac397b4..8ecfff18 100644 --- a/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/mapping/MappingTest.java +++ b/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/mapping/MappingTest.java @@ -42,7 +42,7 @@ public void setUp() { revisionRange = mock(RevisionRange.class); Revision revision = mock(Revision.class); when(revision.getId()).thenReturn("2"); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); } @Test @@ -83,7 +83,7 @@ public void testInvalidRevisionsOfFrom() throws IOException { when(revision.getId()).thenReturn("2"); Revision predRevision = mock(Revision.class); when(predRevision.getId()).thenReturn("1"); - when(revisionRange.getPredecessorRevision()).thenReturn(Optional.of(predRevision)); + when(revisionRange.getPrevious()).thenReturn(Optional.of(predRevision)); ranges = Collections.singletonList(range); mockMappable = mock(Mappable.class); when(mockMappable.getRanges()).thenReturn(ranges); @@ -429,7 +429,7 @@ private VCSFile.Range createMockRange(final int withBeginPosition, when(revision.getId()).thenReturn("1"); Revision predRevision = mock(Revision.class); when(predRevision.getId()).thenReturn("1"); - when(revisionRange.getPredecessorRevision()) + when(revisionRange.getPrevious()) .thenReturn(Optional.of(predRevision)); } else { when(revision.getId()).thenReturn("2"); diff --git a/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/mapping/TrackerGSONTest.java b/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/mapping/TrackerGSONTest.java index 2c4d84fc..eb26fa70 100644 --- a/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/mapping/TrackerGSONTest.java +++ b/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/mapping/TrackerGSONTest.java @@ -57,7 +57,7 @@ public void noMoveInChangedFile() throws IOException { RevisionRange fromRange = engine.next() .orElseThrow(AssertionError::new); - List fromFiles = fromRange.getRevision() + List fromFiles = fromRange.getCurrent() .getFilesBySuffix(suffix); Mappable fromMappable = new MappableMock( fromFiles.get(0), 1, 1, 200, 1); @@ -65,7 +65,7 @@ public void noMoveInChangedFile() throws IOException { RevisionRange toRange = engine.next() .orElseThrow(AssertionError::new); - List toFiles = toRange.getRevision() + List toFiles = toRange.getCurrent() .getFilesBySuffix(suffix); Mappable toMappables = new MappableMock( toFiles.get(0), 1, 1, 200, 1); @@ -94,7 +94,7 @@ public void noMoveInUnchangedFile() throws IOException { RevisionRange fromRange = engine.next() .orElseThrow(AssertionError::new); - List fromFiles = fromRange.getRevision() + List fromFiles = fromRange.getCurrent() .getFilesBySuffix(suffix); Mappable fromMappable = new MappableMock( fromFiles.get(0), 64, 1, 66, 1); @@ -102,7 +102,7 @@ public void noMoveInUnchangedFile() throws IOException { RevisionRange toRange = engine.next() .orElseThrow(AssertionError::new); - List toFiles = toRange.getRevision() + List toFiles = toRange.getCurrent() .getFilesBySuffix(suffix); Mappable toMappables = new MappableMock( toFiles.get(0), 64, 1, 66, 1); @@ -131,7 +131,7 @@ public void moveWithoutChange() throws IOException { RevisionRange fromRange = engine.next() .orElseThrow(AssertionError::new); - List fromFiles = fromRange.getRevision() + List fromFiles = fromRange.getCurrent() .getFilesBySuffix(suffix); Mappable fromMappable = new MappableMock( fromFiles.get(0), 1, 1, 200, 1); @@ -139,7 +139,7 @@ public void moveWithoutChange() throws IOException { RevisionRange toRange = engine.next() .orElseThrow(AssertionError::new); - List toFiles = toRange.getRevision() + List toFiles = toRange.getCurrent() .getFilesBySuffix(suffix); Mappable toMappables = new MappableMock( toFiles.get(0), 3, 1, 200, 1); @@ -168,7 +168,7 @@ public void moveWithChange() throws IOException { RevisionRange fromRange = engine.next() .orElseThrow(AssertionError::new); - List fromFiles = fromRange.getRevision() + List fromFiles = fromRange.getCurrent() .getFilesBySuffix(suffix); Mappable fromMappable = new MappableMock( fromFiles.get(0), 250, 1, 325, 1); @@ -176,7 +176,7 @@ public void moveWithChange() throws IOException { RevisionRange toRange = engine.next() .orElseThrow(AssertionError::new); - List toFiles = toRange.getRevision() + List toFiles = toRange.getCurrent() .getFilesBySuffix(suffix); Mappable toMappables = new MappableMock( toFiles.get(0), 250, 1, 327, 1); diff --git a/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/spoon/EnvironmentBuilderGSONTest.java b/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/spoon/EnvironmentBuilderGSONTest.java index bee1857f..7023b91c 100644 --- a/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/spoon/EnvironmentBuilderGSONTest.java +++ b/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/spoon/EnvironmentBuilderGSONTest.java @@ -87,9 +87,9 @@ public void nullPointerInUpdateFrom565To567() throws Exception { RevisionRange r2 = mock(RevisionRange.class); Path p2 = basePath.resolve("Intercept.java"); assertThat(output.resolve(p2).toFile().delete()).isTrue(); - when(r2.getRevision()).thenReturn(r1.getRevision()); + when(r2.getCurrent()).thenReturn(r1.getCurrent()); when(r2.getFileChanges()).thenReturn(singletonList(new RemoveMock( - r1.getRevision(), p2.toString()))); + r1.getCurrent(), p2.toString()))); when(r2.getRemovedFiles()).thenCallRealMethod(); assertThat(builder.update(r2)).isNotNull(); assertThat(builder.getEnvironment().orElseThrow(AssertionError::new) @@ -101,9 +101,9 @@ public void nullPointerInUpdateFrom565To567() throws Exception { RevisionRange r3 = mock(RevisionRange.class); Path p3 = basePath.resolve("JsonPostDeserializer.java"); assertThat(output.resolve(p3).toFile().delete()).isTrue(); - when(r3.getRevision()).thenReturn(r1.getRevision()); + when(r3.getCurrent()).thenReturn(r1.getCurrent()); when(r3.getFileChanges()).thenReturn(singletonList(new RemoveMock( - r1.getRevision(), p3.toString()))); + r1.getCurrent(), p3.toString()))); when(r3.getRemovedFiles()).thenCallRealMethod(); assertThat(builder.update(r3)).isNotNull(); assertThat(builder.getEnvironment().orElseThrow(AssertionError::new) @@ -115,9 +115,9 @@ public void nullPointerInUpdateFrom565To567() throws Exception { RevisionRange r4 = mock(RevisionRange.class); Path p4 = basePath.resolve("package-info.java"); assertThat(output.resolve(p4).toFile().delete()).isTrue(); - when(r4.getRevision()).thenReturn(r1.getRevision()); + when(r4.getCurrent()).thenReturn(r1.getCurrent()); when(r4.getFileChanges()).thenReturn(singletonList(new RemoveMock( - r1.getRevision(), p4.toString()))); + r1.getCurrent(), p4.toString()))); when(r4.getRemovedFiles()).thenCallRealMethod(); assertThat(builder.update(r4)).isNotNull(); assertThat(builder.getEnvironment().orElseThrow(AssertionError::new) diff --git a/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/spoon/codesmell/bloater/GodClassDetectorTest.java b/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/spoon/codesmell/bloater/GodClassDetectorTest.java index 5469efc5..d3e832b1 100644 --- a/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/spoon/codesmell/bloater/GodClassDetectorTest.java +++ b/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/spoon/codesmell/bloater/GodClassDetectorTest.java @@ -30,7 +30,7 @@ public void test001() throws IOException { revision.addFile(Paths.get("godclass", "GodClass.java")); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); Launcher launcher = new Launcher(); launcher.addInputResource(folder.getRoot().getAbsolutePath()); diff --git a/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/spoon/codesmell/bloater/LongMethodDetectorTest.java b/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/spoon/codesmell/bloater/LongMethodDetectorTest.java index 2774d268..2b2eab6c 100644 --- a/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/spoon/codesmell/bloater/LongMethodDetectorTest.java +++ b/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/spoon/codesmell/bloater/LongMethodDetectorTest.java @@ -30,7 +30,7 @@ public void test001() throws IOException { "LongMethodWithComments.java")); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); Launcher launcher = new Launcher(); launcher.addInputResource(folder.getRoot().getAbsolutePath()); diff --git a/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/spoon/codesmell/bloater/LongParameterListDetectorTest.java b/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/spoon/codesmell/bloater/LongParameterListDetectorTest.java index e887a19e..8cb6275e 100644 --- a/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/spoon/codesmell/bloater/LongParameterListDetectorTest.java +++ b/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/spoon/codesmell/bloater/LongParameterListDetectorTest.java @@ -29,7 +29,7 @@ public void test001() throws IOException { revision.addFile(Paths.get("lpl", "LongParameterList.java")); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); Launcher launcher = new Launcher(); launcher.addInputResource(folder.getRoot().getAbsolutePath()); diff --git a/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/spoon/codesmell/coupler/CycleDetectorTest.java b/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/spoon/codesmell/coupler/CycleDetectorTest.java index 6c4ef557..24092970 100644 --- a/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/spoon/codesmell/coupler/CycleDetectorTest.java +++ b/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/spoon/codesmell/coupler/CycleDetectorTest.java @@ -28,7 +28,7 @@ public void testSimpleCycleDetection() throws Exception { revision.addFile(Paths.get("cycle", "Cycle.java")); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); Launcher launcher = new Launcher(); launcher.addInputResource(folder.getRoot().getAbsolutePath()); diff --git a/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/spoon/codesmell/coupler/MethodChainDetectorTest.java b/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/spoon/codesmell/coupler/MethodChainDetectorTest.java index 5b3dbf5c..da1cf9b6 100644 --- a/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/spoon/codesmell/coupler/MethodChainDetectorTest.java +++ b/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/spoon/codesmell/coupler/MethodChainDetectorTest.java @@ -29,7 +29,7 @@ public void test001() throws IOException { revision.addFile(Paths.get("method_chain", "MethodChainClass.java")); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); Launcher launcher = new Launcher(); launcher.addInputResource(folder.getRoot().getAbsolutePath()); diff --git a/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/spoon/codesmell/dispensable/CommentsDetectorTest.java b/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/spoon/codesmell/dispensable/CommentsDetectorTest.java index dc9945ff..8b339ae1 100644 --- a/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/spoon/codesmell/dispensable/CommentsDetectorTest.java +++ b/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/spoon/codesmell/dispensable/CommentsDetectorTest.java @@ -32,7 +32,7 @@ public void classWithSingleMethod() throws IOException { revision.addFile(Paths.get("comments", "Comment.java")); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); Launcher launcher = new Launcher(); launcher.addInputResource(folder.getRoot().getAbsolutePath()); @@ -63,7 +63,7 @@ public void testTwice() throws IOException { revision.addFile(Paths.get("comments", "Comments.java")); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); Launcher launcher = new Launcher(); launcher.addInputResource(folder.getRoot().getAbsolutePath()); diff --git a/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/spoon/codesmell/dispensable/DataClassDetectorTest.java b/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/spoon/codesmell/dispensable/DataClassDetectorTest.java index 4bcc34ae..fe7340a7 100644 --- a/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/spoon/codesmell/dispensable/DataClassDetectorTest.java +++ b/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/spoon/codesmell/dispensable/DataClassDetectorTest.java @@ -29,7 +29,7 @@ public void tripleDataClass() throws IOException { revision.addFile(Paths.get("dataclass", "Triple.java")); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); Launcher launcher = new Launcher(); launcher.addInputResource(folder.getRoot().getAbsolutePath()); diff --git a/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/spoon/codesmell/dispensable/UnusedCodeDetectorTest.java b/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/spoon/codesmell/dispensable/UnusedCodeDetectorTest.java index dcc936ba..b35c21e2 100644 --- a/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/spoon/codesmell/dispensable/UnusedCodeDetectorTest.java +++ b/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/spoon/codesmell/dispensable/UnusedCodeDetectorTest.java @@ -30,7 +30,7 @@ public void test001() throws IOException { revision.addFile(Paths.get("unused", "PrivateOnly.java")); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); Launcher launcher = new Launcher(); launcher.addInputResource(folder.getRoot().getAbsolutePath()); diff --git a/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/spoon/codesmell/missingJavadoc/JavadocDetectorTest.java b/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/spoon/codesmell/missingJavadoc/JavadocDetectorTest.java index 8c1adfed..4b7e6104 100644 --- a/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/spoon/codesmell/missingJavadoc/JavadocDetectorTest.java +++ b/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/spoon/codesmell/missingJavadoc/JavadocDetectorTest.java @@ -61,7 +61,7 @@ public void testMethodJavadoc() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -215,7 +215,7 @@ public void testMethodWithoutFieldAccess() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -358,7 +358,7 @@ public void testMethodWithoutReturn() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -512,7 +512,7 @@ public void testMethodWithoutParam() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -655,7 +655,7 @@ public void testMethodWithoutException() throws IOException { launcher.addInputResource(folder.getRoot().getAbsolutePath()); CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -782,7 +782,7 @@ public void testMethodWithoutDeprecated() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); JavadocDetector javadocDetectorWithoutDeprecated = new JavadocDetector(env); @@ -930,7 +930,7 @@ public void testMethodJavadocable() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); JavadocDetector javadocDetector = new JavadocDetector(env); @@ -958,7 +958,7 @@ public void testMethodAMPublic() throws IOException { launcher.addInputResource(folder.getRoot().getAbsolutePath()); CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -1047,7 +1047,7 @@ public void testMethodAMPrivate() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -1120,7 +1120,7 @@ public void testMethodAMProtected() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -1219,7 +1219,7 @@ public void testMethodAMNull() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); JavadocDetector javadocDetector = new JavadocDetector(env); @@ -1281,7 +1281,7 @@ public void testMethodAMMixed() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); JavadocDetector javadocDetector = new JavadocDetector(env); @@ -1426,7 +1426,7 @@ public void testPackage() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); JavadocDetector javadocDetector = new JavadocDetector(env); @@ -1492,7 +1492,7 @@ public void testPackageJavadocable() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -1518,7 +1518,7 @@ public void testPackageInfo() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -1582,7 +1582,7 @@ public void testPackageInfoDeclaringPackageMissing_javadoc() throws IOException CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -1647,7 +1647,7 @@ public void testPackageInfo2() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -1708,7 +1708,7 @@ public void testField() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -1790,7 +1790,7 @@ public void testFieldAMPublic() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -1842,7 +1842,7 @@ public void testFieldAMPrivate() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -1903,7 +1903,7 @@ public void testFieldAMProtected() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -1955,7 +1955,7 @@ public void testFieldAMNull() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -2001,7 +2001,7 @@ public void testFieldAMMixed() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -2069,7 +2069,7 @@ public void testFieldJavadocable() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -2099,7 +2099,7 @@ public void testConstructor() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -2176,7 +2176,7 @@ public void testConstructorAMPublic() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -2212,7 +2212,7 @@ public void testConstructorAMPrivate() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -2254,7 +2254,7 @@ public void testConstructorAMProtected() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -2278,7 +2278,7 @@ public void testConstructorAMNull() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -2340,7 +2340,7 @@ public void testConstructorAMMixed() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -2410,7 +2410,7 @@ public void testConstructorJavadocable() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -2470,7 +2470,7 @@ public void testAnnotation() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -2526,7 +2526,7 @@ public void testAnnotationAMPublic() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -2566,7 +2566,7 @@ public void testAnnotationAMPrivate() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -2607,7 +2607,7 @@ public void testAnnotationAMProtected() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -2646,7 +2646,7 @@ public void testAnnotationAMNull() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -2685,7 +2685,7 @@ public void testAnnotationAMMixed() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -2734,7 +2734,7 @@ public void testAnnotationJavadocable() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -2775,7 +2775,7 @@ public void testEnum() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -2836,7 +2836,7 @@ public void testEnumAMPublic() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -2874,7 +2874,7 @@ public void testEnumAMPrivate() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -2912,7 +2912,7 @@ public void testEnumAMProtected() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -2953,7 +2953,7 @@ public void testEnumAMNull() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -2995,7 +2995,7 @@ public void testEnumAMMixed() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -3043,7 +3043,7 @@ public void testEnumJavadocable() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -3072,7 +3072,7 @@ public void testClass() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -3132,7 +3132,7 @@ public void testClassAMPublic() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -3170,7 +3170,7 @@ public void testClassAMPrivate() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -3208,7 +3208,7 @@ public void testClassAMProtected() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -3248,7 +3248,7 @@ public void testClassAMNull() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -3290,7 +3290,7 @@ public void testClassAMMixed() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -3336,7 +3336,7 @@ public void testClassJavadocable() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -3394,7 +3394,7 @@ public void testInterface() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -3460,7 +3460,7 @@ public void testInterfaceAMPublic() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -3502,7 +3502,7 @@ public void testInterfaceAMPrivate() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -3545,7 +3545,7 @@ public void testInterfaceAMProtected() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -3590,7 +3590,7 @@ public void testInterfaceAMNull() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -3636,7 +3636,7 @@ public void testInterfaceAMMixed() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -3689,7 +3689,7 @@ public void testInterfaceJavadocable() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -3777,7 +3777,7 @@ public void testReadByChar() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -3923,7 +3923,7 @@ public void testReadByCharWithoutParam() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -4061,7 +4061,7 @@ public void testReadByCharWithoutDeprecated() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); @@ -4186,7 +4186,7 @@ public void testReadByCharWithoutException() throws IOException { CtModel model = launcher.buildModel(); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); final var env = new Environment(model, revisionRange); diff --git a/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/spoon/codesmell/ooabusers/SwitchStatementDetectorTest.java b/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/spoon/codesmell/ooabusers/SwitchStatementDetectorTest.java index de3bef1c..ada9633d 100644 --- a/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/spoon/codesmell/ooabusers/SwitchStatementDetectorTest.java +++ b/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/spoon/codesmell/ooabusers/SwitchStatementDetectorTest.java @@ -29,7 +29,7 @@ public void simpleDetection() throws IOException { revision.addFile(Paths.get("switch-statement", "A.java")); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); Launcher launcher = new Launcher(); launcher.addInputResource(folder.getRoot().getAbsolutePath()); diff --git a/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/spoon/codesmell/ooabusers/TemporaryFieldDetectorTest.java b/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/spoon/codesmell/ooabusers/TemporaryFieldDetectorTest.java index da30cf85..7cfa2914 100644 --- a/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/spoon/codesmell/ooabusers/TemporaryFieldDetectorTest.java +++ b/libvcs4j-tools/src/test/java/de/unibremen/informatik/st/libvcs4j/spoon/codesmell/ooabusers/TemporaryFieldDetectorTest.java @@ -30,7 +30,7 @@ public void simpleDetection() throws IOException { revision.addFile(Paths.get("temporary-field", "A.java")); RevisionRange revisionRange = mock(RevisionRange.class); - when(revisionRange.getRevision()).thenReturn(revision); + when(revisionRange.getCurrent()).thenReturn(revision); Launcher launcher = new Launcher(); launcher.addInputResource(folder.getRoot().getAbsolutePath()); diff --git a/libvcs4j/src/main/java/de/unibremen/informatik/st/libvcs4j/engine/AbstractVSCEngine.java b/libvcs4j/src/main/java/de/unibremen/informatik/st/libvcs4j/engine/AbstractVSCEngine.java index cfdad758..4ecb2c64 100644 --- a/libvcs4j/src/main/java/de/unibremen/informatik/st/libvcs4j/engine/AbstractVSCEngine.java +++ b/libvcs4j/src/main/java/de/unibremen/informatik/st/libvcs4j/engine/AbstractVSCEngine.java @@ -158,7 +158,7 @@ public final Optional next() throws IOException { mapChanges(changes); } final RevisionRange range = createRevisionRange(changes); - currentRevision = range.getRevision(); + currentRevision = range.getCurrent(); return Optional.of(range); } diff --git a/libvcs4j/src/test/java/de/unibremen/informatik/st/libvcs4j/VCSBaseTest.java b/libvcs4j/src/test/java/de/unibremen/informatik/st/libvcs4j/VCSBaseTest.java index cb7491ae..19763f39 100644 --- a/libvcs4j/src/test/java/de/unibremen/informatik/st/libvcs4j/VCSBaseTest.java +++ b/libvcs4j/src/test/java/de/unibremen/informatik/st/libvcs4j/VCSBaseTest.java @@ -240,7 +240,7 @@ public void processAll() throws IOException { .isEqualTo(i + 1); assertThat(r.getLatestCommit().getId()) .isEqualTo(commitIds.get(i)); - assertThat(r.getRevision().getId()) + assertThat(r.getCurrent().getId()) .isEqualTo(revisionIds.get(i)); } } @@ -260,7 +260,7 @@ public void processSubDir() throws IOException { RevisionRange r = ranges.get(i); assertEquals(i + 1, r.getOrdinal()); assertEquals(commitIds.get(i), r.getLatestCommit().getId()); - assertEquals(revisionIds.get(i), r.getRevision().getId()); + assertEquals(revisionIds.get(i), r.getCurrent().getId()); } } @@ -281,7 +281,7 @@ public void rangeInterval0To3() throws IOException { RevisionRange r = ranges.get(i); assertEquals(i + 1, r.getOrdinal()); assertEquals(commitIds.get(i), r.getLatestCommit().getId()); - assertEquals(revisionIds.get(i), r.getRevision().getId()); + assertEquals(revisionIds.get(i), r.getCurrent().getId()); } } @@ -302,7 +302,7 @@ public void rangeInterval5To9() throws IOException { RevisionRange r = ranges.get(i); assertEquals(i + 1, r.getOrdinal()); assertEquals(commitIds.get(i + 5), r.getLatestCommit().getId()); - assertEquals(revisionIds.get(i + 5), r.getRevision().getId()); + assertEquals(revisionIds.get(i + 5), r.getCurrent().getId()); } } @@ -322,7 +322,7 @@ public void rangeIntervalTo2() throws IOException { RevisionRange r = ranges.get(i); assertEquals(i + 1, r.getOrdinal()); assertEquals(commitIds.get(i), r.getLatestCommit().getId()); - assertEquals(revisionIds.get(i), r.getRevision().getId()); + assertEquals(revisionIds.get(i), r.getCurrent().getId()); } } @@ -345,7 +345,7 @@ public void rangeIntervalLast3() throws IOException { assertEquals(commitIds.get(i + start), r.getLatestCommit().getId()); assertEquals(revisionIds.get(i + start), - r.getRevision().getId()); + r.getCurrent().getId()); } } @@ -366,7 +366,7 @@ public void revisionIntervalIdx0To5() throws IOException { for (int i = 0; i < ranges.size(); i++) { RevisionRange r = ranges.get(i); assertEquals(commitIds.get(i), r.getLatestCommit().getId()); - assertEquals(revisionIds.get(i), r.getRevision().getId()); + assertEquals(revisionIds.get(i), r.getCurrent().getId()); } } @@ -387,7 +387,7 @@ public void revisionIntervalIdx6To8() throws IOException { for (int i = 0; i < ranges.size(); i++) { RevisionRange r = ranges.get(i); assertEquals(commitIds.get(i + 6), r.getLatestCommit().getId()); - assertEquals(revisionIds.get(i + 6), r.getRevision().getId()); + assertEquals(revisionIds.get(i + 6), r.getCurrent().getId()); } } @@ -406,7 +406,7 @@ public void revisionIntervalIdxTo3() throws IOException { for (int i = 0; i < ranges.size(); i++) { RevisionRange r = ranges.get(i); assertEquals(commitIds.get(i), r.getLatestCommit().getId()); - assertEquals(revisionIds.get(i), r.getRevision().getId()); + assertEquals(revisionIds.get(i), r.getCurrent().getId()); } } @@ -429,7 +429,7 @@ public void revisionIntervalLast4() throws IOException { assertEquals(commitIds.get(i + start), r.getLatestCommit().getId()); assertEquals(revisionIds.get(i + start), - r.getRevision().getId()); + r.getCurrent().getId()); } } @@ -448,7 +448,7 @@ public void iterateFirst7() throws IOException { assertEquals(commitIds.get(i), range.getLatestCommit().getId()); assertEquals(revisionIds.get(i), - range.getRevision().getId()); + range.getCurrent().getId()); i++; } } @@ -466,7 +466,7 @@ public void readAllBytesOfOldRevision() throws IOException { file.readAllBytes(); } } - lastRevision = range.getRevision(); + lastRevision = range.getCurrent(); } assertThat(lastRevision).isNotNull(); } @@ -492,7 +492,7 @@ public void readLineInfoOfOldRevision() throws IOException { } } } - lastRevision = range.getRevision(); + lastRevision = range.getCurrent(); } } @@ -524,7 +524,7 @@ public void latestRevision() throws IOException { RevisionRange range = engine.next() .orElseThrow(AssertionFailedError::new); - assertThat(range.getRevision().getId()) + assertThat(range.getCurrent().getId()) .isEqualTo(revisionIds.get(revisionIds.size() - 1)); } diff --git a/libvcs4j/src/test/java/de/unibremen/informatik/st/libvcs4j/engine/IntegrationTest.java b/libvcs4j/src/test/java/de/unibremen/informatik/st/libvcs4j/engine/IntegrationTest.java index 2fc644f0..5bc6117c 100644 --- a/libvcs4j/src/test/java/de/unibremen/informatik/st/libvcs4j/engine/IntegrationTest.java +++ b/libvcs4j/src/test/java/de/unibremen/informatik/st/libvcs4j/engine/IntegrationTest.java @@ -63,14 +63,14 @@ public void testFetchNextVersion() throws IOException { optional = vp.next(); assertTrue(optional.isPresent()); range = optional.get(); - assertEquals("1", range.getRevision().getId()); + assertEquals("1", range.getCurrent().getId()); assertEquals(6, range.getFileChanges().size()); assertTrue(range.isFirst()); optional = vp.next(); assertTrue(optional.isPresent()); range = optional.get(); - assertEquals("2", range.getRevision().getId()); + assertEquals("2", range.getCurrent().getId()); assertFalse(range.isFirst()); assertEquals(7, range.getFileChanges().size()); assertEquals(2, range.getFileChanges().stream() diff --git a/libvcs4j/src/test/java/de/unibremen/informatik/st/libvcs4j/engine/JsonSurferTest.java b/libvcs4j/src/test/java/de/unibremen/informatik/st/libvcs4j/engine/JsonSurferTest.java index c26b6510..16ba3d9d 100644 --- a/libvcs4j/src/test/java/de/unibremen/informatik/st/libvcs4j/engine/JsonSurferTest.java +++ b/libvcs4j/src/test/java/de/unibremen/informatik/st/libvcs4j/engine/JsonSurferTest.java @@ -21,7 +21,7 @@ public void createOutputDirectory() { .build(); for (RevisionRange range : vcs) { - assertTrue(range.getRevision().getOutput().toFile().exists()); + assertTrue(range.getCurrent().getOutput().toFile().exists()); } } } diff --git a/libvcs4j/src/test/java/de/unibremen/informatik/st/libvcs4j/git/JavaCPPTest.java b/libvcs4j/src/test/java/de/unibremen/informatik/st/libvcs4j/git/JavaCPPTest.java index 346e63c4..067dd2f6 100644 --- a/libvcs4j/src/test/java/de/unibremen/informatik/st/libvcs4j/git/JavaCPPTest.java +++ b/libvcs4j/src/test/java/de/unibremen/informatik/st/libvcs4j/git/JavaCPPTest.java @@ -164,7 +164,7 @@ public void includeGitIgnoreInFile() throws IOException { assertTrue(range.isPresent()); List files = range.get() - .getRevision() + .getCurrent() .getFiles() .stream() .map(VCSFile::toRelativePath) @@ -185,7 +185,7 @@ public void doesNotIncludeGitDir() throws IOException { assertEquals(10, ranges.size()); ranges.stream() - .map(RevisionRange::getRevision) + .map(RevisionRange::getCurrent) .map(Revision::getFiles) .flatMap(Collection::stream) .map(VCSFile::toRelativePath) @@ -204,23 +204,23 @@ public void branch_gh_pages() throws IOException { assertEquals(9, ranges.size()); assertEquals("9b2c67502aaf168b1dbfee640a38a897cd02a6ec", - ranges.get(0).getRevision().getId()); + ranges.get(0).getCurrent().getId()); assertEquals("369203faee219272bc658333c71ffc7dc9117efb", - ranges.get(1).getRevision().getId()); + ranges.get(1).getCurrent().getId()); assertEquals("6b95f2bc0b443299e6dbfbf9774fd807c8e8b2c4", - ranges.get(2).getRevision().getId()); + ranges.get(2).getCurrent().getId()); assertEquals("320baec0f14f99c2284bb69e0dc6df52677f1474", - ranges.get(3).getRevision().getId()); + ranges.get(3).getCurrent().getId()); assertEquals("fbdff9f6014d31f6bd7a5424f510ebd77d0b7c16", - ranges.get(4).getRevision().getId()); + ranges.get(4).getCurrent().getId()); assertEquals("4e6011ac12f6e3f7ed9464814cbd7d0a09065273", - ranges.get(5).getRevision().getId()); + ranges.get(5).getCurrent().getId()); assertEquals("1106d44879310a9aa658ac73120ea4aaa67d0ab0", - ranges.get(6).getRevision().getId()); + ranges.get(6).getCurrent().getId()); assertEquals("1c08928b9b4e0f6529760cf7dbc607383afa7fa5", - ranges.get(7).getRevision().getId()); + ranges.get(7).getCurrent().getId()); assertEquals("32510a922ab069d52c312b3fb8668fb9dfda5e5f", - ranges.get(8).getRevision().getId()); + ranges.get(8).getCurrent().getId()); } @Test @@ -233,7 +233,7 @@ public void lineInfoBuildMojo3934c45285d() throws IOException { Optional range = engine.next(); assertTrue(range.isPresent()); - Revision revision = range.get().getRevision(); + Revision revision = range.get().getCurrent(); VCSFile buildMojo = revision.getFilesBySuffix("BuildMojo.java").get(0); List lineInfo = buildMojo.readLineInfo(); @@ -271,7 +271,7 @@ public void lineInfoBuildMojo29208dSubDir() throws IOException { Optional range = engine.next(); assertTrue(range.isPresent()); - Revision revision = range.get().getRevision(); + Revision revision = range.get().getCurrent(); VCSFile buildMojo = revision.getFilesBySuffix("BuildMojo.java").get(0); List lineInfo = buildMojo.readLineInfo(); diff --git a/libvcs4j/src/test/java/de/unibremen/informatik/st/libvcs4j/hg/JavaHGTest.java b/libvcs4j/src/test/java/de/unibremen/informatik/st/libvcs4j/hg/JavaHGTest.java index 1dd9023e..b2c96f9a 100644 --- a/libvcs4j/src/test/java/de/unibremen/informatik/st/libvcs4j/hg/JavaHGTest.java +++ b/libvcs4j/src/test/java/de/unibremen/informatik/st/libvcs4j/hg/JavaHGTest.java @@ -106,7 +106,7 @@ public void branch_1485179654809() throws IOException { engine.forEach(ranges::add); assertEquals(1, ranges.size()); assertEquals("544c5168e4d3d314a996699692d8099ffa6419b2", - ranges.get(0).getRevision().getId()); + ranges.get(0).getCurrent().getId()); } @Test @@ -121,7 +121,7 @@ public void branch_1485179654809_withRevisionInterval() throws IOException { engine.forEach(ranges::add); assertEquals(1, ranges.size()); assertEquals("544c5168e4d3d314a996699692d8099ffa6419b2", - ranges.get(0).getRevision().getId()); + ranges.get(0).getCurrent().getId()); } @Test @@ -134,7 +134,7 @@ public void lineInfoAddCommandTest30b413d2d2() throws IOException { Optional range = engine.next(); assertTrue(range.isPresent()); - Revision revision = range.get().getRevision(); + Revision revision = range.get().getCurrent(); VCSFile addCommandTest = revision .getFilesBySuffix("AddCommandTest.java").get(0); List lineInfo = addCommandTest.readLineInfo(); @@ -169,7 +169,7 @@ public void lineInfoAddCommandTest1da1b235e27cSubDir() throws IOException { Optional range = engine.next(); assertTrue(range.isPresent()); - Revision revision = range.get().getRevision(); + Revision revision = range.get().getCurrent(); VCSFile addCommandTest = revision .getFilesBySuffix("AddCommandTest.java").get(0); List lineInfo = addCommandTest.readLineInfo();