Skip to content

Commit

Permalink
rename field reportReader in SourceLinesCache
Browse files Browse the repository at this point in the history
  • Loading branch information
teryk committed Jun 15, 2015
1 parent a58eab0 commit 4debaa5
Showing 1 changed file with 14 additions and 15 deletions.
Expand Up @@ -19,6 +19,12 @@
*/
package org.sonar.server.computation.issue;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
import org.apache.commons.lang.StringUtils;
import org.sonar.batch.protocol.output.BatchReport;
import org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset;
Expand All @@ -27,13 +33,6 @@
import org.sonar.server.source.index.SourceLineDoc;
import org.sonar.server.source.index.SourceLineIndex;

import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
* Cache of the lines of the currently processed file. Only a <strong>single</strong> file
* is kept in memory at a time. Data is loaded <strong>on demand</strong> (to avoid non necessary
Expand Down Expand Up @@ -65,13 +64,13 @@ public SourceLinesCache(SourceLineIndex index) {
/**
* Marks the currently processed component
*/
void init(String fileUuid, @Nullable Integer fileReportRef, BatchReportReader thisReportReader) {
loaded = false;
currentFileUuid = fileUuid;
currentFileReportRef = fileReportRef;
lastCommitDate = 0L;
lastCommitAuthor = null;
reportReader = thisReportReader;
void init(String fileUuid, @Nullable Integer fileReportRef, BatchReportReader reportReader) {
this.loaded = false;
this.currentFileUuid = fileUuid;
this.currentFileReportRef = fileReportRef;
this.lastCommitDate = 0L;
this.lastCommitAuthor = null;
this.reportReader = reportReader;
clear();
}

Expand All @@ -88,7 +87,7 @@ public String lineAuthor(@Nullable Integer lineNumber) {
}
String author = null;
if (lineNumber <= scm.getChangesetIndexByLineCount()) {
BatchReport.Changesets.Changeset changeset = scm.getChangeset(scm.getChangesetIndexByLine(lineNumber-1));
BatchReport.Changesets.Changeset changeset = scm.getChangeset(scm.getChangesetIndexByLine(lineNumber - 1));
author = changeset.hasAuthor() ? changeset.getAuthor() : null;
}

Expand Down

0 comments on commit 4debaa5

Please sign in to comment.