Exemplo n.º 1
0
 private static void handleUser(
     UserDoc user, ScannerInput.User.Builder userBuilder, OutputStream out) {
   userBuilder.clear().setLogin(user.login()).setName(user.name());
   try {
     userBuilder.build().writeDelimitedTo(out);
   } catch (IOException e) {
     throw new IllegalStateException("Unable to serialize user", e);
   }
   userBuilder.clear();
 }
Exemplo n.º 2
0
 @CheckForNull
 private String findSourceLineUser(DbSession dbSession, String fileUuid, @Nullable Integer line) {
   if (line != null) {
     Optional<DbFileSources.Line> sourceLine = sourceService.getLine(dbSession, fileUuid, line);
     if (sourceLine.isPresent() && sourceLine.get().hasScmAuthor()) {
       UserDoc userDoc = userIndex.getNullableByScmAccount(sourceLine.get().getScmAuthor());
       if (userDoc != null) {
         return userDoc.login();
       }
     }
   }
   return null;
 }