Package com.google.gerrit.server.patch
Interface GitPositionTransformer.PositionConflictStrategy
-
- All Known Implementing Classes:
GitPositionTransformer.BestPositionOnConflict
,GitPositionTransformer.OmitPositionOnConflict
- Enclosing class:
- GitPositionTransformer
public static interface GitPositionTransformer.PositionConflictStrategy
Strategy indicating how to handleGitPositionTransformer.Position
s for which mapping conflicts exist. A mapping conflict means that aGitPositionTransformer.Position
can't be transformed such that it still refers to exactly the same commit content afterwards.Example: A
GitPositionTransformer.Position
refers to file foo.txt and lines 5-6 which contain the text "Line 5\nLine 6". One of theGitPositionTransformer.Mapping
s given toGitPositionTransformer.transform(Collection, Set)
indicates that line 5 of foo.txt was modified to "Line five\nLine 5.1\n". We could derive a transformedGitPositionTransformer.Position
(foo.txt, lines 5-7) but thatGitPositionTransformer.Position
would then refer to the content "Line five\nLine 5.1\nLine 6". If the modification started already in line 4, we could even only guess what the transformedGitPositionTransformer.Position
would be.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Optional<GitPositionTransformer.Position>
getOnFileConflict(GitPositionTransformer.Position oldPosition)
Determines an alternateGitPositionTransformer.Position
when there is no file for the position (= file deletion) in the target tree.Optional<GitPositionTransformer.Position>
getOnRangeConflict(GitPositionTransformer.Position oldPosition)
Determines an alternateGitPositionTransformer.Position
when the range of the position can't be mapped without a conflict.
-
-
-
Method Detail
-
getOnRangeConflict
Optional<GitPositionTransformer.Position> getOnRangeConflict(GitPositionTransformer.Position oldPosition)
Determines an alternateGitPositionTransformer.Position
when the range of the position can't be mapped without a conflict.- Parameters:
oldPosition
- position in the source tree- Returns:
- the new
GitPositionTransformer.Position
or an emptyOptional
if the position should be dropped
-
getOnFileConflict
Optional<GitPositionTransformer.Position> getOnFileConflict(GitPositionTransformer.Position oldPosition)
Determines an alternateGitPositionTransformer.Position
when there is no file for the position (= file deletion) in the target tree.- Parameters:
oldPosition
- position in the source tree- Returns:
- the new
GitPositionTransformer.Position
or an emptyOptional
if the position should be * dropped
-
-