Fix errorprone error AlmostJavadoc
Release-Notes: skip
Change-Id: I8c8fca75fa2869692f8d7ce2ebb1230255c7a1c7
diff --git a/java/com/google/gerrit/extensions/api/accounts/EmailInput.java b/java/com/google/gerrit/extensions/api/accounts/EmailInput.java
index 9d6b3c5..852e6ea 100644
--- a/java/com/google/gerrit/extensions/api/accounts/EmailInput.java
+++ b/java/com/google/gerrit/extensions/api/accounts/EmailInput.java
@@ -18,16 +18,20 @@
/** This entity contains information for registering a new email address. */
public class EmailInput {
- /* The email address. If provided, must match the email address from the URL. */
+ /** The email address. If provided, must match the email address from the URL. */
@DefaultInput public String email;
- /* Whether the new email address should become the preferred email address of
- * the user. Only supported if {@link #noConfirmation} is set or if the
- * authentication type is DEVELOPMENT_BECOME_ANY_ACCOUNT.*/
+ /**
+ * Whether the new email address should become the preferred email address of the user. Only
+ * supported if {@link #noConfirmation} is set or if the authentication type is
+ * DEVELOPMENT_BECOME_ANY_ACCOUNT.
+ */
public boolean preferred;
- /* Whether the email address should be added without confirmation. In this
- * case no verification email is sent to the user. Only Gerrit administrators
- * are allowed to add email addresses without confirmation. */
+ /**
+ * Whether the email address should be added without confirmation. In this case no verification
+ * email is sent to the user. Only Gerrit administrators are allowed to add email addresses
+ * without confirmation.
+ */
public boolean noConfirmation;
}
diff --git a/java/com/google/gerrit/lucene/LuceneChangeIndex.java b/java/com/google/gerrit/lucene/LuceneChangeIndex.java
index 0ef7564..c6deb61 100644
--- a/java/com/google/gerrit/lucene/LuceneChangeIndex.java
+++ b/java/com/google/gerrit/lucene/LuceneChangeIndex.java
@@ -474,15 +474,15 @@
}
}
- /*
+ /**
* Assign shard index values to the score documents.
*
- * <p>TopDocs.merge()'s API has been changed to stop allowing passing in a parameter to
- * indicate if it should set shard indices for hits as they are seen during the merge
- * process. This is done to simplify the API to be more dynamic in terms of passing in
- * custom tie breakers. If shard indices are to be used for tie breaking docs with equal
- * scores during TopDocs.merge(), then it is mandatory that the input ScoreDocs have their
- * shard indices set to valid values prior to calling merge().
+ * <p>TopDocs.merge()'s API has been changed to stop allowing passing in a parameter to indicate
+ * if it should set shard indices for hits as they are seen during the merge process. This is
+ * done to simplify the API to be more dynamic in terms of passing in custom tie breakers. If
+ * shard indices are to be used for tie breaking docs with equal scores during TopDocs.merge(),
+ * then it is mandatory that the input ScoreDocs have their shard indices set to valid values
+ * prior to calling merge().
*
* @param doc document
* @param shard index
diff --git a/java/com/google/gerrit/server/config/MetricsReservoirConfigImpl.java b/java/com/google/gerrit/server/config/MetricsReservoirConfigImpl.java
index ac3c53a..1b5c1c1 100644
--- a/java/com/google/gerrit/server/config/MetricsReservoirConfigImpl.java
+++ b/java/com/google/gerrit/server/config/MetricsReservoirConfigImpl.java
@@ -62,33 +62,33 @@
.orElse(RESERVOIR_ALPHA_DEFAULT);
}
- /* (non-Javadoc)
- * @see com.google.gerrit.server.config.MetricsConfig#reservoirType()
- */
+ // (non-Javadoc)
+ // @see com.google.gerrit.server.config.MetricsConfig#reservoirType()
+ //
@Override
public ReservoirType reservoirType() {
return reservoirType;
}
- /* (non-Javadoc)
- * @see com.google.gerrit.server.config.MetricsConfig#reservoirWindow()
- */
+ // (non-Javadoc)
+ // @see com.google.gerrit.server.config.MetricsConfig#reservoirWindow()
+ //
@Override
public Duration reservoirWindow() {
return reservoirWindow;
}
- /* (non-Javadoc)
- * @see com.google.gerrit.server.config.MetricsConfig#reservoirSize()
- */
+ // (non-Javadoc)
+ // @see com.google.gerrit.server.config.MetricsConfig#reservoirSize()
+ //
@Override
public int reservoirSize() {
return reservoirSize;
}
- /* (non-Javadoc)
- * @see com.google.gerrit.server.config.MetricsConfig#reservoirAlpha()
- */
+ // (non-Javadoc)
+ // @see com.google.gerrit.server.config.MetricsConfig#reservoirAlpha()
+ //
@Override
public double reservoirAlpha() {
return reservoirAlpha;
diff --git a/java/com/google/gerrit/server/diff/DiffInfoCreator.java b/java/com/google/gerrit/server/diff/DiffInfoCreator.java
index 606e42b..2bc36c5 100644
--- a/java/com/google/gerrit/server/diff/DiffInfoCreator.java
+++ b/java/com/google/gerrit/server/diff/DiffInfoCreator.java
@@ -67,7 +67,7 @@
this.intraline = intraline;
}
- /* Returns the {@link DiffInfo} to display for end-users */
+ /** Returns the {@link DiffInfo} to display for end-users */
public DiffInfo create(PatchScript ps, DiffSide sideA, DiffSide sideB) {
DiffInfo result = new DiffInfo();
diff --git a/java/com/google/gerrit/server/fixes/FixCalculator.java b/java/com/google/gerrit/server/fixes/FixCalculator.java
index f7638b5..3969d5b 100644
--- a/java/com/google/gerrit/server/fixes/FixCalculator.java
+++ b/java/com/google/gerrit/server/fixes/FixCalculator.java
@@ -93,68 +93,52 @@
"(%s:%s - %s:%s)", range.startLine, range.startChar, range.endLine, range.endChar);
}
- /*
- Algorithm:
- Input:
- Original text (aka srcText)
- Sorted list of replacements in ascending order, where each replacement has:
- srcRange - part of the original text to be
- replaced, inserted or deleted (see {@link Comment.Range} for details)
- replacement - text to be set instead of srcRange
- Replacement ranges must not intersect.
-
- Output:
- Final text (aka finalText)
- List of Edit, where each Edit is an instance of {@link ReplaceEdit}
- Each ReplaceEdit cover one or more lines in the original text
- Each ReplaceEdit contains one or more Edit for intraline edits
- See {@link ReplaceEdit} and {@link Edit} for details.
- *
- Note: The algorithm is implemented in this way to avoid string.replace operations.
- It has complexity O(len(replacements) + max(len(originalText), len(finalText)) )
-
- Main steps:
- - set srcPos to start of the original text. It is like a cursor position in the original text.
- - set dstPos to start of the final text. It is like a cursor position in the final text.
- - the finalText initially empty
-
- - for each replacement:
- - append text between a previous and a current replacement to the finalText
- (because replacements were sorted, this part of text can't be changed by
- following replacements). I.e. append substring of srcText between srcPos
- and replacement.srcRange.start to the finalText
- Update srcPos and dstPos - set them at the end of appended text
- (i.e. srcPos points to the position before replacement.srcRange.start,
- dstPos points to the position where replacement.text should be inserted)
- - set dstReplacementStart = dstPos
- - append replacement.text to the finalText.
- Update srcPos and dstPos accordingly (i.e. srcPos points to the position after
- replacement.srcRange, dstPos points to the position in the finalText after
- the appended replacement.text).
- - set dstReplacementEnd = dstPos
- - dstRange = (dstReplacementStart, dstReplacementEnd) - is the range in the finalText.
- - srcRange = (replacement.Start, replacement.End) - is the range in the original text *
-
- - If previously created ReplaceEdit ends on the same or previous line as srcRange.startLine,
- then intraline edit is added to it (and ReplaceEdit endLine must be updated if needed);
- srcRange and dstRange together is used to calculate intraline Edit
- otherwise
- create new ReplaceEdit and add intraline Edit to it
- srcRange and dstRange together is used to calculate intraline Edit
-
- - append text after the last replacements,
- i.e. add part of srcText after srcPos to the finalText
-
- - Return the finalText and all created ReplaceEdits
-
- Implementation notes:
- 1) The intraline Edits inside ReplaceEdit stores positions relative to ReplaceEdit start.
- 2) srcPos and dstPos tracks current position as 3 numbers:
- - line number
- - column number
- - textPos - absolute position from the start of the text. The textPos is used to calculate
- relative positions of Edit inside ReplaceEdit
- */
+ /**
+ * Algorithm: Input: Original text (aka srcText) Sorted list of replacements in ascending order,
+ * where each replacement has: srcRange - part of the original text to be replaced, inserted or
+ * deleted (see {@link Comment.Range} for details) replacement - text to be set instead of
+ * srcRange Replacement ranges must not intersect.
+ *
+ * <p>Output: Final text (aka finalText) List of Edit, where each Edit is an instance of {@link
+ * ReplaceEdit} Each ReplaceEdit cover one or more lines in the original text Each ReplaceEdit
+ * contains one or more Edit for intraline edits See {@link ReplaceEdit} and {@link Edit} for
+ * details.
+ *
+ * <p>Note: The algorithm is implemented in this way to avoid string.replace operations. It has
+ * complexity O(len(replacements) + max(len(originalText), len(finalText)) )
+ *
+ * <p>Main steps: - set srcPos to start of the original text. It is like a cursor position in the
+ * original text. - set dstPos to start of the final text. It is like a cursor position in the
+ * final text. - the finalText initially empty
+ *
+ * <p>- for each replacement: - append text between a previous and a current replacement to the
+ * finalText (because replacements were sorted, this part of text can't be changed by following
+ * replacements). I.e. append substring of srcText between srcPos and replacement.srcRange.start
+ * to the finalText Update srcPos and dstPos - set them at the end of appended text (i.e. srcPos
+ * points to the position before replacement.srcRange.start, dstPos points to the position where
+ * replacement.text should be inserted) - set dstReplacementStart = dstPos - append
+ * replacement.text to the finalText. Update srcPos and dstPos accordingly (i.e. srcPos points to
+ * the position after replacement.srcRange, dstPos points to the position in the finalText after
+ * the appended replacement.text). - set dstReplacementEnd = dstPos - dstRange =
+ * (dstReplacementStart, dstReplacementEnd) - is the range in the finalText. - srcRange =
+ * (replacement.Start, replacement.End) - is the range in the original text *
+ *
+ * <p>- If previously created ReplaceEdit ends on the same or previous line as srcRange.startLine,
+ * then intraline edit is added to it (and ReplaceEdit endLine must be updated if needed);
+ * srcRange and dstRange together is used to calculate intraline Edit otherwise create new
+ * ReplaceEdit and add intraline Edit to it srcRange and dstRange together is used to calculate
+ * intraline Edit
+ *
+ * <p>- append text after the last replacements, i.e. add part of srcText after srcPos to the
+ * finalText
+ *
+ * <p>- Return the finalText and all created ReplaceEdits
+ *
+ * <p>Implementation notes: 1) The intraline Edits inside ReplaceEdit stores positions relative to
+ * ReplaceEdit start. 2) srcPos and dstPos tracks current position as 3 numbers: - line number -
+ * column number - textPos - absolute position from the start of the text. The textPos is used to
+ * calculate relative positions of Edit inside ReplaceEdit
+ */
private static class ContentBuilder {
private static class FixRegion {
int startSrcLine;
diff --git a/java/com/google/gerrit/server/query/change/ChangeData.java b/java/com/google/gerrit/server/query/change/ChangeData.java
index 31f56f1..7487c29 100644
--- a/java/com/google/gerrit/server/query/change/ChangeData.java
+++ b/java/com/google/gerrit/server/query/change/ChangeData.java
@@ -1063,7 +1063,11 @@
return allApprovalsWithCopied;
}
- /* @return legacy submit ('SUBM') approval label */
+ /**
+ * Get legacy submit ('SUBM') approval label
+ *
+ * @return legacy submit ('SUBM') approval label
+ */
// TODO(mariasavtchouk): Deprecate legacy submit label,
// see com.google.gerrit.entities.LabelId.LEGACY_SUBMIT_NAME
public Optional<PatchSetApproval> getSubmitApproval() {
diff --git a/java/com/google/gerrit/sshd/commands/ScpCommand.java b/java/com/google/gerrit/sshd/commands/ScpCommand.java
index 3be98fd..5bbfbcc 100644
--- a/java/com/google/gerrit/sshd/commands/ScpCommand.java
+++ b/java/com/google/gerrit/sshd/commands/ScpCommand.java
@@ -15,7 +15,7 @@
* the License.
*/
-/*
+/**
* NB: This code was primarly ripped out of MINA SSHD.
*
* @author <a href="mailto:dev@mina.apache.org">Apache MINA SSHD Project</a>