Skip to content

Commit

Permalink
Resolve #100
Browse files Browse the repository at this point in the history
  • Loading branch information
boyter committed Apr 28, 2017
1 parent 75aa953 commit d45a27a
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,14 @@ public FileVisitResult visitFile(Object file, BasicFileAttributes attrs) throws

String md5Hash = this.indexBaseRepoJob.getFileMd5(fileToString);
String languageName = Singleton.getFileClassifier().languageGuesser(fileName, codeLinesReturn.getCodeLines());

String fileLocation = this.indexBaseRepoJob.getRelativeToProjectPath(file.toString(), fileToString);
String fileLocationFilename = this.indexBaseRepoJob.getFileLocationFilename(fileToString, fileRepoLocations);

String newString = this.indexBaseRepoJob.getBlameFilePath(fileLocationFilename);
String codeOwner = this.indexBaseRepoJob.getCodeOwner(codeLinesReturn.getCodeLines(), newString, this.repoName, fileRepoLocations, Singleton.getSearchCodeLib());

if (this.indexBaseRepoJob.LOWMEMORY) {
Singleton.getCodeIndexer().indexDocument(new CodeIndexDocument(repoLocationRepoNameLocationFilename, this.repoName, fileName, fileLocation, fileLocationFilename, md5Hash, languageName, codeLinesReturn.getCodeLines().size(), StringUtils.join(codeLinesReturn.getCodeLines(), " "), repoRemoteLocation, codeOwner));

} else {
Singleton.incrementCodeIndexLinesCount(codeLinesReturn.getCodeLines().size());
Singleton.getCodeIndexQueue().add(new CodeIndexDocument(repoLocationRepoNameLocationFilename, this.repoName, fileName, fileLocation, fileLocationFilename, md5Hash, languageName, codeLinesReturn.getCodeLines().size(), StringUtils.join(codeLinesReturn.getCodeLines(), " "), repoRemoteLocation, codeOwner));
Expand All @@ -110,7 +109,9 @@ public FileVisitResult visitFile(Object file, BasicFileAttributes attrs) throws
}

@Override
public FileVisitResult visitFileFailed(Object file, IOException exc) throws IOException {
public FileVisitResult visitFileFailed(Object file, IOException ex) throws IOException {
java.nio.file.Path filePath = (java.nio.file.Path)file;
reportList.add(new String[]{filePath.toString(), "excluded", ex.toString()});
return FileVisitResult.CONTINUE;
}

Expand Down

0 comments on commit d45a27a

Please sign in to comment.