Package com.google.gerrit.server
Class CommentContextLoader
- java.lang.Object
-
- com.google.gerrit.server.CommentContextLoader
-
public class CommentContextLoader extends Object
Computes the list ofContextLineInfo
for a given comment, that is, the lines of the source file surrounding and including the area where the comment was written.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
CommentContextLoader.Factory
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
fill()
A call to this method loads the context for all comments stored incandidates
.List<ContextLineInfo>
getContext(CommentInfo comment)
Returns an empty list ofContextLineInfo
.
-
-
-
Method Detail
-
getContext
public List<ContextLineInfo> getContext(CommentInfo comment)
Returns an empty list ofContextLineInfo
. Clients are expected to call this method one or more times. Each call returns a reference to an emptyList<ContextLineInfo>
.A single call to
fill()
will cause all list references returned from this method to be populated. If a client calls this method again with a comment that was passed before callingfill()
, the new populated list will be returned.- Parameters:
comment
- the comment entity for which we want to load the context- Returns:
- a list of
ContextLineInfo
-
fill
public void fill()
A call to this method loads the context for all comments stored incandidates
. This is useful so that the repository is opened once for all comments.
-
-